:root {
  /* PenguinRidge corporate brand tokens */
  --brand-orange: #DD6B20;
  --brand-orange-light: #ED8936;
  --brand-orange-pale: #FBD38D;
  --brand-navy: #1B2A4A;
  --brand-navy-light: #2D3E5F;
  --brand-navy-dark: #111D35;
  --brand-orange-text: #C05621;
  /* App colours */
  --bg-deep: #0D1117;
  --bg-mid: #151929;
  --bg-card: rgba(255,255,255,0.04);
  --border: rgba(255,255,255,0.07);
  --border-light: rgba(255,255,255,0.12);
  --text-bright: #E8ECF4;
  --text-mid: #B8C0D0;
  --text-dim: #9CA4C0;
  --text-faint: #9098B8;
  --text-ghost: #6870A0;
  --accent: #FF6B4A;
  --accent-glow: rgba(255,107,74,0.3);
  --green: #3DD68C;
  --blue: #4AAFFF;
  --purple: #A06BFF;
  --yellow: #FFB84A;
  --pink: #FF6BB5;
  --font-display: 'Inter', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  /* Overlay variables (dark defaults) */
  --overlay-1: rgba(255,255,255,0.01);
  --overlay-2: rgba(255,255,255,0.02);
  --overlay-3: rgba(255,255,255,0.03);
  --overlay-4: rgba(255,255,255,0.04);
  --overlay-5: rgba(255,255,255,0.05);
  --overlay-6: rgba(255,255,255,0.06);
  --overlay-8: rgba(255,255,255,0.08);
  --overlay-10: rgba(255,255,255,0.1);
  --overlay-15: rgba(255,255,255,0.15);
  --overlay-20: rgba(255,255,255,0.2);
  --bg-gradient-end: #1A1535;
  --bg-surface: #1A1F35;
  --accent-light: #FF8A6A;
  --swatch-border: #fff;
  /* Glass-morphism system */
  --glass-blur: 20px;
  --glass-blur-deep: 32px;
  --glass-blur-shallow: 12px;
  --glass-bg: rgba(255,255,255,0.03);
  --glass-bg-medium: rgba(255,255,255,0.05);
  --glass-bg-strong: rgba(255,255,255,0.08);
  --glass-border: rgba(255,255,255,0.08);
  --glass-border-bright: rgba(255,255,255,0.14);
  --glass-inner-glow: inset 0 1px 0 rgba(255,255,255,0.06);
  /* Ambient lighting */
  --ambient-accent: radial-gradient(ellipse at 20% 0%, rgba(255,107,74,0.08) 0%, transparent 60%);
  --ambient-blue: radial-gradient(ellipse at 80% 0%, rgba(74,175,255,0.06) 0%, transparent 60%);
  /* Enhanced shadows */
  --shadow-card: 0 4px 24px rgba(0,0,0,0.2), 0 1px 2px rgba(0,0,0,0.1);
  --shadow-card-hover: 0 8px 40px rgba(0,0,0,0.3), 0 2px 4px rgba(0,0,0,0.15);
  --shadow-glow-accent: 0 0 30px rgba(255,107,74,0.15);
  --shadow-elevated: 0 12px 48px rgba(0,0,0,0.4);
  /* ── Design tokens ── */
  /* Spacing scale (4px base) */
  --space-2xs: 2px;
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-2xl: 24px;
  --space-3xl: 32px;
  --space-4xl: 40px;
  --space-5xl: 48px;
  /* Border radius */
  --radius-xs: 4px;
  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 10px;
  --radius-xl: 12px;
  --radius-2xl: 14px;
  --radius-3xl: 16px;
  --radius-4xl: 20px;
  --radius-pill: 9999px;
  --radius-circle: 50%;
  /* Typography scale */
  --font-2xs: 9px;
  --font-xs: 11px;
  --font-sm: 12px;
  --font-base: 13px;
  --font-md: 14px;
  --font-lg: 16px;
  --font-xl: 18px;
  --font-2xl: 22px;
  --font-3xl: 26px;
  --font-4xl: 32px;
  --font-5xl: 48px;
  /* Component sizing */
  --size-touch-min: 44px;
  --size-icon-sm: 20px;
  --size-icon-md: 24px;
  --size-check: 24px;
}

/* ── Light theme override ── */
:root[data-theme="light"] {
  --bg-deep: #F5F6FA;
  --bg-mid: #ECEDF3;
  --bg-card: rgba(0,0,0,0.02);
  --border: rgba(0,0,0,0.06);
  --border-light: rgba(0,0,0,0.10);
  --text-bright: #1A1D2E;
  --text-mid: #3A3F58;
  --text-dim: #5A6080;
  --text-faint: #5A6280;
  --text-ghost: #8890B0;
  --accent: #E85A3A;
  --accent-glow: rgba(232,90,58,0.2);
  --accent-light: #D04A2A;
  --overlay-1: rgba(0,0,0,0.01);
  --overlay-2: rgba(0,0,0,0.02);
  --overlay-3: rgba(0,0,0,0.03);
  --overlay-4: rgba(0,0,0,0.04);
  --overlay-5: rgba(0,0,0,0.05);
  --overlay-6: rgba(0,0,0,0.06);
  --overlay-8: rgba(0,0,0,0.08);
  --overlay-10: rgba(0,0,0,0.1);
  --overlay-15: rgba(0,0,0,0.15);
  --overlay-20: rgba(0,0,0,0.2);
  --bg-gradient-end: #E8E5F0;
  --bg-surface: #F0F1F6;
  --swatch-border: #333;
  /* Glass — light theme */
  --glass-bg: rgba(255,255,255,0.55);
  --glass-bg-medium: rgba(255,255,255,0.65);
  --glass-bg-strong: rgba(255,255,255,0.8);
  --glass-border: rgba(0,0,0,0.10);
  --glass-border-bright: rgba(0,0,0,0.16);
  --glass-inner-glow: inset 0 1px 0 rgba(255,255,255,0.9);
  --ambient-accent: radial-gradient(ellipse at 20% 0%, rgba(255,107,74,0.10) 0%, transparent 60%);
  --ambient-blue: radial-gradient(ellipse at 80% 0%, rgba(74,175,255,0.08) 0%, transparent 60%);
  --shadow-card: 0 4px 24px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 8px 40px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);
  --shadow-glow-accent: 0 0 30px rgba(232,90,58,0.1);
  --shadow-elevated: 0 12px 48px rgba(0,0,0,0.15);
}
[data-theme="light"] body { -webkit-font-smoothing: auto; }
/* Light mode — stronger glass structure for component visibility */
[data-theme="light"] .card { border-color: rgba(0,0,0,0.10); box-shadow: 0 2px 12px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04); }
[data-theme="light"] .stat-card { border-color: rgba(0,0,0,0.10); background: rgba(255,255,255,0.7); }
[data-theme="light"] .header-row { border-color: rgba(0,0,0,0.10); box-shadow: 0 4px 20px rgba(0,0,0,0.06); }
[data-theme="light"] .week-nav { border-color: rgba(0,0,0,0.10); background: rgba(255,255,255,0.7); }
[data-theme="light"] .task-card { border-color: rgba(0,0,0,0.08); background: rgba(255,255,255,0.6); }
[data-theme="light"] .day-column { border-color: rgba(0,0,0,0.08); background: rgba(255,255,255,0.5); }
[data-theme="light"] .user-dropdown-menu { border-color: rgba(0,0,0,0.10); box-shadow: 0 8px 32px rgba(0,0,0,0.12); }
[data-theme="light"] .filter-btn.off { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.10); }
[data-theme="light"] .journal-textarea { background: rgba(255,255,255,0.6); border-color: rgba(0,0,0,0.10); }
[data-theme="light"] .add-task-area { border-color: rgba(0,0,0,0.10); background: rgba(255,255,255,0.65); }
[data-theme="light"] .inbox-ai-section { border-color: rgba(0,0,0,0.10); background: rgba(255,255,255,0.65); }
[data-theme="light"] .inbox-item { border-color: rgba(0,0,0,0.10); background: rgba(255,255,255,0.65); }
[data-theme="light"] .modal { background: rgba(255,255,255,0.92); border-color: rgba(0,0,0,0.12); }

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

body {
  min-height: 100vh;
  background: linear-gradient(160deg, var(--bg-deep) 0%, var(--bg-mid) 40%, var(--bg-gradient-end) 100%);
  font-family: var(--font-body);
  color: var(--text-bright);
  -webkit-font-smoothing: antialiased;
}

/* Scrollbars */
::-webkit-scrollbar { height: 4px; width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--overlay-10); border-radius: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--overlay-10) transparent; }
select option { background: var(--bg-surface); color: var(--text-bright); }
input::placeholder { color: var(--text-ghost); }

/* Focus styles for accessibility — strong visible ring for keyboard navigation */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}
.tab:focus-visible, .filter-btn:focus-visible, .tag-pill:focus-visible, .month-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Page fade-in */
.container { animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Skeleton loading placeholders */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg,
    var(--overlay-4) 25%, var(--overlay-8) 50%, var(--overlay-4) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-lg);
}
.skeleton-card {
  border-radius: var(--radius-2xl); border: 1px solid var(--glass-border);
  min-height: 90px;
}
.skeleton-block { border-radius: var(--radius-3xl); min-height: 200px; }

.auth-brand { display: flex; align-items: center; justify-content: center; gap: var(--space-md); margin-bottom: var(--space-xs); }
.auth-brand-icon { height: 64px; width: auto; }
.auth-brand-text { font-size: 1.5rem; }

/* Auth page tagline */
.tagline {
  font-size: var(--font-2xs); font-weight: 700; letter-spacing: 2px;
  color: var(--text-ghost); text-transform: uppercase; margin-top: 4px;
}

/* Layout */
.container { max-width: 920px; margin: 0 auto; padding: 0 var(--space-2xl); }
.container.wide { max-width: 1800px; }

/* Header */
.header { padding-top: var(--space-lg); margin-bottom: var(--space-md); position: relative; z-index: 10; }
.header-row { display: flex; align-items: center; gap: var(--space-xl); background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur-deep)); -webkit-backdrop-filter: blur(var(--glass-blur-deep)); border: 1px solid var(--glass-border-bright); border-radius: var(--radius-2xl); padding: 14px 28px; box-shadow: var(--shadow-card-hover), var(--glass-inner-glow); }
.header-brand { flex-shrink: 0; }
.header-brand a { display: flex; align-items: center; text-decoration: none; gap: var(--space-sm); }
.brand-icon { height: 40px; width: auto; }
.brand-text { font-size: 1.1rem; font-weight: 700; font-family: var(--font-display); color: var(--text-bright); letter-spacing: -0.02em; white-space: nowrap; }
.brand-accent { color: var(--accent); }
.logo { font-size: var(--font-3xl); font-weight: 800; font-family: var(--font-display); background: linear-gradient(135deg, var(--accent), var(--yellow)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; letter-spacing: -0.5px; white-space: nowrap; }
.user-info { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.user-name { font-size: var(--font-md); color: var(--text-dim); }
.logout-btn { background: var(--overlay-4); border: 1px solid var(--border-light); color: var(--text-dim); padding: 6px 12px; border-radius: var(--radius-md); font-size: var(--font-xs); cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.logout-btn:hover { background: var(--overlay-8); color: var(--text-bright); }

/* User dropdown */
.user-dropdown { position: relative; }
.user-dropdown-trigger { display: flex; align-items: center; gap: var(--space-sm); background: var(--overlay-4); border: 1px solid var(--glass-border); color: var(--text-dim); padding: 10px 18px; border-radius: var(--radius-xl); font-size: var(--font-md); cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.user-dropdown-trigger:hover { background: var(--overlay-8); color: var(--text-bright); border-color: var(--glass-border-bright); }
.dropdown-chevron { font-size: var(--font-2xs); transition: transform 0.2s; }
.user-dropdown.open .dropdown-chevron { transform: rotate(180deg); }
.user-dropdown-menu { position: absolute; top: calc(100% + 8px); right: 0; background: var(--bg-surface); border: 1px solid var(--glass-border-bright); border-radius: var(--radius-2xl); padding: 8px; min-width: 180px; box-shadow: var(--shadow-elevated); opacity: 0; visibility: hidden; transform: translateY(-8px); transition: all 0.2s; z-index: 50; }
.user-dropdown.open .user-dropdown-menu { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-item { display: flex; align-items: center; width: 100%; padding: 10px 14px; border-radius: var(--radius-lg); font-size: var(--font-md); color: var(--text-dim); text-decoration: none; background: none; border: none; cursor: pointer; text-align: left; font-family: var(--font-body); transition: all 0.15s; }
.dropdown-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; flex-shrink: 0; margin-right: 8px; font-size: var(--font-md); }
.dropdown-item:hover { background: var(--overlay-6); color: var(--text-bright); }
.dropdown-item.logout { color: var(--accent); }
.dropdown-divider { height: 1px; background: var(--border); margin: 4px 0; }

/* Admin notification badges */
.admin-notify-dot {
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--yellow); box-shadow: 0 0 6px var(--yellow);
  display: inline-block; margin-left: -2px; flex-shrink: 0;
  animation: notifyPulse 2s ease-in-out infinite;
}
@keyframes notifyPulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.admin-notify-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-lg); font-size: var(--font-xs); font-weight: 700;
  background: rgba(255,184,74,0.2); color: var(--yellow);
  margin-left: auto;
}

/* Month nav */
.month-nav { display: flex; align-items: center; gap: var(--space-md); }
.month-btn { background: var(--overlay-4); border: 1px solid var(--glass-border); color: var(--text-dim); width: 44px; height: 44px; border-radius: var(--radius-lg); cursor: pointer; font-size: var(--font-xl); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.month-btn:hover { background: var(--overlay-10); color: var(--text-bright); transform: translateY(-1px); }
.month-label { text-align: center; }
.month-name { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); font-family: var(--font-display); }
.month-year { font-size: var(--font-sm); color: var(--text-faint); }

/* Tabs / Nav */
.tabs { display: flex; gap: var(--space-xs); flex: 1; justify-content: center; overflow-x: auto; border-bottom: none; margin-top: 0; }
.tab { padding: 10px 18px; font-size: var(--font-md); font-weight: 600; font-family: var(--font-body); cursor: pointer; background: none; border: none; color: var(--text-faint); border-bottom: 2px solid transparent; transition: all 0.2s; letter-spacing: 0.3px; white-space: nowrap; text-decoration: none; display: inline-flex; align-items: center; border-radius: 8px 8px 0 0; }
.tab:hover { color: var(--text-mid); background: var(--overlay-3); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); text-shadow: 0 0 12px rgba(255,107,74,0.3); background: rgba(255,107,74,0.04); }

/* Sub-tabs — secondary navigation within a section */
.sub-tabs { display: flex; gap: var(--space-xs); margin-bottom: 20px; }
.sub-tab { padding: 8px 16px; font-size: var(--font-base); font-weight: 600; cursor: pointer;
  background: var(--overlay-3); border: 1px solid var(--glass-border);
  color: var(--text-dim); border-radius: var(--radius-lg); text-decoration: none;
  transition: all 0.2s; min-height: 36px; display: inline-flex; align-items: center; }
.sub-tab:hover { background: var(--overlay-6); color: var(--text-mid); }
.sub-tab.active { background: rgba(255,107,74,0.12); color: var(--accent);
  border-color: rgba(255,107,74,0.25); }

.content { padding: var(--space-2xl) 0 0; }

/* Stats */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--space-md); margin-bottom: var(--space-2xl); }
.stat-card { background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border-radius: var(--radius-lg); padding: 18px var(--space-lg); border: 1px solid var(--glass-border); transition: all 0.3s; }
.stat-card:hover { border-color: var(--glass-border-bright); transform: translateY(-2px); }
.stat-label { font-size: var(--font-sm); color: var(--text-faint); letter-spacing: 1.5px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.stat-value { font-size: var(--font-4xl); font-weight: 800; font-family: var(--font-display); line-height: 1; }
.stat-sub { font-size: var(--font-sm); color: var(--text-ghost); margin-top: 4px; }

/* Cards — 3 padding tiers: compact (12px), standard (20px), spacious (28px) */
.card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-radius: var(--radius-xl); padding: var(--space-xl); border: 1px solid var(--glass-border); }
.card.compact { padding: 12px; }
.card.spacious { padding: 28px; }
.card-title { font-size: var(--font-xl); font-weight: 700; color: var(--text-mid); margin-bottom: 16px; font-family: var(--font-display); }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-xl); margin-bottom: 24px; }

/* Progress bars */
.progress-item { margin-bottom: 12px; }
.progress-header { display: flex; justify-content: space-between; margin-bottom: 4px; }
.progress-name { font-size: var(--font-md); color: var(--text-mid); }
.progress-pct { font-size: var(--font-md); font-weight: 700; }
.progress-track { height: 8px; border-radius: var(--radius-xs); background: var(--overlay-4); overflow: hidden; }
.progress-fill { height: 100%; border-radius: var(--radius-xs); transition: width 0.5s ease; box-shadow: 0 0 8px currentColor; }

