/* ============================================
   OFFLOAD — Complete Design System
   Privacy-First Pre-Sleep Brain Release PWA
   ============================================ */

/* ---- CSS Custom Properties (Design Tokens) ---- */
:root {
  /* Color Palette */
  --bg-primary: #070a1f;
  --bg-secondary: #0f142e;
  --bg-tertiary: #181f45;
  --surface: #131b3d;
  --surface-hover: #1c2652;
  --accent-purple: #7c6fae;
  --accent-purple-light: #9d91c7;
  --accent-amber: #f4a261;
  --accent-teal: #2a9d8f;
  --accent-rose: #e76f51;
  --text-primary: #f0f1f5;
  --text-secondary: #a0a8b0;
  --text-muted: #6b7280;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-primary: 0 4px 16px rgba(124, 111, 174, 0.3);
  --shadow-elevated: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-glow-purple: 0 0 20px rgba(124, 111, 174, 0.4);
  --shadow-glow-teal: 0 0 20px rgba(42, 157, 143, 0.4);

  /* Transitions */
  --transition-default: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

  /* Typography Scale */
  --font-caption: 12px;
  --font-body: 14px;
  --font-button: 16px;
  --font-timer: 20px;
  --font-h2: 28px;
  --font-h1: clamp(32px, 8vw, 56px);

  /* Layout */
  --max-width: 600px;
  --header-height: 56px;
  --nav-height: 64px;
}

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

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
  line-height: 1.5;
}

/* ---- Accessibility ---- */
:focus-visible {
  outline: 2px solid var(--accent-purple);
  outline-offset: 2px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Typography ---- */
h1 {
  font-size: var(--font-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--text-primary);
}

h2 {
  font-size: var(--font-h2);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: var(--text-primary);
}

h3 {
  font-size: var(--font-timer);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

p {
  font-size: var(--font-body);
  color: var(--text-secondary);
  line-height: 1.6;
}

.caption {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* ---- Layout Components ---- */
.app-shell {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
  position: relative;
}

.view {
  display: none;
  flex: 1;
  flex-direction: column;
  padding-bottom: calc(var(--nav-height) + var(--space-lg));
  animation: fadeIn 0.4s ease-out;
}

.view.active {
  display: flex;
}

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

/* ---- Header ---- */
.app-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) 0;
  position: sticky;
  top: 0;
  background: rgba(7, 10, 31, 0.85);
  backdrop-filter: blur(12px);
  z-index: 100;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: var(--font-button);
  color: var(--text-primary);
}

.logo-icon {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-glow-purple);
}

.logo-icon svg {
  width: 18px;
  height: 18px;
  color: white;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  border: none;
  border-radius: var(--radius-full);
  font-family: inherit;
  font-size: var(--font-button);
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-default);
  text-decoration: none;
  min-height: 48px;
}

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

.btn-primary {
  background: linear-gradient(135deg, var(--accent-purple), #5d4f8f);
  color: white;
  box-shadow: var(--shadow-primary);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-purple);
}

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid rgba(124, 111, 174, 0.3);
}

.btn-secondary:hover:not(:disabled) {
  background: var(--surface-hover);
  border-color: var(--accent-purple);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  padding: var(--space-sm) var(--space-md);
  min-height: 36px;
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.btn-icon {
  width: 44px;
  height: 44px;
  padding: 0;
  min-height: 44px;
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
}

.btn-icon:hover:not(:disabled) {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ---- Cards ---- */
.card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(124, 111, 174, 0.1);
  transition: var(--transition-default);
}

.card:hover {
  border-color: rgba(124, 111, 174, 0.25);
}

.card-elevated {
  background: var(--bg-tertiary);
  box-shadow: var(--shadow-elevated);
}

/* ---- Form Elements ---- */
.input, .textarea {
  width: 100%;
  padding: var(--space-md);
  background: var(--surface);
  border: 1px solid rgba(124, 111, 174, 0.2);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: inherit;
  font-size: var(--font-body);
  transition: var(--transition-default);
  resize: none;
}

.input:focus, .textarea:focus {
  outline: none;
  border-color: var(--accent-purple);
  box-shadow: 0 0 0 3px rgba(124, 111, 174, 0.15);
}

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

.textarea {
  min-height: 120px;
  line-height: 1.6;
}

/* ---- Star Rating ---- */
.star-rating {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

.star {
  width: 32px;
  height: 32px;
  cursor: pointer;
  color: var(--text-muted);
  transition: var(--transition-bounce);
}

.star.active {
  color: var(--accent-amber);
}

.star:hover {
  transform: scale(1.2);
}

/* ---- Navigation ---- */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--max-width);
  height: var(--nav-height);
  background: rgba(15, 20, 46, 0.95);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(124, 111, 174, 0.15);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 1000;
  padding: 0 var(--space-md);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: var(--space-xs) var(--space-sm);
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 10px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition-default);
  border-radius: var(--radius-sm);
}

