:root {
  --bg-deep:         #0d0d0f;
  --bg-surface:      rgba(20, 20, 23, 0.75);
  --bg-surface-solid:#141417;
  --bg-raised:       rgba(28, 28, 34, 0.65);
  --bg-card:         rgba(22, 22, 28, 0.9);
  --glass-border:    rgba(255, 255, 255, 0.07);

  --text-primary:    #ededed;
  --text-secondary:  #9494a8;
  --text-muted:      #52526a;

  --accent-morning:      #FFB020;
  --accent-morning-dim:  rgba(255, 176, 32, 0.13);
  --accent-morning-glow: rgba(255, 176, 32, 0.35);

  --accent-evening:      #818CF8;
  --accent-evening-dim:  rgba(129, 140, 248, 0.13);
  --accent-evening-glow: rgba(129, 140, 248, 0.35);

  --accent-coach:        #F472B6;
  --accent-coach-dim:    rgba(244, 114, 182, 0.13);
  --accent-coach-glow:   rgba(244, 114, 182, 0.35);

  --accent-base:     #6366f1;
  --accent-base-dim: rgba(99, 102, 241, 0.12);

  --success:         #22c55e;
  --success-dim:     rgba(34, 197, 94, 0.12);
  --success-border:  rgba(34, 197, 94, 0.25);

  --warn:            #f59e0b;
  --warn-dim:        rgba(245, 158, 11, 0.12);

  --danger:          #ef4444;
  --danger-dim:      rgba(239, 68, 68, 0.12);

  --r-xs: 3px;
  --r-sm: 5px;
  --r-md: 8px;
  --r-lg: 10px;
  --r-xl: 14px;
  --r-2xl: 18px;
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background-color: var(--bg-deep);
  color: var(--text-primary);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(circle at 15% 10%, rgba(99, 102, 241, 0.04) 0%, transparent 45%),
    radial-gradient(circle at 85% 90%, rgba(244, 114, 182, 0.03) 0%, transparent 45%);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.app-header {
  height: 64px;
  background: var(--bg-surface-solid);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: var(--r-lg);
  background: linear-gradient(135deg, var(--accent-morning), var(--accent-evening));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: #fff;
}

.logo h1 {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.logo h1 span {
  color: var(--text-secondary);
  font-weight: 400;
}

.header-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}

.date-pill {
  font-size: 11.5px;
  font-family: 'JetBrains Mono', monospace;
  padding: 5px 12px;
  border-radius: var(--r-md);
  background: var(--bg-raised);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--r-md);
  border: 1px solid var(--glass-border);
  background: var(--bg-raised);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-secondary);
}

.coach-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  height: 34px;
  border-radius: var(--r-md);
  background: var(--accent-morning-dim);
  border: 1px solid rgba(255, 176, 32, 0.3);
  color: var(--accent-morning);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
  cursor: pointer;
}

.coach-btn:hover {
  background: rgba(255, 176, 32, 0.2);
  box-shadow: 0 0 12px var(--accent-morning-glow);
}

/* ── Main layout ─────────────────────────────────────────────────────────── */
.dashboard {
  max-width: 1100px;
  margin: 0 auto;
  padding: 36px 32px calc(80px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* ── Section labels ──────────────────────────────────────────────────────── */
.section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--glass-border);
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-2xl);
  padding: 24px;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

/* ── Grid rows ───────────────────────────────────────────────────────────── */
.row {
  display: grid;
  gap: 16px;
}

.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
.row-2-1 { grid-template-columns: 2fr 1fr; }
.row-1-2 { grid-template-columns: 1fr 2fr; }

/* ── Intention card ──────────────────────────────────────────────────────── */
.intention-card {
  border-color: rgba(255, 176, 32, 0.2);
  background: linear-gradient(135deg, rgba(255, 176, 32, 0.06), rgba(22, 22, 28, 0.9));
}

.intention-card .card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-morning);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.intention-text {
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.intention-empty {
  font-size: 15px;
  color: var(--text-muted);
  font-style: italic;
}

.inspiration-card {
  border-color: rgba(129, 140, 248, 0.2);
  background: linear-gradient(135deg, rgba(129, 140, 248, 0.06), rgba(22, 22, 28, 0.9));
}

.inspiration-card .card-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-evening);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.inspiration-text {
  font-size: 15px;
  font-style: italic;
  line-height: 1.6;
  color: var(--text-secondary);
}

