/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { overflow-x: hidden; }

/* ── Light Mode (default) ── Agile Life Management brand */
:root {
  --font-body: 'DM Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-display: 'Bricolage Grotesque', 'DM Sans', 'Helvetica Neue', Arial, sans-serif;
  --bg: #ffffff;
  --surface: #f4f6f9;
  --surface-2: #e9edf3;
  --border: #e3e7ee;
  --text: #0b0d12;
  --text-muted: #5b6270;
  --primary: #146aff;
  --primary-text: #ffffff;
  --primary-hover: #0b57d9;
  --primary-soft: rgba(20, 106, 255, 0.10);
  --accent: #ffb514;
  --accent-text: #2a1d00;
  --danger: #e5372c;
  --danger-hover: #c22c22;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-sm: 8px;
  --shadow: 0 12px 40px rgba(11, 13, 18, .12);
  --transition: 0.15s ease;
}

/* ── Dark Mode ── */
:root[data-theme="dark"] {
  --bg: #0d1016;
  --surface: #161a22;
  --surface-2: #1f2430;
  --border: #2a303c;
  --text: #f4f6f9;
  --text-muted: #9aa2b1;
  --primary: #3d84ff;
  --primary-text: #ffffff;
  --primary-hover: #5a97ff;
  --primary-soft: rgba(61, 132, 255, 0.16);
  --danger: #ff5a4f;
  --danger-hover: #ff7a71;
  --shadow: 0 12px 40px rgba(0, 0, 0, .55);
}

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-font-smoothing: antialiased;
}

/* ── Views ── */
.view { display: none; min-height: 100vh; }
.view.active { display: block; }

/* ── Header ── */
.app-header {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: none;
}

.header-inner {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.app-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  font-family: var(--font-display);
}

.app-title svg { display: block; }

.detail-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.detail-header-icon { font-size: 1.2rem; flex-shrink: 0; }

/* ── Container ── */
.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  border: none;
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  white-space: nowrap;
  flex-shrink: 0;
  font-family: inherit;
}

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

.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text); }

.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }

.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1px solid var(--danger);
}
.btn-danger-outline:hover { background: var(--danger); color: #fff; }

/* ── Theme FAB (fixed bottom-right) ── */
.btn-theme-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 48px;
  height: 48px;
  background: var(--primary);
  color: var(--primary-text);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 50;
  box-shadow: var(--shadow);
  transition: background var(--transition), transform var(--transition);
}
.btn-theme-fab:hover { transform: scale(1.08); }

/* ── Section heading ── */
.section-heading {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ── Lists Grid ── */
.lists-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.list-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 20px;
}

.list-card::after {
  content: '→';
  margin-left: auto;
  flex-shrink: 0;
  font-size: 1.2rem;
  color: var(--text-muted);
  transition: transform var(--transition), color var(--transition);
}

.list-card:hover { background: var(--surface-2); border-color: var(--primary); }
.list-card:hover::after { transform: translateX(4px); color: var(--primary); }

.card-top {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
  min-width: 0;
}

.card-icon {
  font-size: 1.6rem;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  border-radius: var(--radius);
  flex-shrink: 0;
}


.card-text { min-width: 0; }

.card-name {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  word-break: break-word;
  line-height: 1.3;
  margin-bottom: 3px;
  font-family: var(--font-display);
}

.card-type {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.card-progress {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* ── Goal progress ── */
.goal-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  background: var(--accent);
  color: var(--accent-text);
  white-space: nowrap;
  border-radius: 999px;
}

.detail-progress { margin-top: 20px; }
.detail-progress:empty { display: none; }

.detail-progress-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.detail-progress-value {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  font-family: var(--font-display);
}

.detail-progress-sub {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.detail-progress-row .goal-badge { align-self: center; }

.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  margin-top: 14px;
  border-radius: 999px;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
  border-radius: 999px;
}

.card-stats {
  display: flex;
  gap: 20px;
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.02em;
}

.card-stats strong { color: var(--text); font-weight: 700; }

/* ── Archived lists ── */
.archived-section {
  margin-top: 40px;
}

.archived-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  border-bottom: 1px solid var(--border);
  padding: 0 0 12px;
  margin-bottom: 20px;
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
  cursor: pointer;
  transition: color var(--transition);
}
.archived-toggle:hover { color: var(--text); }

