:root {
  --bg: #0d0d0d;
  --surface: #161616;
  --card: #1c1c1c;
  --border: #2a2a2a;
  --border-light: #333;
  --gold: #C9A84C;
  --gold-dim: rgba(201, 168, 76, 0.15);
  --gold-glow: rgba(201, 168, 76, 0.35);
  --blue: #2E6DB4;
  --blue-dim: rgba(46, 109, 180, 0.15);
  --text: #f0f0f0;
  --text-muted: #888;
  --text-dim: #555;
  --green: #4CAF50;
  --header-h: 60px;
  --progress-h: 0px;
  --nav-h: 48px;
  --radius: 12px;
  --radius-sm: 8px;
}

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

html { font-size: 15px; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

#app { display: flex; min-height: 100vh; }

/* ── HEADER ── */
#main-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  gap: 16px;
}

.header-left { display: flex; align-items: center; gap: 16px; }

.logo {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--gold);
  text-transform: uppercase;
}

.header-date {
  font-size: 13px;
  color: var(--text-muted);
  white-space: nowrap;
}

.header-right { display: flex; align-items: center; gap: 10px; }

.streak-pill, .xp-pill {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.streak-pill { border-color: rgba(201, 168, 76, 0.3); }
.xp-pill { border-color: rgba(46, 109, 180, 0.3); color: #7ab3e0; }
.streak-pill .fire-emoji { font-size: 15px; }
#streak-count { color: var(--gold); }
#xp-earned { color: #7ab3e0; }
.xp-sep { color: var(--text-dim); font-weight: 400; }
.pill-label { color: var(--text-muted); font-weight: 400; font-size: 12px; }

.settings-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  transition: color 0.2s, border-color 0.2s;
}
.settings-btn:hover { color: var(--gold); border-color: var(--gold-glow); }

/* ── PROGRESS BAR (now lives inside Dashboard XP card) ── */
.progress-label { display: none; }

/* ── SIDEBAR ── */
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 0 0 40px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  align-self: flex-start;
}

.sidebar-logo {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--gold);
  text-transform: uppercase;
  padding: 22px 20px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.sidebar-section {
  padding: 0 12px;
  margin-bottom: 20px;
}

.sidebar-section-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-dim);
  padding: 0 8px 6px;
  display: block;
}

.nav-item {
  display: block;
  width: 100%;
  background: none;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  padding: 9px 12px;
  text-align: left;
  transition: background 0.15s, color 0.15s;
  margin-bottom: 2px;
}
.nav-item:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.nav-item.active { background: var(--gold-dim); color: var(--gold); font-weight: 700; }

/* ── MAIN WRAPPER ── */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ── MAIN CONTENT ── */
.main-content { }

/* ── VIEWS ── */
.view { display: none; }
.view.active { display: block; }

/* ── SECTION TABS ── */
.section-tabs {
  position: sticky;
  top: calc(var(--header-h) + var(--progress-h));
  z-index: 98;
  background: rgba(13, 13, 13, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  gap: 0;
  padding: 0 24px;
  height: var(--nav-h);
  align-items: flex-end;
}

.section-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 20px;
  transition: color 0.2s, border-color 0.2s;
  margin-bottom: -1px;
  white-space: nowrap;
}
.section-tab:hover { color: var(--text); }
.section-tab.active { color: var(--gold); border-bottom-color: var(--gold); }

/* ── SECTION CONTENT ── */
.section-content { padding: 24px 24px 60px; }

.section-pane { display: none; }
.section-pane.active { display: block; }

/* ── JOURNAL CENTERING ── */
.journal-centered {
  max-width: 680px;
  margin: 0 auto;
}

/* ── HAMBURGER ── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px;
  border-radius: 6px;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  margin-right: 4px;
}
.hamburger:hover { color: var(--text); }

/* ── SIDEBAR OVERLAY ── */
#sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 149;
}
#sidebar-overlay.visible { display: block; }

/* ── MOBILE ── */
@media (max-width: 768px) {
  #app { display: block; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 150;
    transform: translateX(-220px);
    transition: transform 0.25s ease;
  }
  .sidebar.open { transform: translateX(0); }

  .hamburger { display: flex; }

  /* Reduce horizontal padding so each side ≤5% of screen width */
  #main-header { padding: 0 16px; }
  .section-tabs { padding: 0 16px; }
  .section-content { padding: 16px 16px 60px; }

  /* Hide header date to prevent header overflow on small screens */
  .header-date { display: none; }

  /* Journal: allow full available width inside section-content */
  .journal-centered { max-width: 100%; }

  /* Journal history card: switch 4-col fixed grid to flex row */
  .jhistory-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
  }
  .jh-date, .jh-energy, .jh-arrow { flex-shrink: 0; }
  .jh-win { flex: 1; min-width: 0; }

  /* Week bar chart: tighter inner padding so bars aren't cramped */
  .week-grid { padding: 12px 8px; }

  /* Active workout header: smaller timer + finish button on small screens */
  .aw-timer { font-size: 22px; }
  .aw-finish-btn { padding: 10px 14px; font-size: 13px; }

  /* Gym set grid: narrower Previous column gives inputs more room */
  .gym-set-cols,
  .gym-set-row { grid-template-columns: 60px 1fr 1fr 40px; gap: 6px; padding-left: 12px; padding-right: 12px; }
}

/* ── CARDS ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.card-header h2 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.badge {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 10px;
  color: var(--text-muted);
}

/* ── TODAY LAYOUT ── */
.today-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 20px;
  align-items: start;
}

@media (max-width: 820px) {
  .today-layout { grid-template-columns: 1fr; }
}

/* ── HABITS CHECKLIST ── */
#habits-list { padding: 8px; }

.habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  border: 1px solid transparent;
  user-select: none;
  position: relative;
}
.habit-row:hover { background: rgba(255,255,255,0.03); }
.habit-row.completed {
  background: var(--gold-dim);
  border-color: rgba(201, 168, 76, 0.25);
}

.habit-check {
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.habit-row.completed .habit-check {
  background: var(--gold);
  border-color: var(--gold);
}
.habit-check svg { display: none; }
.habit-row.completed .habit-check svg { display: block; }

.habit-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  transition: color 0.2s;
}
.habit-row.completed .habit-name {
  color: var(--gold);
}

.habit-xp {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  transition: color 0.2s;
  white-space: nowrap;
}
.habit-row.completed .habit-xp { color: var(--gold); }

/* ── HABIT EDIT MODE ── */
.habits-header-right { display: flex; align-items: center; gap: 10px; }

.habits-edit-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  padding: 4px 12px;
  transition: color 0.15s, border-color 0.15s;
}
.habits-edit-btn:hover { color: var(--gold); border-color: var(--gold-glow); }

.habit-edit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.15s;
}
.habit-edit-row:hover { background: rgba(255,255,255,0.02); }

.habit-edit-order { display: flex; flex-direction: column; gap: 1px; flex-shrink: 0; }

.habit-order-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 11px;
  line-height: 1;
  padding: 2px 5px;
  transition: color 0.15s, border-color 0.15s;
}
.habit-order-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-light); }
.habit-order-btn:disabled { opacity: 0.25; cursor: default; }

.habit-edit-name {
  flex: 1;
  font-size: 14px;
  color: var(--text);
  cursor: text;
  border-radius: 4px;
  padding: 2px 4px;
  min-width: 0;
  transition: background 0.15s;
}
.habit-edit-name:hover { background: rgba(255,255,255,0.04); }