.nav-item svg {
  width: 22px;
  height: 22px;
}

.nav-item.active {
  color: var(--accent-purple-light);
}

.nav-item:hover {
  color: var(--text-secondary);
}

/* ---- Breathing Animation (Landing) ---- */
.breathing-container {
  position: relative;
  width: 280px;
  height: 280px;
  margin: var(--space-2xl) auto;
}

.orb {
  position: absolute;
  border-radius: var(--radius-full);
  filter: blur(20px);
  opacity: 0.7;
}

.orb-purple {
  width: 100px;
  height: 100px;
  background: var(--accent-purple);
  top: 50%;
  left: 50%;
  margin: -50px 0 0 -50px;
  animation: orbit 8s linear infinite, breathe 4s ease-in-out infinite;
  box-shadow: var(--shadow-glow-purple);
}

.orb-teal {
  width: 80px;
  height: 80px;
  background: var(--accent-teal);
  top: 50%;
  left: 50%;
  margin: -40px 0 0 -40px;
  animation: orbit 12s linear infinite reverse, breathe 5s ease-in-out infinite 1s;
  box-shadow: var(--shadow-glow-teal);
}

.orb-amber {
  width: 60px;
  height: 60px;
  background: var(--accent-amber);
  top: 50%;
  left: 50%;
  margin: -30px 0 0 -30px;
  animation: orbit 6s linear infinite, breathe 3s ease-in-out infinite 0.5s;
  box-shadow: 0 0 20px rgba(244, 162, 97, 0.4);
}

@keyframes orbit {
  from { transform: rotate(0deg) translateX(80px) rotate(0deg); }
  to { transform: rotate(360deg) translateX(80px) rotate(-360deg); }
}

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

/* ---- Moon Phase ---- */
.moon-phase {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  color: var(--text-secondary);
}

.moon-phase img {
  width: 28px;
  height: 28px;
  object-fit: contain;
}

/* ---- Timer Ring ---- */
.timer-container {
  position: relative;
  width: 200px;
  height: 200px;
  margin: 0 auto;
}

.timer-ring {
  transform: rotate(-90deg);
}

.timer-ring-bg {
  fill: none;
  stroke: var(--bg-tertiary);
  stroke-width: 8;
}

.timer-ring-progress {
  fill: none;
  stroke: url(#timerGradient);
  stroke-width: 8;
  stroke-linecap: round;
  stroke-dasharray: 565.48;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.timer-text {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: var(--font-h2);
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}

/* ---- Sentiment Badge ---- */
.sentiment-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.sentiment-positive {
  background: rgba(42, 157, 143, 0.15);
  color: var(--accent-teal);
}

.sentiment-negative {
  background: rgba(231, 111, 81, 0.15);
  color: var(--accent-rose);
}

.sentiment-neutral {
  background: rgba(124, 111, 174, 0.15);
  color: var(--accent-purple-light);
}

/* ---- Focus Mode ---- */
.focus-mode {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  padding: var(--space-lg);
  animation: fadeIn 0.3s ease-out;
}

.focus-mode .focus-textarea {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 18px;
  line-height: 1.8;
  outline: none;
  resize: none;
  font-family: inherit;
}

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

.focus-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin-top: auto;
}

/* ---- Ceremony View ---- */
.ceremony-view {
  position: fixed;
  inset: 0;
  background: var(--bg-primary);
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.ceremony-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ceremony-content {
  position: relative;
  z-index: 10;
  text-align: center;
  padding: var(--space-xl);
}

.ceremony-seal {
  width: 120px;
  height: 120px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent-purple), var(--accent-teal));
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-xl);
  box-shadow: var(--shadow-glow-purple);
  animation: sealAppear 0.6s ease-out;
}

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

/* ---- Archive Cards ---- */
.session-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(124, 111, 174, 0.1);
  cursor: pointer;
  transition: var(--transition-default);
  margin-bottom: var(--space-md);
}