.archived-chevron { transition: transform var(--transition); }
.archived-section.open .archived-chevron { transform: rotate(180deg); }

.list-card.archived::after { display: none; }
.list-card.archived .card-top { opacity: 0.55; }
.card-restore { margin-left: auto; }

/* ── Accent bar per card ── */
.card-accent-bar {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--primary);
  opacity: 1;
}

/* ── Empty State ── */
.empty-state {
  text-align: center;
  padding: 100px 20px;
}

.empty-icon { font-size: 3rem; margin-bottom: 20px; }

.empty-state h2 {
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 10px;
  font-family: var(--font-display);
}

.empty-state p {
  color: var(--text-muted);
  margin-bottom: 28px;
  font-size: 0.9rem;
}

/* ── Detail Page Header ── */
.detail-page-header {
  padding-bottom: 28px;
  margin-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text-muted);
  cursor: pointer;
  margin-bottom: 12px;
  transition: color var(--transition);
  font-family: inherit;
}
.breadcrumb:hover { color: var(--primary); }

.detail-page-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.detail-page-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  font-family: var(--font-display);
}

/* ── Detail View ── */
.detail-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border: 1px solid var(--border);
}

.detail-count {
  font-size: 0.78rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ── Add Entry Bar ── */
.add-entry-bar {
  display: flex;
  margin-bottom: 28px;
}

.btn-add-activity {
  padding: 14px 32px;
  font-size: 0.82rem;
}

/* ── Entries List ── */
.entries-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.entry-group-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 0 4px 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2px;
}

.entry-group-label {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.entry-group-count {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

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

.entry-item {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  border: none;
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: background var(--transition), opacity var(--transition);
}

.entry-item:hover { background: var(--surface-2); }
.entry-text {
  flex: 1;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.entry-item.completed .entry-text {
  text-decoration: line-through;
  color: var(--text-muted);
}

.entry-date {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 0.03em;
}

.entry-delete {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.1rem;
  padding: 2px 6px;
  border-radius: var(--radius);
  transition: color var(--transition);
  flex-shrink: 0;
  line-height: 1;
}
.entry-delete:hover { color: var(--danger); }

.entries-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 0.95rem;
  letter-spacing: 0;
}

/* ── Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 13, 18, .55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  backdrop-filter: blur(4px);
}

.modal {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 500px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  box-shadow: var(--shadow);
  animation: modal-in 0.15s ease;
}

.modal-sm { max-width: 400px; }

/* ── Goal Reached Modal ── */
.goal-body { text-align: center; padding-top: 36px; }
.goal-emoji { font-size: 3rem; margin-bottom: 12px; }
.goal-title {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 8px;
  font-family: var(--font-display);
}
.goal-message { color: var(--text-muted); font-size: 0.9rem; }
#goal-overlay .modal-footer { justify-content: center; }

@keyframes modal-in {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px 28px 0;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.modal-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-family: var(--font-display);
}

.modal-close {
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  padding: 2px 6px;
}
.modal-close:hover { color: var(--text); }

.modal-body { padding: 24px 28px; }

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 0 28px 24px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

/* ── Form ── */
.form-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 0.92rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.form-input::placeholder { color: var(--text-muted); }

.form-hint {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 6px;
}
.form-hint-error { color: var(--danger); }

/* ── Count Mode Toggle ── */
.mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.mode-option {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 11px 12px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.mode-option:hover { color: var(--text); }
.mode-option.active { background: var(--primary); color: var(--primary-text); }

/* ── Icon Grid ── */
.icon-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 4px;
  margin-top: 8px;
  max-height: 160px;
  overflow-y: auto;
}

.icon-option {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color var(--transition), background var(--transition);
}

.icon-option:hover { background: var(--surface-2); border-color: var(--border); }

.icon-option.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}

/* ── Header Right ── */
.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* ── Hamburger (mobile only) ── */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
}

.hamburger span {
  display: block;
  height: 2px;
  background: var(--text);
  transition: transform 0.2s ease, opacity 0.2s ease, width 0.2s ease;
  transform-origin: left center;
}

.hamburger span:nth-child(2) { width: 75%; }

.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(1px, -1px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(1px, 1px); }