/* Habit grid */
.grid-wrap { overflow-x: auto; }
.grid-wrap table { width: 100%; border-collapse: separate; border-spacing: 0; }
.grid-wrap th { padding: 6px 0; font-size: var(--font-sm); color: var(--text-faint); font-weight: 500; border-bottom: 1px solid var(--border); min-width: 28px; }
.grid-wrap th.habit-col { position: sticky; left: 0; z-index: 2; background: var(--bg-mid); padding: 8px 12px; text-align: left; font-size: var(--font-base); color: var(--text-dim); letter-spacing: 1px; font-weight: 600; }
.grid-wrap th.today { color: var(--accent); font-weight: 700; background: rgba(255,107,74,0.05); border-radius: 6px 6px 0 0; }
.grid-wrap td.habit-name-cell { position: sticky; left: 0; z-index: 1; background: var(--bg-mid); padding: 10px 12px; white-space: nowrap; cursor: pointer; transition: background 0.2s; }
.grid-wrap td.habit-name-cell:hover { background: var(--overlay-3); }
.habit-info { display: flex; align-items: center; gap: var(--space-sm); }
.habit-icon { font-size: var(--font-xl); }
.habit-name { font-size: var(--font-md); color: var(--text-mid); font-weight: 600; }
.habit-pct { font-size: var(--font-sm); color: var(--text-faint); }
.cell { text-align: center; padding: 4px 2px; }
.cell.today-col { background: rgba(255,107,74,0.03); }
.check { width: 24px; height: 24px; border-radius: var(--radius-sm); margin: 0 auto; cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; justify-content: center; font-size: var(--font-base); color: #fff; }
.check.off { background: var(--overlay-4); border: 1px solid var(--border-light); }
.check.on { border: none; }
.streak-val { font-size: var(--font-lg); font-weight: 700; font-family: var(--font-body); text-align: center; padding: 4px 8px; }

/* Task progress */
.task-progress { background: var(--overlay-3); border-radius: var(--radius-xl); padding: 16px 20px; margin-bottom: 20px; border: 1px solid var(--border); }
.task-progress-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.task-progress-label { font-size: var(--font-lg); color: var(--text-dim); }
.task-progress-value { font-size: var(--font-3xl); font-weight: 800; color: var(--text-bright); font-family: var(--font-display); }
.task-bar-track { height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.task-bar-fill { height: 100%; border-radius: 3px; background: linear-gradient(90deg, var(--green), var(--blue)); transition: width 0.4s ease; box-shadow: 0 0 12px rgba(61,214,140,0.3); }
.task-bar-sub { font-size: var(--font-base); color: var(--text-faint); margin-top: 6px; }

/* Add task row */
.add-task-row { display: flex; gap: var(--space-sm); margin-bottom: 16px; flex-wrap: wrap; }
.add-task-input { flex: 1; min-width: 200px; padding: 12px 16px; border-radius: var(--radius-xl); background: var(--overlay-3); border: 1px solid var(--glass-border); color: var(--text-bright); font-size: var(--font-lg); font-family: var(--font-body); outline: none; transition: all 0.2s; }
.add-task-input:focus { border-color: rgba(255,107,74,0.35); box-shadow: 0 0 0 3px rgba(255,107,74,0.08); background: var(--overlay-5); }
.add-task-select { padding: 12px 14px; border-radius: var(--radius-xl); background: var(--overlay-3); border: 1px solid var(--glass-border); color: var(--text-mid); font-size: var(--font-md); font-family: var(--font-body); outline: none; cursor: pointer; transition: all 0.2s; }
.add-task-select:focus { border-color: rgba(255,107,74,0.35); }
.add-task-btn { padding: 12px 28px; border-radius: var(--radius-xl); background: linear-gradient(135deg, var(--accent), var(--accent-light)); border: none; color: #fff; font-size: var(--font-lg); font-weight: 700; cursor: pointer; font-family: var(--font-body); box-shadow: 0 4px 15px var(--accent-glow); transition: all 0.2s; letter-spacing: 0.3px; }
.add-task-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 24px var(--accent-glow); }

/* Structured add-task area (weekly view) */
.add-task-area { margin-bottom: 24px; background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-3xl); padding: 20px 20px 12px; box-shadow: var(--shadow-card), var(--glass-inner-glow); }
.add-task-main { display: flex; gap: var(--space-sm); margin-bottom: 12px; align-items: center; flex-wrap: wrap; }
.add-task-selectors { display: flex; gap: var(--space-sm); flex-wrap: wrap; align-items: center; margin-bottom: 10px; }
.selector-label { font-size: var(--font-sm); color: var(--text-dim); font-weight: 700; letter-spacing: 0.3px; flex-shrink: 0; min-width: 48px; }

/* Collapsed add-task selectors — revealed on input focus */
.add-task-selectors--collapsed { max-height: 0; overflow: hidden; opacity: 0; transition: max-height 0.25s ease, opacity 0.2s ease; margin-bottom: 0; }
.add-task-selectors--collapsed.expanded { max-height: 200px; opacity: 1; }

/* Inbox */
.inbox-dictate-btn { width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--glass-border); background: var(--overlay-3); color: var(--text-mid); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.inbox-dictate-btn:hover { background: var(--overlay-6); color: var(--text-bright); }
.inbox-dictate-btn.recording { background: rgba(255,60,60,0.2); border-color: rgba(255,60,60,0.5); color: #ff3c3c; animation: pulse-record 1.5s ease-in-out infinite; }
@keyframes pulse-record { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,60,60,0.3); } 50% { box-shadow: 0 0 0 8px rgba(255,60,60,0); } }

.inbox-ai-section { margin-bottom: 24px; background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border); border-radius: var(--radius-3xl); overflow: hidden; }
.inbox-ai-toggle { padding: 16px 20px; cursor: pointer; font-size: var(--font-base); font-weight: 600; color: var(--text-mid); list-style: none; }
.inbox-ai-toggle::-webkit-details-marker { display: none; }
.inbox-ai-toggle::before { content: '\25B6'; display: inline-block; margin-right: 8px; font-size: var(--font-sm); transition: transform 0.2s; }
details[open] > .inbox-ai-toggle::before { transform: rotate(90deg); }
.inbox-ai-body { padding: 0 20px 20px; }
.inbox-ai-textarea { width: 100%; min-height: 120px; max-height: 300px; resize: vertical; padding: 12px; border-radius: var(--radius-lg); background: var(--overlay-4); border: 1px solid var(--glass-border); color: var(--text-bright); font-size: var(--font-base); font-family: var(--font-body); margin-bottom: 10px; }
.inbox-ai-textarea:focus { border-color: rgba(255,107,74,0.35); outline: none; }
.inbox-ai-directive { width: 100%; padding: 10px 12px; border-radius: var(--radius-lg); background: var(--overlay-4); border: 1px solid var(--glass-border); color: var(--text-bright); font-size: var(--font-sm); font-family: var(--font-body); margin-bottom: 12px; }
.inbox-ai-directive:focus { border-color: rgba(255,107,74,0.35); outline: none; }
.inbox-ai-actions { display: flex; gap: var(--space-sm); align-items: center; }
.inbox-ai-status { font-size: var(--font-sm); color: var(--text-dim); }

.inbox-list { display: flex; flex-direction: column; gap: 8px; }
.inbox-item { display: flex; justify-content: space-between; align-items: center; gap: var(--space-md); padding: 14px 16px; border-radius: var(--radius-xl); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); box-shadow: var(--shadow-card); transition: all 0.2s; }
.inbox-item:hover { border-color: var(--glass-border-bright); }
.inbox-item-text { flex: 1; font-size: var(--font-base); color: var(--text-bright); line-height: 1.4; }
.inbox-item-meta { display: flex; gap: var(--space-sm); align-items: center; flex-shrink: 0; }
.inbox-item-time { font-size: var(--font-xs); color: var(--text-dim); }
.inbox-triage-btn { padding: 6px 14px; border-radius: var(--radius-3xl); background: rgba(74,175,255,0.15); border: 1px solid rgba(74,175,255,0.3); color: var(--blue); font-size: var(--font-sm); font-weight: 600; cursor: pointer; transition: all 0.2s; }
.inbox-triage-btn:hover { background: rgba(74,175,255,0.25); }
.inbox-delete-btn { padding: 6px 14px; border-radius: var(--radius-3xl); background: transparent; border: 1px solid var(--glass-border); color: var(--text-dim); font-size: var(--font-sm); cursor: pointer; transition: all 0.2s; }
.inbox-delete-btn:hover { border-color: rgba(255,60,60,0.4); color: #ff5c5c; }

.inbox-badge { display: inline-block; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: var(--font-2xs); font-weight: 700; line-height: 18px; text-align: center; vertical-align: middle; margin-left: 4px; }
.inbox-badge:empty { display: none; }

.inbox-empty { text-align: center; padding: 40px 20px; }
.inbox-triage-text { font-size: var(--font-base); color: var(--text-bright); padding: 12px; background: var(--overlay-4); border-radius: var(--radius-lg); margin-bottom: 16px; line-height: 1.4; }

/* Filter bar — standardised container for filter pill groups */
.filter-bar {
  display: flex; gap: var(--space-md); align-items: center; flex-wrap: wrap;
  padding: 10px 14px; margin-bottom: 16px;
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow));
  -webkit-backdrop-filter: blur(var(--glass-blur-shallow));
  border: 1px solid var(--glass-border); border-radius: var(--radius-2xl);
}
.filter-bar .filters { margin-bottom: 0; }

/* Filters */
.filters { display: flex; gap: var(--space-sm); margin-bottom: 16px; flex-wrap: wrap; }
.filter-btn { padding: 10px 16px; border-radius: var(--radius-4xl); font-size: var(--font-base); font-weight: 600; cursor: pointer; transition: all 0.2s; text-transform: capitalize; letter-spacing: 0.3px; min-height: 44px; }
.filter-btn.off { background: var(--overlay-3); color: var(--text-dim); border: 1px solid var(--glass-border); }
.filter-btn.off:hover { background: var(--overlay-6); color: var(--text-mid); }
.filter-btn.on { background: rgba(255,107,74,0.15); color: var(--accent); border: 1px solid rgba(255,107,74,0.3); box-shadow: 0 0 12px rgba(255,107,74,0.08); }

/* Compact filter pills for tag/theme view filters — smaller, distinct from status filters */
.filter-group-label { font-size: var(--font-xs); color: var(--text-dim); font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase; padding-left: 4px; }
.filters--compact { gap: 6px; }
.filters--compact .filter-btn { padding: 5px 12px; font-size: var(--font-sm); font-weight: 500; min-height: 32px; border-radius: var(--radius-3xl); letter-spacing: 0; }

/* Tag filter pills */
.tag-filters { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.tag-pill { padding: 10px 14px; border-radius: var(--radius-3xl); font-size: var(--font-base); font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid; min-height: 44px; }
.tag-pill.off { opacity: 0.5; }
.tag-pill.on { opacity: 1; }

/* Task items */
.task-item { display: flex; align-items: center; gap: var(--space-md); padding: 12px 16px; border-radius: var(--radius-lg); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); box-shadow: var(--shadow-card); transition: all 0.2s; margin-bottom: 6px; }
.task-item.done { opacity: 0.5; }
.task-item.dragging { opacity: 0.4; transform: rotate(2deg); }
.task-check { width: 24px; height: 24px; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all 0.2s; flex-shrink: 0; }
.task-check.off { border: 2px solid; background: transparent; }
.task-check.on { border: none; color: #fff; font-size: var(--font-md); }
.task-text { flex: 1; font-size: var(--font-lg); font-weight: 500; }
.task-text.done-text { text-decoration: line-through; color: var(--text-faint); }
.task-cat { font-size: var(--font-sm); color: var(--text-faint); margin-top: 2px; }
.task-tags { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: 3px; }
.task-tag-badge { padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--font-2xs); font-weight: 600; white-space: nowrap; }
.task-priority { padding: 4px 10px; border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.task-delete { background: none; border: none; color: var(--text-ghost); cursor: pointer; font-size: var(--font-lg); padding: 4px; transition: color 0.2s; line-height: 1; }
.task-delete:hover { color: var(--accent); }
.task-drag { cursor: grab; color: var(--text-ghost); font-size: var(--font-md); padding: 4px; user-select: none; }
.task-drag:active { cursor: grabbing; }
.task-empty { text-align: center; padding: 40px 20px; color: var(--text-faint); font-size: var(--font-md); line-height: 1.6; }

/* Weekly view */
.week-nav { display: flex; align-items: center; gap: var(--space-sm); background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); border-radius: var(--radius-2xl); padding: 6px 8px; box-shadow: var(--shadow-card); }
.week-label { font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); font-family: var(--font-display); min-width: 220px; text-align: center; }
.week-today-btn { padding: 8px 18px; border-radius: var(--radius-lg); font-size: var(--font-base); font-weight: 700; cursor: pointer; background: rgba(255,107,74,0.12); border: 1px solid rgba(255,107,74,0.25); color: var(--accent); font-family: var(--font-body); transition: all 0.2s; letter-spacing: 0.3px; }
.week-today-btn:hover { background: rgba(255,107,74,0.22); transform: translateY(-1px); }
.journal-lock-btn { background: none; border: 1px solid var(--border-light); border-radius: var(--radius-md); padding: 4px 10px; cursor: pointer; font-size: var(--font-md); opacity: 0.5; transition: all 0.2s; }
.journal-lock-btn:hover { opacity: 1; border-color: var(--accent); }

.weekly-grid { display: grid; grid-template-columns: minmax(100px, 130px) repeat(7, 1fr) minmax(130px, 170px); gap: var(--space-sm); margin-top: 20px; }
.weekly-grid-label { display: flex; flex-direction: column; justify-content: flex-start; padding: 14px 6px 8px; gap: var(--space-sm); }
.weekly-grid-title { font-size: var(--font-base); font-weight: 700; color: var(--text-dim); letter-spacing: 0.3px; }
.weekly-grid-label .filters { margin-bottom: 0; gap: var(--space-xs); flex-direction: column; }
.weekly-grid-label .filter-btn { padding: 6px 12px; font-size: var(--font-sm); border-radius: var(--radius-md); }
.filter-section-label { font-size: var(--font-2xs); font-weight: 700; color: var(--text-ghost); letter-spacing: 1.5px; text-transform: uppercase; }
.filter-spacer { height: 1px; background: var(--border); margin: 4px 0; }
.scope-toggle-btn {
  padding: 5px 12px; font-size: var(--font-xs); font-weight: 600; border-radius: var(--radius-md);
  border: 1px solid var(--border-light); background: var(--overlay-3);
  color: var(--text-dim); cursor: pointer; transition: all 0.15s;
  font-family: var(--font-body); text-transform: uppercase; letter-spacing: 0.5px;
  margin-top: 4px;
}
.scope-toggle-btn.on {
  background: var(--accent); color: #fff; border-color: var(--accent);
}
.scope-toggle-btn:hover:not(.on) { border-color: var(--text-dim); }
.day-column { background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border-radius: var(--radius-3xl); border: 1px solid var(--glass-border); padding: 14px 10px 10px; min-height: 220px; transition: all 0.25s; box-shadow: var(--shadow-card), var(--glass-inner-glow); }
.day-column:hover { border-color: var(--glass-border-bright); }
.day-column.drag-over { border-color: var(--accent); background: rgba(255,107,74,0.05); box-shadow: var(--shadow-card), 0 0 24px rgba(255,107,74,0.1); }
.day-column.today { border-color: rgba(255,107,74,0.3); box-shadow: var(--shadow-card), 0 0 28px rgba(255,107,74,0.1), inset 0 1px 0 rgba(255,107,74,0.08); background: linear-gradient(180deg, rgba(255,107,74,0.04) 0%, var(--glass-bg-medium) 100%); }
.day-column.past { opacity: 0.65; }
.day-column.past:hover { opacity: 0.85; }
.day-column.backlog { background: var(--glass-bg); border-style: dashed; }
.day-header { text-align: center; margin-bottom: 12px; padding: 4px 0 10px; border-bottom: 1px solid var(--glass-border); }
.day-name { font-size: var(--font-md); font-weight: 600; color: var(--text-dim); letter-spacing: 0.5px; }
.day-date { font-size: var(--font-3xl); font-weight: 800; font-family: var(--font-display); color: var(--text-mid); margin-top: 2px; }
.day-header.today .day-name { color: var(--accent); text-shadow: 0 0 12px rgba(255,107,74,0.3); }
.day-header.today .day-date { color: var(--accent); text-shadow: 0 0 16px rgba(255,107,74,0.25); }
.day-task-list { min-height: 50px; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent; }
.day-task-list::-webkit-scrollbar { width: 4px; }
.day-task-list::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: var(--radius-xs); }

