/* ============================================================
   The Phoenix Project — Client Dashboard
   Mobile-First Stylesheet
   ============================================================ */

/* ------------------------------------------------------------
   1. CSS Variables
   ------------------------------------------------------------ */
:root {
  --bg: #120a14;
  --bg-subtle: #1a1018;
  --bg-gradient: linear-gradient(to top, #3d1e08 0%, #2a1508 12%, #1e100a 28%, #1a0e14 42%, #1e0c24 58%, #1e0e30 72%, #180c2a 85%, #120a20 100%);
  --glass: rgba(200, 160, 140, 0.05);
  --glass-hover: rgba(200, 160, 140, 0.08);
  --glass-border: rgba(255, 190, 130, 0.18);
  --glass-border-hover: rgba(255, 180, 120, 0.28);
  --orange: #FF6B35;
  --purple: #8B5CF6;
  --gradient: linear-gradient(135deg, #FF6B35, #D94520, #8B5CF6);
  --gradient-subtle: linear-gradient(135deg, rgba(255, 107, 53, 0.15), rgba(217, 69, 32, 0.10), rgba(139, 92, 246, 0.08));
  --text: #ffffff;
  --text-body: #B8AFA8;
  --text-muted: #7A7068;
  --text-accent: #FF6B35;
  --status-pending: #9CA3AF;
  --status-active: #22C55E;
  --status-expiring: #F59E0B;
  --status-expired: #EF4444;
  --status-deactivated: #991B1B;
  --radius-lg: 24px;
  --radius: 20px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --transition: 0.3s ease;
  --shadow: 0 4px 24px rgba(40, 20, 8, 0.45);
  --shadow-lg: 0 8px 40px rgba(40, 20, 8, 0.6);
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --bottom-nav-height: 64px;
  --weather-sunny: #FFD700;
  --weather-partly-sunny: #FFA500;
  --weather-cloudy: #9CA3AF;
  --weather-rainy: #60A5FA;
  --weather-stormy: #8B5CF6;
  --weather-rainbow: #22C55E;
}

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

html {
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-body);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--text-accent);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--purple);
}

h1, h2, h3, h4, h5, h6 {
  color: var(--text);
  font-weight: 600;
  line-height: 1.3;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }

img {
  max-width: 100%;
  height: auto;
  display: block;
}

button {
  font-family: var(--font);
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  font-size: inherit;
}

ul, ol {
  list-style: none;
}

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

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 180, 120, 0.15);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 180, 120, 0.25);
}

/* Hidden utility */
.hidden {
  display: none !important;
}

/* ------------------------------------------------------------
   3. Canvas Effects
   ------------------------------------------------------------ */
#fx-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------
   4. Background Glow
   ------------------------------------------------------------ */
body::before {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 30% 20%, rgba(255, 107, 53, 0.08) 0%, transparent 50%),
              radial-gradient(ellipse at 70% 30%, rgba(139, 92, 246, 0.12) 0%, transparent 55%),
              radial-gradient(ellipse at 50% 10%, rgba(100, 60, 180, 0.08) 0%, transparent 60%);
  animation: warmPulse 8s ease-in-out infinite;
  z-index: 0;
  pointer-events: none;
}

body::after {
  content: '';
  position: fixed;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(ellipse at 70% 30%, rgba(255, 107, 53, 0.05) 0%, transparent 50%),
              radial-gradient(ellipse at 30% 50%, rgba(139, 92, 246, 0.08) 0%, transparent 55%),
              radial-gradient(ellipse at 85% 15%, rgba(100, 60, 180, 0.06) 0%, transparent 50%);
  animation: warmPulse 12s ease-in-out infinite reverse;
  z-index: 0;
  pointer-events: none;
}

/* ------------------------------------------------------------
   5. Login Page
   ------------------------------------------------------------ */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-gradient);
  padding: 20px;
  position: relative;
  z-index: 1;
}

.login-container {
  width: 100%;
  max-width: 400px;
}

.login-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 40px 32px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
}

.login-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 32px;
}

.login-logo h1 {
  font-size: 1.75rem;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
}

.login-logo p {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.login-error,
.login-success {
  display: none;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.875rem;
  margin-bottom: 16px;
  text-align: center;
}
.login-error.visible,
.login-success.visible {
  display: block;
}
.login-error {
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #FCA5A5;
}
.login-success {
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  color: #86EFAC;
}

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

.login-card form label {
  display: block;
  color: var(--text-body);
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-weight: 500;
}

.login-card form input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.login-card form input:focus {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
}

.login-card form input::placeholder {
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   6. Form Elements
   ------------------------------------------------------------ */
.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  color: var(--text-body);
  font-size: 0.85rem;
  margin-bottom: 6px;
  font-weight: 500;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
}

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

select.form-input {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%237A7068' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
  cursor: pointer;
}

select.form-input option {
  background: var(--bg-subtle);
  color: var(--text);
}

textarea.form-input {
  resize: vertical;
  min-height: 100px;
  line-height: 1.6;
}

/* ------------------------------------------------------------
   7. Buttons
   ------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  border: none;
  line-height: 1;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient);
  color: var(--text);
  box-shadow: 0 4px 16px rgba(232, 72, 12, 0.3);
}

.btn-primary:hover {
  box-shadow: 0 6px 24px rgba(232, 72, 12, 0.45);
  transform: translateY(-1px);
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-body);
  padding: 10px 20px;
}

.btn-ghost:hover {
  background: var(--glass);
  color: var(--text);
}

.btn-outline {
  background: transparent;
  color: var(--text-accent);
  border: 1px solid var(--glass-border);
}

.btn-outline:hover {
  background: var(--glass);
  border-color: var(--glass-border-hover);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.825rem;
  border-radius: var(--radius-xs);
}

.btn-full {
  width: 100%;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  transition: all var(--transition);
  font-size: 1.15rem;
}

.btn-icon:hover {
  background: var(--glass);
  color: var(--text);
}

.btn-danger {
  background: rgba(239, 68, 68, 0.15);
  color: #FCA5A5;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.25);
  border-color: rgba(239, 68, 68, 0.45);
  color: #FEE2E2;
}

/* ------------------------------------------------------------
   8. App Shell — Sidebar Layout
   ------------------------------------------------------------ */
.app-page {
  display: none;
}

.app-page.active {
  display: block;
}

.app-shell {
  display: flex;
  min-height: 100vh;
  position: relative;
  z-index: 1;
}

/* ---- Sidebar ---- */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 200px;
  height: 100vh;
  background: rgba(20, 14, 22, 0.94);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  z-index: 100;
  padding: 0;
}

.sidebar-top {
  padding: 20px 0 0 0;
}

.sidebar-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 20px 16px 20px 16px;
  border-bottom: 1px solid var(--glass-border);
}

.sidebar-logo {
  font-size: 2rem;
  line-height: 1;
}

.sidebar-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
  text-align: center;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  padding: 12px 0;
}

.nav-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 11px 20px;
  background: transparent;
  color: #D4CBC4;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  border-left: 3px solid transparent;
}

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

.nav-item.nav-active {
  background: linear-gradient(90deg, rgba(255, 107, 53, 0.15), transparent);
  color: var(--orange);
  border-left-color: var(--orange);
  font-weight: 600;
}

.sidebar-bottom {
  padding: 16px;
  border-top: 1px solid var(--glass-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.sidebar-user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 700;
  font-size: 0.9rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-settings-btn {
  font-size: 0.75rem;
  color: #B8AFA8;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-align: left;
  transition: color var(--transition);
}

.sidebar-settings-btn:hover {
  color: var(--text-accent);
}

.sidebar-signout {
  width: 100%;
  padding: 10px 14px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-body);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition);
  text-align: center;
}

.sidebar-signout:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
  color: var(--text);
}

/* ---- Tour Help Button ---- */
.tour-help-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: transparent;
  color: #D4CBC4;
  font-weight: 600;
  font-size: 0.7rem;
  border: 1px solid rgba(212, 203, 196, 0.35);
  cursor: pointer;
  margin: 4px auto 12px;
  transition: color var(--transition), border-color var(--transition);
}
.tour-help-btn:hover {
  color: var(--orange);
  border-color: var(--orange);
}

/* ---- Tutorial Overlay ---- */
.tutorial-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.tutorial-overlay.tutorial-visible {
  opacity: 1;
  pointer-events: auto;
}