/* ── Mobile new list button ── */
.mobile-new-list-btn {
  display: none;
  width: 36px;
  height: 36px;
  padding: 0;
  font-size: 1.3rem;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-left: auto;
}

/* ── Mobile Menu Overlay ── */
.mobile-menu {
  display: none;
  position: fixed;
  inset: 0;
  top: 61px; /* below header */
  background: var(--bg);
  z-index: 9;
  flex-direction: column;
  padding: 0;
  transform: translateY(-8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.mobile-menu.open {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.mobile-menu-nav {
  display: flex;
  flex-direction: column;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.mobile-nav-link {
  background: none;
  border: none;
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
  text-align: left;
  padding: 18px 24px;
  cursor: pointer;
  border-bottom: 1px solid var(--border);
  transition: background var(--transition);
}

.mobile-nav-link:hover { background: var(--surface); color: var(--primary); }

/* ── Header Nav ── */
.header-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: 24px;
}

.nav-link {
  background: none;
  border: none;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0;
  color: var(--text-muted);
  cursor: pointer;
  padding: 6px 12px;
  position: relative;
  transition: color var(--transition);
}

.nav-link::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--primary);
  transform: scaleX(0);
  transition: transform var(--transition);
}

.nav-link:hover { color: var(--text); }
.nav-link.active { color: var(--text); }
.nav-link.active::after { transform: scaleX(1); }

/* ── Icon Button ── */
.btn-icon {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
  flex-shrink: 0;
  border-radius: 50%;
}
.btn-icon:hover { color: var(--primary); border-color: var(--primary); }


/* ── Profile View ── */
.profile-hero {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 40px 0 36px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 36px;
}

.profile-avatar {
  width: 80px;
  height: 80px;
  background: var(--primary);
  color: var(--primary-text);
  font-size: 2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  border-radius: 50%;
  font-family: var(--font-display);
}

.profile-name-display {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 6px;
  font-family: var(--font-display);
}

.profile-goal-display {
  font-size: 0.85rem;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 40px;
}

.profile-stat-card {
  background: var(--surface);
  padding: 20px;
  text-align: center;
  border-radius: var(--radius-lg);
}

.profile-stat-value {
  font-size: 2rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 6px;
  font-family: var(--font-display);
}

.profile-stat-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.profile-section { max-width: 480px; }

.profile-save-btn {
  margin-top: 28px;
  padding: 12px 32px;
}

/* ── Profile Logout ── */
.profile-logout-section {
  max-width: 480px;
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border);
}

/* ── Brand logo ── */
.brand-logo { display: block; height: 34px; width: auto; }
.landing-top .brand-logo { height: 44px; }
/* Dark mode swaps in a copy of the logo with a lighter gray "MANAGEMENT" */
.brand-logo-dark,
:root[data-theme="dark"] .brand-logo-light { display: none; }
:root[data-theme="dark"] .brand-logo-dark { display: block; }

/* ── Eyebrow (small uppercase kicker above headings) ── */
.eyebrow {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 18px;
}

.text-primary { color: var(--primary); }

/* ── Landing View ── */
.landing-view {
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.landing-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 40px;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.landing-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 28px;
  margin-bottom: 72px;
  border-bottom: 1px solid var(--border);
}

.landing-hero {
  max-width: 640px;
  margin-bottom: 96px;
}

.landing-headline {
  font-family: var(--font-display);
  font-size: clamp(2.75rem, 8vw, 4.75rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 24px;
}

.landing-sub {
  font-size: 1.1rem;
  font-weight: 300;
  line-height: 1.6;
  margin-bottom: 36px;
  max-width: 520px;
}

.landing-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.landing-cta {
  padding: 15px 30px;
  font-size: 1rem;
}

.landing-link {
  color: var(--text);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 1px solid var(--border);
  padding-bottom: 2px;
  transition: color var(--transition), border-color var(--transition);
}
.landing-link:hover { color: var(--primary); border-color: var(--primary); }

.landing-steps { margin-bottom: 80px; }

.landing-steps-title {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 4.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.1;
  margin-bottom: 32px;
}

.landing-step-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.landing-step {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
}

.landing-step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--primary-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 18px;
}

