/* ─── nook. design system ─── */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&display=swap');

:root {
  /* Brand */
  --sage:     #5B8C5F;
  --moss:     #2E4A33;
  --fern:     #3D6342;
  --cinnamon: #C97A4B;
  --cin-deep: #A85F35;
  --cream:    #F5EFE1;
  --oat:      #E8DFC9;
  /* Status */
  --pos: #5B8C5F;
  --neg: #C45A5A;
  --warn: #C97A4B;
  /* Activity colours */
  --c-fitness:   #4A7C8E;
  --c-personal:  #C97A4B;
  --c-masters:   #7A6BAE;
  --c-edesign:   #B07040;
  --c-wimbledon: #5B8C5F;
  --c-cfa:       #7A6BAE;
  --c-bible:     #8A6F3A;
  --c-helshoogte:#506878;
  --c-admin:     #556055;
  --c-other:     #556055;
  /* Derived from theme (overridden by JS) */
  --bg:      #0E1510;
  --card:    #172019;
  --surface: #1E2C20;
  --border:  rgba(255,255,255,0.07);
  --borders: rgba(255,255,255,0.12);
  --text:    #F0EBE0;
  --sub:     rgba(240,235,224,0.55);
  --dim:     rgba(240,235,224,0.28);
  --accent:  #C97A4B;
  --accent-s:rgba(201,122,75,0.15);
  /* Layout */
  --nav-h: 56px;
  --hdr-h: 52px;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
}

/* Light themes */
body.theme-sand, body.theme-berry {
  --bg:      #FAF3E0;
  --card:    #FFF8ED;
  --surface: #EFE8D5;
  --border:  rgba(0,0,0,0.08);
  --borders: rgba(0,0,0,0.14);
  --text:    #3A2E1F;
  --sub:     rgba(58,46,31,0.55);
  --dim:     rgba(58,46,31,0.28);
}
body.theme-berry {
  --bg:      #F9F0F4;
  --card:    #FFF5F8;
  --surface: #EDE0E6;
  --text:    #3A1F2E;
  --sub:     rgba(58,31,46,0.55);
  --dim:     rgba(58,31,46,0.28);
}
body.theme-forest {
  --bg:      #0A130B;
  --card:    #122014;
  --surface: #1A2E1C;
  --text:    #E8F0E8;
  --sub:     rgba(232,240,232,0.55);
  --dim:     rgba(232,240,232,0.28);
}
body.theme-dusk {
  --bg:      #0A1320;
  --card:    #111E30;
  --surface: #192840;
  --text:    #E8EEF8;
  --sub:     rgba(232,238,248,0.55);
  --dim:     rgba(232,238,248,0.28);
}
body.theme-slate {
  --bg:      #111318;
  --card:    #1C1F26;
  --surface: #252830;
  --text:    #E4E8F0;
  --sub:     rgba(228,232,240,0.55);
  --dim:     rgba(228,232,240,0.28);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  height: 100%;
}

body {
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

#app {
  display: flex;
  flex-direction: column;
  height: 100%;
  height: 100dvh;
}

/* ─── AUTH ─── */
#auth-screen {
  position: fixed; inset: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg);
  z-index: 1000;
  padding: 24px;
}
.auth-box {
  width: 100%; max-width: 380px;
}
.auth-wordmark {
  font-size: 32px; font-weight: 900; letter-spacing: -0.04em;
  margin-bottom: 6px; color: var(--text);
}
.auth-wordmark span { color: var(--cinnamon); }
.auth-tagline { font-size: 13px; color: var(--sub); margin-bottom: 32px; }

.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.auth-tab {
  flex: 1; padding: 10px; text-align: center;
  font-size: 13px; font-weight: 600; color: var(--sub);
  background: none; border: none; cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
}
.auth-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

.auth-field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.auth-field label { font-size: 11px; font-weight: 600; color: var(--sub); letter-spacing: 0.04em; text-transform: uppercase; }
.auth-field input {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px;
  color: var(--text); font-size: 15px; font-family: inherit;
  outline: none; transition: border-color 0.15s;
}
.auth-field input:focus { border-color: var(--accent); }
.auth-field input::placeholder { color: var(--dim); }

.auth-btn {
  width: 100%; padding: 14px; border-radius: var(--radius-sm);
  background: var(--accent); color: white;
  font-size: 15px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; margin-top: 8px;
  transition: opacity 0.15s, transform 0.1s;
}
.auth-btn:active { transform: scale(0.98); opacity: 0.9; }
.auth-btn.secondary {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border);
  margin-top: 10px;
}