/* Compact task card for weekly columns */
.task-card { padding: 8px 10px; border-radius: var(--radius-lg); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); margin-bottom: 5px; cursor: grab; transition: all 0.2s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.08); }
.task-card:hover { border-color: var(--glass-border-bright); box-shadow: 0 4px 16px rgba(0,0,0,0.18); transform: translateY(-1px); }
.task-card.dragging { opacity: 0.4; transform: rotate(2deg) scale(1.02); }
.task-card.done { opacity: 0.45; }
.task-card-body { display: flex; align-items: flex-start; gap: var(--space-xs); }
.task-card-text { font-size: var(--font-base); color: var(--text-mid); word-break: break-word; line-height: 1.35; }
.task-card-text.done-text { text-decoration: line-through; color: var(--text-faint); }
.task-desc-icon { font-size: var(--font-2xs); opacity: 0.4; flex-shrink: 0; margin-top: 2px; }
.task-card-meta { display: flex; gap: var(--space-xs); flex-wrap: wrap; margin-top: 4px; align-items: center; }
.task-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 5px; gap: var(--space-xs); }
.task-priority-label { font-size: var(--font-2xs); font-weight: 800; opacity: 0.6; letter-spacing: 0.3px; flex-shrink: 0; }
.task-card-check { width: 24px; height: 24px; border-radius: var(--radius-sm); cursor: pointer; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: var(--font-2xs); transition: all 0.2s; position: relative; }
.task-card-check::before { content: ''; position: absolute; top: -8px; left: -8px; right: -8px; bottom: -8px; }
.task-card-check.off { border: 2px solid; background: transparent; }
.task-card-check.on { border: none; color: #fff; }
.task-card-delete { background: none; border: none; color: var(--text-ghost); cursor: pointer; font-size: var(--font-md); padding: 2px; opacity: 0; transition: all 0.2s; border-radius: var(--radius-xs); flex-shrink: 0; }
.task-card:hover .task-card-delete { opacity: 0.7; }
.task-card-delete:hover { color: var(--accent); opacity: 1 !important; }
.task-card-priority { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }

/* Circle tracker */
.circle-container { display: flex; flex-direction: column; align-items: center; }
.circle-legend { display: flex; flex-wrap: wrap; gap: var(--space-md); justify-content: center; margin-top: 12px; }
.legend-item { display: flex; align-items: center; gap: var(--space-sm); }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; }
.legend-text { font-size: var(--font-sm); color: var(--text-dim); }

/* Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px 0; }
.modal { background: var(--glass-bg-strong); backdrop-filter: blur(var(--glass-blur-deep)); -webkit-backdrop-filter: blur(var(--glass-blur-deep)); border-radius: var(--radius-4xl); padding: 28px; width: 90%; max-width: 380px; border: 1px solid var(--glass-border-bright); box-shadow: var(--shadow-elevated), var(--glass-inner-glow); max-height: calc(100vh - 40px); overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--glass-border) transparent; }
.modal::-webkit-scrollbar { width: 6px; }
.modal::-webkit-scrollbar-track { background: transparent; }
.modal::-webkit-scrollbar-thumb { background: var(--glass-border); border-radius: 3px; }
.pills-expand-btn { background: none; border: 1px solid var(--border-light); color: var(--text-faint); font-size: var(--font-xs); padding: 3px 10px; border-radius: var(--radius-xl); cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.pills-expand-btn:hover { color: var(--text-dim); border-color: var(--accent)40; }
.selector-manage-link { font-size: var(--font-xs); color: var(--text-ghost); text-decoration: none; margin-left: 6px; font-weight: 400; letter-spacing: 0; text-transform: none; }
.selector-manage-link:hover { color: var(--accent); text-decoration: underline; }
.modal h3 { margin: 0 0 20px; color: var(--text-bright); font-family: var(--font-display); font-size: var(--font-2xl); font-weight: 700; }
.modal-input { width: 100%; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); background: var(--overlay-4); color: var(--text-bright); font-size: var(--font-lg); font-family: var(--font-body); outline: none; margin-bottom: 16px; }
.modal-textarea { width: 100%; padding: 12px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); background: var(--overlay-4); color: var(--text-bright); font-size: var(--font-md); font-family: var(--font-body); outline: none; margin-bottom: 16px; resize: vertical; min-height: 56px; max-height: 160px; line-height: 1.5; }
.modal-textarea:focus { border-color: var(--accent); }
.modal-label { font-size: var(--font-base); color: var(--text-dim); margin-bottom: 8px; letter-spacing: 1px; }
.color-picker { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: 12px; }
.color-swatch { width: 28px; height: 28px; border-radius: var(--radius-md); cursor: pointer; border: 2px solid transparent; transition: all 0.2s; }
.color-swatch.selected { border-color: var(--swatch-border); }
.icon-picker { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: 20px; }
.icon-opt { width: 34px; height: 34px; border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; font-size: var(--font-xl); cursor: pointer; background: var(--overlay-3); border: 1px solid transparent; transition: all 0.2s; }
.icon-opt.selected { background: var(--overlay-10); border-color: var(--overlay-20); }
.modal-actions { display: flex; gap: var(--space-sm); }
.modal-cancel { flex: 1; padding: 14px; border-radius: var(--radius-xl); border: 1px solid var(--border-light); background: transparent; color: var(--text-dim); font-size: var(--font-lg); font-weight: 600; cursor: pointer; font-family: var(--font-body); }
.modal-confirm { flex: 1; padding: 14px; border-radius: var(--radius-xl); border: none; background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; font-size: var(--font-lg); font-weight: 700; cursor: pointer; font-family: var(--font-body); box-shadow: 0 4px 15px var(--accent-glow); }

/* Settings */
.settings-section { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); }
.settings-tab-content { animation: fadeIn 0.2s ease; }
.settings-card { margin-bottom: 16px; }
.settings-hint { font-size: var(--font-md); color: var(--text-dim); margin-bottom: 12px; line-height: 1.5; }
.settings-label { font-size: var(--font-sm); font-weight: 600; color: var(--text-faint); letter-spacing: 0.5px; text-transform: uppercase; margin-bottom: 8px; }
.settings-title { font-size: var(--font-md); color: var(--text-dim); letter-spacing: 0.3px; font-weight: 700; margin-bottom: 12px; }
.settings-row { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.settings-btn { padding: 10px 20px; border-radius: var(--radius-lg); font-size: var(--font-md); font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.settings-btn.export { background: rgba(74,175,255,0.1); border: 1px solid rgba(74,175,255,0.2); color: var(--blue); }
.settings-btn.import { background: rgba(61,214,140,0.1); border: 1px solid rgba(61,214,140,0.2); color: var(--green); }
.settings-btn:hover { transform: translateY(-1px); }

/* Cancellation survey */
.cancel-survey-options { display: flex; flex-direction: column; gap: 8px; }
.cancel-survey-option { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: var(--radius-lg); background: var(--overlay-3); border: 1px solid var(--glass-border); cursor: pointer; font-size: var(--font-base); color: var(--text-mid); transition: all 0.15s; }
.cancel-survey-option:hover { border-color: var(--glass-border-bright); color: var(--text-bright); }
.cancel-survey-option input[type="radio"] { accent-color: var(--accent); width: 16px; height: 16px; cursor: pointer; }

/* Manage habits */
.manage-habits { margin-top: 20px; }
.manage-label { font-size: var(--font-md); color: var(--text-dim); margin-bottom: 10px; letter-spacing: 1px; }
.habit-tags { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.habit-tag { display: flex; align-items: center; gap: var(--space-sm); padding: 8px 12px; border-radius: var(--radius-lg); background: var(--overlay-3); border: 1px solid var(--border); }
.habit-tag-name { font-size: var(--font-md); color: var(--text-mid); }
.habit-tag-dot { width: 8px; height: 8px; border-radius: 2px; }
.habit-tag-x { background: none; border: none; color: var(--text-ghost); cursor: pointer; font-size: var(--font-md); padding: 0 2px; line-height: 1; }
.habit-tag-x:hover { color: var(--accent); }

/* Quick tasks */
.quick-task { display: flex; align-items: center; gap: var(--space-sm); padding: 8px 0; border-bottom: 1px solid var(--overlay-3); }
.quick-check { width: 18px; height: 18px; border-radius: 5px; cursor: pointer; border: 2px solid; flex-shrink: 0; }
.quick-text { font-size: var(--font-md); color: var(--text-mid); }

/* Section headers */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; flex-wrap: wrap; gap: var(--space-md); }
.section-title { font-size: var(--font-3xl); font-weight: 800; font-family: var(--font-display); color: var(--text-bright); letter-spacing: -0.3px; }
.section-hint { font-size: var(--font-base); color: var(--text-faint); }

.add-habit-btn { padding: 10px 20px; border-radius: var(--radius-lg); border: none; background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; font-size: var(--font-md); font-weight: 700; cursor: pointer; font-family: var(--font-body); box-shadow: 0 4px 15px var(--accent-glow); transition: all 0.2s; }
.add-habit-btn:hover { transform: translateY(-1px); }

/* Button size tiers — sm (8px 16px), md (12px 24px), lg (16px 32px) */
.btn-sm { padding: 8px 16px; font-size: var(--font-base); border-radius: var(--radius-lg); }
.btn-md { padding: 12px 24px; font-size: var(--font-md); border-radius: var(--radius-xl); }
.btn-lg { padding: 16px 32px; font-size: var(--font-lg); border-radius: var(--radius-xl); }

.circle-card { max-width: 500px; margin: 0 auto; }

/* Toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); padding: 14px 28px; border-radius: var(--radius-xl); font-size: var(--font-lg); font-weight: 600; font-family: var(--font-body); z-index: 200; animation: toastIn 0.3s ease, toastOut 0.3s ease 2.2s; opacity: 0; pointer-events: none; }
.toast.show { opacity: 1; pointer-events: auto; }
.toast.success { background: rgba(61,214,140,0.2); color: var(--green); border: 1px solid rgba(61,214,140,0.3); }
.toast.warn { background: rgba(255,107,74,0.2); color: var(--accent); border: 1px solid rgba(255,107,74,0.3); }
.toast-undo-btn { background: none; border: 1px solid currentColor; border-radius: var(--radius-sm); padding: 4px 12px; color: inherit; font-weight: 700; font-size: var(--font-sm); cursor: pointer; margin-left: 12px; transition: background 0.2s; }
.toast-undo-btn:hover { background: rgba(255,255,255,0.15); }
.toast.info { background: rgba(74,175,255,0.2); color: var(--blue); border: 1px solid rgba(74,175,255,0.3); }

/* ── Offline indicator ── */
.offline-indicator {
  position: fixed;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 4px 14px;
  background: rgba(255,184,74,0.12);
  border: 1px solid rgba(255,184,74,0.25);
  border-radius: var(--radius-4xl);
  font-size: var(--font-xs);
  font-weight: 600;
  color: #FFB84A;
  z-index: 9999;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  font-family: var(--font-body);
}
.offline-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #FFB84A;
  animation: offlinePulse 2s ease-in-out infinite;
}
.offline-pending {
  margin-left: 4px;
  padding: 1px 6px;
  background: rgba(255,184,74,0.2);
  border-radius: var(--radius-md);
  font-size: var(--font-2xs);
}
@keyframes offlinePulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } to { opacity: 1; transform: translateX(-50%) translateY(0); } }
@keyframes toastOut { from { opacity: 1; } to { opacity: 0; } }

/* Auth forms */
.auth-container { max-width: 380px; margin: 80px auto 0; padding: 0 24px; }
.auth-card { background: var(--glass-bg-strong); backdrop-filter: blur(var(--glass-blur-deep)); -webkit-backdrop-filter: blur(var(--glass-blur-deep)); border-radius: var(--radius-4xl); padding: 36px 28px; border: 1px solid var(--glass-border-bright); box-shadow: var(--shadow-elevated), var(--glass-inner-glow); }
.auth-card h2 { font-family: var(--font-display); font-size: var(--font-3xl); font-weight: 700; margin-bottom: 8px; color: var(--text-bright); }
.auth-card .subtitle { font-size: var(--font-lg); color: var(--text-dim); margin-bottom: 24px; }
.auth-field { margin-bottom: 16px; }
.auth-field label { display: block; font-size: var(--font-base); color: var(--text-dim); letter-spacing: 1px; font-weight: 600; margin-bottom: 6px; text-transform: uppercase; }
.auth-field input { width: 100%; padding: 14px 16px; border-radius: var(--radius-xl); border: 1px solid var(--border-light); background: var(--overlay-4); color: var(--text-bright); font-size: var(--font-lg); font-family: var(--font-body); outline: none; }
.auth-field input:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow), 0 0 20px rgba(255,107,74,0.1); outline: none; }
.auth-submit { width: 100%; padding: 16px; border-radius: var(--radius-xl); border: none; background: linear-gradient(135deg, var(--accent), var(--accent-light)); color: #fff; font-size: var(--font-lg); font-weight: 700; cursor: pointer; font-family: var(--font-body); box-shadow: 0 4px 15px var(--accent-glow); transition: all 0.2s; margin-top: 8px; }
.auth-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-glow); }
.auth-link { text-align: center; margin-top: 16px; font-size: var(--font-md); color: var(--text-dim); }
.auth-link a { color: var(--accent); text-decoration: none; }
.auth-link a:hover { text-decoration: underline; }
.auth-error { background: rgba(255,107,74,0.1); border: 1px solid rgba(255,107,74,0.2); color: var(--accent); border-radius: var(--radius-lg); padding: 12px 16px; font-size: var(--font-md); margin-bottom: 16px; display: none; }
.auth-info { background: rgba(74,175,255,0.1); border: 1px solid rgba(74,175,255,0.2); color: var(--blue); border-radius: var(--radius-lg); padding: 12px 16px; font-size: var(--font-md); margin-bottom: 16px; }
.auth-divider { display: flex; align-items: center; gap: var(--space-md); margin: 20px 0; }
.auth-divider-line { flex: 1; height: 1px; background: var(--border-light); }
.auth-divider-text { font-size: var(--font-base); color: var(--text-faint); text-transform: uppercase; letter-spacing: 1px; }
.google-login-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: var(--space-sm); padding: 14px 16px; border-radius: var(--radius-xl); border: 1px solid var(--border-light); background: var(--overlay-4); color: var(--text-bright); font-size: var(--font-lg); font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.google-login-btn:hover { background: var(--overlay-8); border-color: var(--border-light); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.google-icon { flex-shrink: 0; }
[data-theme="light"] .google-login-btn { background: #fff; border-color: #dadce0; color: #3c4043; }
[data-theme="light"] .google-login-btn:hover { background: #f8f9fa; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

/* Tags management page */
.tag-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.tag-item { display: flex; align-items: center; gap: var(--space-md); padding: 12px 16px; border-radius: var(--radius-lg); background: var(--bg-card); border: 1px solid var(--border); }
.tag-color-dot { width: 14px; height: 14px; border-radius: var(--radius-xs); flex-shrink: 0; }
.tag-name { font-size: var(--font-md); color: var(--text-mid); font-weight: 600; flex: 1; }
.tag-edit-btn { background: none; border: none; color: var(--text-dim); cursor: pointer; font-size: var(--font-sm); padding: 4px 8px; transition: color 0.2s; }
.tag-edit-btn:hover { color: var(--text-bright); }
.tag-delete-btn { background: none; border: none; color: var(--text-ghost); cursor: pointer; font-size: var(--font-lg); padding: 4px; transition: color 0.2s; }
.tag-delete-btn:hover { color: var(--accent); }

/* Tag multiselect in add task */
.tag-select-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; position: relative; }
.tag-select-pill { padding: 6px 14px; border-radius: var(--radius-4xl); font-size: var(--font-sm); font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid; letter-spacing: 0.2px; }

/* Theme select (single-select for new task) */
.theme-select-row { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; position: relative; }
.theme-select-pill { padding: 6px 14px; border-radius: var(--radius-4xl); font-size: var(--font-sm); font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid; letter-spacing: 0.2px; }

/* Pill search input */
.pill-search-input { width: 90px; padding: 5px 10px; border-radius: var(--radius-4xl); font-size: var(--font-sm); font-family: var(--font-body); background: var(--overlay-6); border: 1px solid var(--border-light); color: var(--text-bright); outline: none; transition: border-color 0.2s; }
.pill-search-input:focus { border-color: rgba(255,107,74,0.35); width: 120px; }
.pill-search-results { display: flex; gap: 5px; flex-wrap: wrap; }

/* Theme filter pills */
.theme-filters { display: flex; gap: var(--space-sm); flex-wrap: wrap; }

/* Theme badge on task cards */
.task-theme-badge { padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--font-2xs); font-weight: 700; letter-spacing: 0.3px; white-space: nowrap; }

/* Scope badge on task cards */
.task-scope-badge { font-size: var(--font-xs); line-height: 1; }

/* Tag group view (by-tag page) */
.tag-group { margin-bottom: 12px; border-radius: var(--radius-xl); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); box-shadow: var(--shadow-card); overflow: hidden; }
.tag-group-header { display: flex; align-items: center; gap: var(--space-sm); padding: 14px 16px; cursor: pointer; transition: background 0.2s; user-select: none; }
.tag-group-header:hover { background: var(--overlay-2); }
.tag-group-color { width: 12px; height: 12px; border-radius: var(--radius-xs); flex-shrink: 0; }
.tag-group-name { font-size: var(--font-lg); font-weight: 700; color: var(--text-mid); font-family: var(--font-display); flex: 1; }
.tag-group-count { font-size: var(--font-base); color: var(--text-faint); font-weight: 600; }
.tag-group-copy { background: none; border: none; cursor: pointer; font-size: var(--font-md); padding: 2px 6px; opacity: 0.4; transition: opacity 0.2s; }
.tag-group-copy:hover { opacity: 1; }
.tag-group-chevron { font-size: var(--font-2xs); color: var(--text-faint); }
.tag-group-tasks { padding: 4px 8px 12px; }
.tag-group-empty { font-size: var(--font-md); color: var(--text-ghost); padding: 12px 16px; }
.task-date-badge { font-size: var(--font-sm); color: var(--text-dim); background: var(--overlay-4); padding: 3px 8px; border-radius: 5px; }