.landing-step-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.landing-step-desc {
  font-size: 0.95rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.landing-footer {
  margin-top: auto;
  padding-top: 24px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.landing-footer a { color: inherit; text-decoration: none; }
.landing-footer a:hover { color: var(--primary); }
.landing-footer span { margin-right: auto; }

@media (max-width: 760px) {
  .landing-step-list { grid-template-columns: 1fr; }
  .landing-top { margin-bottom: 48px; }
  .landing-hero { margin-bottom: 64px; }
  .landing-inner { padding-bottom: 96px; } /* clear the theme button */
  .landing-footer span { flex-basis: 100%; }
}

/* ── Reports ── */
.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.report-stat {
  background: var(--surface);
  padding: 28px 24px;
  border-radius: var(--radius-lg);
}

.report-stat-value {
  font-size: 2.8rem;
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  margin-bottom: 8px;
  font-family: var(--font-display);
}

.report-stat-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.report-list-row {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--surface);
  padding: 18px 22px;
  margin-bottom: 6px;
  border-radius: var(--radius);
}

.report-list-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

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

.report-list-name {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 2px;
  font-family: var(--font-display);
}

.report-list-type {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
}

.report-list-count {
  text-align: right;
  flex-shrink: 0;
}

.report-list-count-num {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
  font-family: var(--font-display);
}

.report-list-count-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.report-bar-wrap {
  height: 5px;
  background: var(--border);
  margin-top: 8px;
  border-radius: 999px;
  overflow: hidden;
}

.report-bar {
  height: 100%;
  background: var(--primary);
  transition: width 0.4s ease;
  border-radius: 999px;
}

.report-feed {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.report-feed-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--surface);
  padding: 14px 22px;
  border-radius: var(--radius);
}

.report-feed-icon { font-size: 1.1rem; flex-shrink: 0; }

.report-feed-text {
  flex: 1;
  font-size: 0.85rem;
}

.report-feed-list {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-top: 1px;
}