.auth-error { font-size: 12px; color: var(--neg); margin-top: 8px; text-align: center; min-height: 16px; }
.auth-divider { text-align: center; font-size: 11px; color: var(--dim); margin: 16px 0; }

/* ─── INSTALL PROMPT ─── */
.install-banner {
  position: fixed; bottom: calc(var(--nav-h) + 8px + env(safe-area-inset-bottom));
  left: 12px; right: 12px;
  background: var(--card); border: 1px solid var(--borders);
  border-radius: var(--radius); padding: 14px 16px;
  display: flex; align-items: center; gap: 12px;
  z-index: 900; box-shadow: 0 8px 32px rgba(0,0,0,0.35);
  animation: slideUp 0.25s ease;
}
.install-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: linear-gradient(135deg, var(--sage), var(--fern));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.install-text { flex: 1; }
.install-text strong { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.install-text span { font-size: 11px; color: var(--sub); }
.install-actions { display: flex; gap: 8px; flex-shrink: 0; }
.install-btn {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
  border: none; cursor: pointer; font-family: inherit;
}
.install-btn.primary { background: var(--accent); color: white; }
.install-btn.dismiss { background: var(--surface); color: var(--sub); }

/* ─── TOP HEADER ─── */
.app-header {
  height: var(--hdr-h);
  display: flex; align-items: center; padding: 0 18px;
  background: var(--bg); border-bottom: 0.5px solid var(--border);
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top);
  height: calc(var(--hdr-h) + env(safe-area-inset-top));
}
.header-wordmark { font-size: 22px; font-weight: 900; letter-spacing: -0.04em; color: var(--text); }
.header-wordmark .dot { color: var(--cinnamon); }
.header-right { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.header-btn {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--surface); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: 16px; transition: background 0.15s;
}
.header-btn:active { background: var(--border); }
.sync-dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--pos);
  transition: background 0.3s;
}
.sync-dot.syncing { background: var(--warn); animation: pulse 1s infinite; }
.sync-dot.error   { background: var(--neg); }

/* ─── BOTTOM NAV ─── */
.bottom-nav {
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--bg); border-top: 0.5px solid var(--border);
  display: flex; flex-shrink: 0;
}
.nav-btn {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 3px; border: none; background: none;
  color: var(--sub); cursor: pointer;
  font-family: inherit; transition: color 0.15s;
  padding-bottom: 2px;
}
.nav-btn svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.nav-btn.active svg { fill: var(--accent); stroke: var(--accent); }
.nav-btn span { font-size: 9px; font-weight: 700; letter-spacing: 0.03em; text-transform: uppercase; }
.nav-btn.active { color: var(--accent); }

/* ─── MAIN CONTENT ─── */
.main-content { flex: 1; overflow: hidden; position: relative; }
.tab-pane { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; display: none; -webkit-overflow-scrolling: touch; }
.tab-pane.active { display: block; }

/* ─── SCROLL CONTAINER ─── */
.scroll-container { padding-bottom: 24px; }

/* ─── SECTION HEADERS ─── */
.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--sub); margin-bottom: 8px;
}
.section-block { padding: 0 16px 14px; }

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

/* ─── STATS STRIP ─── */
.stats-strip { display: grid; gap: 8px; padding: 0 16px 12px; }
.stats-strip.cols-3 { grid-template-columns: repeat(3, 1fr); }
.stats-strip.cols-2 { grid-template-columns: repeat(2, 1fr); }
.stat-tile {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius-sm); padding: 10px;
  text-align: center;
}
.stat-tile .val { font-size: 17px; font-weight: 800; }
.stat-tile .lbl { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sub); margin-top: 2px; }

/* ─── HOME TAB ─── */
.home-header { display: flex; align-items: flex-start; padding: 16px 18px 12px; }
.home-date { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sub); margin-bottom: 3px; }
.home-wordmark { font-size: 26px; font-weight: 900; letter-spacing: -0.04em; color: var(--text); }
.home-wordmark span { color: var(--cinnamon); }
.home-settings-btn {
  margin-left: auto; width: 36px; height: 36px; border-radius: 50%;
  background: var(--surface); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center; color: var(--sub);
}
.today-card {
  margin: 0 16px 16px; padding: 16px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius); position: relative; overflow: hidden;
}
.today-card::before {
  content: ''; position: absolute; right: -20px; top: -20px;
  width: 100px; height: 100px; border-radius: 50%;
  background: var(--accent); opacity: 0.07;
}
.today-eyebrow { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; }
.today-stripe { width: 3px; height: 14px; border-radius: 2px; background: var(--cinnamon); }
.today-label { font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--cinnamon); }
.today-greeting { font-size: 19px; font-weight: 800; color: var(--text); margin-bottom: 3px; }
.today-sub { font-size: 12px; color: var(--sub); margin-bottom: 12px; }