.session-card:hover {
  border-color: rgba(124, 111, 174, 0.3);
  transform: translateY(-2px);
  box-shadow: var(--shadow-elevated);
}

.session-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-sm);
}

.session-date {
  font-size: var(--font-caption);
  color: var(--text-muted);
}

.session-preview {
  font-size: var(--font-body);
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.5;
}

.session-meta {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: var(--font-caption);
  color: var(--text-muted);
}

/* ---- Tags ---- */
.tag {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  font-size: var(--font-caption);
  font-weight: 600;
  gap: var(--space-xs);
}

.tag-lucid { background: rgba(42, 157, 143, 0.15); color: var(--accent-teal); }
.tag-vivid { background: rgba(124, 111, 174, 0.15); color: var(--accent-purple-light); }
.tag-nightmare { background: rgba(231, 111, 81, 0.15); color: var(--accent-rose); }
.tag-recurring { background: rgba(244, 162, 97, 0.15); color: var(--accent-amber); }
.tag-prophetic { background: rgba(156, 136, 255, 0.15); color: #9c88ff; }

/* ---- Stats ---- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-align: center;
  border: 1px solid rgba(124, 111, 174, 0.1);
}

.stat-value {
  font-size: var(--font-h2);
  font-weight: 700;
  color: var(--accent-purple-light);
  font-variant-numeric: tabular-nums;
}

.stat-label {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

.chart-container {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  border: 1px solid rgba(124, 111, 174, 0.1);
}

/* ---- Word Cloud ---- */
.word-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  justify-content: center;
  padding: var(--space-lg);
}

.word-cloud-item {
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-sm);
  transition: var(--transition-default);
  cursor: default;
}

.word-cloud-item:hover {
  background: rgba(124, 111, 174, 0.1);
  transform: scale(1.05);
}

/* ---- Settings ---- */
.settings-section {
  margin-bottom: var(--space-xl);
}

.settings-section-title {
  font-size: var(--font-caption);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-left: var(--space-sm);
}

.settings-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md);
  background: var(--bg-secondary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.settings-item-label {
  font-size: var(--font-body);
  color: var(--text-primary);
}

.settings-item-desc {
  font-size: var(--font-caption);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Toggle Switch */
.toggle {
  position: relative;
  width: 48px;
  height: 26px;
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
  cursor: pointer;
  transition: var(--transition-default);
  border: none;
  flex-shrink: 0;
}

.toggle.active {
  background: var(--accent-purple);
}

.toggle::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  background: white;
  border-radius: var(--radius-full);
  top: 3px;
  left: 3px;
  transition: var(--transition-default);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle.active::after {
  left: 25px;
}

/* Duration Selector */
.duration-selector {
  display: flex;
  gap: var(--space-xs);
  background: var(--bg-tertiary);
  padding: 4px;
  border-radius: var(--radius-full);
}

.duration-option {
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-full);
  font-size: var(--font-body);
  font-family: inherit;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-default);
}

.duration-option.active {
  background: var(--accent-purple);
  color: white;
}

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 3000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
  animation: fadeIn 0.2s ease-out;
}

.modal {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  max-width: 480px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-elevated);
  animation: slideUp 0.3s ease-out;
}

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

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
}

.modal-title {
  font-size: var(--font-h2);
  font-weight: 600;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  border: none;
  background: var(--bg-tertiary);
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-default);
}

.modal-close:hover {
  background: var(--surface-hover);
  color: var(--text-primary);
}

/* ---- Toast Notifications ---- */
.toast-container {
  position: fixed;
  top: var(--header-height);
  left: 50%;
  transform: translateX(-50%);
  z-index: 4000;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  pointer-events: none;
}

.toast {
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  font-size: var(--font-body);
  font-weight: 500;
  animation: slideDown 0.3s ease-out;
  pointer-events: all;
  min-width: 280px;
  text-align: center;
}

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

.toast-success {
  background: rgba(42, 157, 143, 0.9);
  color: white;
  backdrop-filter: blur(8px);
}

.toast-error {
  background: rgba(231, 111, 81, 0.9);
  color: white;
  backdrop-filter: blur(8px);
}

.toast-info {
  background: rgba(124, 111, 174, 0.9);
  color: white;
  backdrop-filter: blur(8px);
}