.report-feed-time {
  font-size: 0.72rem;
  color: var(--text-muted);
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.report-empty {
  padding: 32px 0;
  font-size: 0.95rem;
  color: var(--text-muted);
  letter-spacing: 0;
}

/* ── Auth Modal ── */
.auth-sub {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.auth-error {
  background: rgba(224, 82, 82, 0.12);
  border: 1px solid var(--danger);
  color: var(--danger);
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
}

.auth-footer {
  flex-direction: column;
  align-items: stretch;
  gap: 14px;
}

.auth-submit-btn {
  width: 100%;
  justify-content: center;
  padding: 13px;
  font-size: 0.85rem;
}

.auth-switch {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.auth-link {
  background: none;
  border: none;
  color: var(--primary);
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  font-size: inherit;
  padding: 0;
  font-family: inherit;
}
.auth-link:hover { color: var(--primary-hover); }

.auth-info {
  background: var(--primary-soft);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 0.82rem;
  padding: 10px 14px;
  margin-bottom: 18px;
  border-radius: var(--radius-sm);
}

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

/* ── Wealth ── */
/* "+ New List" belongs to Goals; hide it in the other sections */
body:is([data-view="view-wealth"], [data-view="view-health"], [data-view="view-workout"]) :is(#btn-new-list, #btn-new-list-mobile) { visibility: hidden; }

.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 40px 0 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.section-heading-row .section-heading { margin: 0; padding: 0; border: 0; }

.btn-sm { padding: 7px 14px; font-size: 0.85rem; }

#view-wealth .report-stat-value { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-variant-numeric: tabular-nums; }
.wealth-remaining .report-stat-value { color: var(--primary); }
.wealth-remaining.is-negative .report-stat-value { color: var(--danger); }

.wealth-list,
.bill-group-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bill-groups {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.bill-group-total {
  display: inline-flex;
  align-items: baseline;
  gap: 10px;
  font-size: 0.9rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wealth-share {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-muted);
}

.wealth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-family: inherit;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition);
}
.wealth-row:hover { background: var(--surface-2); border-color: var(--primary); }
.bill-group-items .wealth-row { padding: 12px 20px; }

.wealth-row-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.wealth-row-name {
  font-size: 0.95rem;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.wealth-row-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.wealth-row-amount {
  flex-shrink: 0;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.wealth-per {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 2px;
}

.wealth-row-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 10px;
}

.badge-accent {
  background: rgba(255, 181, 20, 0.16);
  border-color: rgba(255, 181, 20, 0.45);
  color: var(--text);
}

/* Month switcher at the top of Wealth */
.month-switcher,
.page-heading-row { margin-top: 0; }
.month-label,
.page-title {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.month-nav { display: flex; align-items: center; gap: 8px; }
.month-nav .btn-icon { font-size: 1.3rem; line-height: 1; }

.not-due-section .archived-toggle { margin-bottom: 12px; }

.money-grid.money-grid-2 { grid-template-columns: repeat(2, 1fr); }
.wealth-row.cancelled .wealth-row-name,
.wealth-row.cancelled .wealth-row-amount {
  text-decoration: line-through;
  color: var(--text-muted);
}

/* Income / bill form pieces */
.form-subheading {
  margin: 24px 0 10px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text);
}

.money-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

select.form-input { appearance: auto; cursor: pointer; }

.form-check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
}
.form-check input { width: 18px; height: 18px; margin-top: 1px; accent-color: var(--primary); flex-shrink: 0; }
.form-check-hint { display: block; font-size: 0.8rem; font-weight: 400; color: var(--text-muted); }

.modal-footer-start { margin-right: auto; }

/* ── Health ── */
.workout-row-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}
.workout-row-date { font-size: 0.85rem; font-weight: 600; white-space: nowrap; }
.workout-row .wealth-row-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workout-row .wealth-row-main { flex: 1; }

.workout-date-label {
  margin-top: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.exercise-row { justify-content: flex-start; }
.exercise-row .wealth-row-main { flex: 1; }

.exercise-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 0.85rem;
}

.exercise-last {
  margin-top: 8px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.exercise-last:empty { display: none; }
.exercise-last strong { color: var(--text); font-weight: 600; }
.exercise-last .auth-link { margin-left: 6px; }
.exercise-last-none { font-style: italic; }

.exercise-values { margin-top: 20px; }

.time-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--text-muted);
}

#exercise-hint:empty,
#workout-copy-note:empty { display: none; }

/* ── Utility ── */
.hidden { display: none !important; }

/* ── Responsive ── */
@media (max-width: 640px) {
  .header-inner { padding: 0 16px; height: 60px; }
  .container { padding: 24px 16px 60px; }
  .app-title { font-size: 0.95rem; }
  .app-title .brand-logo { height: 28px; }
  .landing-top .brand-logo { height: 36px; }
  .btn { padding: 9px 14px; font-size: 0.85rem; }
  .mobile-new-list-btn { font-size: 1.4rem; font-weight: 500; }
  .modal-body { padding: 18px 20px; }
  .modal-footer { padding: 16px 20px; }
  .modal-header { padding: 20px 20px 16px; }
  .btn-add-activity { width: 100%; justify-content: center; }
  .report-summary { grid-template-columns: repeat(3, 1fr); }
  .detail-page-title { font-size: 1.2rem; }
  .detail-meta { flex-wrap: wrap; flex-shrink: 1; }
  .detail-progress-value { font-size: 1.3rem; }

  /* Center logo on mobile */
  .header-inner { position: relative; }
  .app-title { position: absolute; left: 50%; transform: translateX(-50%); }

  /* Hide desktop-only nav elements */
  .header-nav { display: none; }
  .header-right { display: none; }

  /* Show mobile-only elements */
  .hamburger { display: flex; }
  .mobile-new-list-btn { display: flex; }
  .mobile-menu { display: flex; }

  .money-grid { grid-template-columns: 1fr; }
  .exercise-row { gap: 12px; }
  .exercise-row .wealth-row-amount { font-size: 0.85rem; text-align: right; }
  .money-grid.money-grid-2 { grid-template-columns: 1fr; gap: 0; }
  .money-grid.money-grid-2.exercise-values { gap: 16px; }
  .month-label { font-size: 1.25rem; }
  .wealth-row { padding: 14px 16px; }
  #view-wealth .report-summary { grid-template-columns: 1fr; }
  #view-wealth .report-stat { display: flex; align-items: baseline; justify-content: space-between; padding: 18px 20px; }
  #view-wealth .report-stat-value { font-size: 1.6rem; margin-bottom: 0; order: 2; }
  .bill-group-total { flex-direction: column; align-items: flex-end; gap: 0; }
}
