*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
input[type="number"] { -moz-appearance: textfield; }

:root {
  --bg:         #080808;
  --surface:    #0f0f0f;
  --surface2:   #161616;
  --surface3:   #1c1c1e;
  --border:     rgba(255,255,255,0.07);
  --border2:    rgba(255,255,255,0.12);
  --text:       #f0f0f0;
  --muted:      rgba(255,255,255,0.28);
  --muted2:     rgba(255,255,255,0.48);
  --gold:       #0a84ff;
  --gold-dim:   rgba(10,132,255,0.10);
  --gold-glow:  rgba(10,132,255,0.22);
  --green:      #30d158;
  --green-dim:  rgba(48,209,88,0.10);
  --red:        #ff453a;
  --red-dim:    rgba(255,69,58,0.10);
  --blue:       #0a84ff;
  --blue-dim:   rgba(10,132,255,0.10);
  --purple:     #bf5af2;
  --purple-dim: rgba(191,90,242,0.10);
  --sidebar-w:  212px;
  --radius:     14px;
  --radius-sm:  10px;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'Segoe UI', sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────────────────────── */
.layout { display: flex; height: 100vh; overflow: hidden; }

/* ── Sidebar ───────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: #060606;
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 10px 20px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  padding: 0 8px 18px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.logo-mark {
  width: 26px; height: 26px; border-radius: 7px;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; color: #000; flex-shrink: 0;
}
.logo-text { font-size: 10px; font-weight: 700; letter-spacing: 0.15em; color: var(--gold); }

.nav-links { display: flex; flex-direction: column; gap: 1px; flex: 1; }
.nav-group-label {
  font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--muted);
  padding: 14px 10px 5px; text-transform: uppercase;
}
.nav-group-label:first-child { padding-top: 0; }
.nav-item {
  display: flex; align-items: center; gap: 9px; padding: 8px 10px;
  border-radius: 8px; color: var(--muted2); cursor: pointer;
  font-size: 13px; font-weight: 500; transition: all 0.15s;
  text-decoration: none; user-select: none;
}
.nav-item:hover  { background: var(--surface2); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); font-weight: 600; }
.nav-icon { font-size: 14px; width: 17px; text-align: center; flex-shrink: 0; }
.sidebar-bottom {
  font-size: 11px; color: var(--muted); padding: 14px 10px 0;
  border-top: 1px solid var(--border); line-height: 1.6;
}

/* ── Content ───────────────────────────────────────────── */
.content { flex: 1; overflow-y: auto; padding: 32px 40px 52px; }
.loading-state { color: var(--muted); padding: 48px; }

/* ── Cards ─────────────────────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px 24px; }
.card-sm { padding: 16px 20px; }
.card-xs { padding: 12px 16px; }
.card-gold     { border-color: rgba(10,132,255,0.25); }
.card-tappable { cursor: pointer; transition: background .15s, transform .1s; }
.card-tappable:active { background: var(--card2); transform: scale(0.98); }
.card-green { border-color: rgba(48,209,88,0.25); }
.card-blue  { border-color: rgba(10,132,255,0.25); }

/* ── Page header ───────────────────────────────────────── */
.page-header { margin-bottom: 28px; }
.page-title  { font-size: 30px; font-weight: 700; letter-spacing: -0.025em; }
.page-sub    { color: var(--muted2); font-size: 13px; margin-top: 4px; }

/* ── Mission / Quote Banner ────────────────────────────── */
.mission-banner {
  background: linear-gradient(135deg, #0d0d0d 0%, #080f14 100%);
  border: 1px solid rgba(10,132,255,0.18);
  border-radius: var(--radius);
  padding: 20px 24px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s;
  margin-bottom: 22px;
}
.mission-banner::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.4;
}
.mission-banner:hover { border-color: rgba(10,132,255,0.32); }
.mission-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.12em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 8px; opacity: 0.75;
}
.mission-text  { font-size: 16px; font-weight: 500; color: rgba(255,255,255,0.88); line-height: 1.55; font-style: italic; }
.mission-edit-hint { font-size: 12px; color: var(--muted2); margin-top: 8px; }
.mission-input {
  background: transparent; border: none; color: rgba(255,255,255,0.88);
  font-family: inherit; font-size: 16px; font-weight: 500; font-style: italic;
  line-height: 1.55; width: 100%; resize: none; outline: none; min-height: 48px;
}