/* ---- Toolbar (Dump View) ---- */
.dump-toolbar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  flex-wrap: wrap;
}

.toolbar-group {
  display: flex;
  gap: var(--space-sm);
  align-items: center;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--bg-tertiary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-purple);
}

/* ---- Utility Classes ---- */
.text-center { text-align: center; }
.mt-auto { margin-top: auto; }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.flex-1 { flex: 1; }
.w-full { width: 100%; }
.hidden { display: none !important; }

/* ---- Landing View Specific ---- */
.landing-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--space-xl) 0;
}

.landing-title {
  margin-bottom: var(--space-sm);
  background: linear-gradient(135deg, var(--text-primary), var(--accent-purple-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.landing-subtitle {
  margin-bottom: var(--space-lg);
  max-width: 360px;
}

.sleep-tip {
  background: rgba(255, 255, 255, 0.03);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-lg) 0;
  max-width: 400px;
  border-left: 3px solid var(--accent-purple);
}

.sleep-tip-label {
  font-size: var(--font-caption);
  color: var(--accent-purple-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.sleep-tip-text {
  font-size: var(--font-body);
  color: var(--text-secondary);
  font-style: italic;
}

/* ---- PMR Modal Content ---- */
.pmr-step {
  padding: var(--space-md);
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-sm);
}

.pmr-step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-full);
  background: var(--accent-purple);
  color: white;
  font-size: var(--font-caption);
  font-weight: 700;
  margin-right: var(--space-sm);
}

/* ---- Export/Import Buttons ---- */
.export-import-group {
  display: flex;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ---- Responsive ---- */
@media (min-width: 768px) {
  .app-shell {
    padding: 0 var(--space-xl);
  }

  .stats-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .breathing-container {
    width: 320px;
    height: 320px;
  }
}

/* ---- Animations for View Transitions ---- */
.slide-in-right {
  animation: slideInRight 0.3s ease-out;
}

@keyframes slideInRight {
  from { transform: translateX(30px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

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

/* ---- Audio Visualizer Placeholder ---- */
.audio-visualizer {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 24px;
}

.audio-bar {
  width: 3px;
  background: var(--accent-purple);
  border-radius: var(--radius-full);
  animation: audioBar 1s ease-in-out infinite alternate;
}

.audio-bar:nth-child(2) { animation-delay: 0.1s; height: 40%; }
.audio-bar:nth-child(3) { animation-delay: 0.2s; height: 70%; }
.audio-bar:nth-child(4) { animation-delay: 0.3s; height: 50%; }
.audio-bar:nth-child(5) { animation-delay: 0.4s; height: 80%; }

@keyframes audioBar {
  from { height: 20%; }
  to { height: 100%; }
}

/* ---- Streak Badge ---- */
.streak-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--radius-full);
  background: rgba(244, 162, 97, 0.15);
  color: var(--accent-amber);
  font-size: var(--font-caption);
  font-weight: 600;
}

/* ---- Empty State ---- */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
  color: var(--text-muted);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto var(--space-lg);
  opacity: 0.3;
}

/* ---- Gratitude Input ---- */
.gratitude-input {
  min-height: 80px;
  font-size: var(--font-body);
}

/* ---- Intention Display ---- */
.intention-display {
  background: linear-gradient(135deg, rgba(124, 111, 174, 0.1), rgba(42, 157, 143, 0.1));
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  border: 1px solid rgba(124, 111, 174, 0.2);
  margin: var(--space-md) 0;
}

.intention-text {
  font-size: 18px;
  font-style: italic;
  color: var(--accent-purple-light);
  line-height: 1.6;
}

/* ---- Detail View ---- */
.detail-view {
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
}

.detail-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-content {
  font-size: var(--font-body);
  line-height: 1.8;
  color: var(--text-secondary);
  white-space: pre-wrap;
  margin-bottom: var(--space-lg);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.detail-meta-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.detail-meta-label {
  font-size: var(--font-caption);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.detail-meta-value {
  font-size: var(--font-body);
  color: var(--text-primary);
  font-weight: 500;
}

/* ---- Password Input for Encryption ---- */
.passphrase-input {
  font-family: 'SF Mono', Monaco, monospace;
  letter-spacing: 0.1em;
}

/* ---- Loading Spinner ---- */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--bg-tertiary);
  border-top-color: var(--accent-purple);
  border-radius: var(--radius-full);
  animation: spin 0.8s linear infinite;
}

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