@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;0,9..40,700&family=Playfair+Display:wght@500;600;700&display=swap');

:root {
  --primary: #F8BBD0;
  --primary-soft: #F06292;
  --primary-glow: rgba(74, 108, 247, 0.25);
  --secondary: #E91E63;
  --accent: #AD1457;
  --bg: #FFF0F5;
  --bg-surface: #171A3A;
  --bg-card: #1E2148;
  --bg-card-hover: #252958;
  --text: #E8EBF6;
  --text-secondary: #8B8FAD;
  --text-muted: #5A5E7E;
  --border: rgba(255, 255, 255, 0.06);
  --success: #34D399;
  --danger: #F87171;
  --pattern-calm: #818CF8;
  --pattern-focus: #38BDF8;
  --pattern-energy: #FBBF24;
  --pattern-deep: #2DD4BF;
  --pattern-resonant: #A78BFA;
  --pattern-warrior: #FB7185;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 20px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 40px var(--primary-glow);
  --radius: 16px;
  --radius-sm: 10px;
  --radius-xs: 6px;
}

::selection {
  background: var(--primary);
  color: white;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100vh;
}

.app-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  max-width: 600px;
  margin: 0 auto;
  position: relative;
}

.app-content {
  flex: 1;
  padding: 1rem 1rem 5.5rem;
  overflow-y: auto;
}

/* =================== TAB BAR =================== */
.tab-bar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 600px;
  display: flex;
  background: rgba(23, 26, 58, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 0.5rem 0.75rem 1.25rem;
  gap: 0.25rem;
  z-index: 100;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  padding: 0.5rem 0;
  background: none;
  border: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.2s, transform 0.15s;
  border-radius: var(--radius-xs);
}

.tab-btn:active {
  transform: scale(0.95);
}

.tab-btn .tab-icon {
  font-size: 1.25rem;
  line-height: 1;
}

.tab-btn.active {
  color: var(--primary-soft);
}

.tab-btn.active .tab-icon {
  filter: drop-shadow(0 0 6px var(--primary-glow));
}

/* =================== PATTERN SELECTOR =================== */
.pattern-selector {
  padding-top: 0.5rem;
}

.patterns-header {
  margin-bottom: 1.5rem;
}

.patterns-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.35rem;
}

.patterns-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.patterns-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.pattern-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 3px solid var(--card-accent, var(--primary));
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  animation: fadeSlideUp 0.5s ease both;
}

.pattern-card:hover {
  background: var(--bg-card-hover);
  box-shadow: var(--shadow-md);
}

.pattern-card:active {
  transform: scale(0.985);
}