/* Tag create input (inline new-tag) */
.tag-create-input { width: 90px; padding: 5px 10px; border-radius: var(--radius-xl); font-size: var(--font-sm); font-family: var(--font-body); background: var(--overlay-6); border: 1px solid var(--border-light); color: var(--text-bright); outline: none; }

/* Theme toggle button */
.theme-toggle-btn { background: var(--overlay-4); border: 1px solid var(--border-light); border-radius: var(--radius-lg); width: 38px; height: 38px; font-size: var(--font-xl); cursor: pointer; transition: all 0.2s; display: flex; align-items: center; justify-content: center; padding: 0; }
.theme-toggle-btn:hover { background: var(--overlay-8); }

/* ── Edit task modal ── */
.task-card-text { cursor: pointer; }
.task-card-text:hover { color: var(--text-bright); }
.edit-modal-pills { display: flex; gap: var(--space-sm); flex-wrap: wrap; margin-bottom: 16px; }
.edit-modal-pill { padding: 6px 14px; border-radius: var(--radius-xl); font-size: var(--font-base); font-weight: 600; cursor: pointer; transition: all 0.2s; border: 1px solid; user-select: none; }
.edit-modal-date-row { display: flex; gap: var(--space-sm); align-items: center; margin-bottom: 16px; }
.edit-modal-date-row .modal-input { margin-bottom: 0; flex: 1; }
.edit-modal-clear-date { padding: 8px 14px; border-radius: var(--radius-lg); border: 1px solid var(--border-light); background: transparent; color: var(--text-dim); font-size: var(--font-base); font-weight: 600; cursor: pointer; font-family: var(--font-body); white-space: nowrap; transition: all 0.2s; }
.edit-modal-clear-date:hover { color: var(--accent); border-color: rgba(255,107,74,0.3); }
.edit-modal-danger { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); text-align: center; }
.edit-modal-delete { padding: 10px 22px; border-radius: var(--radius-lg); border: 1px solid rgba(255,107,74,0.2); background: transparent; color: var(--text-dim); font-size: var(--font-md); font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; }
.edit-modal-delete:hover { background: rgba(255,107,74,0.1); color: var(--accent); }
.edit-modal-delete.confirming { background: rgba(255,107,74,0.15); color: var(--accent); border-color: rgba(255,107,74,0.4); }
.edit-modal-date-row input[type="date"] { color-scheme: dark; }
:root[data-theme="light"] .edit-modal-date-row input[type="date"] { color-scheme: light; }

/* Required hint for tag select */
.required-hint { font-size: var(--font-sm); color: var(--text-ghost); font-style: italic; }
.tag-select-required { outline: 1px solid rgba(255,107,74,0.4); border-radius: var(--radius-md); padding: 2px; }

/* Habit strip above weekly grid */
.habit-strip { margin-bottom: 8px; }
.habit-strip-header { font-size: var(--font-sm); font-weight: 600; color: var(--text-faint); letter-spacing: 1.5px; text-transform: uppercase; margin-bottom: 6px; }
.habit-strip-grid { display: grid; grid-template-columns: minmax(100px, 140px) repeat(7, 1fr) minmax(140px, 180px); gap: var(--space-sm); }
.habit-strip-row { display: contents; }
.habit-strip-name { display: flex; align-items: center; gap: var(--space-sm); padding: 5px 10px; font-size: var(--font-base); color: var(--text-dim); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border); }
.habit-strip-icon { font-size: var(--font-lg); flex-shrink: 0; }
.habit-strip-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.habit-strip-cell { display: flex; align-items: center; justify-content: center; background: var(--bg-card); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 4px 0; }
.habit-strip-backlog { background: var(--overlay-1); border-color: transparent; }
.habit-strip-check { width: 24px; height: 24px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.15s ease; display: flex; align-items: center; justify-content: center; font-size: var(--font-sm); color: #fff; }
.habit-strip-check.off { background: var(--overlay-3); border: 1px solid var(--border-light); }
.habit-strip-check.on { border: none; }
.habit-strip-check:hover { transform: scale(1.1); }

/* Inline quick-add input at bottom of day columns */
.inline-add-wrapper { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--glass-border); }
.inline-add-input { width: 100%; padding: 8px 10px; border-radius: var(--radius-md); background: var(--overlay-3); border: 1px solid var(--glass-border); color: var(--text-mid); font-size: var(--font-base); font-family: var(--font-body); outline: none; transition: all 0.2s; }
.inline-add-input:focus { border-color: rgba(255,107,74,0.3); background: var(--overlay-5); box-shadow: 0 0 0 2px rgba(255,107,74,0.06); }
.inline-add-input::placeholder { color: var(--text-ghost); }
.inline-add-prompt { font-size: var(--font-sm); color: var(--text-ghost); text-align: center; padding: 6px; cursor: pointer; transition: all 0.2s; border-radius: var(--radius-sm); }
.inline-add-prompt:hover { color: var(--text-dim); background: var(--overlay-3); }

/* Day header — clickable for target-day selection */
.day-header { cursor: pointer; transition: background 0.2s; }
.day-header:hover { background: var(--overlay-2); border-radius: var(--radius-md); }
.day-header.target-day .day-name, .day-header.target-day .day-date { color: var(--blue); }

/* Target day label near the top input */
.target-day-label { font-size: var(--font-base); font-weight: 700; color: var(--blue); background: rgba(74,175,255,0.1); border: 1px solid rgba(74,175,255,0.2); padding: 8px 16px; border-radius: var(--radius-lg); white-space: nowrap; align-self: center; letter-spacing: 0.3px; box-shadow: 0 0 12px rgba(74,175,255,0.08); }

/* Color shuffle button */
.color-shuffle-btn { width: 28px; height: 28px; border-radius: var(--radius-md); border: 1px solid var(--border-light); background: var(--overlay-4); cursor: pointer; font-size: var(--font-md); display: flex; align-items: center; justify-content: center; transition: all 0.2s; }
.color-shuffle-btn:hover { background: var(--overlay-8); transform: scale(1.1); }

/* ── Journal ── */

/* Journal focus mode — minimalist writing experience */
.journal-focus-btn {
  padding: 8px 14px; border-radius: var(--radius-lg); font-size: var(--font-md); cursor: pointer;
  background: var(--overlay-4); border: 1px solid var(--glass-border);
  color: var(--text-dim); transition: all 0.2s;
}
.journal-focus-btn:hover { background: var(--overlay-8); color: var(--text-bright); }
.journal-focus-btn.active { background: rgba(255,107,74,0.15); color: var(--accent); border-color: rgba(255,107,74,0.3); }

body.journal-focus .journal-sidebar { display: none; }
body.journal-focus #journalStats { display: none; }
body.journal-focus .journal-meta-row { display: none; }
body.journal-focus .story-panel,
body.journal-focus .analysis-panel,
body.journal-focus .story-panel-saved-list { display: none; }
body.journal-focus .journal-context { display: none; }
body.journal-focus .sub-tabs { display: none; }
body.journal-focus .journal-layout { grid-template-columns: 1fr; }
body.journal-focus .journal-textarea { min-height: 250px; }
body.journal-focus .journal-textarea.small { min-height: 120px; }

.journal-layout { display: grid; grid-template-columns: 1fr 300px; gap: var(--space-xl); }
.journal-editor-col { display: flex; flex-direction: column; gap: var(--space-lg); }
.journal-sidebar { display: flex; flex-direction: column; gap: var(--space-lg); }
.journal-date-label { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); font-family: var(--font-display); min-width: 200px; text-align: center; }
.journal-meta-row { display: flex; gap: var(--space-xl); flex-wrap: wrap; }
.journal-meta-group { flex: 1; min-width: 180px; }
.journal-mood-picker { display: flex; gap: var(--space-sm); }
.journal-mood-btn { width: 44px; height: 44px; border-radius: var(--radius-xl); border: 2px solid var(--border-light); background: var(--overlay-3); cursor: pointer; font-size: var(--font-2xl); display: flex; flex-direction: column; align-items: center; justify-content: center; transition: all 0.2s; position: relative; gap: 0; }
.journal-mood-btn:hover { transform: scale(1.1); }
.journal-mood-btn.selected { border-width: 2px; transform: scale(1.15); box-shadow: 0 0 12px var(--accent-glow); }
.journal-mood-label { font-size: var(--font-2xs); color: var(--text-faint); text-align: center; margin-top: 2px; }
.journal-energy-bar { display: flex; gap: var(--space-xs); align-items: flex-end; }
.journal-energy-seg { flex: 1; border-radius: var(--radius-sm); background: var(--overlay-4); border: 1px solid var(--border-light); cursor: pointer; transition: all 0.2s; }
.journal-energy-seg.active { border-color: transparent; }
.journal-energy-seg:hover { opacity: 0.8; }
.journal-section { }
.journal-section-label { font-size: var(--font-md); color: var(--text-dim); margin-bottom: 8px; font-weight: 600; }
.journal-section-label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.journal-section-label-row .journal-section-label { margin-bottom: 0; }
.journal-section-label-actions { display: flex; align-items: center; gap: 6px; }
.journal-idea-btn { font-size: var(--font-sm); padding: 4px 10px; border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-dim); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.journal-idea-btn:hover { color: var(--accent); border-color: var(--accent); }
.journal-idea-btn.loading { opacity: 0.6; pointer-events: none; }
.journal-tidy-btn { font-size: var(--font-sm); padding: 4px 10px; border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-dim); cursor: pointer; transition: all 0.2s; white-space: nowrap; }
.journal-tidy-btn:hover { color: var(--accent); border-color: var(--accent); }
.journal-tidy-btn.loading { opacity: 0.6; pointer-events: none; }
.journal-dictate-btn { font-size: var(--font-sm); padding: 4px 8px; border-radius: var(--radius-md); background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-dim); cursor: pointer; transition: all 0.2s; line-height: 1; }
.journal-dictate-btn:hover { color: var(--accent); border-color: var(--accent); }
.journal-dictate-btn.recording { color: #FF6B4A; border-color: #FF6B4A; animation: dictate-pulse 1.2s ease-in-out infinite; }
@keyframes dictate-pulse { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
.journal-idea-box { display: flex; align-items: flex-start; gap: var(--space-sm); padding: 12px 14px; margin-bottom: 8px; border-radius: var(--radius-lg); background: var(--overlay-4); border: 1px solid var(--glass-border); font-size: var(--font-md); color: var(--text-main); line-height: 1.5; animation: fadeIn 0.3s ease; }
.journal-idea-text { flex: 1; }
.journal-idea-dismiss { background: none; border: none; color: var(--text-faint); cursor: pointer; font-size: var(--font-lg); padding: 0 2px; line-height: 1; }
.journal-idea-dismiss:hover { color: var(--text-dim); }
.journal-textarea { width: 100%; min-height: 200px; padding: 18px; border-radius: var(--radius-xl); background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); color: var(--text-bright); font-size: var(--font-lg); font-family: var(--font-body); line-height: 1.7; resize: none; overflow: hidden; outline: none; transition: all 0.2s; }
.journal-textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-glow), 0 0 20px rgba(255,107,74,0.05); }
.journal-textarea.small { min-height: 80px; }
.journal-footer { display: flex; justify-content: space-between; align-items: center; }
.journal-word-count { font-size: var(--font-base); color: var(--text-faint); }
.journal-save-status { font-size: var(--font-base); color: var(--green); transition: opacity 0.3s; }
.journal-context { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border-radius: var(--radius-xl); padding: 16px; border: 1px solid var(--glass-border); }
.journal-context-title { font-size: var(--font-base); color: var(--text-dim); letter-spacing: 1px; font-weight: 600; margin-bottom: 8px; text-transform: uppercase; }
.journal-context-row { font-size: var(--font-md); color: var(--text-mid); padding: 5px 0; }

/* ── Story Transformation ── */
.journal-footer-actions { display: flex; align-items: center; gap: var(--space-md); }
.story-transform-btn { background: none; border: 1px solid var(--glass-border); color: var(--text-mid); font-size: var(--font-base); padding: 6px 14px; border-radius: var(--radius-md); cursor: pointer; transition: all 0.2s; font-family: var(--font-body); }
.story-transform-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--overlay-4); }

.story-panel { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border-radius: var(--radius-xl); border: 1px solid var(--glass-border); padding: 20px; margin-top: 16px; animation: storyFadeIn 0.3s ease; }
@keyframes storyFadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.story-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: var(--space-sm); }
.story-panel-title { font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); }
.story-panel-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.story-action-btn { background: var(--overlay-4); border: 1px solid var(--glass-border); color: var(--text-mid); font-size: var(--font-sm); padding: 5px 10px; border-radius: var(--radius-sm); cursor: pointer; transition: all 0.2s; font-family: var(--font-body); }
.story-action-btn:hover { background: var(--overlay-8); color: var(--text-bright); border-color: var(--accent); }
.story-close-btn { font-size: var(--font-xl); line-height: 1; padding: 3px 8px; }
.story-panel-content { font-size: var(--font-lg); line-height: 1.8; color: var(--text-mid); }
.story-panel-content p { margin-bottom: 12px; }
.story-panel-content p:last-child { margin-bottom: 0; }
.story-panel-moral { margin-top: 16px; padding: 12px 16px; background: var(--overlay-4); border-radius: var(--radius-md); font-size: var(--font-md); color: var(--text-bright); font-style: italic; border-left: 3px solid var(--accent); }
.story-panel-moral strong { color: var(--accent); font-style: normal; }

.story-loading { display: flex; align-items: center; gap: var(--space-md); padding: 24px 0; color: var(--text-dim); font-size: var(--font-md); }
.story-loading-spinner { width: 24px; height: 24px; border: 3px solid var(--overlay-8); border-top-color: var(--accent); border-radius: 50%; animation: storySpin 0.8s linear infinite; }
@keyframes storySpin { to { transform: rotate(360deg); } }

.story-error { color: var(--accent); font-size: var(--font-md); padding: 12px 0; }
.story-error p { margin-bottom: 8px; }

/* Story modal styles */
.story-style-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.story-style-option { display: flex; align-items: flex-start; gap: var(--space-md); padding: 12px; border-radius: var(--radius-lg); border: 1px solid var(--glass-border); cursor: pointer; transition: all 0.2s; background: var(--overlay-2); }
.story-style-option:hover { border-color: var(--accent); background: var(--overlay-4); }
.story-style-option input[type="radio"] { margin-top: 3px; accent-color: var(--accent); }
.story-style-icon { font-size: var(--font-3xl); }
.story-style-info { display: flex; flex-direction: column; gap: 2px; }
.story-style-label { font-size: var(--font-md); font-weight: 600; color: var(--text-bright); }
.story-style-desc { font-size: var(--font-sm); color: var(--text-dim); line-height: 1.4; }

/* Saved stories list */
.story-panel-saved-list { margin-top: 16px; padding: 16px; background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border-radius: var(--radius-xl); border: 1px solid var(--glass-border); }
.story-saved-title { font-size: var(--font-base); color: var(--text-dim); letter-spacing: 1px; font-weight: 600; margin-bottom: 10px; text-transform: uppercase; }
.story-saved-item { padding: 12px; border-radius: var(--radius-md); border: 1px solid var(--glass-border); background: var(--overlay-2); margin-bottom: 8px; transition: all 0.2s; }
.story-saved-item:hover { border-color: var(--overlay-8); }
.story-saved-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.story-saved-style { font-size: var(--font-base); font-weight: 600; color: var(--text-bright); }
.story-saved-date { font-size: var(--font-sm); color: var(--text-faint); }
.story-saved-preview { font-size: var(--font-base); color: var(--text-dim); line-height: 1.4; margin-bottom: 8px; }
.story-saved-actions { display: flex; gap: var(--space-sm); }