.habit-edit-xp {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  cursor: text;
  border-radius: 4px;
  padding: 2px 6px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
}
.habit-edit-xp:hover { background: rgba(255,255,255,0.04); color: var(--text); }

.habit-inline-input {
  background: var(--surface);
  border: 1px solid var(--gold-glow);
  border-radius: 4px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  padding: 2px 6px;
  width: 100%;
}
.habit-inline-xp { width: 60px; font-size: 12px; }

.habit-delete-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}
.habit-delete-btn:hover { color: #e05555; }

.habit-add-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px 6px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}
.habit-add-name-input {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  padding: 7px 10px;
  transition: border-color 0.15s;
}
.habit-add-name-input:focus { border-color: var(--border-light); }
.habit-add-xp-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  outline: none;
  padding: 7px 8px;
  width: 65px;
  transition: border-color 0.15s;
}
.habit-add-xp-input:focus { border-color: var(--border-light); }
.habit-add-submit { padding: 7px 14px; font-size: 13px; flex-shrink: 0; }

/* ── SUMMARY CARD ── */
.summary-card { min-height: 280px; }
.summary-body { padding: 28px 24px; text-align: center; }
.summary-xp-row { display: flex; align-items: baseline; justify-content: center; gap: 0; margin-bottom: 8px; }
.summary-xp-earned { font-size: 48px; font-weight: 800; color: var(--gold); line-height: 1; }
.summary-xp-denom { font-size: 16px; color: var(--text-muted); }
.summary-pct { font-size: 28px; font-weight: 700; color: var(--text); margin-bottom: 16px; }
.summary-bar-wrap { height: 6px; background: var(--surface); border-radius: 99px; overflow: hidden; margin-bottom: 20px; }
.summary-bar-fill { height: 100%; background: linear-gradient(90deg, var(--blue), var(--gold)); border-radius: 99px; transition: width 0.4s ease; }
.summary-message { font-size: 18px; font-weight: 700; color: var(--text-muted); letter-spacing: 0.5px; }
.summary-card.perfect .summary-message { color: var(--gold); }
.summary-card.perfect { background: linear-gradient(135deg, #1c1c1c 0%, #222018 100%); border-color: var(--gold-glow); }

/* ── WEEK TAB ── */
.week-layout {
  display: grid;
  grid-template-columns: 1fr 240px;
  gap: 20px;
  align-items: start;
}
@media (max-width: 820px) { .week-layout { grid-template-columns: 1fr; } }

.week-controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.week-label { font-size: 13px; color: var(--text); font-weight: 600; min-width: 90px; text-align: center; }
.nav-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 2px 8px 4px;
  transition: color 0.2s, border-color 0.2s;
}
.nav-btn:hover { color: var(--gold); border-color: var(--gold-glow); }

.toggle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  margin-left: 4px;
}
.toggle-wrap input { display: none; }
.toggle-track {
  width: 32px;
  height: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 99px;
  position: relative;
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.toggle-track::after {
  content: '';
  position: absolute;
  width: 12px;
  height: 12px;
  background: var(--text-dim);
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition: transform 0.2s, background 0.2s;
}
.toggle-wrap input:checked + .toggle-track { background: var(--gold-dim); border-color: var(--gold-glow); }
.toggle-wrap input:checked + .toggle-track::after { transform: translateX(14px); background: var(--gold); }
.toggle-text { font-size: 12px; color: var(--text-muted); }

.week-grid { display: flex; gap: 8px; padding: 20px; align-items: flex-end; min-height: 180px; }
.week-day-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.week-day-col.weekend { opacity: 0.6; }
.week-day-col.today .day-name { color: var(--gold); }

.day-bar-wrap { width: 100%; height: 100px; display: flex; align-items: flex-end; }
.day-bar {
  width: 100%;
  min-height: 4px;
  border-radius: 4px 4px 0 0;
  background: var(--surface);
  border: 1px solid var(--border);
  transition: height 0.4s ease;
}
.day-bar.has-data { background: linear-gradient(180deg, var(--gold) 0%, rgba(201,168,76,0.5) 100%); border-color: transparent; }
.day-bar.future { background: var(--surface); opacity: 0.4; }

.day-name { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
.day-pct { font-size: 12px; font-weight: 700; color: var(--text-muted); }
.day-pct.qualifying { color: var(--gold); }

.week-totals {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  gap: 20px;
}
.week-totals strong { color: var(--text); }

/* ── STREAK CARD ── */
.streak-body { padding: 32px 20px; text-align: center; }
.streak-fire-big { font-size: 48px; margin-bottom: 8px; }
.streak-num { font-size: 64px; font-weight: 800; color: var(--gold); line-height: 1; }
.streak-unit { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
.streak-threshold { font-size: 12px; color: var(--text-dim); margin-top: 12px; padding: 6px 12px; background: var(--surface); border-radius: 99px; display: inline-block; }

/* ── MONTH / HEATMAP ── */
.heatmap-card {}
.heatmap-grid { padding: 20px; }
.month-controls { display: flex; align-items: center; gap: 8px; }
.month-label { font-size: 14px; font-weight: 700; color: var(--text); min-width: 110px; text-align: center; }

.heatmap-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 6px; }
.heatmap-weekday { text-align: center; font-size: 11px; font-weight: 600; color: var(--text-dim); text-transform: uppercase; padding: 2px 0; }

.heatmap-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.heatmap-day {
  aspect-ratio: 1;
  border-radius: 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  cursor: default;
  transition: transform 0.15s;
  position: relative;
}
.heatmap-day:hover { transform: scale(1.1); z-index: 1; }
.heatmap-day.empty { background: transparent; pointer-events: none; }
.heatmap-day.today { box-shadow: 0 0 0 2px var(--gold); }
.heatmap-day.future { opacity: 0.3; }
.heatmap-day .day-num { font-size: 12px; font-weight: 700; }
.heatmap-day .day-pct-label { font-size: 9px; font-weight: 600; opacity: 0.85; }

.heatmap-legend { display: flex; align-items: center; gap: 10px; padding: 0 20px 4px; }
.legend-label { font-size: 11px; color: var(--text-dim); }
.legend-scale { display: flex; gap: 3px; }
.legend-swatch { width: 16px; height: 16px; border-radius: 3px; }

.monthly-total {
  padding: 14px 20px;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--text-muted);
}
.monthly-total strong { color: var(--text); }

/* ── SETTINGS MODAL ── */
.modal { position: fixed; inset: 0; z-index: 500; display: flex; align-items: flex-start; justify-content: flex-end; }
.modal.hidden { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.6); }
.modal-panel {
  position: relative;
  z-index: 1;
  background: var(--card);
  border-left: 1px solid var(--border);
  width: 440px;
  max-width: 100vw;
  height: 100vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  animation: slideIn 0.25s ease;
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: translateX(0); } }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--card);
  z-index: 1;
}
.modal-header h2 { font-size: 16px; font-weight: 700; color: var(--gold); }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
  padding: 4px;
  transition: color 0.2s;
}
.modal-close:hover { color: var(--text); }

.editor-list { flex: 1; padding: 8px; }
.editor-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 8px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.15s;
}
.editor-row:hover { background: rgba(255,255,255,0.03); }
.editor-row.editing { background: var(--surface); border-color: var(--border); }

.editor-name { flex: 1; font-size: 14px; color: var(--text); }
.editor-xp { font-size: 13px; color: var(--text-muted); font-weight: 600; min-width: 48px; text-align: right; }
.editor-name-input, .editor-xp-input {
  background: var(--bg);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text);
  font-size: 13px;
  padding: 5px 8px;
  outline: none;
}
.editor-name-input:focus, .editor-xp-input:focus { border-color: var(--gold); }
.editor-name-input { flex: 1; }
.editor-xp-input { width: 64px; }