.pattern-card-header {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.pattern-icon {
  font-size: 2rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 12px;
  flex-shrink: 0;
}

.pattern-card-info {
  flex: 1;
  min-width: 0;
}

.pattern-name {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.pattern-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tag {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.2rem 0.5rem;
  border-radius: 20px;
}

.tag-difficulty {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-secondary);
}

.tag-benefit {
  background: rgba(74, 108, 247, 0.12);
  color: var(--primary-soft);
}

.pattern-phases {
  display: flex;
  gap: 0.35rem;
  margin-top: 0.75rem;
  flex-wrap: wrap;
}

.phase-chip {
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 20px;
  white-space: nowrap;
}

.phase-chip.inhale {
  background: rgba(56, 189, 248, 0.12);
  color: #38BDF8;
}

.phase-chip.exhale {
  background: rgba(251, 191, 36, 0.12);
  color: #FBBF24;
}

.phase-chip.hold {
  background: rgba(167, 139, 250, 0.12);
  color: #A78BFA;
}

.pattern-expanded {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
  animation: fadeIn 0.25s ease;
}

.pattern-desc {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.55;
  margin-bottom: 1rem;
}

/* =================== BUTTONS =================== */
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 0.85rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, opacity 0.2s;
  box-shadow: var(--shadow-glow);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 0 50px var(--primary-glow);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary.saved {
  background: var(--success);
  box-shadow: 0 0 30px rgba(52, 211, 153, 0.25);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.06);
  border: none;
  color: var(--text-secondary);
  font-size: 1.1rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

.btn-control {
  flex: 1;
  padding: 0.8rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-control:hover {
  background: var(--bg-card-hover);
}

.btn-control:active {
  transform: scale(0.97);
}

.btn-control.btn-stop {
  background: rgba(248, 113, 113, 0.1);
  border-color: rgba(248, 113, 113, 0.2);
  color: var(--danger);
}

.btn-tiny {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.3rem 0.6rem;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-tiny:hover {
  background: var(--bg-card-hover);
}

.btn-tiny.btn-danger {
  background: rgba(248, 113, 113, 0.12);
  color: var(--danger);
  border-color: rgba(248, 113, 113, 0.2);
}

.btn-ghost-sm {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 0.25rem 0.4rem;
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}

.btn-ghost-sm:hover {
  color: var(--danger);
  background: rgba(248, 113, 113, 0.08);
}

.btn-test-sound {
  margin-top: 0.5rem;
}

/* =================== BREATHING SESSION =================== */
.session-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: calc(100vh - 6rem);
  padding-top: 0.5rem;
}

.session-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 1rem;
}

.session-timer {
  font-size: 1.1rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.session-cycles {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* =================== BREATH ANIMATION =================== */
.breath-arena {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 300px;
}

.breath-circle-container {
  position: relative;
  width: 260px;
  height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.breath-ring {
  position: absolute;
  border-radius: 50%;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s;
  will-change: transform;
}

.breath-ring-outer {
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, transparent 55%, rgba(74, 108, 247, 0.08) 100%);
  border: 2px solid rgba(74, 108, 247, 0.15);
  transform: scale(var(--scale, 0.75));
  box-shadow: 0 0 60px rgba(74, 108, 247, 0.1), inset 0 0 40px rgba(74, 108, 247, 0.05);
}

.breath-ring-middle {
  width: 220px;
  height: 220px;
  background: radial-gradient(circle, transparent 40%, rgba(108, 99, 255, 0.1) 100%);
  border: 1.5px solid rgba(108, 99, 255, 0.12);
  transform: scale(var(--scale, 0.75));
  box-shadow: 0 0 40px rgba(108, 99, 255, 0.08);
}

.breath-ring-inner {
  width: 160px;
  height: 160px;
  background: radial-gradient(circle, rgba(74, 108, 247, 0.2) 0%, rgba(108, 99, 255, 0.08) 60%, transparent 100%);
  border: 1px solid rgba(123, 147, 250, 0.15);
  transform: scale(var(--scale, 0.75));
  box-shadow: 0 0 50px rgba(74, 108, 247, 0.15), inset 0 0 30px rgba(74, 108, 247, 0.1);
}

.breath-center {
  position: relative;
  z-index: 2;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.phase-emoji {
  font-size: 2rem;
  filter: drop-shadow(0 0 12px var(--primary-glow));
}

/* =================== PHASE INFO =================== */
.phase-info {
  text-align: center;
  width: 100%;
  margin-bottom: 1.5rem;
}

.phase-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  font-weight: 600;
  margin-bottom: 0.75rem;
  letter-spacing: -0.01em;
}

.phase-timer-bar {
  width: 100%;
  max-width: 280px;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  margin: 0 auto 0.5rem;
  overflow: hidden;
}

.phase-timer-fill {
  height: 100%;
  width: var(--progress, 0%);
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 4px;
  transition: width 0.08s linear;
}

.phase-seconds {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.session-controls {
  display: flex;
  gap: 0.75rem;
  width: 100%;
}

/* =================== COUNTDOWN =================== */
.countdown-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 70vh;
  text-align: center;
}

.pattern-title-session {
  font-family: 'Playfair Display', serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.countdown-number {
  font-family: 'Playfair Display', serif;
  font-size: 6rem;
  font-weight: 700;
  color: var(--primary-soft);
  animation: countPulse 1s ease infinite;
  text-shadow: 0 0 40px var(--primary-glow);
}

.countdown-hint {
  margin-top: 1.5rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}

/* =================== COMPLETE =================== */
.complete-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 70vh;
  text-align: center;
  animation: fadeIn 0.6s ease;
}

.complete-icon {
  font-size: 4rem;
  margin-bottom: 1rem;
}

.complete-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.complete-stats {
  display: flex;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-pill {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1.25rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.stat-pill .stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--primary-soft);
}

.stat-pill .stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 0.15rem;
}

.complete-msg {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  max-width: 280px;
  line-height: 1.5;
}

/* =================== HISTORY =================== */
.history-screen {
  padding-top: 0.5rem;
}

.history-header {
  margin-bottom: 1.25rem;
}

.history-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
}

.stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  animation: fadeSlideUp 0.4s ease both;
}