/* ── Analysis ── */
.analysis-btn { background: linear-gradient(135deg, var(--purple), #8B5CF6); color: #fff; border: none; border-radius: var(--radius-md); padding: 8px 14px; font-size: var(--font-base); font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.2s; white-space: nowrap; }
.analysis-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(160,107,255,0.3); }
.analysis-all-btn { width: 100%; padding: 10px 16px; font-size: var(--font-md); }
.analysis-panel { background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur)); border: 1px solid var(--glass-border-bright); border-radius: var(--radius-2xl); padding: 20px; margin-top: 16px; }
.analysis-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.analysis-panel-title { font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); }
.analysis-panel-actions { display: flex; gap: var(--space-sm); }
.analysis-panel-content { font-size: var(--font-md); line-height: 1.7; color: var(--text-mid); }
.analysis-section { margin-bottom: 16px; }
.analysis-section:last-child { margin-bottom: 0; }
.analysis-section-title { font-size: var(--font-base); font-weight: 700; color: var(--text-bright); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px; }
.analysis-section p { margin: 0; }
.analysis-tags { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.analysis-tag { background: var(--overlay-8); color: var(--purple); padding: 4px 10px; border-radius: var(--radius-xl); font-size: var(--font-sm); font-weight: 600; }
.analysis-highlight { background: var(--overlay-4); border-radius: var(--radius-lg); padding: 12px 16px; border-left: 3px solid var(--purple); }
.analysis-closing { font-style: italic; color: var(--text-bright); padding-top: 8px; border-top: 1px solid var(--border); }
.analysis-suggestions { margin: 0; padding-left: 20px; }
.analysis-suggestions li { margin-bottom: 6px; }
.analysis-suggestions li:last-child { margin-bottom: 0; }

/* ── Analysis Status Banner ── */
.analysis-status-banner { padding: 10px 14px; border-radius: var(--radius-md); margin-bottom: 14px; font-size: 0.88rem; color: var(--text-mid); background: var(--bg-card); border: 1px solid var(--border); }
.analysis-status-incremental { background: rgba(99, 179, 237, 0.08); border-color: rgba(99, 179, 237, 0.25); color: var(--accent); }
.analysis-status-uptodate { background: rgba(72, 187, 120, 0.08); border-color: rgba(72, 187, 120, 0.25); color: #48bb78; }
.analysis-empty-hint { color: var(--text-faint); font-style: italic; padding: 12px 0; }

/* ── Analyses Collection Page ── */
.analysis-card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); border-radius: var(--radius-2xl); padding: 20px; transition: all 0.2s; cursor: default; }
.analysis-card:hover { border-color: var(--purple); box-shadow: 0 4px 20px rgba(160,107,255,0.15); transform: translateY(-2px); }
.analysis-card-meta { font-size: var(--font-sm); color: var(--text-faint); margin-bottom: 8px; }
.analysis-card-summary { font-size: var(--font-md); color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }

/* ── Stories Collection Page ── */
.stories-header-actions { display: flex; gap: var(--space-sm); align-items: center; }
.stories-filter-select { background: var(--glass-bg); border: 1px solid var(--glass-border); color: var(--text-mid); font-size: var(--font-base); padding: 7px 12px; border-radius: var(--radius-md); font-family: var(--font-body); cursor: pointer; outline: none; min-width: 140px; }
.stories-filter-select:focus { border-color: var(--accent); }
.stories-filter-select option { background: var(--bg-deep); color: var(--text-mid); }

.stories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: var(--space-lg); margin-top: 16px; }
.story-card { background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--glass-border); border-radius: var(--radius-2xl); padding: 20px; transition: all 0.2s; cursor: default; }
.story-card:hover { border-color: var(--accent); box-shadow: var(--shadow-card-hover); transform: translateY(-2px); }
.story-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.story-card-style { font-size: var(--font-sm); color: var(--text-dim); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.story-card-date { font-size: var(--font-sm); color: var(--text-faint); }
.story-card-title { font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); margin-bottom: 8px; line-height: 1.3; }
.story-card-preview { font-size: var(--font-md); color: var(--text-dim); line-height: 1.6; margin-bottom: 12px; }
.story-card-moral { font-size: var(--font-base); color: var(--accent); font-style: italic; margin-bottom: 12px; padding: 8px 12px; background: var(--overlay-4); border-radius: var(--radius-sm); border-left: 3px solid var(--accent); }
.story-card-actions { display: flex; gap: var(--space-sm); }

.story-spotlight { background: linear-gradient(135deg, var(--glass-bg-strong), var(--glass-bg)); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--accent); border-radius: var(--radius-3xl); padding: 28px; margin-bottom: 20px; animation: storyFadeIn 0.4s ease; box-shadow: var(--shadow-glow-accent); }
.story-spotlight-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.story-spotlight-badge { font-size: var(--font-md); font-weight: 700; color: var(--accent); letter-spacing: 0.5px; }
.story-spotlight-title { font-size: var(--font-2xl); font-weight: 800; color: var(--text-bright); margin-bottom: 16px; line-height: 1.3; }
.story-spotlight-content { font-size: var(--font-lg); line-height: 1.8; color: var(--text-mid); }
.story-spotlight-content p { margin-bottom: 12px; }
.story-spotlight-content p:last-child { margin-bottom: 0; }
.story-spotlight-moral { margin-top: 16px; padding: 14px 18px; background: var(--overlay-4); border-radius: var(--radius-lg); font-size: var(--font-lg); color: var(--text-bright); font-style: italic; border-left: 3px solid var(--accent); }
.story-spotlight-moral strong { color: var(--accent); font-style: normal; }
.story-spotlight-meta { margin-top: 16px; font-size: var(--font-base); color: var(--text-faint); }

.stories-empty { text-align: center; padding: 60px 20px; color: var(--text-dim); }
.stories-empty-icon { font-size: var(--font-5xl); margin-bottom: 16px; }
.stories-empty h3 { font-size: var(--font-xl); color: var(--text-bright); margin-bottom: 8px; }
.stories-empty p { font-size: var(--font-md); line-height: 1.6; max-width: 400px; margin: 0 auto 20px; }

.stories-load-more { text-align: center; padding: 20px; }

.story-reader-modal { max-width: 600px; }
.story-reader-body { max-height: 70vh; overflow-y: auto; }
.story-reader-meta { font-size: var(--font-base); color: var(--text-faint); margin-bottom: 16px; }
.story-reader-text { font-size: var(--font-lg); line-height: 1.8; color: var(--text-mid); }
.story-reader-text p { margin-bottom: 12px; }
.story-reader-text p:last-child { margin-bottom: 0; }
.story-reader-moral { margin-top: 16px; padding: 14px 18px; background: var(--overlay-4); border-radius: var(--radius-lg); font-size: var(--font-lg); color: var(--text-bright); font-style: italic; border-left: 3px solid var(--accent); }
.story-reader-moral strong { color: var(--accent); font-style: normal; }

.journal-cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.journal-cal-header { font-size: var(--font-xs); color: var(--text-faint); text-align: center; padding: 4px 0; font-weight: 600; }
.journal-cal-day { aspect-ratio: 1; border-radius: var(--radius-md); display: flex; flex-direction: column; align-items: center; justify-content: center; cursor: pointer; font-size: var(--font-base); color: var(--text-dim); transition: all 0.15s; background: var(--overlay-2); border: 1px solid transparent; }
.journal-cal-day:hover { background: var(--overlay-6); }
.journal-cal-day.has-entry { border-color: var(--green); }
.journal-cal-day.selected { background: var(--accent); color: #fff; border-color: var(--accent); }
.journal-cal-day.today { font-weight: 700; color: var(--accent); }
.journal-cal-day.other-month { opacity: 0.3; }
.journal-cal-mood { font-size: var(--font-sm); margin-top: 1px; }
.mood-trend-row { display: flex; align-items: center; gap: var(--space-sm); padding: 3px 0; }
.mood-trend-date { font-size: var(--font-sm); color: var(--text-faint); width: 40px; }
.mood-trend-emoji { font-size: var(--font-lg); }
.mood-trend-bar { flex: 1; height: 6px; border-radius: 3px; }

/* ── PIN Lock Overlay ── */
.pin-lock-overlay {
  min-height: calc(100vh - 160px);
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-4xl);
  background: var(--glass-bg-medium);
  backdrop-filter: blur(var(--glass-blur)); -webkit-backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-card), var(--glass-inner-glow);
}
.pin-lock-card { text-align: center; max-width: 320px; width: 90%; background: var(--glass-bg-medium); backdrop-filter: blur(var(--glass-blur-deep)); -webkit-backdrop-filter: blur(var(--glass-blur-deep)); border: 1px solid var(--glass-border); border-radius: 24px; padding: 40px; box-shadow: var(--shadow-elevated); position: relative; z-index: 1; }
.pin-lock-icon { font-size: var(--font-5xl); margin-bottom: 16px; }
.pin-lock-title {
  font-family: var(--font-display); font-size: var(--font-3xl); font-weight: 700;
  color: var(--text-bright); margin: 0 0 8px;
}
.pin-lock-hint { font-size: var(--font-lg); color: var(--text-dim); margin: 0 0 28px; }
.pin-dots { display: flex; gap: var(--space-lg); justify-content: center; margin-bottom: 20px; }
.pin-dot {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid var(--border-light); background: transparent;
  transition: all 0.2s;
}
.pin-dot.filled {
  background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 8px var(--accent-glow);
}
.pin-error { font-size: var(--font-md); color: var(--accent); min-height: 20px; margin-bottom: 12px; }
.pin-numpad {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm);
  max-width: 240px; margin: 0 auto;
}
.pin-key {
  width: 64px; height: 52px; border-radius: var(--radius-xl);
  background: var(--overlay-4); border: 1px solid var(--border-light);
  color: var(--text-bright); font-size: var(--font-2xl); font-weight: 600;
  font-family: var(--font-body);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: all 0.15s; user-select: none;
  margin: 0 auto; padding: 0;
}
.pin-key:hover { background: var(--overlay-8); }
.pin-key:active { transform: scale(0.95); }
.pin-key.empty { visibility: hidden; }
.pin-key.del { font-size: var(--font-3xl); color: var(--text-dim); }

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-8px); }
  40%, 80% { transform: translateX(8px); }
}
.pin-dots.shake { animation: shake 0.4s ease; }

/* ── Settings: PIN Toggle & Form ── */
.pin-toggle-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0; margin-bottom: 12px;
}
.pin-toggle-label { font-size: var(--font-lg); color: var(--text-mid); font-weight: 600; }
.pin-toggle {
  width: 44px; height: 24px; border-radius: var(--radius-xl);
  background: var(--overlay-8); border: 1px solid var(--border-light);
  cursor: pointer; position: relative; transition: all 0.3s;
  padding: 0;
}
.pin-toggle.on { background: rgba(61,214,140,0.3); border-color: rgba(61,214,140,0.4); }
.pin-toggle-thumb {
  position: absolute; top: 2px; left: 2px;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--text-dim); transition: all 0.3s;
}
.pin-toggle.on .pin-toggle-thumb { left: 22px; background: var(--green); }
.pin-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.pin-form { max-width: 280px; }
.pin-form-error { font-size: var(--font-md); color: var(--accent); min-height: 18px; margin-top: 6px; }

/* ── Week View Mode Pills ── */
.week-mode-pills { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.week-mode-pill {
  flex: 1; min-width: 120px; padding: 14px 16px; border-radius: var(--radius-xl);
  border: 1px solid var(--glass-border); background: var(--overlay-3);
  color: var(--text-dim); font-size: var(--font-md); font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: all 0.2s;
  display: flex; flex-direction: column; align-items: center; gap: var(--space-xs);
}
.week-mode-pill:hover { background: var(--overlay-6); color: var(--text-mid); border-color: var(--glass-border-bright); }
.week-mode-pill.active { background: rgba(255,107,74,0.12); color: var(--accent); border-color: rgba(255,107,74,0.3); box-shadow: 0 0 12px rgba(255,107,74,0.08); }
.week-mode-desc { font-size: var(--font-sm); font-weight: 400; color: var(--text-ghost); }
.week-mode-pill.active .week-mode-desc { color: rgba(255,107,74,0.7); }

/* ── Catch Up Button ── */
.catch-up-btn {
  padding: 8px 18px; border-radius: var(--radius-lg); font-size: var(--font-base); font-weight: 700;
  cursor: pointer; background: rgba(61,214,140,0.12); border: 1px solid rgba(61,214,140,0.25);
  color: var(--green); font-family: var(--font-body); transition: all 0.2s; letter-spacing: 0.3px;
  white-space: nowrap;
}
.catch-up-btn:hover { background: rgba(61,214,140,0.22); transform: translateY(-1px); }

/* ── About / Changelog ── */
.about-layout { max-width: 640px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--space-xl); }
.about-version-card { text-align: center; padding: 40px 24px; }
.about-logo { font-family: var(--font-display); font-size: var(--font-4xl); font-weight: 700; color: var(--text-bright); }
.about-logo-img { height: 48px; width: auto; display: inline-block; }
.about-version { font-size: var(--font-lg); color: var(--accent); font-weight: 600; margin-top: 8px; letter-spacing: 1px; }
.about-tagline { font-size: var(--font-lg); color: var(--text-dim); margin-top: 6px; }
.changelog-entry { padding: 16px 0; border-bottom: 1px solid var(--border); }
.changelog-entry:last-child { border-bottom: none; }
.changelog-header { display: flex; align-items: center; gap: var(--space-md); margin-bottom: 12px; cursor: pointer; }
.changelog-header:hover { opacity: 0.8; }
.changelog-toggle { font-size: var(--font-2xs); color: var(--text-faint); transition: transform 0.2s; }
.changelog-entry.collapsed .changelog-list { display: none; }
.changelog-entry.collapsed .changelog-toggle { transform: rotate(-90deg); }
.changelog-version { font-weight: 700; font-size: var(--font-xl); color: var(--text-bright); }
.changelog-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: var(--space-sm); }
.changelog-item { display: flex; align-items: center; gap: var(--space-sm); font-size: var(--font-lg); color: var(--text-mid); }
.changelog-badge {
  display: inline-block; font-size: var(--font-sm); font-weight: 600; text-transform: uppercase;
  padding: 3px 10px; border-radius: var(--radius-md); letter-spacing: 0.5px; flex-shrink: 0;
}
.changelog-badge.feature { background: rgba(74,175,255,0.15); color: var(--blue); }
.changelog-badge.fix { background: rgba(61,214,140,0.15); color: var(--green); }
.changelog-badge.improvement { background: rgba(160,107,255,0.15); color: var(--purple); }

/* ── Help page ── */
.help-layout { max-width: 720px; display: flex; flex-direction: column; gap: var(--space-lg); }
.help-card { padding: 24px; }
.help-card-header { display: flex; align-items: center; gap: var(--space-sm); margin-bottom: 14px; }
.help-icon { font-size: var(--font-2xl); }
.help-content { font-size: var(--font-lg); color: var(--text-mid); line-height: 1.7; }
.help-content p { margin: 0 0 10px; }
.help-content p:last-child { margin-bottom: 0; }
.help-content strong { color: var(--text-bright); font-weight: 700; }