.module-group { margin-bottom: 20px; }
.module-group-label { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sub); padding: 0 18px; margin-bottom: 8px; }
.module-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 16px; }
.module-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 14px; cursor: pointer;
  position: relative; overflow: hidden;
  transition: transform 0.1s, opacity 0.1s;
  -webkit-tap-highlight-color: transparent;
}
.module-card:active { transform: scale(0.97); opacity: 0.8; }
.module-card::after {
  content: ''; position: absolute; top: -10px; right: -10px;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--mc-color, var(--accent)); opacity: 0.10;
}
.module-icon { font-size: 20px; margin-bottom: 6px; }
.module-name { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.module-stat { font-size: 10px; color: var(--sub); line-height: 1.3; }

.review-card {
  display: flex; align-items: center; gap: 14px;
  margin: 16px 16px 0; padding: 14px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.review-card:active { opacity: 0.8; }
.review-icon-wrap {
  width: 44px; height: 44px; border-radius: 12px;
  background: var(--accent-s); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.review-icon-wrap svg { width: 22px; height: 22px; stroke: var(--accent); fill: none; stroke-width: 2.2; }
.review-text strong { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.review-text span { font-size: 12px; color: var(--sub); }
.review-chevron { margin-left: auto; color: var(--sub); font-size: 12px; }

/* ─── TODAY TAB ─── */
.today-tab-header { padding: 16px 18px 12px; }
.today-tab-date { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sub); margin-bottom: 2px; }
.today-tab-greeting { font-size: 22px; font-weight: 900; color: var(--text); }

.intention-placeholder {
  display: flex; align-items: center; gap: 8px;
  padding: 14px; cursor: pointer;
  background: var(--card); border: 1px dashed var(--border);
  border-radius: var(--radius); margin: 0 16px 12px; color: var(--dim); font-size: 13px;
}
.intention-set { margin: 0 16px 12px; padding: 14px; background: var(--accent-s); border: 1px solid rgba(201,122,75,0.3); border-radius: var(--radius); }
.intention-lbl { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); margin-bottom: 4px; }
.intention-text { font-size: 13px; color: var(--text); font-style: italic; }

.schedule-list { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 0.5px solid var(--border); }
.schedule-item { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.schedule-item + .schedule-item { border-top: 0.5px solid var(--border); }
.schedule-stripe { width: 3px; border-radius: 2px; align-self: stretch; min-height: 30px; flex-shrink: 0; }
.schedule-info { flex: 1; }
.schedule-title { font-size: 13px; font-weight: 700; color: var(--text); }
.schedule-title.done { text-decoration: line-through; color: var(--sub); }
.schedule-time { font-size: 11px; color: var(--sub); margin-top: 1px; }
.status-badge {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 800; flex-shrink: 0;
}

.habits-list { border-radius: var(--radius); overflow: hidden; background: var(--card); border: 0.5px solid var(--border); }
.habit-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.habit-row + .habit-row { border-top: 0.5px solid var(--border); }
.habit-row:active { opacity: 0.7; }
.habit-emoji { font-size: 18px; }
.habit-name { flex: 1; font-size: 13px; font-weight: 700; color: var(--text); }
.habit-check {
  width: 24px; height: 24px; border-radius: 6px;
  border: 2px solid var(--border); display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.habit-check.done { background: var(--pos); border-color: var(--pos); }
.habit-check.done::after { content: '✓'; color: white; font-size: 12px; font-weight: 800; }

/* ─── PLANNER TAB ─── */
.planner-wrap { display: flex; flex-direction: column; height: 100%; position: absolute; inset: 0; overflow: hidden; }
.planner-nav { display: flex; align-items: center; height: 50px; background: var(--bg); border-bottom: 0.5px solid var(--border); flex-shrink: 0; }
.planner-nav-btn { padding: 0 14px; height: 50px; display: flex; align-items: center; gap: 5px; background: none; border: none; cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 700; color: var(--accent); }
.planner-month { flex: 1; text-align: center; font-size: 14px; font-weight: 800; color: var(--text); }
.planner-add-btn { padding: 0 16px; height: 50px; background: none; border: none; cursor: pointer; color: var(--accent); font-size: 18px; font-weight: 700; display: flex; align-items: center; }

.planner-stats { display: flex; height: 40px; border-bottom: 0.5px solid var(--border); background: var(--bg); flex-shrink: 0; }
.planner-stat { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; }
.planner-stat + .planner-stat { border-left: 0.5px solid var(--border); }
.planner-stat .val { font-size: 14px; font-weight: 800; color: var(--text); }
.planner-stat .lbl { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sub); }

.planner-body { flex: 1; display: flex; overflow: hidden; }
.time-ruler { width: 44px; flex-shrink: 0; overflow: hidden; position: relative; }
.time-ruler-inner { padding-top: 44px; /* match day header height */ }
.time-label { font-size: 7px; font-weight: 600; font-family: monospace; color: var(--dim); text-align: right; padding-right: 5px; position: absolute; right: 0; transform: translateY(-50%); }

.planner-scroll-x { flex: 1; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; }
.planner-canvas { display: flex; flex-direction: column; }
.day-headers { display: flex; position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 0.5px solid var(--borders); }
.day-hdr {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; flex-shrink: 0;
}
.day-hdr .day-name { font-size: 8px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sub); }
.day-hdr.today .day-name { color: var(--accent); }
.day-hdr .day-num {
  width: 24px; height: 24px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.day-hdr.today .day-num { background: var(--accent); color: white; }
.day-hdr.weekend .day-num { color: var(--sub); }

.planner-grid { display: flex; position: relative; }
.day-col { flex-shrink: 0; position: relative; border-left: 0.5px solid var(--border); }
.day-col.today-col { background: rgba(91,140,95,0.04); }

.hour-line { position: absolute; left: 0; right: 0; height: 0.5px; background: var(--border); pointer-events: none; }
.half-line { position: absolute; left: 0; right: 0; height: 0.5px; background: rgba(255,255,255,0.04); pointer-events: none; }

/* Block on grid */
.block-el {
  position: absolute; left: 2px; right: 2px;
  border-radius: 4px; overflow: hidden;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s, transform 0.1s;
  display: flex; flex-direction: column;
}
.block-el:active { transform: scale(0.97); }
.block-el.faded { opacity: 0.3; }
.block-el.done-block { opacity: 0.7; }
.block-fixed { /* solid fill — set by JS */ }
.block-anchored { /* striped — set by JS */ }
.block-floater { opacity: 0.5; }
.block-title { font-size: 9px; font-weight: 700; color: white; padding: 3px 5px 0; line-height: 1.3; }
.block-sub   { font-size: 7.5px; color: rgba(255,255,255,0.7); padding: 0 5px; }
.block-dur   { font-size: 7px; color: rgba(255,255,255,0.5); padding: 0 5px; margin-top: auto; padding-bottom: 2px; }
.block-done-badge { position: absolute; top: 2px; right: 3px; font-size: 10px; color: rgba(255,255,255,0.85); }

.current-time-line { position: absolute; left: 0; right: 0; pointer-events: none; z-index: 5; }
.ctl-dot { position: absolute; left: -3.5px; top: -3.5px; width: 7px; height: 7px; border-radius: 50%; background: var(--cinnamon); }
.ctl-line { position: absolute; left: 0; right: 0; height: 1px; background: rgba(201,122,75,0.4); }

/* ─── MIND TAB ─── */
.mind-chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 8px; -webkit-overflow-scrolling: touch; }
.mind-chips::-webkit-scrollbar { display: none; }
.mind-chip {
  flex-shrink: 0; background: var(--card); border: 0.5px solid var(--border);
  border-radius: 10px; padding: 8px 10px; min-width: 78px;
}
.mind-chip-icon { font-size: 14px; margin-bottom: 2px; }
.mind-chip-mins { font-size: 15px; font-weight: 800; color: var(--text); }
.mind-chip-label { font-size: 8px; color: var(--sub); line-height: 1.3; }
.mind-chip-target { font-size: 7.5px; color: var(--dim); }

.mind-hint { font-size: 9px; color: var(--sub); padding: 0 14px 6px; }

.mind-grid-container { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.mind-grid-container::-webkit-scrollbar { display: none; }
.mind-grid { padding: 0 14px 24px; min-width: 480px; }
.mind-row-headers { display: flex; margin-bottom: 6px; }
.mind-row-act-col { width: 96px; flex-shrink: 0; }
.mind-day-headers { display: flex; flex: 1; }
.mind-day-hdr { flex: 1; text-align: center; }
.mind-day-hdr .day-abbr { font-size: 8px; font-weight: 700; text-transform: uppercase; color: var(--sub); }
.mind-day-hdr .day-num  { font-size: 9.5px; font-weight: 700; color: var(--text); }
.mind-day-hdr.today-col .day-abbr { color: var(--accent); }
.mind-day-hdr.today-col .day-num  { color: var(--accent); }

.mind-row { display: flex; align-items: center; margin-bottom: 5px; }
.mind-act-info { width: 96px; flex-shrink: 0; padding-right: 5px; }
.mind-act-name { font-size: 9.5px; font-weight: 700; color: var(--text); }
.mind-act-target { font-size: 8px; color: var(--sub); }
.mind-cells { display: flex; flex: 1; gap: 4px; }
.mind-cell {
  flex: 1; height: 36px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 8.5px; font-weight: 700;
  border: 0.5px solid var(--border);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
  background: rgba(255,255,255,0.04); color: var(--dim);
  transition: background 0.15s;
}
.mind-cell.met    { background: #14532D; color: #86EFAC; }
.mind-cell.partial { background: #78350F; color: #FCD34D; }
.mind-cell:active { opacity: 0.7; }

/* ─── TRAINING TAB ─── */
.training-header { padding: 12px 14px 10px; border-bottom: 0.5px solid var(--border); }
.training-block-label { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sub); }
.training-title { font-size: 20px; font-weight: 900; color: var(--text); }
.week-tabs { display: flex; border-bottom: 0.5px solid var(--border); background: var(--bg); }
.week-tab {
  flex: 1; padding: 9px 0; text-align: center;
  font-size: 12px; font-weight: 700; color: var(--sub);
  background: none; border: none; cursor: pointer; font-family: inherit;
  border-bottom: 2px solid transparent; margin-bottom: -0.5px;
  transition: color 0.15s, border-color 0.15s;
}
.week-tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.session-row { border-bottom: 0.5px solid var(--border); }
.session-main { display: flex; align-items: flex-start; padding: 11px 14px; gap: 12px; cursor: pointer; }
.session-day-label { font-size: 8.5px; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; color: var(--dim); margin-bottom: 3px; }
.session-type-badge {
  font-size: 9px; font-weight: 800; padding: 2px 6px;
  border-radius: 4px; display: inline-block; margin-right: 5px;
}
.session-title { font-size: 12px; font-weight: 800; color: var(--text); display: inline; }
.session-meta { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.session-meta-item { font-size: 11px; color: var(--sub); }
.session-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.log-btn {
  font-size: 9.5px; font-weight: 800; padding: 5px 9px; border-radius: 7px;
  background: var(--accent-s); color: var(--accent); border: none; cursor: pointer;
  font-family: inherit;
}
.session-chevron { color: var(--sub); font-size: 12px; }
.session-logged-badge { font-size: 9px; font-weight: 800; color: var(--pos); }

/* ─── MORE / SETTINGS NAV ─── */
.more-section { margin-bottom: 0; }
.more-section-title { font-size: 10px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sub); padding: 12px 18px 6px; }
.more-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 18px;
  border-bottom: 0.5px solid var(--border); cursor: pointer;
  background: var(--card); -webkit-tap-highlight-color: transparent;
}
.more-row:first-of-type { border-top: 0.5px solid var(--border); }
.more-row:active { opacity: 0.7; }
.more-icon-wrap {
  width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; flex-shrink: 0;
}
.more-row-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; }
.more-row-chevron { color: var(--sub); font-size: 11px; }

/* ─── FINANCE VIEW ─── */
.finance-month-nav { display: flex; align-items: center; padding: 8px 16px 4px; }
.fin-nav-btn { width: 40px; height: 40px; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--sub); font-size: 16px; }
.finance-month-label { flex: 1; text-align: center; font-size: 14px; font-weight: 800; color: var(--text); }
.fin-summary { display: flex; background: var(--card); border: 0.5px solid var(--border); border-radius: var(--radius); margin: 0 16px 14px; }
.fin-tile { flex: 1; padding: 12px; text-align: center; }
.fin-tile + .fin-tile { border-left: 0.5px solid var(--border); }
.fin-tile-val { font-size: 16px; font-weight: 800; }
.fin-tile-lbl { font-size: 10px; color: var(--sub); margin-top: 2px; }
.fin-section-hdr { display: flex; align-items: center; padding: 0 16px 6px; }
.fin-section-title { font-size: 10px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; flex: 1; }
.fin-add-btn { background: none; border: none; cursor: pointer; color: var(--accent); font-size: 18px; }
.fin-entry { display: flex; align-items: center; padding: 10px 14px; }
.fin-entry + .fin-entry { border-top: 0.5px solid var(--border); }
.fin-entry-name { font-size: 13px; font-weight: 700; color: var(--text); }
.fin-entry-cat { font-size: 10px; color: var(--sub); background: var(--surface); padding: 2px 6px; border-radius: 20px; display: inline-block; margin-top: 2px; }
.fin-entry-amount { margin-left: auto; font-size: 13px; font-weight: 800; }

.savings-bar { height: 8px; background: var(--surface); border-radius: 4px; margin-top: 6px; overflow: hidden; }
.savings-fill { height: 100%; background: var(--pos); border-radius: 4px; transition: width 0.4s; }

.cat-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.cat-bar-label { font-size: 11px; color: var(--text); width: 100px; flex-shrink: 0; }
.cat-bar-track { flex: 1; height: 6px; background: var(--surface); border-radius: 3px; overflow: hidden; }
.cat-bar-fill  { height: 100%; background: var(--neg); border-radius: 3px; transition: width 0.4s; }
.cat-bar-val   { font-size: 10px; color: var(--sub); width: 55px; text-align: right; flex-shrink: 0; }

/* ─── GOALS VIEW ─── */
.goal-card {
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius); padding: 12px; cursor: pointer; margin-bottom: 8px;
}
.goal-card:active { opacity: 0.8; }
.goal-pillar-badge {
  font-size: 10px; font-weight: 700; padding: 3px 8px; border-radius: 20px;
  background: var(--accent-s); color: var(--accent); display: inline-block; margin-bottom: 6px;
}
.goal-title { font-size: 13px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.goal-why { font-size: 11px; color: var(--sub); font-style: italic; margin-bottom: 6px; }
.goal-date { font-size: 10px; color: var(--sub); }
.milestone-track { display: flex; gap: 3px; margin-top: 8px; }
.milestone-dot { flex: 1; height: 4px; border-radius: 2px; background: var(--surface); transition: background 0.2s; }
.milestone-dot.done { background: var(--accent); }

/* ─── CRM VIEW ─── */
.contact-row { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 0.5px solid var(--border); cursor: pointer; }
.contact-row:active { opacity: 0.8; }
.contact-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; font-weight: 800;
}
.contact-avatar.overdue { background: rgba(196,90,90,0.2); color: var(--neg); }
.contact-avatar.ok { background: var(--accent-s); color: var(--accent); }
.contact-info { flex: 1; min-width: 0; }
.contact-name { font-size: 13px; font-weight: 700; color: var(--text); }
.contact-meta { display: flex; gap: 6px; align-items: center; font-size: 10px; color: var(--sub); flex-wrap: wrap; }
.contact-progress { height: 3px; background: var(--surface); border-radius: 2px; margin-top: 4px; overflow: hidden; }
.contact-progress-fill { height: 100%; border-radius: 2px; transition: width 0.3s; }
.log-contact-btn {
  font-size: 10px; font-weight: 800; padding: 5px 10px; border-radius: 20px;
  background: var(--accent-s); color: var(--accent); border: none; cursor: pointer;
  flex-shrink: 0; font-family: inherit;
}