.stat-card:nth-child(1) { animation-delay: 0s; }
.stat-card:nth-child(2) { animation-delay: 0.05s; }
.stat-card:nth-child(3) { animation-delay: 0.1s; }
.stat-card:nth-child(4) { animation-delay: 0.15s; }

.stat-card.accent {
  border-color: rgba(74, 108, 247, 0.2);
  background: linear-gradient(135deg, var(--bg-card), rgba(74, 108, 247, 0.06));
}

.stat-number {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-card.accent .stat-number {
  color: var(--primary-soft);
}

.stat-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  animation: fadeSlideUp 0.4s ease both;
}

.session-row-left {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.session-pattern-name {
  font-size: 0.85rem;
  font-weight: 600;
}

.session-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.session-row-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.session-duration {
  font-size: 0.9rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--primary-soft);
}

.session-cycles-sm {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.confirm-btns {
  display: flex;
  gap: 0.3rem;
}

/* =================== SETTINGS =================== */
.settings-screen {
  padding-top: 0.5rem;
}

.settings-header {
  margin-bottom: 1.5rem;
}

.settings-title {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.settings-subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.settings-section {
  margin-bottom: 1.75rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.duration-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.duration-btn {
  padding: 0.55rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all 0.15s;
}

.duration-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text);
}

.duration-btn.active {
  background: rgba(74, 108, 247, 0.15);
  border-color: var(--primary);
  color: var(--primary-soft);
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

.toggle-switch {
  width: 48px;
  height: 26px;
  background: var(--text-muted);
  border: none;
  border-radius: 13px;
  cursor: pointer;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}

.toggle-switch.on {
  background: var(--primary);
}

.toggle-knob {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

.toggle-switch.on .toggle-knob {
  transform: translateX(22px);
}

.info-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}

.info-card p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.info-card p:last-child {
  margin-bottom: 0;
}

.info-card strong {
  color: var(--text);
}

.btn-save {
  margin-top: 0.5rem;
}

/* =================== EMPTY STATE =================== */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
  text-align: center;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

.empty-state h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.empty-state p {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 240px;
}

/* =================== SKELETON =================== */
.skeleton-grid {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding-top: 2rem;
}

.skeleton-card {
  height: 80px;
  background: linear-gradient(90deg, var(--bg-card) 25%, var(--bg-card-hover) 50%, var(--bg-card) 75%);
  background-size: 200% 100%;
  border-radius: var(--radius-sm);
  animation: shimmer 1.5s ease infinite;
}

/* =================== ANIMATIONS =================== */
@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

@keyframes countPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.08); }
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* =================== FOCUS =================== */
:focus-visible {
  outline: 2px solid var(--primary-soft);
  outline-offset: 2px;
}

/* =================== RESPONSIVE =================== */
@media (max-width: 400px) {
  .patterns-title,
  .history-title,
  .settings-title {
    font-size: 1.7rem;
  }

  .breath-circle-container {
    width: 220px;
    height: 220px;
  }

  .breath-ring-outer {
    width: 220px;
    height: 220px;
  }

  .breath-ring-middle {
    width: 185px;
    height: 185px;
  }

  .breath-ring-inner {
    width: 135px;
    height: 135px;
  }

  .stats-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }

  .countdown-number {
    font-size: 4.5rem;
  }
}