/* ── Measured Habits ── */
.habit-type-toggle { display: flex; gap: var(--space-xs); margin-bottom: 12px; }
.type-pill {
  flex: 1; padding: 8px 14px; border-radius: var(--radius-md); border: 1px solid var(--border-light);
  background: transparent; color: var(--text-dim); font-size: var(--font-md); font-weight: 600;
  cursor: pointer; text-align: center; font-family: var(--font-body); transition: all 0.2s;
}
.type-pill.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.habit-value-cell {
  width: 22px; height: 22px; border-radius: 5px; display: flex; align-items: center;
  justify-content: center; font-size: var(--font-2xs); font-weight: 600; cursor: pointer;
  background: var(--overlay-4); border: 1px solid var(--border-light); transition: all 0.15s;
  margin: 0 auto;
}
.habit-value-cell:hover { border-color: var(--text-dim); }
.habit-unit-badge {
  font-size: var(--font-2xs); color: var(--text-faint); font-weight: 500; margin-left: 4px;
  background: var(--overlay-5); padding: 1px 5px; border-radius: var(--radius-xs);
}
.habit-strip-measured {
  width: 20px; height: 20px; border-radius: 5px; display: flex; align-items: center;
  justify-content: center; font-size: var(--font-2xs); font-weight: 600; cursor: pointer;
  background: var(--overlay-3); border: 1px solid var(--border-light); transition: all 0.15s;
}
.habit-strip-measured:hover { border-color: var(--text-dim); }
.habit-popup {
  background: var(--bg-mid); border: 1px solid var(--border-light); border-radius: var(--radius-xl);
  padding: 12px 16px; min-width: 180px; box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.habit-popup-title { font-size: var(--font-lg); font-weight: 600; color: var(--text-bright); margin-bottom: 2px; }
.habit-popup-target { font-size: var(--font-base); color: var(--text-dim); margin-bottom: 8px; }
.habit-popup-input {
  width: 100%; padding: 8px 10px; border-radius: var(--radius-md); border: 1px solid var(--border-light);
  background: var(--bg-deep); color: var(--text-bright); font-size: var(--font-md); font-family: var(--font-body);
  outline: none; box-sizing: border-box;
}
.habit-popup-input:focus { border-color: var(--accent); }
.habit-popup-actions { display: flex; gap: var(--space-sm); margin-top: 8px; }
.habit-popup-save, .habit-popup-clear {
  flex: 1; padding: 8px; border-radius: var(--radius-md); border: none; font-size: var(--font-md);
  font-weight: 600; cursor: pointer; font-family: var(--font-body); transition: all 0.15s;
}
.habit-popup-save { background: var(--accent); color: #fff; }
.habit-popup-save:hover { filter: brightness(1.1); }
.habit-popup-clear { background: var(--overlay-5); color: var(--text-dim); }
.habit-popup-clear:hover { background: var(--overlay-10); }

/* ── Landing Page ── */
.landing-hero {
  text-align: center; padding: 80px 24px 60px; max-width: 640px; margin: 0 auto;
  min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  position: relative;
}
.landing-hero.hero-bg { margin: 0 -24px; padding: 80px 48px 60px; max-width: none; }
.landing-hero .landing-hero-content { max-width: 640px; position: relative; z-index: 2; }
.landing-logo {
  font-size: var(--font-5xl); font-weight: 800; font-family: var(--font-display);
  background: linear-gradient(135deg, var(--accent), var(--yellow));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  letter-spacing: -1px; margin-bottom: 16px;
}
.landing-tagline {
  font-size: var(--font-lg); font-weight: 700; letter-spacing: 3px; color: var(--text-dim);
  margin-bottom: 20px; text-transform: uppercase;
}
.landing-desc {
  font-size: var(--font-xl); color: var(--text-mid); line-height: 1.7; max-width: 520px;
  margin: 0 auto 28px;
}
.landing-beta-badge {
  display: inline-block; padding: 7px 20px; border-radius: var(--radius-4xl); font-size: var(--font-base);
  font-weight: 700; letter-spacing: 1px; text-transform: uppercase;
  background: rgba(255,107,74,0.12); color: var(--accent); border: 1px solid rgba(255,107,74,0.25);
  margin-bottom: 28px;
}
.landing-cta { display: flex; gap: var(--space-md); justify-content: center; flex-wrap: wrap; }
.landing-cta-primary {
  padding: 16px 36px; border-radius: var(--radius-xl); font-size: var(--font-lg); font-weight: 700;
  background: linear-gradient(135deg, var(--accent), var(--accent-light));
  color: #fff; text-decoration: none; box-shadow: 0 4px 20px var(--accent-glow);
  transition: all 0.2s; font-family: var(--font-body);
}
.landing-cta-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px var(--accent-glow); }
.landing-cta-secondary {
  padding: 16px 36px; border-radius: var(--radius-xl); font-size: var(--font-lg); font-weight: 700;
  background: transparent; border: 1px solid var(--border-light); color: var(--text-mid);
  text-decoration: none; transition: all 0.2s; font-family: var(--font-body);
}
.landing-cta-secondary:hover { background: var(--overlay-4); color: var(--text-bright); }

/* Features grid */
.landing-features {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg);
  max-width: 900px; margin: 0 auto 48px; padding: 0 24px; position: relative;
}
.landing-features::before {
  content: '';
  position: absolute;
  inset: -100px -50px;
  background: radial-gradient(ellipse at 20% 30%, rgba(255,107,74,0.06) 0%, transparent 50%),
              radial-gradient(ellipse at 80% 70%, rgba(74,175,255,0.04) 0%, transparent 50%),
              radial-gradient(ellipse at 50% 50%, rgba(160,107,255,0.03) 0%, transparent 50%);
  background-size: 200% 200%;
  animation: meshShift 15s ease-in-out infinite;
  pointer-events: none;
  z-index: -1;
}
.landing-feature-card {
  border-radius: var(--radius-3xl);
  padding: 24px 20px; text-align: center; transition: all 0.3s;
}
.landing-feature-card:hover { transform: translateY(-2px); }
.landing-feature-icon { font-size: var(--font-3xl); margin-bottom: 12px; }
.landing-feature-title {
  font-size: var(--font-lg); font-weight: 700; color: var(--text-bright);
  font-family: var(--font-display); margin-bottom: 8px;
}
.landing-feature-desc { font-size: var(--font-md); color: var(--text-dim); line-height: 1.5; }

/* Demo area */
.landing-demo {
  max-width: 900px; margin: 0 auto 48px; padding: 0 24px;
}
.landing-demo-title {
  font-size: var(--font-md); font-weight: 700; letter-spacing: 2px; color: var(--text-dim);
  text-transform: uppercase; text-align: center; margin-bottom: 20px;
}
.landing-demo-panels {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-lg);
}
.landing-demo-panel {
  border-radius: var(--radius-3xl);
  padding: 20px; overflow: hidden;
}
.landing-demo-label {
  font-size: var(--font-sm); font-weight: 600; letter-spacing: 1.5px; color: var(--text-faint);
  text-transform: uppercase; margin-bottom: 14px;
}

/* Demo: Habit Grid */
.demo-grid { display: flex; flex-direction: column; gap: var(--space-sm); }
.demo-grid-row { display: flex; align-items: center; gap: var(--space-xs); }
.demo-habit-name {
  font-size: var(--font-xs); color: var(--text-dim); width: 80px; flex-shrink: 0;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.demo-cell {
  width: 18px; height: 18px; border-radius: var(--radius-xs); background: var(--overlay-4);
  border: 1px solid var(--border-light); flex-shrink: 0;
}
.demo-fill { background: var(--accent); border-color: var(--accent); opacity: 0; }
.demo-fill-blue { background: var(--blue); border-color: var(--blue); opacity: 0; }
.demo-fill-green { background: var(--green); border-color: var(--green); opacity: 0; }

/* Staggered check-in animation */
@keyframes checkIn {
  0% { opacity: 0; transform: scale(0.5); }
  50% { opacity: 1; transform: scale(1.15); }
  100% { opacity: 0.9; transform: scale(1); }
}
.demo-anim-1 { animation: checkIn 0.5s ease 0.3s forwards; }
.demo-anim-2 { animation: checkIn 0.5s ease 0.6s forwards; }
.demo-anim-3 { animation: checkIn 0.5s ease 0.9s forwards; }
.demo-anim-4 { animation: checkIn 0.5s ease 1.2s forwards; }
.demo-anim-5 { animation: checkIn 0.5s ease 1.5s forwards; }
.demo-anim-6 { animation: checkIn 0.5s ease 1.8s forwards; }
.demo-anim-7 { animation: checkIn 0.5s ease 2.1s forwards; }

/* Demo: Circle Rings */
.demo-circle-wrap { display: flex; justify-content: center; }
.demo-circle-svg { width: 160px; height: 160px; }
@keyframes ringFill {
  from { stroke-dashoffset: 440; }
}
.demo-ring { animation-duration: 1.5s; animation-timing-function: ease-out; animation-fill-mode: forwards; }
.demo-ring-1 { animation-name: ringFill; animation-delay: 0.4s; stroke-dashoffset: 440; }
@keyframes ringFill2 { from { stroke-dashoffset: 327; } }
.demo-ring-2 { animation-name: ringFill2; animation-delay: 0.8s; stroke-dashoffset: 327; }
@keyframes ringFill3 { from { stroke-dashoffset: 214; } }
.demo-ring-3 { animation-name: ringFill3; animation-delay: 1.2s; stroke-dashoffset: 214; }

/* Demo: Weekly Board */
.demo-board { display: flex; gap: var(--space-sm); }
.demo-board-col { flex: 1; }
.demo-board-day {
  font-size: var(--font-2xs); font-weight: 600; color: var(--text-faint); text-align: center;
  letter-spacing: 0.5px; margin-bottom: 6px;
}
.demo-board-task {
  padding: 6px 8px; border-radius: var(--radius-sm); background: var(--overlay-4);
  border: 1px solid var(--border-light); font-size: var(--font-2xs); color: var(--text-mid);
  margin-bottom: 4px; opacity: 0; transform: translateY(10px);
}
@keyframes cardSlide {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.demo-task-slide-1 { animation: cardSlide 0.4s ease 0.5s forwards; }
.demo-task-slide-2 { animation: cardSlide 0.4s ease 0.8s forwards; }
.demo-task-slide-3 { animation: cardSlide 0.4s ease 1.1s forwards; }
.demo-task-slide-4 { animation: cardSlide 0.4s ease 1.4s forwards; }
.demo-task-slide-5 { animation: cardSlide 0.4s ease 1.7s forwards; }

/* Demo: AI Story Transformation */
.ai-demo {
  display: grid; grid-template-columns: 1fr auto 1fr; gap: 0; align-items: stretch;
  max-width: 820px; margin: 0 auto;
}
.ai-demo-side {
  border-radius: var(--radius-3xl); padding: 20px; display: flex; flex-direction: column;
}
.ai-demo-label {
  font-size: var(--font-sm); font-weight: 600; letter-spacing: 1.5px; color: var(--text-faint);
  text-transform: uppercase; margin-bottom: 12px;
}
.ai-demo-journal {
  font-size: var(--font-md); color: var(--text-mid); line-height: 1.65;
  font-style: italic; flex: 1;
}
.ai-demo-meta {
  display: flex; justify-content: space-between; margin-top: 12px;
  font-size: var(--font-xs); color: var(--text-faint);
}
.ai-demo-arrow {
  display: flex; align-items: center; justify-content: center; padding: 0 12px;
}
.ai-demo-btn {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 10px 14px; border-radius: var(--radius-lg);
  background: rgba(255,107,74,0.12); border: 1px solid rgba(255,107,74,0.25);
  color: var(--accent); font-size: var(--font-xs); font-weight: 600;
  letter-spacing: 0.5px; transition: all 0.3s;
}
.ai-demo-btn-icon { font-size: var(--font-xl); }
.ai-demo-btn-active {
  background: rgba(255,107,74,0.25); border-color: var(--accent);
  animation: btnPulse 1.2s ease infinite;
}
@keyframes btnPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,107,74,0.3); }
  50% { box-shadow: 0 0 12px 4px rgba(255,107,74,0.15); }
}
.ai-demo-output {
  min-height: 220px;
}
.ai-demo-story {
  font-size: var(--font-md); color: var(--text-mid); line-height: 1.65; flex: 1;
}
.ai-demo-cursor {
  color: var(--accent); animation: cursorBlink 0.6s step-end infinite;
}
@keyframes cursorBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}
.ai-demo-moral {
  margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--glass-border);
  font-size: var(--font-sm); color: var(--text-dim); font-style: italic;
  animation: fadeInUp 0.5s ease;
}
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.ai-demo-caption {
  text-align: center; font-size: var(--font-sm); color: var(--text-faint);
  margin-top: 16px; letter-spacing: 0.5px;
}
@media (max-width: 700px) {
  .ai-demo { grid-template-columns: 1fr; gap: 0; }
  .ai-demo-arrow { padding: 12px 0; transform: rotate(90deg); }
}

/* Trust / Privacy section */
.landing-trust {
  max-width: 900px; margin: 0 auto 40px; padding: 0 24px; text-align: center;
}
.landing-trust-title {
  font-family: var(--font-display); font-size: var(--font-3xl); font-weight: 700;
  color: var(--text-bright); margin-bottom: 6px;
}
.landing-trust-subtitle {
  font-size: var(--font-lg); color: var(--text-dim); margin-bottom: 28px;
}
.landing-trust-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--space-lg);
}
.landing-trust-item {
  border-radius: var(--radius-3xl);
  padding: 24px 18px; text-align: center; transition: all 0.3s;
}
.landing-trust-item:hover { transform: translateY(-2px); }
.landing-trust-icon { font-size: var(--font-3xl); margin-bottom: 10px; }
.landing-trust-heading {
  font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); margin-bottom: 8px;
}
.landing-trust-text {
  font-size: var(--font-md); color: var(--text-dim); line-height: 1.55;
}
@media (max-width: 700px) {
  .landing-features { grid-template-columns: repeat(2, 1fr); }
  .landing-demo-panels { grid-template-columns: 1fr; }
  .landing-trust-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 440px) {
  .landing-features { grid-template-columns: 1fr; }
  .landing-trust-grid { grid-template-columns: 1fr; }
}

/* Footer */
.landing-footer {
  text-align: center; padding: 32px 24px; border-top: 1px solid var(--glass-border);
  margin-top: 20px;
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow));
}
.landing-footer-brand-link { display: inline-block; margin-bottom: 6px; }
.landing-footer-logo { height: 48px; width: auto; opacity: 0.8; transition: opacity 0.2s; border-radius: var(--radius-sm); }
.landing-footer-brand-link:hover .landing-footer-logo { opacity: 1; }
.landing-footer-copy { font-size: var(--font-base); color: var(--text-faint); }

/* ── Auth success message ── */
.auth-success {
  background: rgba(61,214,140,0.1); border: 1px solid rgba(61,214,140,0.2);
  color: var(--green); border-radius: var(--radius-lg); padding: 12px 16px;
  font-size: var(--font-md); margin-bottom: 16px;
}

/* ── Admin Panel ── */
.admin-user-table { width: 100%; border-collapse: separate; border-spacing: 0 var(--space-xs); }
.admin-user-table th {
  font-size: var(--font-xs); color: var(--text-faint); font-weight: 700;
  letter-spacing: 0.8px; text-transform: uppercase; text-align: left;
  padding: var(--space-sm) var(--space-lg); border: none;
}
.admin-user-table td {
  font-size: var(--font-md); color: var(--text-mid); padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border);
  background: var(--overlay-2); vertical-align: middle;
  transition: background 0.15s;
}
.admin-user-table td:first-child { border-left: 1px solid var(--glass-border); border-radius: var(--radius-md) 0 0 var(--radius-md); }
.admin-user-table td:last-child { border-right: 1px solid var(--glass-border); border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.admin-user-table tr:hover td { background: var(--overlay-6); }
.admin-user-actions { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.admin-btn {
  padding: var(--space-sm) var(--space-md); border-radius: var(--radius-sm); font-size: var(--font-sm); font-weight: 600;
  cursor: pointer; font-family: var(--font-body); transition: all 0.2s; border: 1px solid;
  background: transparent; min-height: var(--size-touch-min); display: inline-flex; align-items: center;
}
.admin-btn.reset-pw { border-color: rgba(74,175,255,0.2); color: var(--blue); }
.admin-btn.reset-pw:hover { background: rgba(74,175,255,0.1); }
.admin-btn.clear-pin { border-color: rgba(255,184,74,0.2); color: var(--yellow); }
.admin-btn.clear-pin:hover { background: rgba(255,184,74,0.1); }
.admin-btn.toggle-admin { border-color: rgba(160,107,255,0.2); color: var(--purple); }
.admin-btn.toggle-admin:hover { background: rgba(160,107,255,0.1); }
.admin-badge {
  display: inline-block; padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); font-size: var(--font-xs);
  font-weight: 700; letter-spacing: 0.5px; white-space: nowrap;
}
.admin-badge.admin { background: rgba(160,107,255,0.15); color: var(--purple); }
.admin-badge.user { background: var(--overlay-4); color: var(--text-faint); }
.admin-badge.active { background: rgba(61,214,140,0.15); color: var(--green); }
.admin-badge.pending { background: rgba(255,184,74,0.15); color: var(--yellow); }
.admin-btn.backup-now { border-color: rgba(61,214,140,0.3); color: var(--green); background: rgba(61,214,140,0.08); }
.admin-btn.backup-now:hover { background: rgba(61,214,140,0.15); }
.admin-btn.approve-user { border-color: rgba(61,214,140,0.2); color: var(--green); }
.admin-btn.approve-user:hover { background: rgba(61,214,140,0.1); }
.admin-btn.deactivate-user { border-color: rgba(255,107,74,0.2); color: var(--text-faint); }
.admin-btn.deactivate-user:hover { background: rgba(255,107,74,0.1); color: var(--accent); }
.pending-row { background: rgba(255,184,74,0.04); }
.stat-card.pending-highlight { border-color: rgba(255,184,74,0.4); }

.feedback-card {
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow));
  border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  padding: 14px 16px; margin-bottom: 8px; box-shadow: var(--shadow-card);
}
.feedback-meta { display: flex; justify-content: space-between; margin-bottom: 6px; }
.feedback-user { font-size: var(--font-md); font-weight: 600; color: var(--text-mid); }
.feedback-date { font-size: var(--font-base); color: var(--text-faint); }
.feedback-content { font-size: var(--font-lg); color: var(--text-dim); line-height: 1.5; white-space: pre-wrap; }

/* ── Weekly Habits Grid ── */
/* Flat grid: every cell is a direct child. Row 1 = headers, rows 2+ = habits.
   This guarantees row alignment across all columns. */