/* ─── MODALS / SHEETS ─── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  z-index: 500; display: flex; align-items: flex-end;
  animation: fadeIn 0.2s ease;
}
.modal-overlay.center { align-items: center; justify-content: center; }
.sheet {
  background: var(--card); border-radius: 18px 18px 0 0;
  width: 100%; max-height: 92vh; overflow-y: auto;
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  animation: slideUp 0.25s ease;
}
.sheet.dialog {
  border-radius: var(--radius-lg); width: calc(100% - 32px);
  max-width: 400px; max-height: 85vh;
  animation: scaleIn 0.2s ease;
}
.sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--border); margin: 10px auto 14px;
}
.sheet-header { display: flex; align-items: center; padding: 0 18px 14px; }
.sheet-title { font-size: 17px; font-weight: 800; color: var(--text); flex: 1; }
.sheet-close {
  width: 28px; height: 28px; border-radius: 50%; background: var(--surface);
  border: none; cursor: pointer; display: flex; align-items: center; justify-content: center;
  color: var(--sub); font-size: 14px;
}
.sheet-body { padding: 0 18px; }

/* Form elements */
.form-group { margin-bottom: 14px; }
.form-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--sub); display: block; margin-bottom: 6px; }
.form-input {
  width: 100%; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 11px 12px;
  color: var(--text); font-size: 14px; font-family: inherit; outline: none;
  transition: border-color 0.15s;
}
.form-input:focus { border-color: var(--accent); }
.form-input::placeholder { color: var(--dim); }
textarea.form-input { resize: vertical; min-height: 72px; }
select.form-input { appearance: none; cursor: pointer; }