.cta-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 8px 16px;
  border-radius: var(--r-lg);
  background: var(--accent-morning-dim);
  border: 1px solid rgba(255, 176, 32, 0.25);
  color: var(--accent-morning);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.cta-link:hover {
  background: rgba(255, 176, 32, 0.2);
}

/* ── Priorities card ─────────────────────────────────────────────────────── */
.priority-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.priority-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 14px;
  line-height: 1.4;
  color: var(--text-primary);
}

.priority-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bg-raised);
  border: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: var(--accent-morning);
  flex-shrink: 0;
  margin-top: 1px;
}

.priority-text { flex: 1; }

.priority-empty {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  padding: 8px 0;
}

.vitals-empty {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Vitals card ─────────────────────────────────────────────────────────── */
.vitals-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 4px;
}

.vital-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.vital-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  width: 72px;
  flex-shrink: 0;
}

.vital-bar-wrap {
  flex: 1;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 3px;
  overflow: hidden;
}

.vital-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.vital-bar.energy  { background: linear-gradient(90deg, #FFB020, #f59e0b); }
.vital-bar.mood    { background: linear-gradient(90deg, #818CF8, #a78bfa); }
.vital-bar.ms      { background: linear-gradient(90deg, #F472B6, #e879f9); }
.vital-bar.whoop   { background: linear-gradient(90deg, #22c55e, #34d399); }

.vital-val {
  font-size: 13px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
  width: 38px;
  text-align: right;
  flex-shrink: 0;
}

.vital-val.dim { color: var(--text-muted); }

.whoop-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 700;
  font-family: 'JetBrains Mono', monospace;
}
.whoop-badge.green { background: var(--success-dim); color: var(--success); border: 1px solid var(--success-border); }
.whoop-badge.yellow { background: var(--warn-dim); color: var(--warn); border: 1px solid rgba(245,158,11,0.25); }
.whoop-badge.red { background: var(--danger-dim); color: var(--danger); border: 1px solid rgba(239,68,68,0.25); }

/* ── Weekly goal card ────────────────────────────────────────────────────── */
.weekly-goal-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
}

.weekly-goal-empty {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Goals card ──────────────────────────────────────────────────────────── */
.goal-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.goal-tab {
  padding: 5px 12px;
  border-radius: var(--r-lg);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
}

.goal-tab:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.goal-tab.active {
  background: var(--accent-base-dim);
  color: var(--accent-evening);
  border-color: rgba(99, 102, 241, 0.3);
}

.goal-panel { display: none; }
.goal-panel.active { display: block; }

.goal-content {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 260px;
  overflow-y: auto;
}

.goal-content::-webkit-scrollbar { width: 4px; }
.goal-content::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

.goal-content strong, .goal-content b { color: var(--text-primary); }
.goal-content h1, .goal-content h2, .goal-content h3 {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 12px 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.goal-content h1:first-child, .goal-content h2:first-child, .goal-content h3:first-child {
  margin-top: 0;
}
.goal-content ul, .goal-content ol {
  padding-left: 16px;
  margin: 6px 0;
}
.goal-content li { margin-bottom: 4px; }

.goals-empty {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
  padding: 12px 0;
}

/* ── Trend chart ─────────────────────────────────────────────────────────── */
.trend-wrap {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-top: 4px;
}

.trends-empty {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.trend-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

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

.trend-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.trend-avg {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
}

.sparkline {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 36px;
}

.spark-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: default;
  position: relative;
}

.spark-bar.empty {
  background: rgba(255, 255, 255, 0.06);
  height: 100% !important;
}

.spark-bar.energy-bar  { background: rgba(255, 176, 32, 0.7); }
.spark-bar.mood-bar    { background: rgba(129, 140, 248, 0.7); }
.spark-bar.whoop-bar   { background: rgba(34, 197, 94, 0.7); }

.spark-bar:hover { opacity: 0.85; }

.spark-dates {
  display: flex;
  gap: 3px;
  margin-top: 4px;
}

.spark-date {
  flex: 1;
  font-size: 9px;
  font-family: 'JetBrains Mono', monospace;
  color: var(--text-muted);
  text-align: center;
  overflow: hidden;
  text-overflow: clip;
}

/* ── Coach notes card ────────────────────────────────────────────────────── */
.coach-notes {
  font-size: 14px;
  line-height: 1.7;
  color: var(--text-secondary);
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 4px;
}

.coach-notes::-webkit-scrollbar { width: 4px; }
.coach-notes::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ── Tomorrow's focus ────────────────────────────────────────────────────── */
.tomorrow-text {
  font-size: 15px;
  line-height: 1.6;
  color: var(--accent-evening);
  font-style: italic;
}

/* ── Blueprint card ──────────────────────────────────────────────────────── */
.blueprint-card {
  border-color: rgba(99, 102, 241, 0.2);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.05), rgba(22, 22, 28, 0.9));
}

.blueprint-eyebrow {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-evening);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.blueprint-identity {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-primary);
  letter-spacing: -0.01em;
  margin-bottom: 18px;
  padding-left: 14px;
  border-left: 2px solid rgba(99, 102, 241, 0.4);
}

.blueprint-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.blueprint-sub-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.blueprint-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.bp-value-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: var(--r-lg);
  font-size: 12px;
  font-weight: 600;
  background: var(--accent-base-dim);
  border: 1px solid rgba(99, 102, 241, 0.25);
  color: var(--accent-evening);
}

.blueprint-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.blueprint-list li {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  padding-left: 16px;
  position: relative;
}

.blueprint-list li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-evening);
  font-weight: 700;
}

.blueprint-empty-text {
  font-size: 13px;
  color: var(--text-muted);
  font-style: italic;
}

/* ── Action strip ────────────────────────────────────────────────────────── */
.action-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.action-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px 20px;
  border-radius: var(--r-xl);
  border: 1px solid var(--glass-border);
  background: var(--bg-card);
  text-decoration: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.action-btn:hover { transform: translateY(-2px); }

.action-btn.planday {
  color: var(--accent-morning);
  border-color: rgba(255, 176, 32, 0.25);
}
.action-btn.planday:hover {
  background: var(--accent-morning-dim);
  box-shadow: 0 4px 20px var(--accent-morning-glow);
}

.action-btn.closeday {
  color: var(--accent-evening);
  border-color: rgba(129, 140, 248, 0.25);
}
.action-btn.closeday:hover {
  background: var(--accent-evening-dim);
  box-shadow: 0 4px 20px var(--accent-evening-glow);
}

.action-btn.coaching {
  color: var(--accent-coach);
  border-color: rgba(244, 114, 182, 0.25);
}
.action-btn.coaching:hover {
  background: var(--accent-coach-dim);
  box-shadow: 0 4px 20px var(--accent-coach-glow);
}

/* ── Status indicators ───────────────────────────────────────────────────── */
.status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}
.status-dot.done { background: var(--success); }
.status-dot.pending { background: var(--text-muted); }

/* ── Loading / skeleton ──────────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(90deg, rgba(255,255,255,0.04) 25%, rgba(255,255,255,0.08) 50%, rgba(255,255,255,0.04) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease infinite;
  border-radius: var(--r-md);
}

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

/* ── Animations ──────────────────────────────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.card { animation: fadeUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) both; }
.card:nth-child(1) { animation-delay: 0.05s; }
.card:nth-child(2) { animation-delay: 0.10s; }
.card:nth-child(3) { animation-delay: 0.15s; }

.row .card:nth-child(1) { animation-delay: 0.05s; }
.row .card:nth-child(2) { animation-delay: 0.10s; }
.row .card:nth-child(3) { animation-delay: 0.15s; }

/* ── Tooltip ─────────────────────────────────────────────────────────────── */
[data-tip] { position: relative; }
[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(30, 30, 40, 0.95);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  white-space: nowrap;
  padding: 4px 8px;
  border-radius: var(--r-sm);
  z-index: 100;
  pointer-events: none;
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
  .app-header { padding: 0 16px; }
  .dashboard  { padding: 20px 16px 60px; gap: 14px; }
  .row-2, .row-2-1, .row-1-2, .row-3 { grid-template-columns: 1fr; }
  .action-strip { grid-template-columns: 1fr; }
  .intention-text { font-size: 18px; }
  .coach-btn span { display: none; }
}

@media (max-width: 480px) {
  .date-pill { display: none; }
}