.weekly-habits-grid {
  display: grid;
  grid-template-columns: minmax(100px, 180px) repeat(7, 1fr) minmax(50px, 70px);
  gap: var(--space-sm);
  margin-top: 16px;
  align-items: stretch;
}
.wh-header-cell {
  font-size: var(--font-sm); font-weight: 600; color: var(--text-faint);
  letter-spacing: 1px; text-transform: uppercase;
  text-align: center; padding: 8px 4px;
  display: flex; align-items: center; justify-content: center;
}
.wh-day-header {
  text-align: center; padding: 6px 4px;
  background: var(--glass-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md); border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.wh-day-header .day-name { font-size: var(--font-sm); font-weight: 600; color: var(--text-faint); letter-spacing: 0.5px; }
.wh-day-header .day-date { font-size: var(--font-lg); font-weight: 700; color: var(--text-mid); }
.wh-day-header.today .day-name, .wh-day-header.today .day-date { color: var(--accent); }
.wh-habit-name {
  display: flex; align-items: center; gap: var(--space-sm); padding: 6px 10px;
  background: var(--glass-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md); border: 1px solid var(--glass-border);
  font-size: var(--font-md); color: var(--text-mid); font-weight: 600;
  cursor: pointer; transition: all 0.2s; overflow: hidden;
}
.wh-habit-name:hover { background: var(--overlay-3); }
.wh-icon { font-size: var(--font-xl); flex-shrink: 0; }
.wh-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-unit-badge {
  font-size: var(--font-xs); color: var(--text-ghost); background: var(--overlay-5);
  padding: 2px 6px; border-radius: var(--radius-xs); margin-left: auto; flex-shrink: 0;
}
.wh-cell {
  display: flex; align-items: center; justify-content: center;
  background: var(--glass-bg); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border-radius: var(--radius-md); border: 1px solid var(--glass-border);
  padding: 4px 0;
}
.wh-check {
  width: 26px; height: 26px; border-radius: var(--radius-sm); cursor: pointer;
  transition: all 0.15s; display: flex; align-items: center;
  justify-content: center; font-size: var(--font-base); color: #fff;
}
.wh-check.off { background: var(--overlay-4); border: 2px solid var(--border-light); }
.wh-check.on { border: none; box-shadow: 0 0 10px rgba(255,107,74,0.3); }
.wh-check:hover { transform: scale(1.1); }
.wh-measured {
  min-width: 34px; height: 26px; border-radius: var(--radius-sm); display: flex;
  align-items: center; justify-content: center; font-size: var(--font-xs);
  font-weight: 600; cursor: pointer; background: var(--overlay-3);
  border: 1px solid var(--border-light); transition: all 0.15s; padding: 0 4px;
}
.wh-measured:hover { border-color: var(--text-dim); }
.wh-streak {
  font-size: var(--font-lg); font-weight: 700; text-align: center;
  padding: 4px; display: flex; align-items: center; justify-content: center;
}

/* Responsive */
@media (max-width: 900px) {
  .header-row { flex-wrap: wrap; justify-content: space-between; }
  .tabs { order: 3; flex-basis: 100%; justify-content: flex-start; border-bottom: 1px solid var(--border); }
  .journal-layout { grid-template-columns: 1fr; }
  .weekly-grid { grid-template-columns: minmax(80px, 120px) repeat(3, 1fr); }
  .weekly-grid-label { display: none; }
  .habit-strip-grid { grid-template-columns: minmax(80px, 120px) repeat(3, 1fr); }
  .weekly-habits-grid {
    grid-template-columns: minmax(90px, 140px) repeat(7, minmax(36px, 1fr)) minmax(40px, 56px);
    gap: var(--space-xs); font-size: var(--font-xs);
  }
}
@media (max-width: 700px) {
  .two-col { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .weekly-grid { grid-template-columns: minmax(80px, 120px) 1fr; }
  .habit-strip-grid { grid-template-columns: minmax(80px, 120px) 1fr; }
  .weekly-habits-grid {
    grid-template-columns: minmax(80px, 120px) repeat(7, minmax(32px, 1fr)) minmax(36px, 50px);
    gap: 3px; overflow-x: auto;
  }
  .admin-user-table th:nth-child(2), .admin-user-table td:nth-child(2) { display: none; }
  .footer-inner { flex-direction: column; gap: var(--space-lg); text-align: center; }
  .footer-col-left, .footer-col-centre, .footer-col-right { text-align: center; }
}
@media (max-width: 480px) {
  .weekly-grid { grid-template-columns: 1fr; }
  .habit-strip-grid { grid-template-columns: 1fr; }
  .weekly-habits-grid {
    grid-template-columns: minmax(70px, 100px) repeat(7, 36px) 36px;
    gap: 3px; overflow-x: auto;
  }
  .wh-day-header .day-name { font-size: var(--font-2xs); }
  .wh-day-header .day-date { font-size: var(--font-sm); }
  .wh-habit-name { font-size: var(--font-xs); padding: 4px 6px; }
}

/* ── Footer — glass card matching header ── */
.site-footer {
  margin-top: var(--space-2xl);
  padding: 0;
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--glass-bg-medium);
  backdrop-filter: blur(var(--glass-blur-deep));
  -webkit-backdrop-filter: blur(var(--glass-blur-deep));
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-2xl);
  padding: 14px 28px;
  box-shadow: var(--shadow-card-hover), var(--glass-inner-glow);
}
.footer-col { flex: 1; }
.footer-col-left { flex: 0 0 auto; }
.footer-col-centre { text-align: center; }
.footer-col-right { text-align: right; flex: 0 0 auto; }
.footer-logo { height: 36px; width: auto; }
.footer-tagline { font-size: var(--font-sm); margin: 0; color: var(--text-mid); }
.footer-tagline strong { color: var(--text-bright); }
.footer-subtitle { font-size: var(--font-sm); margin: 0; color: var(--text-dim); }
.footer-orange { color: var(--accent); }
.footer-link { color: var(--accent); text-decoration: none; font-size: var(--font-sm); transition: color 0.2s; }
.footer-link:hover { color: var(--text-bright); }
.footer-copy {
  font-size: var(--font-xs);
  color: var(--text-ghost);
  display: block;
  margin-top: 4px;
}

/* ── Tag/Theme notes link icon ── */
.tag-group-link {
  color: var(--text-dim);
  text-decoration: none;
  font-size: var(--font-base);
  opacity: 0.5;
  transition: opacity 0.2s;
  margin-left: 2px;
}
.tag-group-link:hover { opacity: 1; }
.tag-group-edit { color: var(--text-ghost); text-decoration: none; font-size: var(--font-md); opacity: 0.4; transition: opacity 0.2s; margin-left: 4px; cursor: pointer; }
.tag-group-edit:hover { opacity: 1; color: var(--accent); }
.tag-group-name[data-add-tag],
.tag-group-name[data-add-theme] {
  cursor: pointer;
  text-decoration-style: dotted;
  text-decoration-line: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--text-ghost);
}
.tag-group-name[data-add-tag]:hover,
.tag-group-name[data-add-theme]:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* ── Tag/Theme link input on manage pages ── */
.tag-link-input {
  flex: 1;
  min-width: 0;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-mid);
  font-size: var(--font-sm);
  font-family: var(--font-body);
}
.tag-link-input::placeholder { color: var(--text-ghost); }
.tag-link-input:focus { border-color: var(--accent); outline: none; }
.tag-link-icon {
  color: var(--text-dim);
  font-size: var(--font-base);
  opacity: 0.5;
  text-decoration: none;
  transition: opacity 0.2s;
  margin-left: 6px;
}
.tag-link-icon:hover { opacity: 1; }

/* ── AI Analysis Panel ── */
.tag-group-analyse {
  background: none; border: none; cursor: pointer; font-size: var(--font-md);
  opacity: 0.4; transition: opacity 0.2s; padding: 2px 4px; line-height: 1;
}
.tag-group-analyse:hover { opacity: 1; }
.tag-group-analyse.loading { opacity: 0.8; animation: ai-pulse 1.2s ease-in-out infinite; }
@keyframes ai-pulse { 0%, 100% { opacity: 0.4; } 50% { opacity: 1; } }

.ai-panel {
  background: var(--glass-bg); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow));
  border: 1px solid rgba(160,107,255,0.2); border-radius: var(--radius-lg);
  padding: 14px 16px; margin: 8px 0 4px 0;
}
.ai-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.ai-panel-title { font-size: var(--font-base); font-weight: 700; color: var(--purple); letter-spacing: 0.5px; }
.ai-panel-dismiss {
  background: none; border: none; color: var(--text-dim); cursor: pointer;
  font-size: var(--font-xl); line-height: 1; padding: 0 4px; opacity: 0.5; transition: opacity 0.2s;
}
.ai-panel-dismiss:hover { opacity: 1; }
.ai-summary { font-size: var(--font-base); color: var(--text-mid); line-height: 1.5; margin-bottom: 12px; }
.ai-section { margin-bottom: 10px; }
.ai-section-title {
  font-size: var(--font-xs); font-weight: 700; color: var(--text-faint); letter-spacing: 1px;
  text-transform: uppercase; margin-bottom: 6px;
}
.ai-suggestion {
  display: flex; align-items: center; gap: var(--space-sm); padding: 6px 0;
  border-bottom: 1px solid var(--border-light);
}
.ai-suggestion:last-child { border-bottom: none; }
.ai-suggestion-text { flex: 1; font-size: var(--font-base); color: var(--text-bright); }
.ai-suggestion-priority { font-size: var(--font-xs); font-weight: 600; text-transform: uppercase; }
.ai-add-task-btn {
  background: rgba(160,107,255,0.1); border: 1px solid rgba(160,107,255,0.2);
  color: var(--purple); border-radius: var(--radius-sm); padding: 4px 10px;
  font-size: var(--font-xs); font-weight: 600; cursor: pointer; font-family: var(--font-body);
  transition: background 0.2s;
  white-space: nowrap;
}
.ai-add-task-btn:hover { background: rgba(160,107,255,0.2); }
.ai-add-task-btn:disabled { opacity: 0.5; cursor: default; }
.ai-reasoning { font-size: var(--font-xs); color: var(--text-dim); padding: 2px 0 4px 0; font-style: italic; }
.ai-adjustment { font-size: var(--font-base); color: var(--text-mid); padding: 4px 0; }

/* ── Floating Action Button (feedback) ── */
.fab-feedback {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  border: none;
  font-size: var(--font-2xl);
  cursor: pointer;
  z-index: 40;
  box-shadow: 0 4px 14px rgba(255,107,74,0.3);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.fab-feedback:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 20px rgba(255,107,74,0.4);
}

/* ── Feedback category select ── */
.feedback-category {
  width: 100%;
  padding: 8px 10px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-mid);
  font-size: var(--font-base);
  font-family: var(--font-body);
  margin-bottom: 12px;
}
.feedback-category:focus { border-color: var(--accent); outline: none; }

/* ── Work day picker (settings) ── */
.work-day-picker {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}
.work-day-btn {
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-light);
  background: var(--overlay-3);
  color: var(--text-dim);
  font-size: var(--font-base);
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  transition: all 0.15s;
}
.work-day-btn.on {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: 0 0 8px rgba(255,107,74,0.2);
}
.work-day-btn:hover:not(.on) {
  border-color: var(--text-dim);
  color: var(--text-mid);
}

/* ── AI Usage Table ── */
.ai-usage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-base);
  margin-top: 10px;
}
.ai-usage-table th {
  text-align: left;
  color: var(--text-faint);
  font-weight: 600;
  font-size: var(--font-xs);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--border);
}
.ai-usage-table td {
  padding: 8px 10px;
  color: var(--text-mid);
  border-bottom: 1px solid var(--border-faint);
}
.ai-usage-table tr:last-child td { border-bottom: none; }
.ai-usage-total td {
  font-weight: 700;
  color: var(--text-bright);
  border-top: 1px solid var(--border);
  border-bottom: none;
}
.ai-usage-model-label {
  font-size: var(--font-sm);
  color: var(--text-faint);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 16px;
  margin-bottom: 4px;
}
.ai-usage-model-table { margin-top: 4px; }
.ai-usage-empty {
  font-size: var(--font-base);
  color: var(--text-faint);
  padding: 12px 0;
}

/* ── Welcome Card (New Users) ── */
.welcome-card { position: relative; background: linear-gradient(135deg, var(--glass-bg-strong), var(--glass-bg)); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--accent); border-radius: var(--radius-3xl); padding: 28px 28px 24px; margin-bottom: 20px; animation: storyFadeIn 0.4s ease; }
.welcome-dismiss { position: absolute; top: 12px; right: 16px; background: none; border: none; color: var(--text-faint); font-size: var(--font-2xl); cursor: pointer; padding: 4px 8px; border-radius: var(--radius-sm); }
.welcome-dismiss:hover { color: var(--text-bright); background: var(--overlay-4); }
.welcome-greeting { font-size: var(--font-2xl); font-weight: 800; color: var(--text-bright); margin-bottom: 4px; }
.welcome-subtitle { font-size: var(--font-md); color: var(--text-mid); margin-bottom: 16px; }
.welcome-steps { display: flex; gap: var(--space-md); flex-wrap: wrap; }
.welcome-step { display: flex; align-items: flex-start; gap: var(--space-md); flex: 1 1 200px; padding: 14px 16px; border-radius: var(--radius-xl); background: var(--overlay-4); border: 1px solid var(--border-light); text-decoration: none; color: inherit; transition: border-color 0.2s, background 0.2s; }
.welcome-step:hover { border-color: var(--accent); background: var(--overlay-8); }
.welcome-step-icon { font-size: var(--font-3xl); flex-shrink: 0; margin-top: 2px; }
.welcome-step-check { font-size: var(--font-2xl); flex-shrink: 0; margin-top: 2px; line-height: 1; }
.welcome-step-text { font-size: var(--font-base); line-height: 1.5; color: var(--text-mid); }
.welcome-step-text strong { color: var(--text-bright); font-size: var(--font-md); }
.welcome-step.onboard-done { opacity: 0.5; }
.welcome-step.onboard-done .welcome-step-text strong { text-decoration: line-through; }
.welcome-progress { font-size: var(--font-sm); font-weight: 700; color: var(--accent); margin-top: 8px; }

/* ── Thought for the Day (Dashboard) ── */
.thought-of-day { background: linear-gradient(135deg, var(--glass-bg-strong), var(--glass-bg)); backdrop-filter: blur(var(--glass-blur-shallow)); -webkit-backdrop-filter: blur(var(--glass-blur-shallow)); border: 1px solid var(--accent); border-radius: var(--radius-3xl); padding: 20px 24px; margin-bottom: 20px; animation: storyFadeIn 0.4s ease; box-shadow: var(--shadow-glow-accent); }
.thought-of-day-badge { font-size: var(--font-base); font-weight: 700; color: var(--accent); letter-spacing: 0.5px; margin-bottom: 10px; }
.thought-of-day-moral { font-size: var(--font-lg); line-height: 1.6; color: var(--text-bright); font-style: italic; }
.thought-of-day-meta { margin-top: 10px; font-size: var(--font-sm); color: var(--text-faint); }

/* ── Admin Docs Viewer ── */
.doc-list-item { display: flex; align-items: center; gap: var(--space-sm); padding: 12px 14px; border-radius: var(--radius-lg); cursor: pointer; transition: all 0.15s; border: 1px solid transparent; }
.doc-list-item:hover { background: var(--overlay-6); border-color: var(--border-light); }
.doc-list-icon { font-size: var(--font-xl); flex-shrink: 0; }
.doc-list-title { flex: 1; font-size: var(--font-md); font-weight: 600; color: var(--text-mid); }
.doc-list-item:hover .doc-list-title { color: var(--text-bright); }
.doc-list-size { font-size: var(--font-sm); color: var(--text-faint); flex-shrink: 0; }
.doc-viewer-header { display: flex; align-items: center; gap: var(--space-lg); margin-bottom: 20px; padding-bottom: 16px; border-bottom: 1px solid var(--border); }
.doc-viewer-title { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); }
.doc-viewer-content { font-size: var(--font-md); line-height: 1.8; color: var(--text-mid); }
.doc-viewer-content h1 { font-size: var(--font-2xl); font-weight: 800; color: var(--text-bright); margin: 24px 0 12px; }
.doc-viewer-content h2 { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); margin: 20px 0 10px; }
.doc-viewer-content h3 { font-size: var(--font-lg); font-weight: 700; color: var(--text-bright); margin: 16px 0 8px; }
.doc-viewer-content p { margin-bottom: 12px; }
.doc-viewer-content ul, .doc-viewer-content ol { padding-left: 24px; margin-bottom: 12px; }
.doc-viewer-content li { margin-bottom: 4px; }
.doc-viewer-content code { background: var(--overlay-6); padding: 2px 6px; border-radius: var(--radius-xs); font-size: var(--font-base); font-family: 'SF Mono', 'Fira Code', monospace; color: var(--accent); }
.doc-viewer-content pre { background: var(--bg-deep); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 16px; overflow-x: auto; margin-bottom: 16px; }
.doc-viewer-content pre code { background: none; padding: 0; color: var(--text-mid); }
.doc-viewer-content table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
.doc-viewer-content th, .doc-viewer-content td { padding: 8px 12px; border: 1px solid var(--border); text-align: left; font-size: var(--font-base); }
.doc-viewer-content th { background: var(--overlay-4); color: var(--text-bright); font-weight: 600; }
.doc-viewer-content a { color: var(--blue); text-decoration: none; }
.doc-viewer-content a:hover { text-decoration: underline; }

/* ── Search modal ── */
.search-btn { background: none; border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 8px 12px; cursor: pointer; font-size: var(--font-lg); color: var(--text-dim); transition: all 0.2s; line-height: 1; }
.search-btn:hover { background: var(--overlay-6); color: var(--text-bright); }
.search-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 2000; display: flex; justify-content: center; padding-top: 12vh; }
.search-modal { width: 100%; max-width: 560px; height: fit-content; max-height: 70vh; display: flex; flex-direction: column;
  background: var(--glass-bg-strong); backdrop-filter: blur(32px); -webkit-backdrop-filter: blur(32px);
  border: 1px solid var(--glass-border-bright); border-radius: var(--radius-3xl);
  box-shadow: var(--shadow-elevated), var(--glass-inner-glow); overflow: hidden; }