.btn-icon {
  background: none;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 8px;
  transition: all 0.15s;
  white-space: nowrap;
}
.btn-icon.edit:hover { color: var(--blue); border-color: rgba(46,109,180,0.4); }
.btn-icon.save:hover, .btn-icon.save { color: var(--gold); border-color: var(--gold-glow); }
.btn-icon.delete:hover { color: #e05a5a; border-color: rgba(224,90,90,0.4); }

.add-habit-section {
  padding: 16px 16px 20px;
  border-top: 1px solid var(--border);
}
.add-habit-section h3 { font-size: 13px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 10px; letter-spacing: 0.5px; }
.add-habit-form { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.add-habit-form input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
  outline: none;
  flex: 1;
  min-width: 120px;
}
.add-habit-form input:focus { border-color: var(--gold); }
.btn-gold {
  background: var(--gold);
  border: none;
  border-radius: var(--radius-sm);
  color: #111;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
  transition: opacity 0.2s;
  white-space: nowrap;
}
.btn-gold:hover { opacity: 0.85; }

/* ── STREAK BANNER ── */
#streak-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 200;
  background: linear-gradient(90deg, #8a5c0c, #C9A84C, #8a5c0c);
  color: #111;
  font-weight: 700;
  font-size: 15px;
  padding: 14px 20px;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  animation: slideDown 0.4s ease;
}
#streak-banner.hidden { display: none; }
@keyframes slideDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }
.banner-close { background: none; border: none; font-size: 18px; cursor: pointer; color: #111; font-weight: 700; padding: 0 4px; }

/* ── MILESTONE OVERLAY ── */
#milestone-overlay {
  position: fixed;
  inset: 0;
  z-index: 600;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.4s ease;
}
#milestone-overlay.hidden { display: none; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.milestone-content { text-align: center; }
.milestone-fire { font-size: 80px; margin-bottom: 16px; animation: pulse 1.5s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.1); } }
.milestone-number { font-size: 96px; font-weight: 900; color: var(--gold); line-height: 1; }
.milestone-title { font-size: 28px; font-weight: 700; color: var(--gold); margin-bottom: 12px; }
.milestone-sub { font-size: 18px; color: var(--text-muted); margin-bottom: 36px; }
.milestone-btn {
  background: var(--gold);
  border: none;
  border-radius: 99px;
  color: #111;
  cursor: pointer;
  font-size: 16px;
  font-weight: 700;
  padding: 14px 40px;
  transition: opacity 0.2s;
}
.milestone-btn:hover { opacity: 0.85; }

/* ── CONFETTI CANVAS ── */
#confetti-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 400;
  display: none;
}

/* ── XP FLOAT ── */
#xp-float-container { position: fixed; top: 0; left: 0; pointer-events: none; z-index: 300; }
.xp-float {
  position: fixed;
  color: var(--gold);
  font-size: 14px;
  font-weight: 800;
  pointer-events: none;
  text-shadow: 0 0 8px var(--gold-glow);
  animation: floatUp 0.9s ease forwards;
}
@keyframes floatUp {
  0% { opacity: 1; transform: translateY(0); }
  100% { opacity: 0; transform: translateY(-40px); }
}

/* ── JOURNAL ── */
.jbig3-card { margin-bottom: 16px; }

.big3-list { padding: 8px; }
.big3-empty { padding: 16px 12px; color: var(--text-dim); font-size: 13px; font-style: italic; }

.big3-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.15s;
  user-select: none;
}
.big3-row:hover { background: rgba(255,255,255,0.03); }
.big3-row.done { background: var(--gold-dim); border-color: rgba(201,168,76,0.2); }

.big3-check {
  width: 20px; height: 20px;
  border: 2px solid var(--border-light);
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  transition: all 0.2s;
}
.big3-row.done .big3-check { background: var(--gold); border-color: var(--gold); }

.big3-text { flex: 1; font-size: 14px; color: var(--text); transition: color 0.2s; }
.big3-row.done .big3-text { color: var(--gold); text-decoration: line-through; text-decoration-color: rgba(201,168,76,0.5); }

.big3-badge-tag {
  font-size: 10px; font-weight: 700; color: var(--gold);
  background: var(--gold-dim); border: 1px solid rgba(201,168,76,0.25);
  border-radius: 99px; padding: 2px 8px; white-space: nowrap;
}

/* View toggle bar */
.jview-bar {
  display: flex; align-items: center; justify-content: space-between;
  margin: 20px 0 16px;
}
.jview-tabs { display: flex; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 3px; }
.jview-tab {
  background: none; border: none; border-radius: 6px;
  color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 6px 16px; transition: all 0.2s;
}
.jview-tab.active { background: var(--gold); color: #111; }
.jtoday-badge { font-size: 12px; color: var(--text-muted); }
.jtoday-badge.done { color: var(--gold); font-weight: 700; }

/* Journal section cards */
.jcard { margin-bottom: 16px; }

.jcard-hd {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
}
.jcard-icon { font-size: 20px; line-height: 1; margin-top: 2px; flex-shrink: 0; }
.jcard-title { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gold); }
.jcard-sub { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

.jcard-body { padding: 16px 20px 20px; display: flex; flex-direction: column; gap: 18px; }

/* Fields */
.jfield { display: flex; flex-direction: column; gap: 6px; }
.jfield-row { display: flex; gap: 12px; }

.jlabel {
  font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-muted);
  display: flex; align-items: center; gap: 8px;
}
.jlabel-row { display: flex; align-items: center; justify-content: space-between; }
.jhint { font-size: 12px; color: var(--text-dim); line-height: 1.4; }
.jsub { font-size: 11px; color: var(--text-dim); font-style: italic; line-height: 1.4; opacity: 0.8; }

.jtag {
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: 99px; text-transform: uppercase; letter-spacing: 0.3px;
  background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(201,168,76,0.25);
}
.jtag.red { background: rgba(224,85,85,0.15); color: #e05555; border-color: rgba(224,85,85,0.25); }
.jtag.gold { background: var(--gold-dim); color: var(--gold); border-color: rgba(201,168,76,0.25); }

.jinput {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; padding: 11px 14px; outline: none;
  transition: border-color 0.2s; width: 100%;
}
.jinput:focus { border-color: var(--gold); }
.jinput::placeholder { color: var(--text-dim); }

.jtextarea {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 14px; padding: 11px 14px; outline: none; resize: vertical;
  transition: border-color 0.2s; width: 100%; font-family: inherit; line-height: 1.5;
  min-height: 72px;
}
.jtextarea:focus { border-color: var(--gold); }
.jtextarea::placeholder { color: var(--text-dim); }

/* Metrics grid */
.jmetrics-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }
@media (max-width: 600px) { .jmetrics-row { grid-template-columns: 1fr; } }

/* Energy slider */
.jenergy-num {
  font-size: 22px; font-weight: 800; color: var(--gold); line-height: 1;
}
.jenergy-slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; border-radius: 99px;
  background: var(--border); outline: none; cursor: pointer;
}
.jenergy-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); cursor: pointer;
  border: 3px solid var(--bg); box-shadow: 0 0 0 1px var(--gold);
}
.jenergy-slider::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); cursor: pointer; border: 3px solid var(--bg);
}
.jenergy-marks {
  display: flex; justify-content: space-between;
  font-size: 10px; color: var(--text-dim); margin-top: 4px;
  padding: 0 2px;
}