.seg-picker { display: flex; gap: 0; background: var(--surface); border-radius: var(--radius-sm); padding: 3px; }
.seg-btn {
  flex: 1; padding: 8px 6px; border-radius: 8px; text-align: center;
  font-size: 11px; font-weight: 700; background: none; border: none;
  cursor: pointer; font-family: inherit; color: var(--sub);
  transition: background 0.15s, color 0.15s;
}
.seg-btn.active { background: var(--card); color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,0.2); }

.recur-day-grid { display: grid; grid-template-columns: repeat(7,1fr); gap: 4px; }
.recur-day-btn {
  padding: 8px 2px; border-radius: 7px; text-align: center;
  font-size: 10px; font-weight: 700; background: var(--surface); border: none;
  cursor: pointer; font-family: inherit; color: var(--sub);
  transition: background 0.15s, color 0.15s;
}
.recur-day-btn.active { background: var(--fern); color: white; }

.action-row { display: flex; gap: 8px; margin-top: 14px; }
.btn {
  flex: 1; padding: 13px 14px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 700; font-family: inherit;
  border: none; cursor: pointer; transition: opacity 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.98); opacity: 0.85; }
.btn-primary { background: var(--accent); color: white; }
.btn-pos     { background: var(--pos); color: white; }
.btn-neg     { background: var(--neg); color: white; }
.btn-surface { background: var(--surface); color: var(--text); }
.btn-sub     { background: var(--surface); color: var(--sub); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

.pill-options { display: flex; gap: 6px; flex-wrap: wrap; }
.pill-option {
  padding: 7px 14px; border-radius: 20px; font-size: 12px; font-weight: 700;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--sub); cursor: pointer; font-family: inherit;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pill-option.active { background: var(--accent); color: white; border-color: var(--accent); }

/* ─── INFO ROWS ─── */
.info-row { display: flex; align-items: center; gap: 10px; padding: 5px 0; }
.info-row svg { width: 16px; height: 16px; stroke: var(--sub); fill: none; flex-shrink: 0; }
.info-row span { font-size: 13px; color: var(--sub); }

/* ─── APPEARANCE ─── */
.preset-row {
  display: flex; align-items: center; gap: 14px; padding: 12px;
  background: var(--card); border: 0.5px solid var(--border);
  border-radius: var(--radius); cursor: pointer; margin-bottom: 8px;
  -webkit-tap-highlight-color: transparent;
}
.preset-row.active-preset { border-color: rgba(91,140,95,0.5); border-width: 1.5px; }
.preset-preview {
  width: 96px; height: 62px; border-radius: 10px;
  flex-shrink: 0; overflow: hidden; padding: 8px;
  border: 0.5px solid rgba(255,255,255,0.08);
}
.preset-preview-line { display: flex; align-items: center; gap: 3px; margin-bottom: 4px; }
.preset-stripe { width: 2px; height: 7px; border-radius: 1px; flex-shrink: 0; }
.preset-preview-text { font-size: 5.5px; font-weight: 500; line-height: 1; }
.preset-name { font-size: 14px; font-weight: 800; color: var(--text); }
.preset-tag  { font-size: 11px; color: var(--sub); }
.preset-check { margin-left: auto; font-size: 18px; color: var(--sage); }

.accent-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.accent-swatch { display: flex; flex-direction: column; align-items: center; gap: 5px; cursor: pointer; }
.accent-circle { width: 42px; height: 42px; border-radius: 50%; position: relative; transition: transform 0.1s; }
.accent-swatch:active .accent-circle { transform: scale(0.9); }
.accent-circle.active::after {
  content: '✓'; position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 14px; font-weight: 800;
}
.accent-swatch .name { font-size: 8.5px; color: var(--sub); }

/* ─── SETTINGS ─── */
.settings-section { margin-bottom: 0; }
.settings-row {
  display: flex; align-items: center; padding: 13px 18px; gap: 14px;
  border-bottom: 0.5px solid var(--border); background: var(--card);
}
.settings-row:first-of-type { border-top: 0.5px solid var(--border); }
.settings-label { flex: 1; font-size: 13px; font-weight: 600; color: var(--text); }
.settings-sub { font-size: 11px; color: var(--sub); margin-top: 1px; }
.toggle {
  width: 48px; height: 28px; border-radius: 14px;
  background: var(--surface); border: none; cursor: pointer; position: relative;
  transition: background 0.2s; flex-shrink: 0;
}
.toggle::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: white;
  transition: transform 0.2s; box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.toggle.on { background: var(--accent); }
.toggle.on::after { transform: translateX(20px); }

/* ─── TOAST ─── */
.toast {
  position: fixed; bottom: calc(var(--nav-h) + 12px + env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: var(--text); color: var(--bg);
  padding: 10px 18px; border-radius: 20px;
  font-size: 13px; font-weight: 700; z-index: 800;
  animation: toastIn 0.25s ease, toastOut 0.25s ease 1.8s forwards;
  white-space: nowrap;
}

/* ─── ANIMATIONS ─── */
@keyframes fadeIn  { from { opacity: 0 } to { opacity: 1 } }
@keyframes slideUp { from { transform: translateY(100%) } to { transform: translateY(0) } }
@keyframes scaleIn { from { transform: scale(0.95); opacity: 0 } to { transform: scale(1); opacity: 1 } }
@keyframes pulse   { 0%,100% { opacity: 1 } 50% { opacity: 0.5 } }
@keyframes toastIn  { from { opacity: 0; transform: translateX(-50%) translateY(10px) } to { opacity: 1; transform: translateX(-50%) translateY(0) } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(-6px) } }

/* ─── UTILITIES ─── */
.hidden { display: none !important; }
.text-accent { color: var(--accent); }
.text-pos    { color: var(--pos); }
.text-neg    { color: var(--neg); }
.text-sub    { color: var(--sub); }
.text-warn   { color: var(--warn); }
.divider     { height: 0.5px; background: var(--border); margin: 0; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.fw-800 { font-weight: 800; }
.empty-state { text-align: center; padding: 60px 16px; color: var(--sub); font-size: 13px; }

/* ─── SCROLLBAR HIDE ─── */
* { scrollbar-width: none; -ms-overflow-style: none; }
*::-webkit-scrollbar { display: none; }

/* ─── MINI CALENDAR ─── */
.mini-cal { padding: 6px 0; }
.mini-cal-nav { display: flex; align-items: center; }
.mini-cal-btn { width: 36px; height: 36px; display: flex; align-items: center; justify-content: center; background: none; border: none; cursor: pointer; color: var(--sage); font-size: 14px; border-radius: 50%; }
.mini-cal-month { flex: 1; text-align: center; font-size: 13px; font-weight: 800; color: var(--text); }
.mini-cal-weekdays { display: grid; grid-template-columns: repeat(7,1fr); margin-top: 4px; }
.mini-cal-wd { text-align: center; font-size: 10px; font-weight: 700; color: var(--sub); padding: 4px 0; }
.mini-cal-days { display: grid; grid-template-columns: repeat(7,1fr); gap: 2px; margin-top: 2px; }
.mini-cal-day { text-align: center; }
.mini-cal-day button {
  width: 30px; height: 30px; border-radius: 50%; border: none; cursor: pointer;
  font-size: 12px; font-family: inherit; background: none; color: var(--text);
  transition: background 0.15s;
}
.mini-cal-day button.today-day { background: rgba(91,140,95,0.2); color: var(--sage); font-weight: 800; }
.mini-cal-day button.selected  { background: var(--sage); color: white; font-weight: 800; }

/* Focus (Pomodoro) */
.focus-timer-ring { transform: rotate(-90deg); }
.focus-ring-bg  { fill: none; stroke: var(--surface); }
.focus-ring-fg  { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 0.5s linear; }
.focus-time-display { font-size: 42px; font-weight: 900; color: var(--text); text-align: center; letter-spacing: -0.02em; }
.focus-state-label  { font-size: 13px; font-weight: 700; color: var(--sub); text-align: center; text-transform: uppercase; letter-spacing: 0.08em; }