.search-input-wrapper { padding: 16px; border-bottom: 1px solid var(--glass-border); }
.search-input { width: 100%; padding: 12px 16px; font-size: var(--font-lg); font-family: var(--font-body);
  background: var(--overlay-4); border: 1px solid var(--glass-border); border-radius: var(--radius-lg);
  color: var(--text-bright); outline: none; transition: border-color 0.2s; }
.search-input:focus { border-color: rgba(255,107,74,0.4); }
.search-input::placeholder { color: var(--text-ghost); }
.search-results { overflow-y: auto; padding: 8px 16px 16px; flex: 1; }
.search-section-title { font-size: var(--font-xs); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); padding: 8px 0 4px; }
.search-result-item { padding: 10px 12px; border-radius: var(--radius-lg); cursor: pointer; transition: background 0.15s; margin-bottom: 4px; border: 1px solid transparent; }
.search-result-item:hover { background: var(--overlay-6); border-color: var(--glass-border); }
.search-result-title { font-size: var(--font-md); font-weight: 600; color: var(--text-bright); margin-bottom: 2px; }
.search-result-meta { font-size: var(--font-sm); color: var(--text-dim); }
.search-result-snippet { font-size: var(--font-base); color: var(--text-mid); line-height: 1.4; }
.search-highlight { background: rgba(255,107,74,0.2); color: var(--accent); border-radius: 2px; padding: 0 2px; }
.search-empty { text-align: center; padding: 32px 16px; color: var(--text-dim); font-size: var(--font-md); }
.search-kbd { font-size: var(--font-xs); color: var(--text-ghost); background: var(--overlay-6); padding: 2px 6px; border-radius: var(--radius-xs); border: 1px solid var(--glass-border); margin-left: 4px; }

/* ── Utility classes (CSP: replaces inline style attributes) ── */
.u-hidden { display: none; }
.u-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.u-sr-only-focusable:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; padding: 12px 20px; margin: 0; overflow: visible; clip: auto; white-space: normal; background: var(--brand-navy); color: white; font-size: var(--font-md); font-weight: 700; border-radius: var(--radius-md); z-index: 9999; box-shadow: 0 4px 12px rgba(0,0,0,0.3); outline: 2px solid var(--brand-orange); outline-offset: 2px; }
.u-relative { position: relative; z-index: 1; }
.u-flex-row { display: flex; gap: var(--space-lg); align-items: center; flex-wrap: wrap; margin-bottom: 16px; }
.u-flex-row-sm { display: flex; gap: var(--space-md); align-items: center; flex-wrap: wrap; }
.u-flex-row-tight { display: flex; gap: var(--space-sm); align-items: center; }
.u-mt-24 { margin-top: 24px; }
.u-mt-32 { margin-top: 32px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-10 { margin-top: 10px; }
.u-mw-280 { max-width: 280px; }
.u-mw-440 { max-width: 440px; }
.u-card-tight { padding: 4px 0; overflow: hidden; }
.u-text-faint-sm { font-size: var(--font-base); color: var(--text-faint); }
.u-text-faint-xs { font-size: var(--font-sm); color: var(--text-faint); }
.u-text-center-pad { font-size: var(--font-base); color: var(--text-faint); padding: 16px 0; text-align: center; }
.u-text-empty-pad { font-size: var(--font-sm); color: var(--text-faint); padding: 8px 0; }
.u-text-accent { color: var(--accent); }
.u-bg-accent { background: var(--accent); }
.u-text-center-mb { text-align: center; margin-bottom: 32px; }
.u-mb-0 { margin-bottom: 0; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-20 { margin-bottom: 20px; }
.u-mt-0 { margin-top: 0; }
.u-mt-12 { margin-top: 12px; }
.u-mt-16 { margin-top: 16px; }
.u-flex-1 { flex: 1; }
.u-overflow-x { overflow-x: auto; }
.u-text-bright { color: var(--text-bright); }
.u-fixed-top-right { position: fixed; top: 12px; right: 12px; z-index: 50; }
.u-inline-input { width: 80px; padding: 4px 8px; font-size: var(--font-sm); border: 1px solid var(--border-light); border-radius: var(--radius-xl); background: var(--overlay-4); color: var(--text-bright); outline: none; }
/* Section divider — use between groups of settings cards or journal sections */
.u-section-divider { border-top: 1px solid var(--border); margin: 20px 0; }

/* Dynamic color pills — use CSS custom properties instead of inline style */
.tag-select-pill.off, .theme-select-pill.off { background: transparent; color: var(--text-dim); border-color: var(--border-light); }
.tag-select-pill.on, .theme-select-pill.on { background: var(--pill-bg); color: var(--pill-color); border-color: var(--pill-border); }
.stat-value[data-color] { color: var(--stat-color); }

/* Edit modal pills — dynamic colors via CSS custom properties */
.edit-modal-pill { background: var(--pill-bg, transparent); color: var(--pill-color, var(--text-dim)); border-color: var(--pill-border, var(--border-light)); }
.color-swatch { background: var(--swatch-bg); }
.habit-circle-toggle { display: flex; align-items: center; gap: var(--space-sm); margin: 12px 0; cursor: pointer; font-size: var(--font-base); color: var(--text-dim); }
.color-row { display: flex; gap: var(--space-sm); align-items: center; margin-bottom: 12px; }
.modal-feedback-hint { font-size: var(--font-sm); color: var(--text-dim); margin-bottom: 16px; }
.modal-textarea-tall { min-height: 120px; }

/* ── Trello export task selection ── */
.trello-task-list { max-height: 320px; overflow-y: auto; margin-bottom: 16px; border: 1px solid var(--border); border-radius: var(--radius-md); }
.trello-task-row { display: flex; align-items: center; gap: 8px; padding: 8px 12px; cursor: pointer; transition: background 0.15s; border-bottom: 1px solid var(--border); }
.trello-task-row:last-child { border-bottom: none; }
.trello-task-row:hover { background: var(--overlay-3); }
.trello-task-row input[type="checkbox"] { flex-shrink: 0; width: 16px; height: 16px; accent-color: var(--blue); cursor: pointer; }
.trello-task-text { font-size: var(--font-base); color: var(--text-main); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trello-task-actions { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.trello-select-toggle { background: none; border: none; color: var(--blue); font-size: var(--font-sm); cursor: pointer; font-family: var(--font-body); padding: 0; }
.trello-select-toggle:hover { text-decoration: underline; }

/* ── Cookie notice ── */
.cookie-notice { position: fixed; bottom: 0; left: 0; right: 0; z-index: 9000; background: var(--glass-bg-strong); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--glass-border-bright); padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: var(--space-lg); flex-wrap: wrap; box-shadow: 0 -4px 24px rgba(0,0,0,0.25); }
.cookie-notice.u-hidden { display: none; }
.cookie-notice-text { font-size: var(--font-sm); color: var(--text-mid); flex: 1; min-width: 200px; }
.cookie-notice-actions { display: flex; align-items: center; gap: var(--space-md); flex-shrink: 0; }
.cookie-notice-link { font-size: var(--font-sm); color: var(--accent); text-decoration: none; }
.cookie-notice-link:hover { text-decoration: underline; }
.cookie-notice-btn { padding: 8px 20px; border-radius: var(--radius-pill); background: var(--accent); color: #fff; border: none; font-size: var(--font-sm); font-weight: 600; font-family: var(--font-body); cursor: pointer; transition: opacity 0.2s; }
.cookie-notice-btn:hover { opacity: 0.85; }

/* ── Auth pages — legal footer & notice ── */
.auth-legal-footer { display: flex; justify-content: center; gap: var(--space-lg); flex-wrap: wrap; padding: 16px 0 8px; }
.auth-legal-link { font-size: var(--font-sm); color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.auth-legal-link:hover { color: var(--text-mid); }
.auth-legal-notice { font-size: var(--font-xs); color: var(--text-ghost); text-align: center; margin-top: 12px; line-height: 1.5; }
.auth-legal-notice a { color: var(--text-faint); }
.auth-legal-notice a:hover { color: var(--accent); }

/* ── Landing page footer links ── */
.landing-footer-links { display: flex; gap: var(--space-lg); flex-wrap: wrap; justify-content: center; margin-bottom: 8px; }
.landing-footer-link { font-size: var(--font-sm); color: var(--text-faint); text-decoration: none; transition: color 0.2s; }
.landing-footer-link:hover { color: var(--text-mid); }

/* ── Legal & Pricing pages ── */
.legal-page { max-width: 860px; margin: 0 auto; padding-bottom: 64px; }
.legal-hero { text-align: center; padding: 40px 0 32px; position: relative; }
.legal-back-link { position: absolute; left: 0; top: 44px; font-size: var(--font-sm); color: var(--text-dim); text-decoration: none; display: inline-flex; align-items: center; gap: 4px; transition: color 0.15s; }
.legal-back-link:hover { color: var(--accent); }
.legal-hero-title { font-size: var(--font-4xl); font-weight: 800; color: var(--text-bright); margin: 0 0 8px; font-family: var(--font-display); }
.legal-hero-sub { font-size: var(--font-md); color: var(--text-dim); margin: 0; }
.legal-body { padding: 36px 40px; border-radius: var(--radius-2xl); margin-bottom: 24px; }
.legal-body section { margin-bottom: 32px; }
.legal-body h2 { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); margin: 0 0 12px; padding-top: 4px; }
.legal-body p { color: var(--text-mid); line-height: 1.8; margin-bottom: 10px; }
.legal-body ul, .legal-body ol { color: var(--text-mid); line-height: 1.8; padding-left: 24px; margin-bottom: 12px; }
.legal-body li { margin-bottom: 6px; }
.legal-body a { color: var(--accent); text-decoration: none; }
.legal-body a:hover { text-decoration: underline; }
.legal-body strong { color: var(--text-bright); }
.legal-body code { background: var(--overlay-6); padding: 2px 6px; border-radius: var(--radius-xs); font-size: 0.9em; color: var(--accent); }
.legal-table { width: 100%; border-collapse: collapse; margin-bottom: 16px; font-size: var(--font-base); }
.legal-table th, .legal-table td { padding: 10px 14px; border: 1px solid var(--border); text-align: left; vertical-align: top; line-height: 1.5; }
.legal-table th { background: var(--overlay-4); font-weight: 600; color: var(--text-bright); }
.legal-table td { color: var(--text-mid); }
.legal-toc { background: var(--overlay-4); border: 1px solid var(--glass-border); border-radius: var(--radius-lg); padding: 20px 24px; margin-bottom: 28px; }
.legal-toc-title { font-size: var(--font-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-dim); margin-bottom: 10px; }
.legal-toc-list { margin: 0; padding-left: 20px; }
.legal-toc-list li { margin-bottom: 4px; }
.legal-toc-list a { font-size: var(--font-base); color: var(--text-dim); text-decoration: none; }
.legal-toc-list a:hover { color: var(--accent); }
.legal-contact-bar { text-align: center; padding: 20px; font-size: var(--font-base); color: var(--text-faint); }
.legal-contact-bar a { color: var(--accent); text-decoration: none; }
.legal-contact-bar a:hover { text-decoration: underline; }

/* ── Pricing page ── */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 32px; }
@media (max-width: 680px) { .pricing-grid { grid-template-columns: 1fr; } }
.pricing-card { padding: 32px 28px; border-radius: var(--radius-2xl); position: relative; display: flex; flex-direction: column; }
.pricing-card-pro { border: 1px solid rgba(255,107,74,0.3); box-shadow: 0 0 32px rgba(255,107,74,0.08); }
.pricing-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: var(--font-xs); font-weight: 700; padding: 4px 14px; border-radius: var(--radius-pill); letter-spacing: 0.5px; white-space: nowrap; }
.pricing-tier-label { font-size: var(--font-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--text-dim); margin-bottom: 8px; }
.pricing-price { font-size: 52px; font-weight: 800; color: var(--text-bright); line-height: 1; margin-bottom: 4px; font-family: var(--font-display); }
.pricing-period { font-size: var(--font-md); font-weight: 400; color: var(--text-dim); }
.pricing-annual { font-size: var(--font-sm); color: var(--accent); margin-bottom: 8px; }
.pricing-tagline { font-size: var(--font-base); color: var(--text-dim); margin-bottom: 20px; }
.pricing-features { list-style: none; padding: 0; margin: 0 0 28px; flex: 1; }
.pricing-feature { display: flex; align-items: flex-start; gap: 10px; padding: 6px 0; font-size: var(--font-base); color: var(--text-mid); border-bottom: 1px solid var(--overlay-4); }
.pricing-feature:last-child { border-bottom: none; }
.pricing-feature-off { opacity: 0.45; }
.pricing-check { color: var(--green); font-weight: 700; flex-shrink: 0; }
.pricing-cross { color: var(--text-ghost); flex-shrink: 0; }
.pricing-cta { display: block; text-align: center; padding: 14px 20px; border-radius: var(--radius-pill); font-size: var(--font-md); font-weight: 700; text-decoration: none; transition: all 0.2s; }
.pricing-cta-primary { background: var(--accent); color: #fff; }
.pricing-cta-primary:hover { opacity: 0.88; transform: translateY(-1px); }
.pricing-cta-secondary { background: var(--overlay-6); color: var(--text-mid); border: 1px solid var(--glass-border-bright); }
.pricing-cta-secondary:hover { background: var(--overlay-8); color: var(--text-bright); }
.pricing-faq { padding: 32px 36px; border-radius: var(--radius-2xl); margin-bottom: 24px; }
.pricing-faq-title { font-size: var(--font-xl); font-weight: 700; color: var(--text-bright); margin: 0 0 24px; }
.pricing-faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 680px) { .pricing-faq-grid { grid-template-columns: 1fr; } }
.pricing-faq-q { font-size: var(--font-md); font-weight: 600; color: var(--text-bright); margin-bottom: 6px; }
.pricing-faq-a { font-size: var(--font-base); color: var(--text-dim); line-height: 1.7; }

/* ── Pricing toggle ── */
.pricing-toggle-wrap { text-align: center; margin-bottom: 32px; }
.pricing-toggle { display: inline-flex; background: var(--overlay-6); border: 1px solid var(--glass-border); border-radius: var(--radius-pill); padding: 4px; gap: 4px; }
.pricing-toggle-btn { padding: 8px 24px; border-radius: var(--radius-pill); border: none; font-family: var(--font-body); font-size: var(--font-sm); font-weight: 600; cursor: pointer; background: transparent; color: var(--text-dim); transition: background 0.2s, color 0.2s; }
.pricing-toggle-btn.active { background: var(--accent); color: #fff; }
.pricing-save-badge { display: inline-block; margin-left: 6px; background: var(--green); color: #000; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: var(--radius-pill); vertical-align: middle; }

/* ── Landing — self-hosted community section ── */
.landing-community { text-align: center; padding: 64px 24px; }
.landing-community-inner { max-width: 680px; margin: 0 auto; }
.landing-community-label { font-size: var(--font-sm); font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--accent); margin-bottom: 14px; }
.landing-community-title { font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 800; color: var(--text-bright); margin: 0 0 20px; font-family: var(--font-display); line-height: 1.2; }
.landing-community-text { font-size: var(--font-md); color: var(--text-mid); line-height: 1.8; margin: 0 0 28px; }
.landing-community-tags { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 32px; }
.landing-community-tag { background: var(--overlay-6); border: 1px solid var(--glass-border-bright); border-radius: var(--radius-pill); padding: 6px 16px; font-size: var(--font-sm); color: var(--text-mid); font-weight: 500; }

/* ── High-contrast mode ── */
@media (prefers-contrast: more) {
  :root {
    --text-bright: #FFFFFF;
    --text-mid: #E0E0E0;
    --text-dim: #C0C0C0;
    --text-faint: #A0A0A0;
    --text-ghost: #909090;
    --border: rgba(255,255,255,0.25);
    --border-light: rgba(255,255,255,0.35);
    --glass-border: rgba(255,255,255,0.20);
    --glass-border-bright: rgba(255,255,255,0.35);
    --bg-card: rgba(255,255,255,0.08);
    --overlay-4: rgba(255,255,255,0.08);
    --overlay-6: rgba(255,255,255,0.12);
    --overlay-8: rgba(255,255,255,0.16);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.3);
  }
  :root[data-theme="light"] {
    --text-bright: #000000;
    --text-mid: #1A1A1A;
    --text-dim: #333333;
    --text-faint: #444444;
    --text-ghost: #555555;
    --border: rgba(0,0,0,0.25);
    --border-light: rgba(0,0,0,0.35);
    --glass-border: rgba(0,0,0,0.20);
    --glass-border-bright: rgba(0,0,0,0.35);
    --bg-card: rgba(0,0,0,0.06);
    --shadow-card: 0 2px 12px rgba(0,0,0,0.15), 0 1px 2px rgba(0,0,0,0.1);
  }
  /* Stronger focus rings */
  *:focus-visible { outline: 3px solid var(--accent) !important; outline-offset: 2px !important; }
  /* Ensure buttons have visible borders */
  .filter-btn, .add-task-btn, .add-habit-btn, .modal-confirm, .modal-cancel,
  .admin-btn, .week-today-btn, .month-btn, .sub-tab { border-width: 2px; }
  /* Stronger stat card borders */
  .stat-card, .card, .task-card, .day-column { border-width: 2px; }
}