/* Yes/No toggle */
.yesno-row { display: flex; gap: 8px; margin-top: 2px; }
.yesno-opt {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text-muted);
  cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 8px 24px; transition: all 0.2s;
}
.yesno-opt.active { background: var(--gold-dim); border-color: var(--gold); color: var(--gold); }

/* Yesterday review */
.jno-tasks { color: var(--text-dim); font-size: 13px; font-style: italic; }
.j-ytask-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
}
.j-ytask-row:last-of-type { border-bottom: none; }
.jyt-box {
  width: 20px; height: 20px; border: 2px solid var(--border-light);
  border-radius: 5px; flex-shrink: 0; margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.j-ytask-row.checked .jyt-box { background: var(--gold); border-color: var(--gold); }
.jyt-info { display: flex; flex-direction: column; gap: 1px; }
.jyt-label { font-size: 11px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.4px; }
.jyt-name { font-size: 14px; color: var(--text); }
.j-ytask-row.checked .jyt-name { color: var(--gold); text-decoration: line-through; text-decoration-color: rgba(201,168,76,0.4); }

/* Submit */
.jsubmit-wrap { padding: 8px 0 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px; }
.jsubmit-btn { font-size: 15px; padding: 14px 36px; }
.jsuccess {
  display: flex; align-items: center; gap: 8px;
  color: var(--gold); font-size: 14px; font-weight: 600;
}
.jsuccess.hidden { display: none; }
.jsuccess-check {
  width: 22px; height: 22px; border-radius: 50%;
  background: var(--gold); color: #111; font-size: 12px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
}

/* History list */
.history-empty { color: var(--text-dim); font-size: 14px; padding: 24px 0; font-style: italic; }
.jhistory-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 20px; margin-bottom: 10px; cursor: pointer;
  display: grid; grid-template-columns: 130px 1fr auto 24px;
  align-items: center; gap: 16px; transition: border-color 0.15s, background 0.15s;
}
.jhistory-card:hover { border-color: rgba(201,168,76,0.3); background: rgba(201,168,76,0.03); }
.jh-date { font-size: 13px; font-weight: 700; color: var(--text-muted); }
.jh-energy { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.jh-energy-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.jh-win { font-size: 13px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jh-arrow { color: var(--text-dim); font-size: 18px; }

/* History detail */
.jback-btn {
  background: none; border: 1px solid var(--border); border-radius: var(--radius-sm);
  color: var(--text-muted); cursor: pointer; font-size: 13px; font-weight: 600;
  padding: 8px 14px; margin-bottom: 20px; transition: all 0.2s;
}
.jback-btn:hover { color: var(--gold); border-color: var(--gold-glow); }

.jdetail-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); margin-bottom: 12px; overflow: hidden; }
.jdetail-hd { padding: 14px 20px; border-bottom: 1px solid var(--border); }
.jdetail-section-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gold); }
.jdetail-rows { padding: 4px 20px 12px; }
.jdetail-row { padding: 10px 0; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 4px; }
.jdetail-row:last-child { border-bottom: none; }
.jdetail-label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-dim); }
.jdetail-val { font-size: 14px; color: var(--text); white-space: pre-wrap; line-height: 1.5; }
.jdetail-val.muted { color: var(--text-dim); font-style: italic; }
.jdetail-meta { display: flex; gap: 20px; flex-wrap: wrap; }
.jdetail-metric { display: flex; flex-direction: column; gap: 2px; }
.jdetail-metric-val { font-size: 24px; font-weight: 800; color: var(--gold); }
.jdetail-metric-label { font-size: 11px; color: var(--text-dim); }
.jdetail-bool { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.jdetail-bool.yes { color: var(--gold); }
.jdetail-bool.no { color: var(--text-dim); }
.jdetail-header-row {
  display: flex; align-items: baseline; gap: 16px;
  padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
}
.jdetail-big-date { font-size: 20px; font-weight: 800; color: var(--text); }
.jdetail-big-energy { font-size: 32px; font-weight: 900; color: var(--gold); }

/* ── AUTH GATE ── */
#auth-gate {
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
}

.auth-box {
  width: 100%;
  max-width: 340px;
  padding: 0 24px;
  text-align: center;
}

.auth-logo {
  font-size: 44px;
  font-weight: 900;
  letter-spacing: -1.5px;
  color: var(--gold);
  text-transform: uppercase;
  margin-bottom: 8px;
}

.auth-tagline {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 36px;
}

#auth-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 16px;
  padding: 14px 16px;
  outline: none;
  text-align: center;
  letter-spacing: 3px;
  margin-bottom: 10px;
  transition: border-color 0.2s;
  display: block;
}
#auth-input:focus { border-color: var(--gold); }
#auth-input::placeholder { letter-spacing: normal; color: var(--text-dim); }

.auth-submit {
  width: 100%;
  background: var(--gold);
  border: none;
  border-radius: var(--radius);
  color: #111;
  cursor: pointer;
  font-size: 15px;
  font-weight: 700;
  padding: 14px;
  transition: opacity 0.2s;
  margin-bottom: 14px;
}
.auth-submit:hover { opacity: 0.85; }
.auth-submit:disabled { opacity: 0.5; cursor: default; }

.auth-error {
  font-size: 13px;
  font-weight: 600;
  color: #e05555;
  min-height: 18px;
  opacity: 0;
  transition: opacity 0.2s;
}
.auth-error.visible { opacity: 1; }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  15%, 45%, 75% { transform: translateX(-8px); }
  30%, 60%, 90% { transform: translateX(8px); }
}
.shake { animation: shake 0.4s ease; }

/* ── GYM ── */
.gym-screen { display: none; }
.gym-screen.active { display: block; }

/* Workout selection cards */
.workout-cards {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.workout-cards::-webkit-scrollbar { display: none; }

.workout-card {
  flex: 1;
  min-width: 80px;
  background: var(--card);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 8px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  user-select: none;
  text-align: center;
  transition: border-color 0.2s;
}
.workout-card:hover { border-color: rgba(201,168,76,0.4); }
.workout-card.selected { border-color: var(--gold); }

.wc-name { font-size: 15px; font-weight: 800; color: var(--text); letter-spacing: -0.2px; }
.wc-day { font-size: 11px; font-weight: 600; color: var(--text-dim); }

/* Exercise preview list */
#gym-exercise-preview { margin-top: 20px; }
.gym-preview-header {
  font-size: 10px; font-weight: 800; color: var(--text-dim);
  text-transform: uppercase; letter-spacing: 1px;
  padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.gym-preview-row {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--border);
}
.gym-preview-label {
  font-size: 11px; font-weight: 800; color: var(--gold);
  background: var(--gold-dim); border: 1px solid rgba(201,168,76,0.2);
  border-radius: 4px; padding: 2px 6px; flex-shrink: 0;
  min-width: 26px; text-align: center; margin-top: 1px;
}
.gym-preview-info { flex: 1; min-width: 0; }
.gym-preview-name { font-size: 13px; font-weight: 600; color: var(--text); }
.gym-preview-note { font-size: 11px; color: var(--text-dim); margin-top: 2px; }
.gym-preview-sets { font-size: 12px; color: var(--text-muted); font-weight: 600; flex-shrink: 0; white-space: nowrap; margin-top: 2px; }
.gym-preview-empty { padding: 16px 0; color: var(--text-muted); font-size: 14px; }

/* Start workout button */
.gym-start-wrap { margin-top: 24px; }
.gym-start-btn { width: 100%; padding: 16px; font-size: 16px; font-weight: 800; }

/* Active workout header */
.aw-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding-bottom: 16px; margin-bottom: 4px;
  border-bottom: 1px solid var(--border);
}
.aw-meta { display: flex; flex-direction: column; gap: 2px; }
.aw-name { font-size: 16px; font-weight: 800; color: var(--text); letter-spacing: -0.3px; }
.aw-timer { font-size: 28px; font-weight: 800; color: var(--gold); font-variant-numeric: tabular-nums; }
.aw-finish-btn { font-size: 14px; padding: 10px 18px; white-space: nowrap; flex-shrink: 0; }