@media (min-width: 640px) {
  .app-content {
    padding: 1.5rem 1.5rem 5.5rem;
  }
}
```

<!-- WALKTHROUGH_SCRIPT:
[
  {"step": 1, "narration": "Welcome to your guided breathing app. You'll see a selection of breathing patterns — each one designed for a specific benefit like sleep, focus, or energy.", "view": "user", "highlight_selector": ".patterns-grid", "wait_for": "tap_to_continue"},
  {"step": 2, "narration": "Tap on any pattern card to expand it and learn more about the technique. You'll see the breathing phase timing breakdown.", "view": "user", "highlight_selector": ".pattern-card", "wait_for": "user_interaction"},
  {"step": 3, "narration": "Press 'Start Session' to begin. A 3-second countdown gives you time to settle in.", "view": "user", "highlight_selector": ".btn-start", "wait_for": "user_interaction"},
  {"step": 4, "narration": "Watch the animated circle expand as you breathe in and contract as you breathe out. Follow the phase label and progress bar. Sound cues mark each phase transition.", "view": "user", "highlight_selector": ".breath-arena", "wait_for": "tap_to_continue"},
  {"step": 5, "narration": "You can pause or end the session at any time using the controls at the bottom. When your session timer completes, you'll see a summary.", "view": "user", "highlight_selector": ".session-controls", "wait_for": "tap_to_continue"},
  {"step": 6, "narration": "Check the History tab to see all your past sessions, total minutes breathed, cycle count, and your daily streak.", "view": "user", "highlight_selector": ".tab-btn:nth-child(3)", "wait_for": "user_interaction"},
  {"step": 7, "narration": "In Settings, adjust your default session duration and toggle sound cues on or off. Your preferences sync across all your devices.", "view": "user", "highlight_selector": ".tab-btn:nth-child(4)", "wait_for": "user_interaction"}
]
-->

.history-subtitle {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-top: 0.25rem;
  word-break: break-all;
}

.chart-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  animation: fadeSlideUp 0.4s ease both;
}

.chart-header {
  margin-bottom: 0.85rem;
}

.chart-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.chart-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.chart-canvas {
  width: 100% !important;
  height: 220px !important;
  display: block;
}

.chart-empty {
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.25rem;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.recommendation-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.recommendation-header h2 {
  margin: 0 0 6px;
}

.recommendation-header p {
  margin: 0 0 14px;
  opacity: 0.8;
}

.recommendation-controls {
  display: grid;
  grid-template-columns: 1fr 160px;
  gap: 12px;
  margin-bottom: 12px;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.text-input,
.select-input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.18);
  color: inherit;
  padding: 12px 14px;
}

.recommend-btn {
  border: none;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  background: linear-gradient(135deg, #7c5cff, #38bdf8);
  color: white;
  font-weight: 600;
}

.recommend-btn.secondary {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.12);
}

.recommend-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.recommendation-error {
  margin-top: 10px;
  color: #ff9b9b;
}

.recommendation-result {
  margin-top: 14px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(124, 92, 255, 0.12);
}

.recommendation-result-title {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  opacity: 0.8;
  margin-bottom: 8px;
}

.recommendation-result-body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.pattern-card {
  text-align: left;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  padding: 16px;
  color: inherit;
  cursor: pointer;
}

.pattern-title {
  font-size: 0.8rem;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pattern-name {
  margin-top: 6px;
  font-size: 1.1rem;
  font-weight: 700;
}

.pattern-desc,
.pattern-meta {
  margin-top: 8px;
  opacity: 0.8;
}

.session-recommendation-banner {
  margin-bottom: 16px;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.18);
}

.session-recommendation-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.session-recommendation-text {
  margin-top: 6px;
  opacity: 0.9;
}

.session-pattern-name {
  font-size: 1.3rem;
  font-weight: 700;
}

.session-pattern-duration,
.session-phase {
  margin-top: 8px;
  opacity: 0.85;
}

.session-btn {
  margin-top: 14px;
  margin-right: 10px;
  border: none;
  border-radius: 999px;
  padding: 10px 14px;
  cursor: pointer;
}

.session-btn.primary {
  background: linear-gradient(135deg, #7c5cff, #38bdf8);
  color: white;
}

.share-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: 1rem;
  animation: fadeSlideUp 0.4s ease both;
}

.share-card-header {
  margin-bottom: 0.9rem;
}

.share-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.share-card-subtitle {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.share-controls {
  display: flex;
  gap: 0.75rem;
  margin-bottom: 0.85rem;
}

.share-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  width: 100%;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.share-select {
  width: 100%;
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text);
  padding: 0.7rem 0.85rem;
  font: inherit;
}

.share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.btn-share {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  border-color: transparent;
}

.share-preview {
  background: rgba(74, 108, 247, 0.08);
  border: 1px solid rgba(74, 108, 247, 0.16);
  border-radius: var(--radius-xs);
  padding: 0.85rem;
  margin-bottom: 0.65rem;
}

.share-preview-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.share-preview-text {
  font-size: 0.85rem;
  line-height: 1.55;
  color: var(--text);
  margin-bottom: 0.5rem;
  word-break: break-word;
}

.share-preview-link {
  font-size: 0.75rem;
  color: var(--primary-soft);
  word-break: break-all;
}

.share-status {
  font-size: 0.8rem;
  color: var(--success);
  margin-top: 0.35rem;
}

.share-error {
  font-size: 0.8rem;
  color: var(--danger);
  margin-top: 0.35rem;
}