/* ── CTA Cards ─────────────────────────────────────────── */
.cta-card {
  border-radius: var(--radius);
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  border: 1px solid;
  transition: transform 0.15s, border-color 0.2s, box-shadow 0.2s;
}
.cta-card:not(.cta-done) { cursor: pointer; }
.cta-card:not(.cta-done):hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(0,0,0,0.4); }
.cta-morning {
  background: linear-gradient(135deg, #080f1a 0%, #0c1320 100%);
  border-color: rgba(10,132,255,0.28);
}
.cta-morning:hover { border-color: rgba(10,132,255,0.50); }
.cta-evening {
  background: linear-gradient(135deg, #080f1a 0%, #0c1320 100%);
  border-color: rgba(10,132,255,0.28);
}
.cta-evening:hover { border-color: rgba(10,132,255,0.50); }
.cta-done {
  background: var(--green-dim);
  border-color: rgba(48,209,88,0.20);
}
.cta-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.11em;
  text-transform: uppercase; margin-bottom: 5px;
}
.cta-morning .cta-label { color: var(--gold); }
.cta-evening .cta-label { color: var(--blue); }
.cta-done    .cta-label { color: var(--green); }
.cta-title {
  font-size: 22px; font-weight: 700; letter-spacing: -0.02em;
  color: var(--text); line-height: 1.1;
}
.cta-sub   { font-size: 12px; color: var(--muted2); margin-top: 4px; }
.cta-arrow { font-size: 24px; font-weight: 300; line-height: 1; }
.cta-morning .cta-arrow { color: var(--gold); }
.cta-evening .cta-arrow { color: var(--blue); }
.cta-done    .cta-arrow { font-size: 20px; color: var(--green); }

/* ── Grid ──────────────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stack  { display: flex; flex-direction: column; gap: 12px; }

/* ── Dashboard layout ──────────────────────────────────── */
.dash-top {
  display: flex; align-items: flex-start; justify-content: space-between;
  margin-bottom: 22px; gap: 16px;
}
.dash-top > div:first-child { flex: 1; min-width: 0; }
.dash-bottom-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}

/* ── Streak mini cards (2x2 grid) ──────────────────────── */
.streak-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.streak-mini {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; min-width: 0;
}
.streak-mini.hot { border-color: rgba(10,132,255,0.22); }

/* ── Reel Kanban ───────────────────────────────────────── */
.reel-kanban {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 16px;
}
@media (max-width: 767px) {
  .reel-kanban { grid-template-columns: 1fr; gap: 12px; }
}

/* ── Personal Brand ────────────────────────────────────── */
.pillar-tag {
  display: inline-flex; align-items: center;
  padding: 5px 14px; border-radius: 20px;
  font-size: 12px; font-weight: 600; letter-spacing: 0.01em;
}
.reel-card {
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 14px 16px;
}
.reel-status-badge {
  font-size: 10px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 3px 10px; border-radius: 20px;
}

/* ── Platform buttons ──────────────────────────────────── */
.platform-row { display: flex; gap: 8px; flex-wrap: wrap; }
.platform-btn {
  display: inline-flex; align-items: center; padding: 9px 18px;
  background: var(--surface2); border: 1px solid var(--border2); border-radius: 50px;
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--muted2); transition: all 0.18s; letter-spacing: 0.01em;
}
.platform-btn:hover { border-color: var(--gold); color: var(--text); }
.platform-btn.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }
.platform-btn.active-green { background: var(--green-dim); border-color: var(--green); color: var(--green); }