/* Exercise cards */
.aw-exercises { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }

.gym-ex-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.gym-ex-hd {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px 10px; border-bottom: 1px solid var(--border);
}
.gym-ex-label {
  font-size: 11px; font-weight: 800; color: var(--gold);
  background: var(--gold-dim); border: 1px solid rgba(201,168,76,0.25);
  border-radius: 5px; padding: 2px 7px; flex-shrink: 0;
  min-width: 28px; text-align: center;
}
.gym-ex-info { flex: 1; min-width: 0; }
.gym-ex-name {
  font-size: 14px; font-weight: 700; color: var(--text);
  display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.gym-ex-note { font-size: 11px; color: var(--text-dim); display: block; margin-top: 1px; }
.gym-name-input {
  background: var(--surface); border: 1px solid var(--gold);
  border-radius: 6px; color: var(--text); font-size: 14px; font-weight: 700;
  padding: 4px 8px; outline: none; width: 100%;
}
.gym-change-btn {
  background: none; border: 1px solid var(--border); border-radius: 6px;
  color: var(--text-dim); cursor: pointer; font-size: 11px; font-weight: 600;
  padding: 4px 8px; transition: all 0.15s; flex-shrink: 0; white-space: nowrap;
}
.gym-change-btn:hover { color: var(--text); border-color: var(--border-light); }

.gym-ex-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.gym-reorder-btns { display: flex; flex-direction: column; gap: 2px; }
.gym-reorder-btn {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--text-dim); cursor: pointer; font-size: 11px; line-height: 1;
  padding: 2px 5px; transition: all 0.15s;
}
.gym-reorder-btn:hover { color: var(--gold); border-color: var(--gold-glow); }

/* Set column headers */
.gym-set-cols {
  display: grid; grid-template-columns: 80px 1fr 1fr 44px; gap: 8px;
  padding: 6px 14px 4px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: var(--text-dim);
}
/* Set rows */
.gym-set-row {
  display: grid; grid-template-columns: 80px 1fr 1fr 44px; gap: 8px;
  align-items: center; padding: 8px 14px;
  border-top: 1px solid var(--border); transition: background 0.2s;
}
.gym-set-row.completed { background: rgba(76,175,80,0.12); }

.gym-prev { font-size: 12px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.gym-input {
  background: var(--surface); border: 1px solid var(--border); border-radius: 6px;
  color: var(--text); font-size: 15px; font-weight: 600; padding: 8px 6px;
  outline: none; width: 100%; text-align: center; transition: border-color 0.2s;
  -moz-appearance: textfield;
}
.gym-input::-webkit-outer-spin-button,
.gym-input::-webkit-inner-spin-button { -webkit-appearance: none; }
.gym-input:focus { border-color: var(--gold); }

.gym-check {
  width: 36px; height: 36px; border: 2px solid var(--border-light);
  border-radius: var(--radius-sm); background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; transition: all 0.15s;
  flex-shrink: 0;
}
.gym-check.done { background: var(--green); border-color: var(--green); }
.gym-check:active { transform: scale(0.9); }

.gym-add-set-btn {
  display: block; width: 100%; background: none; border: none;
  border-top: 1px solid var(--border); color: var(--text-dim); cursor: pointer;
  font-size: 13px; font-weight: 600; padding: 10px 14px; text-align: left;
  transition: color 0.15s, background 0.15s;
}
.gym-add-set-btn:hover { background: rgba(255,255,255,0.03); color: var(--text-muted); }

.gym-add-exercise-wrap { margin-top: 8px; }
.gym-add-exercise-btn {
  background: none; border: 1px dashed var(--border-light); border-radius: var(--radius);
  color: var(--text-muted); cursor: pointer; font-size: 14px; font-weight: 600;
  padding: 16px; width: 100%; text-align: center; transition: all 0.15s;
}
.gym-add-exercise-btn:hover { border-color: var(--gold-glow); color: var(--gold); }

/* Summary */
.gym-summary-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 12px; overflow: hidden;
}
.gym-summary-header { padding: 20px 20px 16px; border-bottom: 1px solid var(--border); }
.gym-summary-title { font-size: 20px; font-weight: 800; color: var(--text); }
.gym-summary-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.gym-summary-stats {
  display: grid; grid-template-columns: repeat(3,1fr);
  gap: 1px; background: var(--border); border-bottom: 1px solid var(--border);
}
.gym-stat { background: var(--card); padding: 16px 12px; text-align: center; }
.gym-stat-val { font-size: 22px; font-weight: 800; color: var(--gold); }
.gym-stat-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-top: 2px; }

.gym-vol-compare {
  padding: 10px 20px; font-size: 13px; font-weight: 600;
  border-bottom: 1px solid var(--border);
}
.gym-vol-up { color: var(--green); }
.gym-vol-down { color: #e05555; }
.gym-vol-same { color: var(--text-muted); }

.gym-summary-sets { padding: 12px 20px 16px; }
.gym-summary-ex { margin-bottom: 14px; }
.gym-summary-ex-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 5px; }
.gym-summary-set-row {
  display: flex; gap: 10px; font-size: 12px; color: var(--text-dim); padding: 2px 0;
}
.gym-summary-set-row.completed { color: var(--gold); }

.gym-save-btn {
  display: block; width: 100%; background: var(--gold); border: none;
  border-radius: var(--radius); color: #111; cursor: pointer;
  font-size: 15px; font-weight: 700; padding: 16px; text-align: center;
  transition: opacity 0.2s; margin-top: 4px;
}
.gym-save-btn:hover { opacity: 0.85; }
.gym-save-btn:disabled { opacity: 0.5; cursor: default; }