/* SVG overlay with cutout — sits above everything including the sidebar */
.tutorial-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.tutorial-svg path {
  fill: rgba(0, 0, 0, 0.7);
  transition: d 0.3s ease;
}
.tutorial-tooltip {
  position: fixed;
  z-index: 10000;
  width: 360px;
  max-width: calc(100vw - 48px);
  background: #1a1020;
  border: 2px solid rgba(218, 165, 32, 0.55);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.6);
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.tutorial-tooltip-fade {
  opacity: 0;
  transform: translateY(8px);
}
.tutorial-tooltip-hidden {
  visibility: hidden;
}
.tutorial-step-indicator {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.tutorial-title {
  font-size: 1.1rem;
  color: var(--text);
  margin: 0 0 8px;
}
.tutorial-text {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.55;
  margin: 0 0 20px;
}
.tutorial-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.tutorial-skip {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.tutorial-skip:hover {
  color: var(--text-body);
}
.tutorial-next {
  padding: 8px 20px;
  font-size: 0.85rem;
}


/* ---- Main Wrapper ---- */
.main-wrapper {
  margin-left: 200px;
  flex: 1;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top Bar ---- */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 24px;
  background: rgba(20, 14, 22, 0.88);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--glass-border);
  gap: 16px;
}

.top-bar-left {
  flex-shrink: 0;
}

.top-bar-greeting {
  font-size: 1.35rem;
  font-weight: 700;
  background: var(--gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0;
  white-space: nowrap;
}

.top-bar-center {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  justify-content: center;
  min-width: 0;
}

.top-bar-goal-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.top-bar-goal-text {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-shrink: 0;
}

.top-bar-date {
  font-size: 0.8rem;
  color: var(--text-body);
  white-space: nowrap;
}

.top-bar-session {
  display: flex;
  align-items: center;
  gap: 6px;
}

.top-bar-session-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.top-bar-session-text {
  font-size: 0.85rem;
  color: var(--orange);
  font-weight: 600;
  white-space: nowrap;
}

.top-bar-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* ---- Content Area ---- */
.content-area {
  flex: 1;
  padding: 24px;
  overflow-y: auto;
}

/* ---- Container Outlines matching Apps Script board ---- */
.content-area > .glass-card,
.content-area .declaration-card,
.content-area .declaration-banner,
.content-area .declaration-banner--hero,
.content-area .journey-card,
.content-area .journey-progress--hero,
.content-area .stat-card,
.content-area .resource-card,
.content-area .partner-spotlight,
.content-area .contact-info,
.content-area .feedback-form,
.content-area .journal-entry,
.content-area .streak-banner,
.content-area .goal-card--hero,
.content-area .weather-sub-btn,
.content-area .stats-grid .stat-card,
.content-area .discount-card,
.content-area .day-detail-entry,
.resources-bottom-card {
  border: 2px solid rgba(218, 165, 32, 0.55) !important;
  box-shadow: 0 0 14px rgba(218, 165, 32, 0.12), 0 0 28px rgba(218, 165, 32, 0.04), 0 4px 24px rgba(40, 20, 8, 0.45) !important;
}

/* (Journal styles moved to nested layout section at bottom) */

.content-area > .glass-card:hover,
.content-area .declaration-banner--hero:hover,
.content-area .journey-progress--hero:hover,
.content-area .stat-card:hover,
.content-area .resource-card:hover,
.content-area .journal-entry:hover,
.resources-bottom-card:hover {
  border-color: rgba(218, 165, 32, 0.75) !important;
  box-shadow: 0 0 20px rgba(218, 165, 32, 0.2), 0 0 36px rgba(218, 165, 32, 0.06), 0 4px 24px rgba(40, 20, 8, 0.45) !important;
}

/* Declaration glow effect */
.content-area .declaration-banner,
.content-area .declaration-banner--hero {
  border-width: 2px !important;
  border-color: rgba(218, 165, 32, 0.65) !important;
  box-shadow: 0 0 28px rgba(218, 165, 32, 0.18), 0 0 56px rgba(218, 165, 32, 0.07), 0 4px 24px rgba(40, 20, 8, 0.45) !important;
}

.content-area .declaration-banner .declaration-label,
.content-area .declaration-banner--hero .declaration-label {
  text-shadow: 0 0 16px rgba(255, 140, 40, 0.5);
}

.content-area .declaration-banner .declaration-text,
.content-area .declaration-banner--hero .declaration-text,
.content-area .declaration-banner p {
  text-shadow: 0 0 20px rgba(255, 200, 80, 0.12);
}

/* Stat values stay white to pop against gold frames */
.content-area .stat-value {
  color: #DAA520 !important;
}

/* Journey week and percentage pop in gold */
.content-area .journey-week-label,
.content-area .journey-percent {
  color: #DAA520 !important;
  font-weight: 700;
}

/* ---- Gradient Label System (matching Session text style) ---- */
/* Pure text labels get the gradient */
.top-bar-goal-label,
.top-bar-session-label,
.content-area .journey-label,
.content-area .stat-label {
  color: var(--orange) !important;
  -webkit-text-fill-color: var(--orange) !important;
  background: none !important;
}

/* Headers with emojis stay solid orange so emojis render naturally */
.content-area .declaration-label,
.content-area .declaration-banner .declaration-label,
.content-area .declaration-banner--hero .declaration-label,
.content-area .section-header h2,
.content-area .section-title,
.content-area .write-title,
.content-area .milestones-section h3,
.content-area .upcoming-section h3,
.content-area .wins-section h3,
.content-area .home-outer-title {
  color: var(--orange) !important;
  -webkit-text-fill-color: var(--orange) !important;
  background: none !important;
}

/* Next session value pops in orange */
.top-bar-session-text,
.persistent-session-text {
  color: #ffffff !important;
}

/* ---- Brighten All Dim Text ---- */

/* Home tab: journey card labels — white, not gradient */
.content-area .progress-label,
.content-area .phase-label {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}
.content-area .progress-marker,
.content-area .progress-marker--end {
  color: #ffffff !important;
}
.content-area .declaration-footer {
  color: #D4CBC4 !important;
}

/* Home tab: section headers */
.content-area .milestones-section h3,
.content-area .upcoming-section h3,
.content-area .upcoming-section h4,
.content-area .wins-section h3,
.content-area .wins-section h4 {
  color: #ffffff !important;
}

/* Home tab: upcoming deadline meta */
.content-area .upcoming-date,
.content-area .upcoming-week {
  color: #D4CBC4 !important;
}

/* Tasks tab: all dim meta text — selectors match tasks.js class names */
.content-area .task-status-row,
.content-area .due-date,
.content-area .status-badge,
.content-area .task-expand-btn,
.content-area .phase-badge,
.content-area .task-detail-label,
.content-area .task-detail-text {
  color: #D4CBC4 !important;
}

/* Journal tab: private line message */
.content-area .journal-private-msg {
  color: #D4CBC4 !important;
}
.content-area .journal-private-msg strong {
  color: #FF6B35 !important;
}

/* Journal tab: form labels and meta */
.content-area .journal-write label,
.content-area .journal-link-label,
.content-area .journal-date,
.content-area .journal-time {
  color: #D4CBC4 !important;
}

/* Resources tab: all dim text */
.resources-bottom-card p,
.resources-bottom-card .contact-label,
.resources-bottom-card .contact-note {
  color: #D4CBC4 !important;
}

/* ---- Brightness Through Progress ---- */
/* Progress bar glows warmer as it fills */
.content-area .journey-progress-fill {
  box-shadow: 0 0 12px rgba(255, 107, 53, 0.4), 0 0 24px rgba(255, 107, 53, 0.15);
}

/* Completed stat cards glow subtly */
.content-area .stat-card.has-value .stat-value {
  text-shadow: 0 0 12px rgba(255, 215, 0, 0.3);
}

/* Milestone cards glow when earned */
.content-area .milestone-badge {
  box-shadow: 0 0 16px rgba(218, 165, 32, 0.2);
}

/* ------------------------------------------------------------
   9. (Reserved — Bottom Nav removed, sidebar replaces it)
   ------------------------------------------------------------ */

/* ------------------------------------------------------------
   10. Tab Content
   ------------------------------------------------------------ */
.tab-content {
  display: none;
}

.tab-content.tab-visible {
  display: block;
  animation: fadeIn 0.35s ease forwards;
}

/* ------------------------------------------------------------
   11. Glass Cards
   ------------------------------------------------------------ */
.glass-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.glass-card:hover {
  border-color: var(--glass-border-hover);
}

/* ------------------------------------------------------------
   12. Toast Notifications
   ------------------------------------------------------------ */
/* toast styles moved to bottom of file */

/* ------------------------------------------------------------
   13. Modal System
   ------------------------------------------------------------ */
/* Old modal styles removed — modal system is defined in the
   modal-overlay / modal-visible section below (line ~3929+).
   Kept here: modal-content, modal-footer for any legacy markup. */

.modal-content {
  background: rgba(28, 20, 14, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding: 16px 24px 20px;
  border-top: 1px solid var(--glass-border);
}

/* ------------------------------------------------------------
   14. Status Badges
   ------------------------------------------------------------ */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.status-badge.active {
  background: rgba(34, 197, 94, 0.15);
  color: #86EFAC;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.status-badge.pending_review {
  background: rgba(255, 107, 53, 0.15);
  color: #FDBA74;
  border: 1px solid rgba(255, 107, 53, 0.3);
}

.status-badge.completed {
  background: rgba(96, 165, 250, 0.15);
  color: #93C5FD;
  border: 1px solid rgba(96, 165, 250, 0.3);
}

.status-badge.pending {
  background: rgba(156, 163, 175, 0.15);
  color: #D1D5DB;
  border: 1px solid rgba(156, 163, 175, 0.3);
}

/* ------------------------------------------------------------
   15. Phase Badges
   ------------------------------------------------------------ */
.phase-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--gradient-subtle);
  color: var(--text-body);
  border: 1px solid var(--glass-border);
}

/* ------------------------------------------------------------
   16. Page Header
   ------------------------------------------------------------ */
.page-header {
  margin-bottom: 24px;
}

.page-header h2 {
  font-size: 1.4rem;
  margin-bottom: 4px;
}

.page-header .subtitle {
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* ------------------------------------------------------------
   17. Section Header
   ------------------------------------------------------------ */
.section-header {
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 1.15rem;
}

.section-header h3 {
  font-size: 1rem;
  color: var(--text-body);
}

/* ============================================================
   COMPONENT-SPECIFIC STYLES
   ============================================================ */

/* ------------------------------------------------------------
   18. Declaration Banner
   ------------------------------------------------------------ */
.declaration-banner {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-left: 4px solid transparent;
  border-image: var(--gradient) 1;
  border-image-slice: 1;
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  margin-bottom: 28px;
  position: relative;
  overflow: hidden;
}

.declaration-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--gradient-subtle);
  pointer-events: none;
}