/* ── Stat block ────────────────────────────────────────── */
.stat-block { text-align: center; }
.stat-num   { font-size: 36px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.stat-label { font-size: 10px; font-weight: 600; letter-spacing: 0.08em; color: var(--muted2); text-transform: uppercase; margin-top: 4px; }
.stat-sub   { font-size: 12px; color: var(--muted2); margin-top: 3px; }

/* ── Progress bar ──────────────────────────────────────── */
.progress-bar  { height: 3px; background: var(--surface2); border-radius: 2px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 2px; background: var(--gold); transition: width 0.6s ease; }

/* ── Habit row ─────────────────────────────────────────── */
.habit-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 0; border-bottom: 1px solid var(--border);
}
.habit-row:last-child { border-bottom: none; }
.habit-info  { display: flex; align-items: center; gap: 10px; }
.habit-emoji { font-size: 16px; }
.habit-name  { font-weight: 500; font-size: 13px; }
.habit-streak-badge {
  font-size: 12px; font-weight: 700; padding: 3px 10px;
  border-radius: 20px; background: var(--surface2); color: var(--muted2);
}
.habit-streak-badge.hot { background: var(--gold-dim); color: var(--gold); }

/* ── Toggle ────────────────────────────────────────────── */
.habit-toggle {
  width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border2);
  background: transparent; cursor: pointer; display: flex; align-items: center;
  justify-content: center; font-size: 14px; transition: all 0.2s; color: transparent;
}
.habit-toggle.clean  { background: var(--green); border-color: var(--green); color: #fff; }
.habit-toggle.failed { background: var(--red-dim); border-color: var(--red); color: var(--red); }

/* ── Forms ─────────────────────────────────────────────── */
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-label { font-size: 11px; font-weight: 700; color: var(--muted2); letter-spacing: 0.07em; text-transform: uppercase; }
.form-input, .form-textarea, .form-select {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
  font-size: 14px; padding: 11px 14px; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-dim);
}
.form-textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.form-select   { appearance: none; cursor: pointer; }

.win-input {
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: var(--radius-sm); color: var(--text); font-family: inherit;
  font-size: 14px; padding: 10px 14px; width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.win-input:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 3px var(--green-dim); }
.win-row { display: flex; align-items: center; gap: 10px; }
.win-num { font-size: 13px; font-weight: 700; color: var(--green); width: 16px; flex-shrink: 0; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 22px; border-radius: var(--radius-sm); font-size: 13px; font-weight: 600;
  cursor: pointer; border: none; transition: all 0.15s; font-family: inherit; white-space: nowrap;
}
.btn-primary { background: var(--gold); color: #fff; }
.btn-primary:hover { background: #0066cc; transform: translateY(-1px); box-shadow: 0 4px 16px var(--gold-glow); }
.btn-secondary { background: var(--surface2); color: var(--text); border: 1px solid var(--border2); }
.btn-secondary:hover { background: var(--surface3); }
.btn-danger { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,69,58,0.3); }
.btn-danger:hover { background: var(--red); color: #fff; }
.btn-sm   { padding: 7px 14px; font-size: 12px; }
.btn-full { width: 100%; }
.btn:disabled { opacity: 0.40; cursor: not-allowed; transform: none !important; box-shadow: none !important; }

.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.quick-btn {
  display: flex; align-items: center; gap: 8px; padding: 11px 18px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 600;
  color: var(--text); transition: all 0.15s;
}
.quick-btn:hover { border-color: var(--gold); color: var(--gold); }
.quick-btn.done  { border-color: rgba(48,209,88,0.4); color: var(--green); background: var(--green-dim); }

/* ── Mentor box ────────────────────────────────────────── */
.mentor-box {
  background: var(--surface); border: 1px solid rgba(10,132,255,0.18);
  border-radius: var(--radius); padding: 22px 24px; position: relative; overflow: hidden;
}
.mentor-box::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(10,132,255,0.5), transparent);
}
.mentor-label { font-size: 10px; font-weight: 700; letter-spacing: 0.10em; color: var(--gold); text-transform: uppercase; margin-bottom: 12px; }
.mentor-text  { color: rgba(255,255,255,0.80); font-size: 14px; line-height: 1.75; white-space: pre-wrap; }
.mentor-loading { color: var(--muted2); font-style: italic; }

/* ── Section title ─────────────────────────────────────── */
.section-title { font-size: 11px; font-weight: 700; letter-spacing: 0.09em; color: var(--muted2); text-transform: uppercase; margin-bottom: 14px; }

/* ── Pills ─────────────────────────────────────────────── */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: 11px; font-weight: 600; }
.pill-green { background: var(--green-dim); color: var(--green); }
.pill-gold  { background: var(--gold-dim);  color: var(--gold);  }
.pill-red   { background: var(--red-dim);   color: var(--red);   }
.pill-blue  { background: var(--blue-dim);  color: var(--blue);  }
.pill-muted { background: var(--surface2);  color: var(--muted2); }

/* ── Heatmap ───────────────────────────────────────────── */
.heatmap { display: flex; flex-wrap: wrap; gap: 3px; }
.heatmap-cell { width: 11px; height: 11px; border-radius: 2px; background: var(--surface2); }
.heatmap-cell.active { background: var(--green); }
.heatmap-cell.posted { background: var(--gold); }
.heatmap-cell.fail   { background: var(--red-dim); }

/* ── Bar chart ─────────────────────────────────────────── */
.chart-bars { display: flex; align-items: flex-end; gap: 4px; height: 120px; }
.chart-bar-wrap { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; justify-content: flex-end; }
.chart-bar      { width: 100%; border-radius: 4px 4px 0 0; min-height: 3px; transition: height 0.4s; }
.chart-bar-label { font-size: 9px; color: var(--muted); text-align: center; }

/* ── Habit Month Grid ────────────────────────────────── */
.hg-wrap { padding: 0; overflow: hidden; }
.hg-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 14px 16px; }
.hg-header-row, .hg-row { display: flex; align-items: center; gap: 4px; }
.hg-header-row { margin-bottom: 6px; }
.hg-row { margin-bottom: 3px; }
.hg-name-spacer { width: 170px; min-width: 170px; max-width: 170px; flex-shrink: 0; }
.hg-name { width: 170px; min-width: 170px; max-width: 170px; flex-shrink: 0; display: flex; align-items: center; gap: 5px; cursor: pointer; padding-right: 8px; overflow: hidden; }
.hg-name:active { opacity: .7; }
.hg-emoji { font-size: 14px; flex-shrink: 0; }
.hg-label { font-size: 11px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.hg-streak { font-size: 11px; font-weight: 800; flex-shrink: 0; }
.hg-cells { display: flex; gap: 3px; }
.hg-day-head { width: 26px; height: 26px; border-radius: 6px; display: flex; align-items: center; justify-content: center; font-size: 9px; font-weight: 600; color: var(--muted2); flex-shrink: 0; }
.hg-today-head { font-weight: 800; color: var(--blue); background: rgba(10,132,255,0.1); }
.hg-cell { width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0; border: 1.5px solid transparent; }
.hg-future { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.04); }
.hg-missed { background: rgba(239,68,68,0.15); border-color: rgba(239,68,68,0.25); }
.hg-empty { background: rgba(255,255,255,0.05); border-color: rgba(255,255,255,0.07); }
.hg-today-empty { background: rgba(255,255,255,0.07); border-color: rgba(10,132,255,0.3); }

/* ── Counter cards (Days Since style) ─────────────────── */
.counter-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}
.counter-item {
  display: flex; flex-direction: column; align-items: center;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 16px; padding: 16px 12px 14px;
  text-align: center; transition: background .15s, transform .1s;
}
.counter-item:active { background: var(--surface3); transform: scale(0.97); }
.counter-card {
  border-radius: 20px;
  padding: 22px 20px 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: transform 0.15s, box-shadow 0.15s;
}
.counter-card:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,0.5); }
.counter-card::before {
  content: '';
  position: absolute; right: -24px; top: -24px;
  width: 120px; height: 120px; border-radius: 50%;
  background: rgba(255,255,255,0.12);
}
.counter-card::after {
  content: '';
  position: absolute; right: 12px; top: 12px;
  width: 65px; height: 65px; border-radius: 50%;
  background: rgba(255,255,255,0.07);
}
.counter-num  {
  font-size: 58px; font-weight: 800; color: #fff; line-height: 1;
  position: relative; z-index: 1; letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
}
.counter-unit {
  font-size: 12px; color: rgba(255,255,255,0.72); font-weight: 600;
  margin-top: 2px; position: relative; z-index: 1;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.counter-name { font-size: 14px; font-weight: 600; color: var(--text); margin-top: 10px; text-align: center; }
.counter-date { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.counter-actions { display: flex; gap: 7px; margin-top: 7px; }
.counter-action {
  font-size: 11px; font-weight: 600; padding: 4px 10px;
  border-radius: 20px; border: none; cursor: pointer;
  font-family: inherit; transition: all 0.15s;
}
.counter-action-reset  { background: var(--red-dim); color: var(--red); }
.counter-action-reset:hover  { background: var(--red); color: #fff; }
.counter-action-delete { background: var(--surface2); color: var(--muted2); }
.counter-action-delete:hover { background: var(--surface3); color: var(--text); }

/* ── Color swatches ────────────────────────────────────── */
.color-swatches { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.color-swatch {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 2px solid transparent; transition: all 0.15s; flex-shrink: 0;
}
.color-swatch.selected { border-color: #fff; transform: scale(1.15); }

/* ── Streak card ───────────────────────────────────────── */
.streak-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; }
.streak-count { font-size: 44px; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; }
.streak-unit  { font-size: 12px; color: var(--muted2); }

/* ── Milestone ─────────────────────────────────────────── */
.milestone-card { background: var(--gold-dim); border: 1px solid rgba(10,132,255,0.25); border-radius: 10px; padding: 12px 16px; display: flex; align-items: flex-start; gap: 10px; }
.milestone-day  { font-size: 10px; font-weight: 700; color: var(--gold); text-transform: uppercase; letter-spacing: 0.08em; }
.milestone-text { font-size: 13px; color: rgba(255,255,255,0.75); line-height: 1.4; }
.milestone-locked .milestone-card { background: var(--surface2); border-color: var(--border2); opacity: 0.45; }

/* ── Platform cards (Growth) ───────────────────────────── */
.platform-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 20px 24px; display: flex; flex-direction: column; gap: 10px; transition: border-color 0.2s;
}
.platform-name      { font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted2); }
.platform-followers { font-size: 38px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.platform-change    { font-size: 13px; font-weight: 600; }
.platform-change.up   { color: var(--green); }
.platform-change.down { color: var(--red); }
.platform-change.flat { color: var(--muted2); }

/* ── Training ──────────────────────────────────────────── */
.exercise-row { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 30px; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
.exercise-row:last-child { border-bottom: none; }
.day-badge { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 6px; font-size: 11px; font-weight: 700; background: var(--surface2); color: var(--muted2); }
.day-badge.today { background: var(--gold-dim); color: var(--gold); }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 26px; right: 26px; background: var(--surface2);
  border: 1px solid var(--border2); border-radius: 12px; padding: 12px 20px;
  font-size: 13px; font-weight: 500; z-index: 9999; animation: toastIn 0.22s ease;
  box-shadow: 0 12px 42px rgba(0,0,0,0.7);
}
.toast.success { border-color: rgba(48,209,88,0.4); color: var(--green); }
.toast.error   { border-color: rgba(255,69,58,0.4); color: var(--red); }
@keyframes toastIn { from { opacity:0; transform:translateY(14px) scale(0.96); } to { opacity:1; transform:none; } }

/* ── Modal ─────────────────────────────────────────────── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.68); z-index: 400; backdrop-filter: blur(5px); }
.modal-box {
  position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%);
  background: var(--surface); border: 1px solid var(--border2); border-radius: 18px;
  padding: 28px 32px; z-index: 401; width: 420px; max-width: 90vw;
  max-height: 85vh; overflow-y: auto;
  box-shadow: 0 28px 72px rgba(0,0,0,0.75); animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { opacity:0; transform:translate(-50%,-50%) scale(0.94); } to { opacity:1; transform:translate(-50%,-50%) scale(1); } }
.modal-title { font-size: 18px; font-weight: 700; margin-bottom: 20px; }

/* ── Journal Wizard ────────────────────────────────────── */
.wizard-overlay {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(4,4,4,0.88);
  backdrop-filter: blur(20px) saturate(0.4);
  display: flex; align-items: center; justify-content: center;
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
.gehirn-modal-box { height: 80vh; max-height: 80vh; }
.wizard-box {
  width: 500px; max-width: 94vw; max-height: 92vh; overflow-y: auto;
  background: var(--surface2); border: 1px solid var(--border2);
  border-radius: 24px; padding: 36px 32px;
  box-shadow: 0 48px 120px rgba(0,0,0,0.9);
}
.wizard-dot { height: 6px; border-radius: 3px; background: var(--border2); transition: all 0.3s ease; }
.wizard-dot.active  { background: var(--gold); width: 22px !important; }
.wizard-dot.done    { background: rgba(10,132,255,0.45); }
.wizard-question    { font-size: 27px; font-weight: 800; line-height: 1.2; letter-spacing: -0.02em; }
.wizard-sub         { color: var(--muted2); font-size: 14px; margin-top: 8px; line-height: 1.55; }
.wizard-input-large { font-size: 34px !important; font-weight: 800 !important; text-align: center !important; padding: 18px !important; }

/* ── Utils ─────────────────────────────────────────────── */
.mt-4{margin-top:4px} .mt-8{margin-top:8px} .mt-12{margin-top:12px}
.mt-16{margin-top:16px} .mt-20{margin-top:20px} .mt-24{margin-top:24px}
.mb-8{margin-bottom:8px} .mb-12{margin-bottom:12px} .mb-16{margin-bottom:16px}
.flex{display:flex} .flex-center{display:flex;align-items:center}
.flex-between{display:flex;align-items:center;justify-content:space-between}
.gap-6{gap:6px} .gap-8{gap:8px} .gap-10{gap:10px}
.gap-12{gap:12px} .gap-16{gap:16px} .gap-24{gap:24px}
.text-center{text-align:center} .text-muted{color:var(--muted2)}
.text-gold{color:var(--gold)} .text-green{color:var(--green)}
.text-red{color:var(--red)} .text-blue{color:var(--blue)}
.text-sm{font-size:12px} .text-xs{font-size:11px}
.font-bold{font-weight:700} .font-800{font-weight:800} .w-full{width:100%}

/* ── Weekly Bars ───────────────────────────────────────────── */
.weekly-bars { display:flex; gap:5px; align-items:flex-end; height:52px; }
.weekly-bar-wrap { flex:1; display:flex; flex-direction:column; align-items:center; gap:2px; justify-content:flex-end; }
.weekly-bar { width:100%; border-radius:2px 2px 0 0; min-height:3px; transition:height 0.5s ease; }
.weekly-label { font-size:9px; color:var(--muted); font-weight:600; text-transform:uppercase; }

/* ── Mindset Tabs ──────────────────────────────────────────── */
.mindset-tabs {
  display: flex; gap: 0; border-bottom: 1px solid var(--border);
  margin-bottom: 28px; margin-top: 16px;
}
.mtab {
  padding: 10px 22px; background: transparent; border: none; border-bottom: 2px solid transparent;
  color: var(--muted2); font-family: inherit; font-size: 13px; font-weight: 600;
  cursor: pointer; margin-bottom: -1px; transition: all 0.15s; letter-spacing: 0.01em;
}
.mtab:hover { color: var(--text); }
.mtab.active { color: var(--gold); border-bottom-color: var(--gold); }

::-webkit-scrollbar{width:4px} ::-webkit-scrollbar-track{background:transparent}
::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px}

/* ═══════════════════════════════════════════════════════════
   BOTTOM NAV (hidden on desktop, shown on mobile)
   ═══════════════════════════════════════════════════════════ */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 300;
  background: rgba(6,6,6,0.96);
  backdrop-filter: blur(24px) saturate(1.8);
  -webkit-backdrop-filter: blur(24px) saturate(1.8);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  transition: opacity 0.2s;
}
body.overlay-open .bottom-nav { pointer-events: none; opacity: 0.3; }
.bottom-nav-inner {
  display: flex; justify-content: space-around; align-items: center;
  padding: 8px 0 6px;
}
.bnav-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 4px; min-width: 0; flex: 1; cursor: pointer;
  background: none; border: none; font-family: inherit;
  color: rgba(255,255,255,0.35); transition: color 0.15s;
}
.bnav-item.active { color: var(--gold); }
.bnav-icon  { font-size: 19px; line-height: 1; }
.bnav-label { font-size: 9px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }

/* ═══════════════════════════════════════════════════════════
   MOBILE RESPONSIVE  (max-width: 767px)
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Layout ─────────────────────────────────────────── */
  .sidebar     { display: none; }
  .bottom-nav  { display: block; }
  .content     { padding: calc(env(safe-area-inset-top, 0px) + 20px) 16px calc(env(safe-area-inset-bottom, 0px) + 80px); }

  /* ── Typography ─────────────────────────────────────── */
  .page-title  { font-size: 24px; }
  .card        { padding: 16px; }
  .card-sm     { padding: 12px 14px; }

  /* ── Grids → single column ──────────────────────────── */
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .dash-bottom-grid          { grid-template-columns: 1fr; }

  /* ── Home dashboard ─────────────────────────────────── */
  .dash-top { margin-bottom: 16px; }
  .dash-top .page-title { font-size: 22px; }

  /* ── Streak mini grid stays 2-col ───────────────────── */
  .streak-grid { grid-template-columns: 1fr 1fr; }

  /* ── CTA cards ──────────────────────────────────────── */
  .cta-title { font-size: 19px; }
  .cta-card  { padding: 16px 18px; margin-bottom: 16px; }

  /* ── Mindset tabs ───────────────────────────────────── */
  .mindset-tabs { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .mindset-tabs::-webkit-scrollbar { display: none; }
  .mtab { padding: 10px 16px; font-size: 12px; white-space: nowrap; }

  /* ── Platform buttons ───────────────────────────────── */
  .platform-row { gap: 6px; }
  .platform-btn { flex: 1; justify-content: center; font-size: 11px; padding: 8px 10px; }

  /* ── Weekly bars ─────────────────────────────────────── */
  .weekly-bars { height: 44px; }

  /* ── Forms ───────────────────────────────────────────── */
  .form-input, .form-textarea, .form-select { font-size: 16px; } /* prevents iOS zoom */

  /* ── Modals → bottom sheet ───────────────────────────── */
  .modal-overlay { align-items: flex-end; }
  .modal-box {
    position: fixed !important;
    bottom: 0 !important; left: 0 !important; right: 0 !important;
    top: auto !important; transform: none !important;
    width: 100% !important; max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    max-height: 88vh; overflow-y: auto;
    padding: 24px 20px;
    padding-bottom: max(88px, env(safe-area-inset-bottom, 88px));
    animation: slideUp 0.25s ease !important;
  }
  .gehirn-modal-box { height: auto !important; max-height: 85vh !important; }
  @keyframes slideUp {
    from { transform: translateY(100%); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
  }

  /* ── Wizards → bottom sheet ──────────────────────────── */
  .wizard-overlay { align-items: flex-end; padding: 0; bottom: 0; }
  .wizard-box {
    width: 100% !important; max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    height: auto !important; min-height: 72vh; max-height: 88vh; overflow-y: auto;
    padding: 28px 20px;
    padding-bottom: max(88px, env(safe-area-inset-bottom, 88px));
  }
  .wizard-question { font-size: 22px; }
  .wizard-input-large { font-size: 28px !important; }

  /* ── Personal Brand kanban → stacked ─────────────────── */
  .dash-bottom-grid { gap: 12px; }

  /* ── Counter cards (Habits) ──────────────────────────── */
  .counter-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .counter-card { min-height: 110px; padding: 16px 14px 12px; }
  .counter-num  { font-size: 44px; }

  /* ── Mentor box ──────────────────────────────────────── */
  .mentor-box { padding: 16px; }

  /* ── Body training day grid ──────────────────────────── */
  .training-week { gap: 4px; }
  .training-day  { padding: 10px 4px; font-size: 10px; }

  /* ── Buttons ─────────────────────────────────────────── */
  .btn { padding: 11px 18px; }
  .btn-sm { padding: 7px 12px; font-size: 11px; }

  /* ── Section title ───────────────────────────────────── */
  .section-title { font-size: 10px; }

  /* ── Habit rows ──────────────────────────────────────── */
  .habit-name { font-size: 12px; }
}

/* Slightly larger phones / small tablets */
@media (min-width: 480px) and (max-width: 767px) {
  .content { padding: calc(env(safe-area-inset-top, 0px) + 24px) 20px calc(env(safe-area-inset-bottom, 0px) + 80px); }
  .counter-num { font-size: 52px; }
}