/* Gym history */
.gym-history-item {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; gap: 16px; transition: border-color 0.15s;
}
.gym-history-item:hover { border-color: rgba(201,168,76,0.3); }
.gym-hi-type { font-size: 15px; font-weight: 800; color: var(--gold); min-width: 60px; }
.gym-hi-info { flex: 1; }
.gym-hi-date { font-size: 13px; color: var(--text); font-weight: 600; }
.gym-hi-meta { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.gym-hi-arrow { color: var(--text-dim); font-size: 18px; }

.gym-detail-header { margin-bottom: 16px; }
.gym-detail-title { font-size: 20px; font-weight: 800; color: var(--text); }
.gym-detail-meta { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.gym-detail-date { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.gym-detail-back { margin-bottom: 10px; }
.gym-detail-set-row {
  display: grid; grid-template-columns: auto 1fr auto auto;
  gap: 8px; font-size: 13px; color: var(--text-dim); padding: 3px 0; align-items: center;
}

/* Shared gym exercise/set headers */
.gym-ex-header { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.gym-ex-info { flex: 1; min-width: 0; }
.gym-col-label {
  font-size: 10px; color: var(--text-dim); text-transform: uppercase;
  letter-spacing: 0.5px; padding-bottom: 4px;
}
.gym-ex-name-edit { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.gym-ex-name-input { flex: 1; }

/* Summary — compact inline layout */
.gym-summary-comp {
  padding: 10px 20px; font-size: 13px; font-weight: 700;
  border-bottom: 1px solid var(--border);
}
.gym-summary-exercises { padding: 4px 0 8px; }
.gym-sum-ex { padding: 12px 20px; border-bottom: 1px solid var(--border); }
.gym-sum-ex:last-child { border-bottom: none; }
.gym-sum-exname { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.gym-sum-sets { display: flex; flex-wrap: wrap; gap: 6px; }
.gym-sum-set {
  background: rgba(201,168,76,0.12); color: var(--gold);
  border-radius: 4px; padding: 3px 8px; font-size: 12px; font-weight: 600;
}

/* History rows */
.gym-history-row {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 20px; margin-bottom: 10px; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; transition: border-color 0.15s;
}
.gym-history-row:hover { border-color: rgba(201,168,76,0.3); }
.gym-history-type { font-size: 15px; font-weight: 800; color: var(--gold); }
.gym-history-date { font-size: 12px; color: var(--text-muted); margin-top: 3px; }
.gym-history-row-right { text-align: right; flex-shrink: 0; }
.gym-history-vol { font-size: 15px; font-weight: 700; color: var(--text); }
.gym-history-dur { font-size: 12px; color: var(--text-muted); margin-top: 2px; }

/* Ghost button */
.btn-ghost {
  background: none; border: 1px solid var(--border-light);
  border-radius: var(--radius); color: var(--text-muted); cursor: pointer;
  font-size: 14px; font-weight: 600; transition: all 0.15s;
}
.btn-ghost:hover { border-color: var(--border-light); color: var(--text); }

/* ── CONTENT / TWEET CALENDAR ── */

.tc-nav {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tc-week-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  min-width: 160px;
  text-align: center;
}

.tc-today-btn {
  font-size: 13px;
  padding: 6px 14px;
}

.tc-stats {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.tc-stat {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.tc-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--gold);
}

.tc-stat-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

/* Desktop grid */
.tc-grid-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.tc-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(120px, 1fr));
  gap: 6px;
  min-width: 700px;
}

.tc-col {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.tc-col-head {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 6px;
  text-align: center;
}

.tc-col.today .tc-col-head {
  background: var(--gold-dim);
  border-color: var(--gold-glow);
}

.tc-day-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.tc-day-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  margin-top: 2px;
}

.tc-col.today .tc-day-name { color: var(--gold); }
.tc-col.today .tc-day-date { color: var(--gold); }

.tc-slot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-height: 80px;
  cursor: pointer;
  padding: 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}

.tc-slot:hover { border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.03); }

.tc-slot.empty {
  border-style: dashed;
  align-items: center;
  justify-content: center;
}

.tc-slot-add {
  font-size: 22px;
  color: var(--text-dim);
  line-height: 1;
  transition: color 0.15s;
}

.tc-slot:hover .tc-slot-add { color: var(--gold); }

.tc-slot-content {
  font-size: 11px;
  color: var(--text-muted);
  line-height: 1.4;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  flex: 1;
  word-break: break-word;
}

.tc-slot-status {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 2px 5px;
  border-radius: 99px;
  align-self: flex-start;
  flex-shrink: 0;
}

.tc-slot-status.draft { background: rgba(85,85,85,0.25); color: var(--text-dim); }
.tc-slot-status.scheduled { background: var(--blue-dim); color: var(--blue); }
.tc-slot-status.posted { background: rgba(76,175,80,0.15); color: var(--green); }

/* Mobile single-day view */
.tc-mobile-view { display: none; }

.tc-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 20px;
}

.tc-mobile-date {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  flex: 1;
  text-align: center;
}

.tc-mobile-date.today { color: var(--gold); }

.tc-mobile-slots {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tc-mobile-slot {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  min-height: 80px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: border-color 0.15s, background 0.15s;
}

.tc-mobile-slot:hover { border-color: rgba(201,168,76,0.4); background: rgba(201,168,76,0.03); }

.tc-mobile-slot.empty {
  align-items: center;
  justify-content: center;
  border-style: dashed;
}

.tc-mobile-slot-num {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-dim);
}

.tc-mobile-slot-content {
  font-size: 14px;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}

/* Tweet modal */
#tweet-modal {
  align-items: center;
  justify-content: center;
}

#tweet-modal .modal-panel {
  width: 480px;
  max-width: calc(100vw - 32px);
  height: auto;
  max-height: 90vh;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  overflow-y: auto;
  animation: fadeScaleIn 0.2s ease;
}

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