.declaration-banner p {
  position: relative;
  font-size: 1.1rem;
  color: var(--text);
  line-height: 1.7;
  font-style: italic;
}

.declaration-banner .declaration-label {
  position: relative;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
  font-weight: 600;
  font-style: normal;
}

/* ------------------------------------------------------------
   19. Goal Card
   ------------------------------------------------------------ */
.goal-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.goal-card h4 {
  margin-bottom: 6px;
  font-size: 0.95rem;
}

.goal-card p {
  font-size: 0.875rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   20. Journey Progress
   ------------------------------------------------------------ */
.journey-progress {
  margin-bottom: 28px;
}

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

.progress-header span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.progress-header strong {
  color: var(--text);
}

.progress-bar {
  height: 8px;
  border-radius: 99px;
  background: var(--glass);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--gradient);
  transition: width 0.6s ease;
  min-width: 0;
}

.phase-label {
  margin-top: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   21. Stats Grid
   ------------------------------------------------------------ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.stat-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 12px;
  text-align: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.stat-value {
  font-size: 2.3rem;
  font-weight: 800;
  color: #DAA520;
  line-height: 1.2;
  margin-bottom: 4px;
}

.stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 500;
}

/* ------------------------------------------------------------
   22. Milestones Row
   ------------------------------------------------------------ */
.milestones-row {
  margin-bottom: 28px;
}

.milestones-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.milestones-scroll::-webkit-scrollbar {
  display: none;
}

.milestone-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  font-size: 0.8rem;
  color: var(--text-body);
  white-space: nowrap;
  flex-shrink: 0;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.milestone-chip .milestone-icon {
  font-size: 1rem;
}

/* ------------------------------------------------------------
   23. Upcoming Section
   ------------------------------------------------------------ */
.upcoming-section {
  margin-bottom: 28px;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid var(--glass-border);
  gap: 12px;
}

.upcoming-item:last-child {
  border-bottom: none;
}

.upcoming-item .upcoming-title {
  font-size: 0.9rem;
  color: var(--text);
  flex: 1;
}

.upcoming-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.upcoming-date.overdue {
  color: var(--status-expired);
  font-weight: 600;
}

/* ------------------------------------------------------------
   24. Task Cards
   ------------------------------------------------------------ */
.task-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition);
}

.task-card:hover {
  border-color: var(--glass-border-hover);
}


.task-card.task-overdue {
  border-left: 3px solid var(--status-expired);
}

.task-card.task-new-feedback {
  border-color: rgba(218, 165, 32, 0.55);
  box-shadow: 0 0 12px rgba(218, 165, 32, 0.25), 0 0 24px rgba(218, 165, 32, 0.1);
  animation: feedbackGlow 2s ease-in-out infinite alternate;
}

@keyframes feedbackGlow {
  from { box-shadow: 0 0 8px rgba(218, 165, 32, 0.2), 0 0 16px rgba(218, 165, 32, 0.08); }
  to { box-shadow: 0 0 14px rgba(218, 165, 32, 0.35), 0 0 28px rgba(218, 165, 32, 0.15); }
}

.new-feedback-badge {
  display: inline-block;
  background: var(--orange);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 8px;
  vertical-align: middle;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.task-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.task-card-header h4 {
  font-size: 0.95rem;
  flex: 1;
}

.task-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* ------------------------------------------------------------
   25. Checklist
   ------------------------------------------------------------ */
.checklist-section {
  margin-bottom: 16px;
}

.checklist-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 0.825rem;
  color: var(--text-muted);
}

.checklist-progress .progress-bar {
  flex: 1;
  height: 6px;
}

.checklist-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}

.checklist-item label {
  font-size: 0.875rem;
  color: var(--text-body);
  cursor: pointer;
  line-height: 1.5;
  flex: 1;
}

.checklist-item.checked label {
  text-decoration: line-through;
  color: var(--text-muted);
}

.checklist-item input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  min-width: 20px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-xs);
  background: transparent;
  cursor: pointer;
  position: relative;
  margin-top: 2px;
  transition: all var(--transition);
}

.checklist-item input[type="checkbox"]:checked {
  background: var(--orange);
  border-color: var(--orange);
}

.checklist-item input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 6px;
  width: 5px;
  height: 9px;
  border: solid var(--text);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ------------------------------------------------------------
   26. Task Notepad
   ------------------------------------------------------------ */
.task-notepad {
  background: rgba(255, 180, 120, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 12px;
}

.task-notepad h5 {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}

.task-notepad textarea {
  width: 100%;
  background: transparent;
  border: none;
  color: var(--text-body);
  font-family: var(--font);
  font-size: 0.875rem;
  line-height: 1.6;
  resize: vertical;
  min-height: 60px;
  outline: none;
}

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

/* ------------------------------------------------------------
   27. Task Details
   ------------------------------------------------------------ */
.task-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}

.task-expand-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.825rem;
  cursor: pointer;
  transition: color var(--transition);
  gap: 6px;
}

.task-expand-btn:hover {
  color: var(--text-accent);
}

/* ── Completed task collapsed card ───────────────────────── */
.task-card-completed-collapsed .task-completed-toggle {
  cursor: pointer;
}
.task-card-completed-collapsed .task-completed-summary {
  cursor: pointer;
  padding: 0 4px;
}
.task-card-completed-collapsed .task-header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 4px;
}
.task-completed-expanded {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.task-completed-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--glass-border);
}
.task-completed-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.btn-mark-done {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.3);
  border-radius: var(--radius-sm);
  color: #86EFAC;
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}

.btn-mark-done:hover {
  background: rgba(34, 197, 94, 0.2);
  border-color: rgba(34, 197, 94, 0.45);
}

/* ------------------------------------------------------------
   28. Coach Feedback Block
   ------------------------------------------------------------ */
.coach-feedback-block {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.coach-feedback-block .coach-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.coach-icon {
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  background: var(--gradient);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  color: var(--text);
  font-weight: 700;
}

.coach-feedback-block p {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.6;
}

/* ------------------------------------------------------------
   29. Journal Write Section
   ------------------------------------------------------------ */
.journal-write {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.journal-write h3 {
  margin-bottom: 12px;
}

.journal-links {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ------------------------------------------------------------
   30. Journal Entry Cards
   ------------------------------------------------------------ */
.journal-entry-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition);
}

.journal-entry-card:hover {
  border-color: var(--glass-border-hover);
}

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

.entry-date {
  font-size: 0.825rem;
  color: var(--text-muted);
  font-weight: 500;
}

.entry-time {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.entry-text {
  font-size: 0.9rem;
  color: #ffffff;
  line-height: 1.65;
}

/* ------------------------------------------------------------
   31. Status Dots
   ------------------------------------------------------------ */
.status-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  display: inline-block;
  background: var(--text-muted);
}

.status-dot-new {
  background: #60A5FA;
}

.status-dot-read {
  background: var(--orange);
}

.status-dot-responded {
  background: var(--status-active);
}

/* ------------------------------------------------------------
   32. Coach Response Block
   ------------------------------------------------------------ */
.coach-response-block {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-left: 3px solid var(--orange);
  border-radius: var(--radius);
  padding: 16px 20px;
  margin-top: 12px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.response-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.response-header h4 {
  font-size: 0.9rem;
  flex: 1;
}

.response-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.coach-response-block p {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.65;
}

/* ------------------------------------------------------------
   33. Journal Search
   ------------------------------------------------------------ */
.journal-search {
  margin-bottom: 20px;
}

.journal-search input {
  width: 100%;
  padding: 12px 16px;
  padding-left: 40px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  transition: border-color var(--transition), background var(--transition);
  outline: none;
}

.journal-search input:focus {
  border-color: var(--glass-border-hover);
  background: var(--glass-hover);
}

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

.journal-search {
  position: relative;
}

.journal-search .search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 0.9rem;
  pointer-events: none;
}

/* ------------------------------------------------------------
   34. Resource Cards
   ------------------------------------------------------------ */
.resource-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  cursor: pointer;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.resource-card:hover {
  border-color: var(--glass-border-hover);
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.resource-card h4 {
  margin-bottom: 6px;
}

.resource-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.resource-type-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 99px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--glass);
  color: var(--text-muted);
  border: 1px solid var(--glass-border);
}

.resource-video {
  margin-top: 12px;
}

/* ------------------------------------------------------------
   35. Video Embed
   ------------------------------------------------------------ */
.video-embed {
  position: relative;
  width: 100%;
  max-width: 560px;
  padding-top: min(56.25%, 315px); /* 16:9, capped at 560px width */
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

.video-embed iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
}

.video-placeholder {
  position: relative;
  max-width: 560px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  aspect-ratio: 16 / 9;
}
.video-thumb {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.video-thumb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s ease;
}
.video-placeholder:hover .video-thumb-overlay {
  background: rgba(0, 0, 0, 0.15);
}
.video-thumb-play {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}
.video-placeholder:hover .video-thumb-play {
  transform: scale(1.1);
  background: rgba(255, 255, 255, 0.95);
}
.video-thumb-triangle {
  display: block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 10px 0 10px 18px;
  border-color: transparent transparent transparent #1a1020;
  margin-left: 3px;
}

/* ------------------------------------------------------------
   35b. Expandable Resource Cards (Videos & Books)
   ------------------------------------------------------------ */
.resources-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.resource-expandable {
  background: rgba(30, 20, 35, 0.4);
  border: 1.5px solid rgba(255, 190, 130, 0.2);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color var(--transition);
}

.resource-expandable:hover {
  border-color: rgba(255, 190, 130, 0.35);
}

.resource-expand-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer;
  gap: 12px;
}

.resource-expand-info {
  flex: 1;
  min-width: 0;
}

.resource-expand-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}

.resource-expand-meta {
  font-size: 0.8rem;
  color: #D4CBC4;
}

.resource-expand-arrow {
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
  transition: transform var(--transition);
}

.resource-expand-body {
  padding: 0 20px 20px;
}

.resource-expand-desc {
  font-size: 0.875rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 16px;
}

.resource-expand-body .video-embed {
  margin-top: 4px;
}

/* ------------------------------------------------------------
   36. Discount Cards
   ------------------------------------------------------------ */
.discount-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.discount-card h4 {
  margin-bottom: 8px;
}

.discount-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.discount-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.discount-code {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 99px;
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  font-size: 0.9rem;
  color: var(--text);
  letter-spacing: 0.06em;
  font-weight: 600;
}

/* ------------------------------------------------------------
   37. Star Rating
   ------------------------------------------------------------ */
.star-rating {
  display: flex;
  gap: 6px;
}

.star {
  font-size: 2rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition), transform var(--transition);
  line-height: 1;
  -webkit-user-select: none;
  user-select: none;
}

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

.star.star-filled {
  color: #FFD700;
}

/* ------------------------------------------------------------
   38. Feedback Form
   ------------------------------------------------------------ */
.feedback-form {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.feedback-form h3 {
  margin-bottom: 16px;
}

.feedback-form .form-group {
  margin-bottom: 16px;
}

/* ------------------------------------------------------------
   39. Session Timeline
   ------------------------------------------------------------ */
.session-timeline {
  padding-left: 24px;
  position: relative;
}

.timeline-item {
  display: flex;
  position: relative;
  padding-bottom: 24px;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -17px;
  top: 16px;
  bottom: -8px;
  width: 2px;
  background: var(--glass-border);
}

.timeline-item:last-child::before {
  display: none;
}

.timeline-dot {
  position: absolute;
  left: -24px;
  top: 6px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--glass-border);
  background: var(--bg);
  z-index: 2;
}

.timeline-dot.completed {
  background: var(--status-active);
  border-color: var(--status-active);
}

.timeline-dot.scheduled {
  background: var(--orange);
  border-color: var(--orange);
}

.timeline-dot.cancelled {
  background: var(--text-muted);
  border-color: var(--text-muted);
}

.timeline-dot.future {
  background: var(--bg);
  border: 2px dashed var(--text-muted);
}

.timeline-content {
  flex: 1;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-left: 8px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.timeline-content h4 {
  font-size: 0.9rem;
  margin-bottom: 6px;
}

.timeline-content p {
  font-size: 0.825rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   40. Session Details
   ------------------------------------------------------------ */
.session-theme {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 8px;
  font-style: italic;
}

.session-detail {
  display: flex;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-body);
  margin-bottom: 4px;
}

.detail-label {
  font-weight: 600;
  color: var(--text);
  min-width: fit-content;
}

/* ------------------------------------------------------------
   41. Notification Bell
   ------------------------------------------------------------ */
.notification-bell {
  position: relative;
}

.notification-bell button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-body);
  transition: all var(--transition);
  font-size: 1.15rem;
  border: none;
  cursor: pointer;
}

.notification-bell button:hover {
  background: var(--glass);
  color: var(--text);
}

#notification-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 99px;
  background: var(--orange);
  color: var(--text);
  font-size: 0.65rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  pointer-events: none;
}

/* ------------------------------------------------------------
   42. Notification Dropdown
   ------------------------------------------------------------ */
#notification-dropdown {
  position: fixed;
  top: 60px;
  right: 24px;
  width: 340px;
  max-height: 400px;
  overflow-y: auto;
  z-index: 200;
  background: rgba(28, 20, 14, 0.97);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  display: none;
}

#notification-dropdown.visible {
  display: block;
  animation: fadeIn 0.2s ease forwards;
}

.notification-list {
  padding: 4px 0;
}

.notification-item {
  display: flex;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  transition: background var(--transition);
  cursor: pointer;
}

.notification-item:last-child {
  border-bottom: none;
}

.notification-item:hover {
  background: var(--glass);
}

.notification-item.unread {
  background: rgba(255, 180, 120, 0.06);
}

.notification-dot {
  width: 8px;
  height: 8px;
  min-width: 8px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--text-muted);
}

.notification-dot.active {
  background: var(--orange);
}

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

.notification-title {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
  margin-bottom: 2px;
}

.notification-message {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.notification-empty {
  text-align: center;
  padding: 32px 16px;
  color: var(--text-muted);
  font-size: 0.875rem;
}

.notification-mark-all {
  display: block;
  width: 100%;
  text-align: center;
  padding: 12px;
  border-top: 1px solid var(--glass-border);
  color: var(--text-accent);
  font-size: 0.825rem;
  font-weight: 500;
  cursor: pointer;
  background: transparent;
  border-left: none;
  border-right: none;
  border-bottom: none;
  transition: background var(--transition);
}

.notification-mark-all:hover {
  background: var(--glass);
}

/* ------------------------------------------------------------
   43. Settings
   ------------------------------------------------------------ */
.settings-section {
  margin-bottom: 28px;
}

.settings-section h3 {
  font-size: 1rem;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--glass-border);
}

.settings-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 190, 130, 0.08);
}

.settings-info:last-child {
  border-bottom: none;
}

.settings-info label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
}

.settings-info span {
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   44. Quick Journal Button
   ------------------------------------------------------------ */
.btn-quick-journal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 20px auto 0;
  padding: 12px 24px;
  background: var(--gradient);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-weight: 500;
  box-shadow: 0 4px 16px rgba(255, 107, 53, 0.25);
  transition: all var(--transition);
  border: none;
  cursor: pointer;
}

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

/* ------------------------------------------------------------
   45. Rich Text Editor
   ------------------------------------------------------------ */
.rich-text-editor {
  margin-bottom: 16px;
}

.rte-toolbar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px 10px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-bottom: none;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  flex-wrap: wrap;
}

.rte-toolbar button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
}

.rte-toolbar button:hover {
  background: var(--glass-hover);
  color: var(--text);
}

.rte-toolbar button.active {
  background: rgba(255, 107, 53, 0.2);
  color: var(--orange);
}

.rte-content {
  min-height: 120px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  padding: 14px 16px;
  color: var(--text);
  font-family: var(--font);
  font-size: 0.9rem;
  line-height: 1.65;
  outline: none;
  overflow-y: auto;
}

.rte-content:focus {
  border-color: var(--glass-border-hover);
}

.rte-content:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
}

/* ------------------------------------------------------------
   46. Empty States
   ------------------------------------------------------------ */
.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  display: block;
  opacity: 0.6;
}

.empty-state h3 {
  color: var(--text);
  font-size: 1.1rem;
  margin-bottom: 8px;
}

.empty-state p {
  color: var(--text-muted);
  font-size: 0.875rem;
  max-width: 300px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes warmPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

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

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

@keyframes celebrate {
  0% { transform: scale(1); }
  50% { transform: scale(1.05); }
  100% { transform: scale(1); }
}

/* ------------------------------------------------------------
   50. Home Redesign — Hero Modifiers & New Sections
   ------------------------------------------------------------ */

/* Declaration hero */
.declaration-banner--hero {
  padding: 28px;
  border-left: 5px solid transparent;
  margin-bottom: 20px;
}

.declaration-banner--hero .declaration-text {
  font-size: 1.2rem;
  line-height: 1.8;
}

.declaration-divider {
  border: none;
  border-top: 1px solid rgba(218, 165, 32, 0.3);
  margin: 16px 0 12px;
}

.declaration-footer {
  position: relative;
  text-align: right;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0;
  font-style: italic;
}

.declaration-placeholder,
.goal-placeholder {
  color: var(--text-muted);
  font-style: italic;
  font-size: 0.95rem;
}

/* Goal hero */
.goal-card--hero {
  padding: 22px 24px;
  margin-bottom: 28px;
  border-left: 4px solid var(--orange);
}

.goal-card--hero .goal-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-weight: 600;
  margin-bottom: 8px;
}

.goal-card--hero .goal-text {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.6;
}

/* Journey hero */
.journey-progress--hero {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

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

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

.progress-meta {
  font-size: 0.85rem;
  color: var(--text-body);
}

.progress-meta strong {
  color: #E8480C;
  font-weight: 700;
  font-size: 1.1rem;
}

/* Taller progress bar */
.progress-bar--lg {
  height: 12px;
}

/* Week markers */
.progress-markers {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  position: relative;
  min-height: 20px;
}

.progress-marker {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 500;
}

.progress-marker--current {
  position: absolute;
  transform: translateX(-50%);
  color: var(--orange);
  font-weight: 700;
}

.progress-marker--end {
  margin-left: auto;
}

/* Milestones section (vertical card grid) */
.milestones-section {
  margin-bottom: 28px;
}

.milestones-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 14px;
  font-weight: 600;
}

.milestones-grid {
  display: grid;
  gap: 12px;
}

.milestone-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.milestone-card .milestone-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
  line-height: 1;
}

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

.milestone-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: #ffffff !important;
  margin-bottom: 4px;
}

.milestone-desc {
  font-size: 0.8rem;
  color: #D4CBC4 !important;
  line-height: 1.5;
}

.milestone-bullets {
  list-style: none;
  padding-left: 1em;
  margin: 6px 0;
}
.milestone-bullets li {
  position: relative;
  padding-left: 4px;
  margin-bottom: 2px;
}
.milestone-bullets li::before {
  content: '\2013';
  position: absolute;
  left: -1em;
  color: var(--orange);
}

/* Section empty state */
.section-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 20px 16px;
  font-style: italic;
}

/* Bottom grid (Deadlines + Wins) */
.home-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 28px;
}

.home-bottom-col {
  min-width: 0;
}

/* Upcoming section updates */
.upcoming-section h3,
.wins-section h3 {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 600;
}

.upcoming-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
  gap: 10px;
}

.upcoming-item:last-child {
  border-bottom: none;
}

.upcoming-left {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  gap: 2px;
}

.upcoming-left .upcoming-title {
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.upcoming-week {
  font-size: 0.7rem;
  color: var(--text-muted);
}

.upcoming-meta {
  flex-shrink: 0;
}

.upcoming-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 99px;
  text-transform: uppercase;
}

.upcoming-badge--today {
  background: rgba(245, 158, 11, 0.2);
  color: #F59E0B;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.upcoming-badge--overdue {
  background: rgba(239, 68, 68, 0.2);
  color: #EF4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

/* Recent wins */
.wins-section {
  margin-bottom: 0;
}

.wins-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
  gap: 10px;
}

.wins-item:last-child {
  border-bottom: none;
}

.wins-title {
  font-size: 0.85rem;
  color: var(--text);
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.wins-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 99px;
  background: rgba(34, 197, 94, 0.2);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.3);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   HOME TAB — NESTED CONTAINER LAYOUT
   Mirrors the Journal tab's "rooms inside rooms" pattern.
   Outer containers: gold 2px outlines, solid dark fills.
   Inner items: subtler 1.5px borders, lower opacity.
   ============================================================ */

/* Outer containers (Milestones, Activity) */
.home-outer-container {
  background: rgba(24, 16, 28, 0.4);
  border: 2px solid rgba(218, 165, 32, 0.55);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 14px rgba(218, 165, 32, 0.12), 0 0 28px rgba(218, 165, 32, 0.04), 0 4px 24px rgba(40, 20, 8, 0.45);
}

/* Outer container title (emoji-containing → solid orange, not gradient) */
.home-outer-title {
  color: var(--orange);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

/* Inner sub-section titles (Upcoming Deadlines, Recent Wins) */
.home-inner-title {
  font-size: 1rem;
  color: var(--text);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Inside outer containers, milestone cards get subtler borders */
.home-outer-container .milestone-card {
  background: rgba(30, 20, 35, 0.4) !important;
  background-image: none !important;
  border: 2.5px solid #DAA520 !important;
  box-shadow: 0 0 12px rgba(218, 165, 32, 0.3), 0 0 24px rgba(255, 107, 53, 0.15) !important;
  border-radius: var(--radius) !important;
}

/* Inside activity outer, upcoming/wins items get subtler dividers */
.activity-outer .upcoming-section,
.activity-outer .wins-section {
  background: rgba(30, 20, 35, 0.4);
  border: 1.5px solid rgba(255, 190, 130, 0.2);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 4px 16px rgba(40, 20, 8, 0.3);
}

.activity-outer .upcoming-section:hover,
.activity-outer .wins-section:hover {
  border-color: rgba(255, 190, 130, 0.35);
}

/* Bottom grid inside activity outer — no extra margin since outer has padding */
.activity-outer .home-bottom-grid {
  margin-bottom: 0;
}

/* ============================================================
   TASKS TAB — NESTED CONTAINER LAYOUT
   ============================================================ */

/* 3-column stats grid for tasks progress */
.stats-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

/* Count badge next to "Tasks" outer title */
.tasks-count-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 99px;
  background: rgba(255, 107, 53, 0.15);
  color: var(--orange);
  border: 1px solid rgba(255, 107, 53, 0.3);
  vertical-align: middle;
  margin-left: 8px;
}

/* Task cards inside outer container get subtler borders */
.tasks-list-outer .task-card {
  background: rgba(30, 20, 35, 0.4) !important;
  border: 2px solid rgba(218, 165, 32, 0.45) !important;
  box-shadow: 0 0 10px rgba(218, 165, 32, 0.1), 0 4px 16px rgba(40, 20, 8, 0.3) !important;
}

.tasks-list-outer .task-card:hover {
  border-color: rgba(255, 190, 130, 0.35) !important;
}

/* Focus task keeps its gradient border treatment */

/* Milestones inside tasks outer also get subtler borders */
.tasks-milestones-outer .milestone-card {
  background: rgba(30, 20, 35, 0.4) !important;
  background-image: none !important;
  border: 2.5px solid #DAA520 !important;
  box-shadow: 0 0 12px rgba(218, 165, 32, 0.3), 0 0 24px rgba(255, 107, 53, 0.15) !important;
  border-radius: var(--radius) !important;
}

/* Task section titles inside outer container */
.tasks-list-outer .task-section-title {
  color: var(--text) !important;
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 12px;
  cursor: pointer;
}

.tasks-list-outer .task-section-title .section-count {
  color: #D4CBC4;
  font-weight: 400;
}

/* Task notepad textarea (clean, no toolbar) */
.task-notepad-textarea {
  min-height: 80px;
  resize: vertical;
  line-height: 1.6;
  font-size: 0.9rem;
}

/* Notepad label */
.task-notepad .notepad-label {
  font-size: 0.8rem;
  color: #D4CBC4;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
  font-weight: 600;
}

/* Task cards 2-column grid */
.task-cards-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px) {
  .task-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Task description preview */
.task-desc-preview {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.5;
  margin-bottom: 12px;
}

/* Pending review submission blocks */
.task-submission-block {
  border-left: 3px solid var(--orange);
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 107, 53, 0.04);
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
}
.task-submission-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--orange);
  margin-bottom: 4px;
}
.task-submission-text {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* Waiting for coach card */
.task-waiting-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  margin: 12px 0;
  border: 2px dashed rgba(218, 165, 32, 0.35);
  border-radius: var(--radius-sm);
  background: rgba(218, 165, 32, 0.04);
}
.task-waiting-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}
.task-waiting-text {
  font-size: 0.85rem;
  color: var(--text-body);
  line-height: 1.5;
}

/* Completed task lockout */
.task-submission-block.task-locked {
  opacity: 0.6;
}
.task-locked-badge {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 0;
  margin-top: 8px;
}

/* ============================================================
   LOADING SCREEN
   ============================================================ */

.loading-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 100px 24px;
  gap: 20px;
}

.loading-icon {
  font-size: 2.5rem;
  animation: loadingPulse 1.5s ease-in-out infinite;
}

.loading-spinner-ring {
  width: 48px;
  height: 48px;
  border: 3px solid rgba(255, 255, 255, 0.08);
  border-top-color: var(--orange);
  border-right-color: var(--purple);
  border-radius: 50%;
  animation: loadingSpin 1s linear infinite;
}

.loading-label {
  font-size: 0.9rem;
  color: var(--text-muted);
  letter-spacing: 1px;
  text-transform: uppercase;
  font-weight: 500;
}

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

@keyframes loadingPulse {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

/* ============================================================
   RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Tablet and small desktop */
@media (max-width: 600px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .stat-value {
    font-size: 1.6rem;
  }

  .content-area {
    padding: 12px;
  }

  .glass-card {
    padding: 16px;
  }

  .modal-content {
    max-width: 100%;
    margin: 0 8px;
  }

  .modal-header {
    padding: 16px 18px 14px;
  }

  .modal-body {
    padding: 16px 18px;
  }

  .modal-footer {
    padding: 14px 18px 16px;
  }

  .login-card {
    padding: 32px 24px;
  }

  .declaration-banner {
    padding: 18px;
  }

  .declaration-banner--hero {
    padding: 20px;
  }

  .declaration-banner--hero .declaration-text,
  .declaration-banner p {
    font-size: 1rem;
  }

  .goal-card--hero {
    padding: 18px 20px;
  }

  .journey-progress--hero {
    padding: 18px;
  }

  .home-bottom-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  #notification-dropdown {
    width: calc(100vw - 32px);
    right: -8px;
  }

  .timeline-content {
    padding: 14px 16px;
  }

  .feedback-form {
    padding: 18px;
  }
}

/* Small mobile */
@media (max-width: 480px) {
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.2rem; }
  h3 { font-size: 1.05rem; }

  .top-bar {
    padding: 10px 12px;
  }

  .top-bar-greeting {
    font-size: 1.05rem;
  }

  .content-area {
    padding: 10px;
  }

  .stat-value {
    font-size: 1.4rem;
  }

  .stat-card {
    padding: 12px 8px;
  }

  .stat-label {
    font-size: 0.65rem;
  }

  .glass-card {
    padding: 14px;
    border-radius: var(--radius-sm);
  }

  .task-card {
    padding: 14px 16px;
  }

  .journal-entry-card {
    padding: 14px 16px;
  }

  .coach-feedback-block {
    padding: 14px 16px;
  }

  .coach-response-block {
    padding: 14px 16px;
  }

  .page-header h2 {
    font-size: 1.2rem;
  }

  .declaration-banner p,
  .declaration-banner--hero .declaration-text {
    font-size: 0.95rem;
  }

  .declaration-banner--hero {
    padding: 16px;
  }

  .goal-card--hero {
    padding: 16px 18px;
  }

  .goal-card--hero .goal-text {
    font-size: 1rem;
  }

  .journey-progress--hero {
    padding: 14px;
  }

  .progress-bar--lg {
    height: 10px;
  }

  .milestone-card {
    padding: 14px 16px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.875rem;
  }

  .btn-sm {
    padding: 6px 12px;
    font-size: 0.775rem;
  }

  .toast-container {
    left: 0;
    padding: 0 12px;
  }

  .resource-card {
    padding: 14px 16px;
  }

  .discount-code-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .session-timeline {
    padding-left: 20px;
  }

  .timeline-dot {
    left: -20px;
    width: 14px;
    height: 14px;
  }

  .timeline-item::before {
    left: -14px;
  }

  .settings-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }

  .star {
    font-size: 1.6rem;
  }

  .rte-toolbar {
    padding: 6px 8px;
  }

  .rte-toolbar button {
    width: 28px;
    height: 28px;
    font-size: 0.8rem;
  }

  .rte-content {
    min-height: 100px;
    padding: 12px 14px;
  }

  .empty-state {
    padding: 36px 16px;
  }

  .empty-icon {
    font-size: 2.5rem;
  }
}

/* ============================================================
   Flight Conditions (Mood Tracker) — Integrated Tab
   ============================================================ */

/* Weather Sub-Navigation */
.weather-sub-nav {
  display: flex;
  gap: 8px;
  padding: 0 0 16px 0;
}
.weather-sub-btn {
  flex: 1;
  padding: 10px 12px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}
.weather-sub-btn:hover {
  background: var(--glass-hover);
  color: var(--text-body);
}
.weather-sub-btn.weather-sub-active {
  background: linear-gradient(135deg, rgba(255, 107, 53, 0.2), rgba(139, 92, 246, 0.15));
  border-color: var(--orange);
  color: var(--text);
}
.weather-sub-content { display: none; }
.weather-sub-content.weather-sub-visible { display: block; }

.mood-greeting {
  margin-bottom: 24px;
  animation: fadeIn 0.5s ease;
}
.mood-greeting h2 {
  font-size: 1.3rem;
  margin-bottom: 4px;
}
.mood-greeting p {
  color: var(--text-muted);
  font-size: 0.9rem;
}

.streak-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 20px;
  background: var(--gradient-subtle);
  border: 1px solid rgba(255,107,53,0.15);
  border-radius: var(--radius);
  margin-bottom: 20px;
  animation: fadeIn 0.4s ease;
}
.streak-fire { font-size: 1.5rem; }
.streak-text { flex: 1; }
.streak-count {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text);
}
.streak-label { font-size: 0.8rem; color: var(--text-muted); }

.weather-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 20px 0;
}
.weather-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 16px 8px 12px;
  background: var(--glass);
  border: 2px solid transparent;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 44px;
  user-select: none;
}
.weather-option:hover {
  background: var(--glass-hover);
  border-color: rgba(255,180,120,0.15);
  transform: translateY(-2px);
}
.weather-option.weather-selected {
  border-color: var(--orange);
  background: rgba(255,107,53,0.12);
  box-shadow: 0 0 24px rgba(255,107,53,0.2), inset 0 0 12px rgba(255,107,53,0.05);
  transform: translateY(-2px);
}
.weather-emoji {
  font-size: 48px;
  line-height: 1;
  transition: transform 0.2s ease;
}
.weather-option.weather-selected .weather-emoji {
  transform: scale(1.1);
}
.weather-label-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-align: center;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.weather-option.weather-selected .weather-label-text {
  color: var(--text);
}
.weather-desc {
  font-size: 0.75rem;
  color: var(--text-body);
  text-align: center;
}
.weather-option.weather-selected .weather-desc {
  color: var(--text);
}

.note-area { margin: 16px 0; }
.note-area label { display: block; margin-bottom: 8px; }
.char-counter {
  text-align: right;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 4px;
  transition: color var(--transition);
}
.char-counter.near-limit { color: var(--status-expiring); }
.char-counter.at-limit { color: var(--status-expired); }

.tag-section { margin: 20px 0; }
.tag-section label {
  display: block;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-body);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag-pill {
  padding: 8px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.8rem;
  font-family: var(--font);
  cursor: pointer;
  transition: all var(--transition);
  min-height: 36px;
  display: flex;
  align-items: center;
  user-select: none;
}
.tag-pill:hover {
  background: rgba(255,200,150,0.06);
  color: var(--text-body);
}
.tag-pill.tag-selected {
  color: var(--text);
  background: var(--gradient-subtle);
  border-color: rgba(255,107,53,0.3);
}

.mood-submit { margin-top: 24px; }

/* Already Logged State */
.logged-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 28px 24px;
  text-align: center;
  animation: fadeInScale 0.4s ease;
}
.logged-weather-big {
  font-size: 64px;
  margin-bottom: 8px;
  animation: celebrate 0.6s ease;
}
.logged-label {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.logged-note {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 12px;
  font-style: italic;
}
.logged-tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.logged-tag {
  font-size: 0.7rem;
  padding: 3px 10px;
  background: rgba(255,200,150,0.06);
  border: 1px solid rgba(255,190,130,0.12);
  border-radius: 12px;
  color: var(--text-muted);
}
.logged-time {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 10px;
}

.all-done-card {
  padding: 40px 24px;
  text-align: center;
}
.all-done-card .emoji-big {
  font-size: 4rem;
  margin-bottom: 16px;
  display: block;
}

/* Countdown timer — subtle note style */
.next-log-countdown {
  text-align: center;
  margin-top: 16px;
  padding: 10px 16px;
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}
.countdown-icon {
  font-size: 0.85rem;
}
.countdown-time {
  color: var(--text-body);
  font-weight: 600;
}

.today-entries {
  margin-top: 24px;
}
.today-entries h4 {
  margin-bottom: 12px;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.entry-mini {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.entry-mini-emoji { font-size: 1.8rem; }
.entry-mini-info { flex: 1; }
.entry-mini-type {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.entry-mini-note {
  font-size: 0.85rem;
  color: var(--text-body);
  margin-top: 2px;
}
.entry-mini-time {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* Backfill Banner */
.backfill-banner {
  background: rgba(245,158,11,0.08);
  border: 1px solid rgba(245,158,11,0.2);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  animation: fadeIn 0.4s ease;
}
.backfill-banner .backfill-icon { font-size: 1.3rem; }
.backfill-banner .backfill-text { flex: 1; font-size: 0.85rem; color: var(--text-body); }
.backfill-banner .btn { flex-shrink: 0; }

/* ── Calendar ────────────────────────────────────────────── */
.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.calendar-header h2 { font-size: 1.2rem; }
.calendar-nav {
  display: flex;
  gap: 8px;
}
.calendar-nav .btn-icon {
  width: 36px;
  height: 36px;
  font-size: 1rem;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 20px;
}
.calendar-day-header {
  text-align: center;
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 8px 0;
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.04em;
}
.calendar-cell {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-xs);
  background: var(--glass);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-size: 0.75rem;
  position: relative;
  padding: 2px;
  min-height: 44px;
  gap: 1px;
  overflow: hidden;
}
.calendar-cell:hover { background: var(--glass-hover); }
.calendar-cell.cell-today {
  border-color: var(--orange);
  box-shadow: 0 0 12px rgba(255,107,53,0.2);
}
.calendar-cell.cell-empty {
  background: transparent;
  border: none;
  cursor: default;
}
.calendar-cell.cell-future {
  opacity: 0.25;
  cursor: default;
}
.calendar-cell.cell-missed {
  border-color: rgba(239,68,68,0.15);
  background: rgba(239,68,68,0.04);
}
.cell-day-num {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1;
}
.calendar-cell.cell-today .cell-day-num { color: var(--orange); }
.cell-moods {
  display: flex;
  gap: 1px;
  font-size: 0.85rem;
  line-height: 1;
}
.cell-mood-score {
  position: absolute;
  bottom: 2px;
  right: 3px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

/* Calendar month summary */
.month-summary {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 20px;
}
.summary-stat {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.summary-stat-value {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 4px;
}
.summary-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Day detail modal */
.day-detail-entries {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.day-detail-entry {
  padding: 16px;
  background: rgba(255,200,150,0.04);
  border: 1px solid rgba(255,190,130,0.10);
  border-radius: var(--radius-sm);
}
.day-detail-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.day-detail-emoji { font-size: 2rem; }
.day-detail-meta { flex: 1; }
.day-detail-type {
  font-size: 0.75rem;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}
.day-detail-weather {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}
.day-detail-note {
  font-size: 0.9rem;
  color: var(--text-body);
  margin-bottom: 8px;
  font-style: italic;
}
.day-detail-tags { display: flex; flex-wrap: wrap; gap: 6px; }

/* ── Insights ────────────────────────────────────────────── */
.insight-card {
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  animation: fadeIn 0.4s ease;
}
.insight-card h3 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 16px;
  color: var(--text-muted);
}

.insight-big-number {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
}
.insight-trend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-left: 8px;
}
.insight-trend.trend-up { color: var(--status-active); background: rgba(34,197,94,0.1); }
.insight-trend.trend-down { color: var(--status-expired); background: rgba(239,68,68,0.1); }
.insight-trend.trend-steady { color: var(--status-expiring); background: rgba(245,158,11,0.1); }

/* Bar Chart */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 6px;
  height: 160px;
  padding: 0;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 40px;
  border-radius: var(--radius-xs) var(--radius-xs) 0 0;
  min-height: 4px;
  transition: height 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
}
.bar-value {
  position: absolute;
  top: -18px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.65rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.bar-label {
  margin-top: 8px;
  font-size: 0.65rem;
  color: var(--text-muted);
  text-align: center;
}
.bar-highlight .bar-label { color: var(--text); font-weight: 600; }

/* Pie Chart */
.pie-chart-container {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  justify-content: center;
}
.pie-chart {
  width: 160px;
  height: 160px;
  border-radius: 50%;
  position: relative;
  flex-shrink: 0;
}
.pie-center {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
}
.pie-legend {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.pie-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--text-body);
}
.pie-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.pie-legend-pct {
  color: var(--text-muted);
  margin-left: auto;
  font-size: 0.75rem;
}

/* Trend Line SVG */
.trend-svg {
  width: 100%;
  height: 160px;
  display: block;
}

/* AM vs PM Comparison */
.comparison-bars {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.comparison-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.comparison-label {
  width: 50px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
}
.comparison-bar-bg {
  flex: 1;
  height: 24px;
  background: rgba(255,200,150,0.04);
  border-radius: 12px;
  overflow: hidden;
}
.comparison-bar-fill {
  height: 100%;
  border-radius: 12px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  align-items: center;
  padding-left: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
}

/* Tag Correlation Bars */
.tag-correlation-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.tag-corr-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.tag-corr-name {
  width: 90px;
  font-size: 0.8rem;
  color: var(--text-body);
  text-align: right;
  flex-shrink: 0;
}
.tag-corr-bar-bg {
  flex: 1;
  height: 20px;
  background: rgba(255,200,150,0.04);
  border-radius: 10px;
  overflow: hidden;
}
.tag-corr-bar-fill {
  height: 100%;
  border-radius: 10px;
  transition: width 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}
.tag-corr-score {
  width: 32px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: left;
}

/* Pattern Insights */
.pattern-list {
  list-style: none;
  padding: 0;
}
.pattern-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255,190,130,0.08);
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.5;
}
.pattern-item:last-child { border-bottom: none; }
.pattern-icon { font-size: 1.2rem; flex-shrink: 0; margin-top: 2px; }

.not-enough-data {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.not-enough-data .emoji-big {
  font-size: 3rem;
  display: block;
  margin-bottom: 16px;
}

.export-btn-area {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid rgba(255,190,130,0.10);
}

/* ── Toast ────────────────────────────────────────────────── */
.toast-container {
  position: fixed;
  top: 60px;
  left: 200px;
  right: 0;
  z-index: 2000;
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 24px;
}
.toast {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 500px;
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 500;
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,0.3);
  opacity: 0;
  transform: translateY(-12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: auto;
}
.toast.toast-show { opacity: 1; transform: translateY(0); }
.toast.toast-hide { opacity: 0; transform: translateY(-12px); }
.toast-success { background: #16a34a; }
.toast-error { background: #dc2626; }
.toast-warning { background: #d97706; }
.toast-info { background: #7c3aed; }
.toast-message { flex: 1; }

/* ── Modal ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(12,6,4,0.70);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.modal-overlay.modal-visible {
  opacity: 1;
  pointer-events: auto;
}
.modal {
  background: #1f1612;
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  max-width: 480px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), 0 8px 20px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,180,120,0.08);
  transform: scale(0.95) translateY(10px);
  transition: transform 0.25s ease;
}
.modal.modal-show {
  transform: scale(1) translateY(0);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 16px;
}
.modal-header h3 { font-size: 1.15rem; }
.modal-close,
.modal-close-btn {
  font-size: 1.4rem;
  color: var(--text-muted);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
  border-radius: var(--radius-xs);
  transition: color var(--transition), background var(--transition);
}
.modal-close:hover,
.modal-close-btn:hover {
  color: var(--text);
  background: rgba(255, 200, 150, 0.1);
}
.modal-body { padding: 0 28px 20px; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 16px 28px;
  border-top: 1px solid var(--glass-border);
}

/* ── Insights Filter Bar ─────────────────────────────────── */
.insights-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 20px;
}
.filter-pills {
  display: flex;
  gap: 8px;
}
.filter-pill {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text-body);
  font-size: 0.85rem;
  transition: var(--transition);
}
.filter-pill:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
}
.filter-pill.filter-active {
  background: var(--gradient);
  border-color: transparent;
  color: white;
  font-weight: 600;
}
.filter-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}
.filter-nav-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--glass-border);
  background: var(--glass);
  color: var(--text);
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}
.filter-nav-btn:hover {
  background: var(--glass-hover);
  border-color: var(--glass-border-hover);
}
.filter-nav-label {
  font-size: 0.9rem;
  color: var(--text);
  font-weight: 500;
  min-width: 140px;
  text-align: center;
}

/* ── Print Report (hidden on screen) ────────────────────── */
#print-report { display: none; }

/* ── Print Styles ────────────────────────────────────────── */
@media print {
  * { print-color-adjust: exact !important; -webkit-print-color-adjust: exact !important; }
  body { background: white !important; color: #333 !important; }
  body::before, body::after, #fx-canvas { display: none !important; }
  .app-shell, .sidebar, .top-bar, .btn, .modal-overlay, .toast-container,
  .tab-content, .insights-filter-bar, .export-btn-area, .streak-banner,
  .backfill-banner, .mood-greeting { display: none !important; }

  #print-report {
    display: block !important;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    padding: 20px;
  }

  .report-header { text-align: center; margin-bottom: 24px; border-bottom: 2px solid #333; padding-bottom: 16px; }
  .report-header h1 { font-size: 1.6rem; color: #111; margin-bottom: 8px; }
  .report-meta { display: flex; justify-content: center; gap: 24px; font-size: 0.85rem; color: #555; }
  .report-meta div { white-space: nowrap; }

  .report-summary {
    display: flex;
    justify-content: space-around;
    margin: 20px 0;
    padding: 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
  }
  .report-stat { text-align: center; }
  .report-stat-value { font-size: 1.5rem; font-weight: 700; color: #111; }
  .report-stat-label { font-size: 0.75rem; color: #666; text-transform: uppercase; letter-spacing: 0.04em; }

  .report-section-title { font-size: 1.1rem; color: #111; margin: 24px 0 12px; border-bottom: 1px solid #ddd; padding-bottom: 6px; }

  .report-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; margin-bottom: 20px; }
  .report-table th { background: #f5f5f5; text-align: left; padding: 8px 10px; border: 1px solid #ddd; font-weight: 600; color: #333; }
  .report-table td { padding: 6px 10px; border: 1px solid #ddd; color: #444; vertical-align: top; }
  .report-note-cell { max-width: 180px; font-size: 0.75rem; }

  .report-calendar { width: 100%; border-collapse: collapse; margin-bottom: 20px; }
  .report-calendar th { padding: 6px; text-align: center; font-size: 0.75rem; color: #666; border: 1px solid #ddd; }
  .report-calendar td { padding: 4px; text-align: center; border: 1px solid #ddd; height: 48px; vertical-align: top; }
  .cal-empty { background: #fafafa; }
  .cal-cell { background: white; }
  .cal-day { font-weight: 600; font-size: 0.8rem; color: #333; }
  .cal-mood { font-size: 0.85rem; }

  .report-footer { text-align: center; margin-top: 30px; padding-top: 16px; border-top: 1px solid #ddd; font-size: 0.75rem; color: #999; }
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
  .login-card { padding: 32px 24px; }
  .onboarding-card { padding: 32px 24px; }
  .content-area { padding: 12px; }
  .weather-grid { gap: 8px; }
  .weather-emoji { font-size: 40px; }
  .weather-option { padding: 12px 6px 10px; }
  .time-select-grid { grid-template-columns: repeat(2, 1fr); }
  .month-summary { grid-template-columns: 1fr; }
  .pie-chart-container { flex-direction: column; align-items: center; }
  .calendar-cell { min-height: 38px; }
  .cell-moods { font-size: 0.75rem; }
  .tag-corr-name { width: 70px; font-size: 0.7rem; }
  h1 { font-size: 1.4rem; }
  .toast { max-width: calc(100vw - 24px); }
}

@media (min-width: 768px) {
  .weather-emoji { font-size: 60px; }
  .weather-option { padding: 20px 12px 16px; }
  .weather-grid { gap: 16px; }
  .calendar-cell { min-height: 60px; }
  .cell-moods { font-size: 1rem; }
  .bar-chart { height: 200px; }
}

/* Journal Private Line Message */
.journal-intro {
  margin-bottom: 20px;
  padding: 16px 20px;
  border-left: 3px solid var(--orange);
}
.journal-private-msg {
  font-size: 0.95rem;
  color: var(--text-body);
  line-height: 1.6;
}
.journal-private-msg strong {
  color: var(--orange);
}

/* Partner Spotlight */
.partner-spotlight {
  padding: 24px;
  margin-bottom: 16px;
}
.partner-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.partner-header h3 {
  font-size: 1.2rem;
  color: var(--text);
}
.partner-badge {
  font-size: 0.75rem;
  color: var(--orange);
  background: rgba(255, 107, 53, 0.12);
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  font-weight: 600;
}
.partner-desc {
  font-size: 0.9rem;
  color: var(--text-body);
  line-height: 1.6;
  margin-bottom: 16px;
}
.partner-offer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.partner-link {
  white-space: nowrap;
}
.discount-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

/* Contact Info */
.contact-info {
  padding: 20px;
}
.contact-row {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--glass-border);
}
.contact-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}
.contact-value {
  font-size: 0.95rem;
  color: var(--text);
  font-weight: 600;
}
.contact-note {
  margin-top: 12px;
  font-size: 0.85rem;
  color: var(--text-muted);
}

/* ── Resources page styles ──────────────────────────────── */
.resources-subtitle {
  color: #D4CBC4;
  font-size: 0.9rem;
  margin-bottom: 20px;
}
.resources-coach-header {
  margin-bottom: 16px;
}
.resource-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.resource-video-card {
  background: rgba(30, 20, 35, 0.4);
  border: 1.5px solid rgba(255, 190, 130, 0.2);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
}
.resource-video-card:hover {
  border-color: rgba(255, 190, 130, 0.35);
}
.video-fallback-link {
  display: inline-block;
  margin-top: 8px;
  color: var(--orange);
  font-size: 0.85rem;
  text-decoration: none;
  font-weight: 500;
}
.video-fallback-link:hover {
  text-decoration: underline;
}
.books-list {
  padding-left: 24px;
  margin: 0;
}
.book-item {
  color: var(--text-body);
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 10px;
}
.book-item strong {
  color: var(--text);
}

/* ── Resources Bottom Grid ──────────────────────────────── */
.resources-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.resources-bottom-card {
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.resources-bottom-card h3 {
  font-size: 0.95rem;
  margin-bottom: 10px;
  color: var(--orange);
}

.resources-bottom-card .text-sm {
  font-size: 0.8rem;
  line-height: 1.5;
}

.resources-bottom-card .text-muted {
  color: var(--text-muted);
}

.resources-bottom-card .contact-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 12px;
  background: var(--glass);
  border-radius: var(--radius-xs);
  margin-bottom: 6px;
}

.resources-bottom-card .contact-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.resources-bottom-card .contact-value {
  font-size: 0.85rem;
  color: var(--text);
  font-weight: 500;
}

.resources-bottom-card .contact-note {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 8px;
}

.discount-badge {
  display: inline-block;
  padding: 4px 10px;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: var(--radius-xs);
  font-size: 0.8rem;
  font-weight: 600;
  color: #FFD700;
}

.mt-8 { margin-top: 8px; }
.mt-12 { margin-top: 12px; }

.partner-compact {
  display: flex;
  flex-direction: column;
}

.partner-compact strong {
  font-size: 0.9rem;
  color: var(--text);
}

@media (max-width: 900px) {
  .resources-bottom-grid {
    grid-template-columns: 1fr;
  }
}


/* ── Journal Nested Layout (matching Apps Script board) ── */
.journal-outer,
.journal-history-outer {
  background: rgba(24, 16, 28, 0.4);
  border: 2px solid rgba(218, 165, 32, 0.55);
  border-radius: var(--radius-lg);
  padding: 28px;
  margin-bottom: 24px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 0 14px rgba(218, 165, 32, 0.12), 0 0 28px rgba(218, 165, 32, 0.04), 0 4px 24px rgba(40, 20, 8, 0.45);
}

.journal-outer .section-title,
.journal-history-outer .section-title {
  color: var(--orange);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 20px;
}

.journal-write-section {
  background: rgba(30, 20, 35, 0.4);
  border: 2px solid rgba(218, 165, 32, 0.55);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: 0 0 10px rgba(218, 165, 32, 0.08), 0 4px 16px rgba(40, 20, 8, 0.3);
}

.journal-write-section .write-title {
  color: var(--orange);
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 16px;
}

/* Coach note inside write section */
.journal-coach-note {
  border-left: 4px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(255, 107, 53, 0.06);
  padding: 12px 18px;
  margin-bottom: 18px;
}

.journal-coach-note .journal-private-msg {
  color: #D4CBC4;
  font-size: 0.9rem;
  line-height: 1.6;
  margin: 0;
}

.journal-coach-note .journal-private-msg strong {
  color: var(--orange);
}

/* Tag row */
.journal-tag-row {
  margin-bottom: 14px;
}

.journal-tag-row .tag-label {
  display: block;
  color: #D4CBC4;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 6px;
}

/* Textarea inside write section */
.journal-write-section .journal-textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.7;
  font-size: 0.95rem;
  margin-bottom: 16px;
}

/* Submit button */
.journal-write-section .btn-primary {
  margin-top: 4px;
}

/* History section: search and entries get subtle styling */
.journal-history-outer .journal-search {
  border: 1.5px solid rgba(255, 190, 130, 0.2) !important;
  border-radius: 50px !important;
  box-shadow: none !important;
  overflow: hidden;
  margin-bottom: 16px;
}

.journal-history-outer .journal-search .form-input {
  border: none !important;
  border-radius: 50px !important;
  box-shadow: none !important;
}

.journal-history-outer .journal-entry-card {
  border: 1.5px solid rgba(218, 165, 32, 0.25) !important;
  box-shadow: 0 4px 16px rgba(40, 20, 8, 0.3) !important;
  border-radius: var(--radius) !important;
  margin-bottom: 12px;
}

.journal-history-outer .journal-entry-card:hover {
  border-color: rgba(255, 190, 130, 0.35) !important;
}

/* Journal status badges */
.journal-status-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 99px;
  margin-left: auto;
}
.badge-seen {
  background: rgba(96, 165, 250, 0.15);
  color: #60A5FA;
  border: 1px solid rgba(96, 165, 250, 0.3);
}
.badge-responded {
  background: rgba(34, 197, 94, 0.15);
  color: #22C55E;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* Collapsible entry toggle */
.btn-text.entry-toggle {
  background: none;
  border: none;
  color: var(--orange);
  font-size: 0.8rem;
  cursor: pointer;
  padding: 4px 0;
  margin-top: 4px;
}

/* Tagged task card inside entries */
.entry-tagged-task {
  border: 1.5px solid rgba(255, 190, 130, 0.2);
  border-left: 3px solid var(--orange);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 10px 14px;
  margin-bottom: 10px;
  background: rgba(255, 107, 53, 0.08);
}
.entry-tagged-task strong {
  color: #ffffff;
}
.tagged-task-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--orange);
  display: block;
  margin-bottom: 4px;
}

/* Entry action buttons */
.entry-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}
.entry-actions .btn-ghost {
  color: #ffffff;
}
.btn-danger-text {
  color: #EF4444 !important;
}
.btn-danger-text:hover {
  color: #F87171 !important;
}

/* ============================================================
   SIDEBAR LOGO (image instead of emoji)
   ============================================================ */
.sidebar-logo {
  width: 40px;
  height: auto;
  display: block;
}
.sidebar-logo[src] {
  font-size: 0;
}

/* Hamburger button — hidden on desktop */
.hamburger-btn {
  display: none;
  background: none;
  border: none;
  color: var(--text);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 4px 8px;
  line-height: 1;
}

/* Mobile logo — hidden on desktop */
.mobile-logo {
  display: none;
  width: 28px;
  height: auto;
}

/* Sidebar backdrop — hidden by default */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
}
.sidebar-backdrop.backdrop-visible {
  display: block;
}

/* ============================================================
   MOBILE RESPONSIVE — max-width 768px
   ============================================================ */
@media (max-width: 768px) {
  /* Sidebar: hidden by default, overlay when open */
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 200;
  }
  .sidebar.sidebar-open {
    transform: translateX(0);
  }

  /* Main wrapper: full width */
  .main-wrapper {
    margin-left: 0 !important;
  }

  /* Show hamburger and mobile logo */
  .hamburger-btn {
    display: block;
  }
  .mobile-logo {
    display: block;
  }

  /* Top bar: compact layout */
  .top-bar {
    flex-wrap: wrap;
    gap: 6px;
    padding: 10px 12px;
  }
  .top-bar-left {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .top-bar-greeting {
    font-size: 1rem !important;
  }
  .top-bar-center {
    width: 100%;
    font-size: 0.8rem;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }
  .top-bar-right {
    width: 100%;
    justify-content: space-between;
  }

  /* Content area: full width, less padding */
  .content-area {
    padding: 12px;
  }

  /* Stats grid: 2 columns */
  .stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  .stats-grid--3 {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Task cards: single column */
  .task-cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* Activity: stack vertically */
  .home-bottom-grid {
    grid-template-columns: 1fr !important;
  }

  /* Resources bottom: stack */
  .resources-bottom-grid {
    grid-template-columns: 1fr !important;
  }

  /* Weather grid: 2 columns */
  .weather-grid {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Calendar cells: smaller */
  .calendar-cell {
    min-height: 48px;
    font-size: 0.75rem;
  }

  /* Modals: full width */
  .modal {
    max-width: 100% !important;
    margin: 10px;
  }

  /* Buttons: tap-friendly */
  .btn {
    min-height: 44px;
  }

  /* Outer containers: reduce padding */
  .home-outer-container {
    padding: 18px;
  }
  .journal-outer,
  .journal-history-outer {
    padding: 18px;
  }
}