.tweet-modal-body {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.tm-date {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.tm-char-wrap { position: relative; }

.tm-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 15px;
  font-family: inherit;
  line-height: 1.5;
  padding: 12px 14px 36px;
  outline: none;
  resize: vertical;
  min-height: 120px;
  max-height: 280px;
  transition: border-color 0.2s;
}

.tm-textarea:focus { border-color: var(--gold); }
.tm-textarea::placeholder { color: var(--text-dim); }

.tm-char-count {
  position: absolute;
  bottom: 8px;
  right: 12px;
  font-size: 12px;
  color: var(--text-dim);
  font-weight: 600;
  pointer-events: none;
  transition: color 0.2s;
}

.tm-char-count.near { color: #e0a040; }
.tm-char-count.full { color: #e05555; }

.tm-field { display: flex; flex-direction: column; gap: 8px; }

.tm-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.tm-status-row { display: flex; gap: 8px; }

.tm-status-btn {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 12px;
  transition: all 0.15s;
  text-align: center;
}

.tm-status-btn:hover { border-color: rgba(201,168,76,0.3); color: var(--text); }
.tm-status-btn.active.draft { background: rgba(85,85,85,0.2); color: var(--text); border-color: var(--border-light); }
.tm-status-btn.active.scheduled { background: var(--blue-dim); color: var(--blue); border-color: rgba(46,109,180,0.5); }
.tm-status-btn.active.posted { background: rgba(76,175,80,0.15); color: var(--green); border-color: rgba(76,175,80,0.5); }

.tm-notes-textarea {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  padding: 10px 12px;
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.tm-notes-textarea:focus { border-color: var(--gold); }
.tm-notes-textarea::placeholder { color: var(--text-dim); }

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

/* Mobile overrides */
@media (max-width: 768px) {
  .tc-grid-wrap { display: none; }
  .tc-mobile-view { display: block; }

  #tweet-modal {
    align-items: flex-end;
  }

  #tweet-modal .modal-panel {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
  }
}

/* ── GOALS ── */

/* Pillar dots */
.pillar-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.pillar-dot-business { background: var(--gold); }
.pillar-dot-fitness  { background: var(--blue); }
.pillar-dot-life     { background: #7C3AED; }

/* Vision Cascade */
.vision-cascade {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.vision-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.vision-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
}
.pillar-name { font-weight: 700; font-size: 0.9rem; flex: 1; }
.vision-save-btn { font-size: 0.75rem; padding: 4px 12px; }
.vision-fields { padding: 14px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.vision-field { display: flex; flex-direction: column; gap: 4px; }
.vision-label { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-dim); }
.vision-textarea {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.83rem;
  font-family: inherit;
  resize: vertical;
  min-height: 72px;
  box-sizing: border-box;
}
.vision-textarea:focus { outline: none; border-color: var(--gold); }
.vision-textarea::placeholder { color: var(--text-dim); }

/* Weekly Planner nav */
.wp-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wp-week-label { font-size: 0.9rem; color: var(--text-dim); flex: 1; }
.wp-today-btn { font-size: 0.78rem; padding: 5px 14px; }

/* Weekly grid */
.wp-grid-wrap { overflow-x: auto; margin-bottom: 40px; }
.wp-grid {
  display: grid;
  grid-template-columns: 72px repeat(7, minmax(110px, 1fr));
  background: var(--border);
  gap: 1px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 850px;
}
.wp-header-cell {
  background: var(--surface);
  padding: 10px 8px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
  color: var(--text-dim);
  line-height: 1.3;
}
.wp-header-cell.wp-today-col { color: var(--gold); }
.wp-pillar-label {
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  writing-mode: vertical-lr;
  transform: rotate(180deg);
  text-transform: uppercase;
}
.pillar-label-business { color: var(--gold); }
.pillar-label-fitness  { color: var(--blue); }
.pillar-label-life     { color: #7C3AED; }
.wp-cell {
  background: var(--bg);
  padding: 6px;
  min-height: 90px;
  display: flex;
  flex-direction: column;
}
.wp-cell.wp-today-col { background: var(--card); }

/* Tasks within cells */
.wp-task {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  padding: 2px 3px;
  border-radius: 4px;
  position: relative;
}
.wp-task:hover { background: rgba(255,255,255,0.04); }
.wp-task:hover .wp-task-delete { opacity: 1; }
.wp-task-check {
  width: 13px; height: 13px;
  flex-shrink: 0;
  margin-top: 3px;
  accent-color: var(--gold);
  cursor: pointer;
}
.wp-task-text {
  flex: 1;
  font-size: 0.78rem;
  line-height: 1.35;
  color: var(--text);
  cursor: pointer;
  word-break: break-word;
}
.wp-task-text:hover { color: var(--gold); }
.wp-task-text.completed { text-decoration: line-through; color: var(--text-dim); }
.wp-task-text.completed:hover { color: var(--text-dim); }
.wp-task-delete {
  opacity: 0;
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 0.68rem;
  padding: 1px 3px;
  flex-shrink: 0;
  transition: opacity 0.15s, color 0.15s;
  line-height: 1;
}
.wp-task-delete:hover { color: #e05a5a; }

/* Groups */
.wp-group-header {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 3px 2px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 4px;
  margin-top: 4px;
  user-select: none;
}
.wp-group-header:hover { background: rgba(255,255,255,0.04); color: var(--text); }
.wp-group-arrow { font-size: 0.6rem; line-height: 1; }
.wp-group-tasks { padding-left: 4px; }

/* Cell action buttons */
.wp-cell-actions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: auto; padding-top: 6px; }
.wp-add-task-btn, .wp-add-group-btn {
  background: none;
  border: none;
  color: var(--text-dim);
  font-size: 0.68rem;
  cursor: pointer;
  padding: 2px 5px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.wp-add-task-btn:hover, .wp-add-group-btn:hover { color: var(--text); background: rgba(255,255,255,0.06); }

/* Inline input */
.wp-inline-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--gold);
  color: var(--text);
  padding: 3px 6px;
  border-radius: 4px;
  font-size: 0.78rem;
  font-family: inherit;
  margin: 3px 0;
  box-sizing: border-box;
}
.wp-inline-input:focus { outline: none; }
.wp-inline-input::placeholder { color: var(--text-dim); }

/* Mobile planner view */
.wp-mobile-view { display: none; }
.wp-mobile-nav { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.wp-mobile-day-label {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dim);
}
.wp-mobile-day-label.today { color: var(--gold); }
.wp-mobile-pillar { margin-bottom: 16px; }
.wp-mobile-pillar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.85rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.wp-mobile-cell {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px;
}

/* Today's Tasks */
.goals-today-list { display: flex; flex-direction: column; gap: 24px; padding-bottom: 40px; }
.gt-pillar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  font-weight: 700;
  font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.gt-group-name {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 8px 4px 2px;
}
.gt-task {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 6px 4px;
  border-radius: var(--radius-sm);
}
.gt-task:hover { background: rgba(255,255,255,0.03); }
.gt-task-check {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--gold);
  cursor: pointer;
}
.gt-task-text { font-size: 0.9rem; line-height: 1.5; }
.gt-task-text.completed { text-decoration: line-through; color: var(--text-dim); }
.gt-empty { text-align: center; color: var(--text-dim); padding: 60px 0; font-size: 0.9rem; line-height: 1.8; }

@media (max-width: 768px) {
  .vision-cascade { grid-template-columns: 1fr; }
  .wp-grid-wrap { display: none; }
  .wp-mobile-view { display: block; }
}

/* ── LEARNINGS ── */
#view-learnings { padding: 0 24px 60px; }
.lr-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 12px;
  flex-wrap: wrap;
}
.lr-search {
  flex: 1;
  min-width: 160px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 0.875rem;
}
.lr-search:focus { outline: none; border-color: var(--gold); }
.lr-search::placeholder { color: var(--text-dim); }
.lr-filters { display: flex; gap: 6px; flex-wrap: wrap; }
.lr-filter {
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: transparent;
  color: var(--text-dim);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.15s;
}
.lr-filter:hover { border-color: var(--text-dim); color: var(--text); }
.lr-filter.active { background: var(--gold); border-color: var(--gold); color: #000; font-weight: 600; }
.lr-sort {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  cursor: pointer;
}
.lr-add-btn { white-space: nowrap; }
.lr-list { display: flex; flex-direction: column; gap: 10px; padding-bottom: 40px; }
.lr-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: border-color 0.15s;
}
.lr-row:hover { border-color: var(--border-light); }
.lr-row-body { flex: 1; min-width: 0; }
.lr-row-title {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lr-row-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
  flex-wrap: wrap;
}
.lr-row-date { font-size: 0.78rem; color: var(--text-dim); }
.lr-row-source { font-size: 0.78rem; color: var(--text-dim); }
.lr-cat-tag {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
  flex-shrink: 0;
}
.lr-cat-book        { background: rgba(46,109,180,0.18); color: #6baeff; border: 1px solid rgba(46,109,180,0.35); }
.lr-cat-podcast     { background: rgba(155,89,182,0.18); color: #c07dff; border: 1px solid rgba(155,89,182,0.35); }
.lr-cat-experience  { background: rgba(76,175,80,0.18);  color: #6fcf74; border: 1px solid rgba(76,175,80,0.35); }
.lr-cat-course      { background: rgba(201,168,76,0.18); color: var(--gold); border: 1px solid rgba(201,168,76,0.35); }
.lr-cat-other       { background: rgba(120,120,120,0.18); color: #aaa;   border: 1px solid rgba(120,120,120,0.35); }
.lr-empty { text-align: center; color: var(--text-dim); padding: 60px 0; font-size: 0.9rem; }

/* Learning modal */
#learning-modal {
  align-items: center;
  justify-content: center;
}
.lm-panel {
  width: 600px;
  max-width: 95vw;
  max-height: 85vh;
  overflow-y: auto;
}
.lm-body { padding: 0 24px 24px; }
.lm-field { margin-bottom: 16px; }
.lm-label { font-size: 0.78rem; color: var(--text-dim); margin-bottom: 5px; text-transform: uppercase; letter-spacing: 0.04em; }
.lm-input, .lm-textarea, .lm-select {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 9px 12px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  box-sizing: border-box;
}
.lm-input:focus, .lm-textarea:focus, .lm-select:focus { outline: none; border-color: var(--gold); }
.lm-input::placeholder, .lm-textarea::placeholder { color: var(--text-dim); }
.lm-textarea { resize: vertical; min-height: 90px; font-family: inherit; }
.lm-select { cursor: pointer; }
.lm-row { display: flex; gap: 12px; }
.lm-row .lm-field { flex: 1; }
.lm-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.lm-detail-section { margin-bottom: 20px; }
.lm-detail-label { font-size: 0.75rem; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 6px; }
.lm-detail-text { color: var(--text); font-size: 0.9rem; line-height: 1.6; white-space: pre-wrap; }
.lm-detail-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.lm-detail-date { color: var(--text-dim); font-size: 0.85rem; }
.lm-detail-source { color: var(--text-dim); font-size: 0.85rem; }
.lm-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.lm-tag {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-dim);
  padding: 2px 9px;
  border-radius: 99px;
  font-size: 0.75rem;
}
.lm-detail-actions { display: flex; gap: 10px; margin-bottom: 20px; }

@media (max-width: 768px) {
  #view-learnings { padding: 0 16px 40px; }
  .lr-toolbar { gap: 8px; }
  .lr-search { min-width: 100%; }
  #learning-modal { align-items: flex-end; }
  .lm-panel {
    width: 100%;
    max-width: 100%;
    border-radius: var(--radius) var(--radius) 0 0;
    border-bottom: none;
    max-height: 90vh;
  }
  .lm-row { flex-direction: column; gap: 0; }
}

/* ── DASHBOARD ── */
#view-dashboard { overflow-y: auto; }
.db-content { padding: 24px 24px 60px; }

.db-top-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}

.db-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
}

.db-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* XP Card */
.db-xp-nums {
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  margin-bottom: 16px;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
#db-xp-earned { color: var(--gold); }
.db-xp-sep { color: var(--text-dim); font-size: 18px; font-weight: 400; margin: 0 2px; }
#db-xp-total { color: var(--text-muted); font-size: 18px; font-weight: 400; }
.db-xp-unit { font-size: 13px; color: var(--text-dim); margin-left: 4px; font-weight: 500; }
.db-progress-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 99px;
  overflow: hidden;
}
.db-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, var(--blue) 0%, var(--gold) 100%);
  border-radius: 99px;
  transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 0 8px var(--gold-glow);
}

/* Streak Card */
.db-streak-val {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 4px;
  line-height: 1;
}
.db-streak-fire { font-size: 26px; line-height: 1; }
#db-streak-num { font-size: 44px; font-weight: 700; color: var(--gold); line-height: 1; }
.db-streak-unit { font-size: 13px; color: var(--text-muted); }

/* Weekly Card */
.db-weekly-inner { display: flex; align-items: center; gap: 18px; }
.db-ring { width: 72px; height: 72px; flex-shrink: 0; transform: rotate(-90deg); }
.db-ring-bg { stroke: var(--border); }
.db-ring-fill { stroke: var(--gold); transition: stroke-dasharray 0.6s ease; }
.db-weekly-pct { font-size: 34px; font-weight: 700; color: var(--gold); }

/* Section */
.db-section { margin-bottom: 28px; }
.db-section-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.9px;
  color: var(--text-dim);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.db-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* Big 3 / checkable items */
.db-big3-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}
.db-big3-item:last-child { border-bottom: none; }
.db-check-box {
  width: 18px; height: 18px;
  border: 2px solid var(--border-light);
  border-radius: 4px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.db-check-box.done { background: var(--gold); border-color: var(--gold); }
.db-check-box.done::after {
  content: '';
  display: block;
  width: 5px; height: 9px;
  border: 2px solid #111;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-1px, -1px);
}
.db-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.db-item-group { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 2px; }
.db-item-label { font-size: 14px; color: var(--text); }
.db-item-label.done { text-decoration: line-through; color: var(--text-muted); }
.db-empty { font-size: 13px; color: var(--text-muted); padding: 6px 0; }

/* Gym */
.db-gym-type { font-size: 20px; font-weight: 700; color: var(--gold); margin-bottom: 4px; }
.db-gym-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; }
.db-gym-exlist { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; }
.db-gym-ex { font-size: 12px; color: var(--text-dim); }

/* Content */
.db-stat-big { font-size: 36px; font-weight: 700; color: var(--gold); line-height: 1; margin-bottom: 4px; }
.db-stat-big-denom { font-size: 20px; color: var(--text-muted); font-weight: 400; }
.db-stat-sub { font-size: 12px; color: var(--text-muted); }
.db-slots-list { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }
.db-slot-item {
  padding: 7px 10px;
  background: var(--surface);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: border-color 0.15s;
}
.db-slot-item:hover { border-color: var(--gold-glow); }
.db-slot-num { font-size: 10px; color: var(--text-dim); margin-bottom: 2px; }
.db-slot-text { font-size: 12px; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.db-slot-add { font-size: 12px; color: var(--gold); }

/* Today Tasks */
.db-pillar-group { margin-bottom: 14px; }
.db-pillar-group:last-child { margin-bottom: 0; }
.db-pillar-header {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 8px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-dim);
}
.db-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.db-dot-Business { background: var(--gold); }
.db-dot-Fitness { background: var(--blue); }
.db-dot-Life { background: #7C3AED; }
.db-task-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(42,42,42,0.5);
  cursor: pointer;
}
.db-task-row:last-child { border-bottom: none; }
.db-task-check {
  width: 16px; height: 16px;
  border: 2px solid var(--border-light);
  border-radius: 3px;
  flex-shrink: 0;
  margin-top: 1px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s, border-color 0.15s;
}
.db-task-check.done { background: var(--gold); border-color: var(--gold); }
.db-task-check.done::after {
  content: '';
  display: block;
  width: 4px; height: 7px;
  border: 1.5px solid #111;
  border-top: none; border-left: none;
  transform: rotate(45deg) translate(-0.5px, -1px);
}
.db-task-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.db-task-group-label { font-size: 10px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 1px; }
.db-task-text { font-size: 13px; color: var(--text); }
.db-task-text.done { text-decoration: line-through; color: var(--text-muted); }

/* Bar Chart */
.db-chart-bars {
  display: flex;
  gap: 8px;
  height: 80px;
  align-items: flex-end;
  margin-bottom: 8px;
}
.db-bar-col {
  flex: 1;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  height: 100%;
  position: relative;
}
.db-bar {
  width: 100%;
  border-radius: 3px 3px 0 0;
  background: var(--border);
  min-height: 3px;
  position: relative;
}
.db-bar.has-data { background: rgba(201,168,76,0.35); }
.db-bar.today { background: var(--gold); }
.db-bar:hover::before {
  content: attr(data-xp);
  position: absolute;
  bottom: calc(100% + 5px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
  font-size: 11px;
  white-space: nowrap;
  color: var(--text);
  pointer-events: none;
  z-index: 10;
}
.db-chart-labels { display: flex; gap: 8px; margin-top: 2px; }
.db-chart-label { flex: 1; text-align: center; font-size: 11px; color: var(--text-dim); }
.db-chart-label.today { color: var(--gold); font-weight: 600; }

@media (max-width: 768px) {
  .db-content { padding: 16px 16px 60px; }
  .db-top-row { grid-template-columns: 1fr; gap: 12px; }
  .db-two-col { grid-template-columns: 1fr; gap: 12px; }
  .db-section { margin-bottom: 20px; }
}

/* ── SCROLLBAR ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border-light); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }
