/* ===== SWISS BRUTALISM THEME ===== */

/* ===== CSS Variables ===== */
:root {
    /* Core Colors */
    --surface-0: #000000;
    --surface-1: #0a0a0a;
    --surface-2: #111111;
    --surface-3: #1a1a1a;
    --surface-4: #222222;
    --surface-5: #2b2b2b;
    --bg-primary: var(--surface-0);
    --bg-secondary: var(--surface-1);
    --bg-card: var(--surface-1);
    --bg-input: var(--surface-1);
    
    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #aaaaaa;
    --text-muted: #666666;
    --text-dim: #333333;
    --text-subtle: #888888;
    --text-inverse: #000000;
    --text-on-accent: #ffffff;

    /* Accents */
    --accent-primary: #a78bfa; /* Electric Purple */
    --accent-secondary: #ffffff;
    --accent-success: #ccff00; /* Acid Green */
    --accent-danger: #ff0000;
    --accent-warning: #ffff00;
    --accent-success-glow: rgba(204, 255, 0, 0.35);
    --accent-primary-glow: rgba(106, 0, 255, 0.35);

    /* Habit Strength */
    --strength-mastered: var(--accent-success);
    --strength-strong: var(--accent-primary);
    --strength-building: var(--text-secondary);
    --strength-fragile: var(--accent-danger);
    --strength-mastered-text: var(--text-inverse);
    --strength-strong-text: var(--text-on-accent);
    --strength-building-text: var(--bg-primary);
    --strength-fragile-text: var(--text-primary);

    /* Borders */
    --border-color: #ffffff;
    --border-muted: #333333;
    --border-strong: #444444;
    --border-width: 4px;
    --border-width-thin: 2px;
    --border-style: solid;

    /* Spacing (Grid-like) */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Layout */
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --header-height: 70px;
    --nav-height: 80px;
    --nav-bottom-extra: 28px;

    /* Typography */
    --font-mono: 'Inter', sans-serif;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body[data-theme="light"] {
    --surface-0: #f7f6f2;
    --surface-1: #ffffff;
    --surface-2: #f0efe9;
    --surface-3: #e7e6df;
    --surface-4: #dddcd4;
    --surface-5: #d4d4cf;
    --bg-primary: var(--surface-0);
    --bg-secondary: var(--surface-1);
    --bg-card: var(--surface-1);
    --bg-input: var(--surface-1);
    --text-primary: #141414;
    --text-secondary: #4d4d4d;
    --text-muted: #6b6b6b;
    --text-dim: #6b6b6b;
    --text-subtle: #8a8a8a;
    --text-inverse: #ffffff;
    --text-on-accent: #ffffff;
    --accent-primary: #6f5b8c;
    --accent-success: #4d7c0f;
    --accent-success-glow: rgba(77, 124, 15, 0.35);
    --accent-primary-glow: rgba(111, 91, 140, 0.24);
    --border-color: #b8b8b2;
    --border-muted: #d4d4cf;
    --border-strong: #b8b8b2;
    --strength-mastered: #3e6b52;
    --strength-strong: #4c5c7a;
    --strength-building: #d1cabf;
    --strength-fragile: #a14b3a;
    --strength-mastered-text: #ffffff;
    --strength-strong-text: #ffffff;
    --strength-building-text: #1f1f1f;
    --strength-fragile-text: #ffffff;
}

body[data-theme="light"] .app-header {
    background: var(--surface-1);
}

body[data-theme="light"] .strength-list {
    gap: var(--spacing-sm);
}

body[data-theme="light"] .strength-item {
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
}

body[data-theme="light"] .strength-item:last-child {
    border-bottom: 1px solid var(--border-muted);
}

body[data-theme="light"] .chart-container {
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
}

/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: var(--font-mono);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh;
    line-height: 1.4;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-sans);
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -1px;
    line-height: 1;
}

button, input, select {
    font-family: var(--font-mono);
}

/* ===== App Container ===== */
#app {
    min-height: 100vh;
    min-height: 100dvh;
    border: var(--border-width) solid var(--border-color);
    margin: 0 auto;
    max-width: 600px; /* Constrain width for desktop to maintain brutalist frame */
    position: relative;
    background: var(--bg-primary);
}

/* ===== Screens ===== */
.screen {
    display: none;
    min-height: 100%;
    padding-top: var(--safe-top);
    padding-bottom: calc(var(--safe-bottom) + var(--nav-height) + var(--nav-bottom-extra));
    flex-direction: column;
}

.screen.active {
    display: flex;
}

/* ===== Common Utilities ===== */
.hidden { display: none !important; }

/* ===== Loading Screen ===== */
#loading-screen {
    justify-content: center;
    align-items: center;
    background: var(--bg-primary);
    z-index: 200;
}

.loading-content {
    text-align: center;
    border: var(--border-width) solid var(--border-color);
    padding: var(--spacing-xl);
    width: 80%;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    margin: var(--spacing-lg) auto;
    border: var(--border-width) solid var(--border-color);
    animation: spin 1s steps(8) infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ===== Auth Screen ===== */
#auth-screen {
    justify-content: center;
    padding: var(--spacing-lg);
}

.auth-content {
    border: var(--border-width) solid var(--border-color);
    padding: var(--spacing-xl) var(--spacing-md);
    text-align: center;
    position: relative; /* Added for child absolute positioning */
}

.logo {
    width: 84px;
    height: 84px;
    border: var(--border-width) solid var(--border-color);
    background: var(--text-primary);
    color: var(--bg-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto var(--spacing-lg);
    font-size: 32px;
    font-weight: 900;
    border-radius: 12px;
    overflow: hidden;
}

.subtitle {
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-transform: uppercase;
    font-weight: 900;
}

.subtitle-line {
    display: block;
}

.subtitle-highlight {
    background: var(--accent-success);
    color: var(--text-inverse);
    display: inline-block;
    padding: 2px 6px;
    margin-top: var(--spacing-xs);
}

.logo-image {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.input-group {
    margin-bottom: var(--spacing-md);
    text-align: left;
}

.input-label {
    display: block;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
    font-size: 0.8rem;
}

.input-group input {
    width: 100%;
    background: var(--bg-primary);
    border: var(--border-width-thin) solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-md);
    font-size: 1rem;
    border-radius: 0;
    outline: none;
}

.input-group input:focus {
    background: var(--accent-primary);
    color: var(--text-inverse);
    border-color: var(--text-on-accent);
}

/* Auth Enhancements */
.forgot-password-container {
    text-align: center;
    margin-top: var(--spacing-sm);
}

.forgot-password-btn {
    color: var(--accent-primary);
    text-decoration: none;
    text-transform: none;
    font-weight: 700;
}

.forgot-password-btn:hover {
    text-decoration: underline;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-lg) 0;
    text-transform: uppercase;
}

.divider-line {
    flex: 1;
    height: 2px;
    background: var(--border-muted);
}

.divider-text {
    font-size: 0.75rem;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

.btn-google {
    background: #ffffff;
    color: #3c4043;
    border-color: #dadce0;
    text-transform: none;
    font-weight: 700;
}

.btn-google:hover {
    background: #f8f9fa;
}

.btn-google:active {
    background: #f1f3f4;
}

.google-icon {
    flex-shrink: 0;
}

.auth-error,
.auth-success {
    margin-top: var(--spacing-md);
    padding: var(--spacing-sm) var(--spacing-md);
    border: var(--border-width-thin) solid;
    text-transform: uppercase;
    font-size: 0.8rem;
    text-align: center;
}

.auth-error {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.auth-success {
    border-color: var(--accent-success);
    color: var(--accent-success);
}

/* ===== Buttons ===== */
.btn {
    width: 100%;
    padding: var(--spacing-md);
    border: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 1rem;
    transition: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    border-radius: 0;
}

.btn:active {
    transform: translate(2px, 2px);
}

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

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

.btn-secondary {
    background: transparent;
}

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

.btn-danger {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

.btn-danger:hover {
    background: var(--accent-danger);
    color: var(--text-on-accent);
}

body[data-theme="light"] .profile-signout-section .btn-danger {
    border-color: var(--strength-fragile);
    color: var(--strength-fragile);
}

body[data-theme="light"] .profile-signout-section .btn-danger:hover {
    background: var(--strength-fragile);
    color: var(--strength-fragile-text);
    border-color: var(--strength-fragile);
}

.btn-link {
    background: none;
    border: none;
    color: var(--text-secondary);
    text-decoration: underline;
    cursor: pointer;
    text-transform: uppercase;
    font-size: 0.8rem;
    padding: var(--spacing-sm);
}

/* ===== App Header ===== */
.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 0 var(--spacing-md);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 100;
}

.today-title-header {
    position: static;
}

.btn-icon {
    width: 44px;
    height: 44px;
    border: var(--border-width-thin) solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.2rem;
    border-radius: 0;
}

.btn-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

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

.date-display {
    text-align: center;
    display: flex;
    flex-direction: column;
}

.date-text {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.date-full {
    font-size: 0.7rem;
    color: var(--text-secondary);
}

/* ===== Calendar Picker ===== */
.calendar-picker {
    border-bottom: var(--border-width) solid var(--border-color);
    padding: var(--spacing-md);
    background: var(--bg-primary);
    display: block;
}

.calendar-picker.hidden {
    display: none;
}

.calendar-picker-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
}

.calendar-month-label {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    border-bottom: var(--border-width-thin) solid var(--border-color);
    margin-bottom: var(--spacing-xs);
}

.calendar-weekdays span {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    padding: var(--spacing-xs) 0;
}

.calendar-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
}

.calendar-day-btn {
    aspect-ratio: 1;
    background: transparent;
    border: 1px solid var(--border-muted);
    color: var(--text-primary);
    cursor: pointer;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 0;
}

.calendar-day-btn.before-account {
    background: repeating-linear-gradient(
        135deg,
        rgba(160, 160, 160, 0.25) 0,
        rgba(160, 160, 160, 0.25) 1px,
        transparent 1px,
        transparent 6px
    );
    color: var(--text-muted);
    border-color: var(--border-strong);
    cursor: not-allowed;
}

.calendar-day-btn:disabled {
    opacity: 0.2;
    border-color: var(--surface-4);
}

.calendar-day-btn.before-account:disabled {
    opacity: 1;
    border-color: var(--border-strong);
}

.calendar-day-btn.today {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.calendar-day-btn.selected {
    border: 2px solid var(--accent-primary);
    color: var(--accent-primary);
}

.calendar-day-btn.has-data::after {
    content: '';
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 4px;
    height: 4px;
    background: var(--accent-success);
}

/* ===== Tabs ===== */
.tab-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: var(--border-width) solid var(--border-color);
}

.tab-btn,
.dash-tab {
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    border-right: var(--border-width-thin) solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    border-radius: 0;
    min-height: 64px;
    position: relative;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

.tab-btn:last-child,
.dash-tab:last-child {
    border-right: none;
}

.tab-btn.active,
.dash-tab.active {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

.tab-btn.inactive,
.dash-tab.inactive {
    background: var(--bg-primary);
    color: var(--text-muted);
}

.tab-btn.morning.active,
.dash-tab.morning.active {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.tab-btn.evening.active,
.dash-tab.evening.active {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

body[data-theme="light"] .tab-btn.morning.active,
body[data-theme="light"] .dash-tab.morning.active {
    color: var(--text-on-accent);
}

.tab-btn .tab-icon,
.dash-tab .tab-icon {
    width: 32px;
    height: 32px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
    stroke-linecap: square;
    stroke-linejoin: round;
    flex-shrink: 0;
}

.tab-btn.inactive .tab-icon,
.dash-tab.inactive .tab-icon {
    opacity: 0.5;
}

.tab-btn.morning .sun-arc,
.dash-tab.morning .sun-arc {
    transform-origin: 50% 15px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.tab-btn.morning.inactive .sun-arc,
.dash-tab.morning.inactive .sun-arc {
    transform: translateY(15px) scale(0.5);
    opacity: 0;
}

.tab-btn.morning.active .sun-arc,
.dash-tab.morning.active .sun-arc {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.tab-btn.morning .sun-ray,
.dash-tab.morning .sun-ray {
    transition: opacity 0.3s ease 0.2s, transform 0.3s ease 0.2s;
    transform-origin: bottom;
}

.tab-btn.morning.inactive .sun-ray,
.dash-tab.morning.inactive .sun-ray {
    opacity: 0;
    transform: scaleY(0);
}

.tab-btn.morning.active .sun-ray,
.dash-tab.morning.active .sun-ray {
    opacity: 1;
    transform: scaleY(1);
}

.tab-btn.evening .moon-arc,
.dash-tab.evening .moon-arc {
    transform-origin: 50% 9px;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.4s ease;
}

.tab-btn.evening.inactive .moon-arc,
.dash-tab.evening.inactive .moon-arc {
    transform: translateY(-15px) rotate(-10deg);
    opacity: 0;
}

.tab-btn.evening.active .moon-arc,
.dash-tab.evening.active .moon-arc {
    transform: translateY(0) rotate(0deg);
    opacity: 1;
}

/* ===== Habit List ===== */
.habit-container {
    padding: 0;
}

.habit-section {
    border-bottom: var(--border-width) solid var(--border-color);
}

.habit-section:last-child {
    border-bottom: none;
}

.section-header {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    border-bottom: var(--border-width-thin) solid var(--border-color);
}

.habit-list {
    display: none;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md) var(--spacing-md);
}

.habit-list.active {
    display: flex;
}

.weekly-habit-list {
    display: none;
    flex-direction: column;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) 0 var(--spacing-md);
}

.weekly-habit-list.active {
    display: flex;
}

.weekly-goal-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 0 var(--spacing-md);
}

.weekly-goal-empty {
    padding: var(--spacing-md);
    font-size: 0.85rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
}

.habit-item {
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
    padding: 18px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    overflow: hidden;
}

.habit-item.future-locked {
    cursor: not-allowed;
}

.habit-item.future-denied {
    animation: future-denied 0.35s ease;
}

.habit-item:active {
    background: var(--surface-2);
}

.habit-item.opt-d .fill-layer {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 0%;
    z-index: 1;
    transition: width 0.4s cubic-bezier(0.25, 1, 0.5, 1);
}

.habit-icon {
    width: 24px;
    height: 24px;
    border: 2px solid var(--text-muted);
    flex-shrink: 0;
    position: relative;
    z-index: 2;
    transition: all 0.3s ease;
}

.habit-text {
    font-family: 'SF Mono', 'Consolas', 'Monaco', monospace;
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 2;
    color: var(--text-primary);
    display: flex;
    align-items: baseline;
    gap: 8px;
    transition: color 0.3s ease;
}

.habit-number {
    min-width: 28px;
    text-align: right;
}

.habit-item.opt-d-morning .fill-layer {
    background-color: var(--accent-success);
}

.habit-item.opt-d-evening .fill-layer {
    background-color: var(--accent-primary);
}

.habit-item.opt-d-morning.completed .fill-layer,
.habit-item.opt-d-evening.completed .fill-layer {
    width: 100%;
}

.habit-item.opt-d-morning.completed .habit-text {
    color: var(--text-inverse);
    transition-delay: 0.1s;
}

.habit-item.opt-d-evening.completed .habit-text {
    color: var(--text-on-accent);
    transition-delay: 0.1s;
}

.habit-item.opt-d-morning.completed .habit-icon {
    border-color: var(--text-inverse);
    background: var(--text-inverse);
}

.habit-item.opt-d-evening.completed .habit-icon {
    border-color: var(--text-on-accent);
    background: var(--text-on-accent);
}

.habit-item.opt-d-morning.completed .habit-icon::after,
.habit-item.opt-d-evening.completed .habit-icon::after {
    content: "";
    display: block;
    width: 10px;
    height: 5px;
    transform: rotate(-45deg);
    position: absolute;
    top: 5px;
    left: 4px;
    border-bottom: 3px solid currentColor;
    border-left: 3px solid currentColor;
}

.habit-item.opt-d-morning.completed .habit-icon::after {
    color: var(--accent-success);
}

.habit-item.opt-d-evening.completed .habit-icon::after {
    color: var(--accent-primary);
}

.habit-item.has-tips {
    padding-right: 70px;
}

.habit-tips-btn {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-2);
    color: var(--text-primary);
    padding: 6px 10px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.6rem;
    cursor: pointer;
    z-index: 2;
}

.habit-tips-btn:hover,
.habit-tips-btn:active {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

@keyframes future-denied {
    0% {
        transform: translateX(0);
    }
    35% {
        transform: translateX(-2px);
    }
    70% {
        transform: translateX(2px);
    }
    100% {
        transform: translateX(0);
    }
}

/* Not Today Section */
.not-today-section {
    border-top: var(--border-width) solid var(--border-color);
}

.not-today-header {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--surface-2);
    border: none;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    text-align: left;
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    cursor: pointer;
}

.not-today-title {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.not-today-page {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.not-today-list {
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
    display: flex;
    flex-direction: column;
}

.not-today-type {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-muted);
    background: var(--surface-2);
}

.not-today-habit {
    padding: var(--spacing-sm) var(--spacing-md);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-sm);
    color: var(--text-muted);
    font-size: 0.8rem;
    border-bottom: 1px solid var(--border-muted);
}

.not-today-habit:last-child {
    border-bottom: none;
}

.schedule-badge {
    border: 1px solid var(--border-muted);
    padding: 2px 6px;
    text-transform: uppercase;
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    white-space: nowrap;
}

.not-today-empty {
    padding: var(--spacing-md);
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* ===== Progress Bar ===== */
.progress-section {
    padding: var(--spacing-md);
    border-top: var(--border-width) solid var(--border-color);
    --progress-complete-color: var(--accent-success);
    --progress-glow: var(--accent-success-glow);
    --progress-neutral: var(--border-strong);
}

.progress-bar {
    height: 20px;
    border: 2px solid var(--border-color);
    margin-bottom: var(--spacing-xs);
    position: relative;
    transform-origin: center;
}

.progress-fill {
    height: 100%;
    background: var(--accent-success);
    width: 0%;
    transition: width 0.2s steps(4), background-color 0.2s ease;
}

.progress-section.progress-evening,
.weekly-progress.progress-evening {
    --progress-complete-color: var(--accent-primary);
    --progress-glow: var(--accent-primary-glow);
}

.progress-section.progress-empty .progress-fill,
.progress-section.progress-partial .progress-fill,
.weekly-progress.progress-empty .progress-fill,
.weekly-progress.progress-partial .progress-fill {
    background: var(--progress-neutral);
}

.progress-section.progress-complete .progress-fill,
.weekly-progress.progress-complete .progress-fill {
    background: var(--progress-complete-color);
}

.progress-section.progress-reward .progress-fill,
.weekly-progress.progress-reward .progress-fill {
    animation: progress-reward 0.6s ease;
}

.progress-section.progress-reward .progress-bar {
    animation: progress-shake 0.45s ease;
}

.weekly-progress.progress-reward .progress-bar {
    animation: progress-shake 0.45s ease;
}

.weekly-progress {
    --progress-complete-color: var(--accent-success);
    --progress-glow: var(--accent-success-glow);
    --progress-neutral: var(--border-strong);
}

.weekly-progress .progress-bar {
    height: 14px;
}

.weekly-progress .progress-text {
    font-size: 0.7rem;
}

@keyframes progress-reward {
    0% {
        box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
        transform: scaleY(1);
    }
    45% {
        box-shadow: inset 0 0 8px rgba(255, 255, 255, 0.15), 0 0 10px var(--progress-glow);
        transform: scaleY(1.08);
    }
    100% {
        box-shadow: inset 0 0 0 rgba(0, 0, 0, 0), 0 0 0 rgba(0, 0, 0, 0);
        transform: scaleY(1);
    }
}

@keyframes progress-shake {
    0% {
        transform: translateX(0) scaleY(1);
    }
    30% {
        transform: translateX(-1px) scaleY(1.15);
    }
    60% {
        transform: translateX(1px) scaleY(1.1);
    }
    100% {
        transform: translateX(0) scaleY(1);
    }
}

.progress-text {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

/* ===== Bottom Nav ===== */
.bottom-nav {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    border-top: var(--border-width) solid var(--border-color);
    height: calc(var(--nav-height) + var(--safe-bottom) + var(--nav-bottom-extra));
    padding-bottom: calc(var(--safe-bottom) + var(--nav-bottom-extra));
    background: var(--bg-primary);
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    z-index: 300;
    box-sizing: border-box;
    align-items: start;
}

.nav-btn {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    border-radius: 0;
    height: var(--nav-height);
}

.nav-btn.active {
    background: transparent;
    color: var(--accent-success);
}

.nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
}

.nav-svg {
    width: 26px;
    height: 26px;
    color: currentColor;
    fill: none;
    stroke: currentColor;
    stroke-width: 3;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.today-dot,
.setting-knob-1,
.setting-knob-2 {
    fill: currentColor;
    stroke: none;
}

.bulb-glass {
    fill: none;
}

/* Bottom nav icon animations */
.dash-frame,
.dash-cross {
    transform-origin: center;
    transform-box: fill-box;
    transition: all 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn.active .dash-cross {
    transform: rotate(90deg) scale(1.1);
    stroke-width: 3;
}

.today-dot {
    transition: r 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nav-btn.active .today-dot {
    r: 5;
}

.insight-line {
    transition: all 0.8s ease;
}

.nav-btn.active .insight-line {
    d: path('M4 20 L10 10 L14 14 L20 4');
}

.setting-knob-1,
.setting-knob-2 {
    transition: transform 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

.nav-btn.active .setting-knob-1 {
    transform: translateX(-8px);
}

.nav-btn.active .setting-knob-2 {
    transform: translateX(8px);
}

.bulb-glass {
    transition: fill 0.8s ease;
}

.bulb-filament {
    opacity: 1;
    transition: opacity 0.8s ease;
}

.bulb-rays {
    opacity: 0;
    transform-origin: center;
    transform-box: fill-box;
    transform: scale(0.5);
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.8s ease;
}

.nav-btn.active .bulb-glass {
    fill: currentColor;
}

.nav-btn.active .bulb-filament {
    opacity: 0;
}

.nav-btn.active .bulb-rays {
    opacity: 1;
    transform: scale(1.2);
}

@keyframes nav-pulse {
    0% {
        transform: scale(1);
    }
    45% {
        transform: scale(1.12);
    }
    100% {
        transform: scale(1);
    }
}

.nav-btn.pulse .nav-svg {
    animation: nav-pulse 0.8s ease;
}

/* ===== Mindset ===== */
#mindset-screen {
    position: relative;
}

.mindset-journal-open .mindset-date-header,
.mindset-journal-open #mindset-calendar-picker {
    display: none;
}

.header-title {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.mindset-date-header {
    border-bottom: var(--border-width) solid var(--border-color);
}

.mindset-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 0;
}

.mindset-content::-webkit-scrollbar {
    width: 6px;
}

.mindset-content::-webkit-scrollbar-track {
    background: var(--surface-2);
}

.mindset-content::-webkit-scrollbar-thumb {
    background: var(--border-muted);
}

.mindset-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.mindset-block {
    border-bottom: var(--border-width) solid var(--border-color);
}

.mindset-block-header {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
}

.mindset-block-header h2 {
    font-size: 1rem;
    display: flex;
    align-items: center;
}

.mindset-block-header h2::before {
    content: '// ';
    color: var(--accent-primary);
    margin-right: var(--spacing-sm);
}

.mindset-block-content {
    padding: var(--spacing-lg);
}

.mindset-quote {
    margin-bottom: var(--spacing-lg);
}

.mindset-quote-mark {
    font-size: 3rem;
    color: var(--accent-success);
    line-height: 0.5;
    margin-bottom: var(--spacing-sm);
}

.mindset-quote-mark-end {
    text-align: right;
    margin-top: calc(var(--spacing-sm) * -1);
}

.mindset-quote-text {
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.6;
    margin-bottom: var(--spacing-sm);
}

.mindset-author {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    background: var(--bg-secondary);
    border-left: var(--border-width) solid var(--accent-primary);
}

.mindset-author-avatar {
    width: 48px;
    height: 48px;
    border: 2px solid var(--border-color);
    background: var(--accent-primary);
    color: var(--text-on-accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.mindset-author-name {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.85rem;
}

.mindset-author-role {
    color: var(--text-secondary);
    font-size: 0.7rem;
    text-transform: uppercase;
    margin-top: 2px;
}

.mindset-rating {
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--border-muted);
}

.mindset-rating-label {
    font-size: 0.75rem;
    color: var(--text-primary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
    letter-spacing: 0.5px;
}

.mindset-star-rating {
    display: flex;
    gap: 6px;
}

.mindset-star {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-muted);
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.15s ease;
    position: relative;
}

.mindset-star:hover {
    border-color: var(--accent-success);
    color: var(--text-inverse);
    background: var(--accent-success);
    transform: scale(1.1);
}

.mindset-star.active {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

.mindset-star.active:hover {
    transform: scale(1.1);
}

.mindset-star.preview {
    border-color: var(--accent-success);
    color: var(--text-inverse);
    background: var(--accent-success);
}

.mindset-question {
    margin-bottom: var(--spacing-lg);
}

.mindset-question-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.mindset-question-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    font-size: 0.7rem;
    font-weight: 900;
    text-transform: uppercase;
    background: var(--text-secondary);
    color: var(--bg-primary);
    transition: background 0.3s ease;
}

.mindset-question-badge.answered {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.mindset-question-icon {
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mindset-question-icon svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.mindset-question-text {
    font-size: 0.75rem;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    text-transform: uppercase;
}

.mindset-answer-input {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-muted);
    color: var(--text-primary);
    padding: var(--spacing-sm);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.2s;
}

.mindset-answer-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.mindset-answer-input.has-content {
    border-color: var(--accent-success);
}

.mindset-save-btn {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--text-primary);
    color: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.9rem;
    transition: all 0.15s;
}

.mindset-save-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

.mindset-save-btn:active {
    transform: translate(2px, 2px);
}

body[data-theme="light"] .mindset-save-btn {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

body[data-theme="light"] .mindset-save-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

body[data-theme="light"] .mindset-save-btn:active {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

.mindset-save-btn.disabled {
    cursor: not-allowed;
    opacity: 0.6;
}


.mindset-journal-page,
.mindset-entry-detail {
    display: none;
    flex-direction: column;
    position: absolute;
    inset: 0;
    background: var(--bg-primary);
    z-index: 200;
    padding-bottom: calc(var(--nav-height) + var(--nav-bottom-extra));
}

.mindset-journal-page.active,
.mindset-entry-detail.active {
    display: flex;
}

.mindset-journal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 0 var(--spacing-md);
    flex-shrink: 0;
}

.mindset-back-btn svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.mindset-journal-title {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
}

.mindset-sort-btn {
    padding: 8px 12px;
    border: 1px solid var(--border-strong);
    background: transparent;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.15s;
}

.mindset-sort-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.mindset-filter-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    border-bottom: var(--border-width) solid var(--border-color);
    flex-shrink: 0;
}

.mindset-filter-tab {
    padding: var(--spacing-md);
    background: transparent;
    border: none;
    border-right: 1px solid var(--border-muted);
    color: var(--text-secondary);
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    font-size: 0.75rem;
    transition: all 0.15s;
}

.mindset-filter-tab:last-child {
    border-right: none;
}

.mindset-filter-tab.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.mindset-filter-tab:hover:not(.active) {
    background: var(--bg-secondary);
}

.mindset-journal-list {
    flex: 1;
    overflow-y: auto;
    padding-bottom: calc(var(--nav-height) + var(--nav-bottom-extra));
}

.mindset-journal-list::-webkit-scrollbar {
    width: 6px;
}

.mindset-journal-list::-webkit-scrollbar-track {
    background: var(--surface-2);
}

.mindset-journal-list::-webkit-scrollbar-thumb {
    background: var(--border-muted);
}

.mindset-journal-list::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.mindset-journal-entry {
    border-bottom: 1px solid var(--border-muted);
    padding: var(--spacing-md);
    cursor: pointer;
    transition: background 0.1s;
}

.mindset-journal-entry:hover {
    background: var(--bg-secondary);
}

.mindset-entry-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: var(--spacing-sm);
}

.mindset-entry-date {
    font-size: 0.7rem;
    color: var(--bg-primary);
    text-transform: uppercase;
    font-weight: 900;
    background: var(--text-secondary);
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mindset-entry-rating {
    display: flex;
    gap: 2px;
}

.mindset-entry-rating .star-icon {
    color: var(--accent-success);
    font-size: 0.7rem;
}

.mindset-entry-rating .star-icon.empty {
    color: var(--text-muted);
}

.mindset-entry-quote {
    font-size: 0.85rem;
    line-height: 1.4;
    margin-bottom: var(--spacing-xs);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mindset-entry-author {
    font-size: 0.7rem;
    color: var(--text-on-accent);
    text-transform: uppercase;
    font-weight: 900;
    background: var(--accent-primary);
    padding: 3px 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.mindset-empty-state {
    padding: var(--spacing-lg);
    color: var(--text-secondary);
    text-transform: uppercase;
    font-weight: 700;
    font-size: 0.8rem;
}

.mindset-detail-content {
    flex: 1;
    padding: var(--spacing-lg);
    overflow-y: auto;
    padding-bottom: calc(var(--nav-height) + var(--nav-bottom-extra) + var(--spacing-lg));
}

.mindset-detail-content::-webkit-scrollbar {
    width: 6px;
}

.mindset-detail-content::-webkit-scrollbar-track {
    background: var(--surface-2);
}

.mindset-detail-content::-webkit-scrollbar-thumb {
    background: var(--border-muted);
}

.mindset-detail-content::-webkit-scrollbar-thumb:hover {
    background: var(--border-strong);
}

.mindset-detail-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
}

.mindset-detail-date {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

.mindset-detail-rating {
    display: flex;
    gap: 4px;
}

.mindset-detail-rating .star-icon {
    color: var(--accent-success);
}

.mindset-detail-rating .star-icon.empty {
    color: var(--text-muted);
}

.mindset-detail-quote {
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.6;
    margin-bottom: var(--spacing-lg);
    padding: var(--spacing-md);
    border-left: var(--border-width) solid var(--accent-success);
    background: rgba(204, 255, 0, 0.05);
}

.mindset-detail-author {
    margin-bottom: var(--spacing-xl);
}

.mindset-detail-name {
    font-weight: 900;
    text-transform: uppercase;
}

.mindset-detail-role {
    color: var(--text-muted);
    font-size: 0.8rem;
}

.mindset-detail-responses {
    border: var(--border-width-thin) solid var(--border-color);
}

.mindset-detail-header {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    padding: var(--spacing-sm) var(--spacing-md);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
}

.mindset-detail-item {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
}

.mindset-detail-item:last-child {
    border-bottom: none;
}

.mindset-detail-q {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.mindset-detail-q svg {
    width: 14px;
    height: 14px;
    fill: none;
    stroke: var(--accent-success);
    stroke-width: 2;
}

.mindset-detail-a {
    font-size: 0.9rem;
    line-height: 1.5;
}

/* ===== Dashboard ===== */
.dashboard-content {
    padding-bottom: 0;
}

.month-select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: var(--border-width-thin) solid var(--border-color);
    padding: var(--spacing-sm);
    margin-right: var(--spacing-md);
    font-weight: 700;
    text-transform: uppercase;
}

.summary-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr); /* 2 columns for brutalist look */
    border-bottom: var(--border-width) solid var(--border-color);
}

.summary-card {
    padding: var(--spacing-md);
    border-right: var(--border-width-thin) solid var(--border-color);
    border-bottom: var(--border-width-thin) solid var(--border-color);
}

.summary-card:nth-child(even) {
    border-right: none;
}

.card-label {
    display: block;
    font-size: 0.7rem;
    font-weight: 900;
    color: var(--text-secondary);
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
}

.card-value {
    font-family: var(--font-sans);
    font-size: 2rem;
    font-weight: 900;
    display: block;
    line-height: 0.9;
}

.dashboard-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: var(--border-width) solid var(--border-color);
}

.chart-section {
    padding: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--border-color);
}

.chart-section h2 {
    font-size: 1rem;
    margin-bottom: var(--spacing-md);
    display: flex;
    align-items: center;
}

.chart-section h2::before {
    content: '// ';
    color: var(--accent-primary);
    margin-right: var(--spacing-sm);
}

.chart-section.collapsible h2 {
    cursor: pointer;
    padding: 4px 6px;
    border: 1px solid transparent;
    width: 100%;
    transition: box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.chart-section.collapsible h2::before {
    display: inline-block;
    transition: transform 0.25s ease;
    transform-origin: 50% 50%;
}

.chart-section.collapsible:hover h2,
.chart-section.collapsible h2:active {
    background-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 18px rgba(255, 255, 255, 0.25);
    border-color: var(--border-muted);
}

.chart-section.collapsible.collapsed h2 {
    margin-bottom: 0;
}

.chart-section.collapsible .section-body {
    display: none;
}

.chart-section.collapsible.expanded .section-body {
    display: block;
}

.chart-section.collapsible.expanded h2::before {
    transform: rotate(90deg);
}

.completion-section {
    margin-top: var(--spacing-md);
}

.completion-section:first-of-type {
    margin-top: 0;
}

.completion-divider {
    height: 4px;
    background: var(--border-color);
    opacity: 1;
    margin: var(--spacing-md) 0;
}

.chart-container {
    height: 200px;
    border: 1px dashed var(--border-muted);
    padding: var(--spacing-sm);
}

.weekly-goal-chart {
    height: auto;
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.weekly-goal-chart-canvas {
    height: calc(200px - (var(--spacing-sm) * 2));
}

.weekly-goal-chart-canvas canvas {
    width: 100% !important;
    height: 100% !important;
}

.weekly-goal-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    justify-content: center;
    font-size: 12px;
    font-family: 'Courier New', Courier, monospace;
    font-weight: bold;
    color: var(--text-primary);
}

.weekly-goal-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    font: inherit;
}

.weekly-goal-legend-swatch {
    width: 12px;
    height: 12px;
    border: 1px solid currentColor;
    background: transparent;
    flex: 0 0 auto;
}

.weekly-goal-legend-item.is-hidden {
    text-decoration: line-through;
    opacity: 0.6;
}

.habit-rates {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.rate-item {
    border: 1px solid var(--border-muted);
    padding: var(--spacing-sm);
}

.rate-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
    font-size: 0.8rem;
    font-weight: 700;
}

.streak-badge {
    padding: 2px 6px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    background: var(--text-secondary);
    color: var(--text-on-accent);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.streak-badge.morning {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.streak-badge.evening {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

.streak-label {
    font-weight: 900;
}

.streak-value {
    font-weight: 700;
}

.rate-bar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.rate-bar {
    flex: 1;
    height: 12px;
    border: 1px solid var(--border-color);
}

.rate-fill {
    height: 100%;
    background: var(--text-primary);
}

.calendar-shell {
    width: 100%;
}

.calendar-layout {
    display: flex;
    gap: var(--spacing-lg);
    align-items: center;
}

.calendar-grid {
    flex: 1;
    min-width: 0;
}

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.weekday-label {
    text-align: center;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.calendar-heatmap {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
}

.calendar-day {
    aspect-ratio: 1;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    background: var(--surface-2);
    color: var(--text-dim);
    border: 1px solid var(--surface-3);
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
}

.calendar-day:not(.empty) {
    cursor: pointer;
}

.calendar-day:not(.empty):hover,
.calendar-day:not(.empty):active {
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
    border-color: var(--text-muted);
    transform: translateY(-1px);
}

.calendar-day.level-0 { background: #050505; color: var(--text-dim); }
.calendar-day.level-1 { background: #2b2b2b; color: #8c8c8c; }
.calendar-day.level-2 { background: #4a4a4a; color: #c0c0c0; }
.calendar-day.level-3 { background: #6a6a6a; color: #f0f0f0; }
.calendar-day.level-4 { background: #8a8a8a; color: #101010; }
.calendar-day.level-5 { background: var(--text-primary); color: var(--text-inverse); font-weight: 900; }
.calendar-day.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 4px,
        rgba(10, 10, 10, 0.8) 4px,
        rgba(10, 10, 10, 0.8) 8px
    );
    color: #555;
}
.calendar-day.before-account {
    background: repeating-linear-gradient(
        135deg,
        rgba(160, 160, 160, 0.25) 0,
        rgba(160, 160, 160, 0.25) 1px,
        transparent 1px,
        transparent 6px
    );
    color: var(--text-muted);
    border-color: var(--border-strong);
    cursor: not-allowed;
}
.calendar-day.future {
    background: #070707;
    color: #2f2f2f;
    border-color: #101010;
}
.calendar-shell[data-type="morning"] .calendar-day.level-5 { background: var(--accent-success); color: var(--text-inverse); }
.calendar-shell[data-type="evening"] .calendar-day.level-5 { background: var(--accent-primary); color: var(--text-on-accent); }
.calendar-day.today { border: 2px solid var(--accent-primary); }
.calendar-shell[data-type="morning"] .calendar-day.today { border-color: var(--accent-success); }
body[data-theme="light"] .calendar-shell[data-type="evening"] .calendar-day.today { border-color: var(--accent-primary); }

.calendar-legend {
    min-width: 180px;
    padding: var(--spacing-sm);
    border: 1px solid var(--border-muted);
    background: var(--surface-1);
}

.calendar-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.calendar-legend-item:last-child {
    margin-bottom: 0;
}

.legend-swatch {
    width: 16px;
    height: 16px;
    border: 1px solid var(--surface-4);
    background: #0d0d0d;
}

.legend-swatch.level-0 { background: #050505; }
.legend-swatch.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 4px,
        rgba(10, 10, 10, 0.8) 4px,
        rgba(10, 10, 10, 0.8) 8px
    );
}
.legend-swatch.level-1 { background: #2b2b2b; }
.legend-swatch.level-2 { background: #4a4a4a; }
.legend-swatch.level-3 { background: #6a6a6a; }
.legend-swatch.level-4 { background: #8a8a8a; }
.legend-swatch.level-5 { background: var(--text-primary); }
.calendar-shell[data-type="morning"] .legend-swatch.level-5 { background: var(--accent-success); }
.calendar-shell[data-type="evening"] .legend-swatch.level-5 { background: var(--accent-primary); }

@media (max-width: 720px) {
    .calendar-layout {
        flex-direction: column;
    }

    .calendar-legend {
        width: 100%;
    }
}

body[data-theme="light"] .calendar-day {
    background: var(--surface-2);
    color: var(--text-muted);
    border-color: var(--border-muted);
}

body[data-theme="light"] .calendar-day:not(.empty):hover,
body[data-theme="light"] .calendar-day:not(.empty):active {
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.15);
    border-color: var(--border-strong);
}

body[data-theme="light"] .calendar-day.level-0 { background: #f4f3ee; color: #9a9a92; }
body[data-theme="light"] .calendar-day.level-1 { background: #e7e6df; color: #7a7a72; }
body[data-theme="light"] .calendar-day.level-2 { background: #d9d7cf; color: #5f5f58; }
body[data-theme="light"] .calendar-day.level-3 { background: #c8c6bf; color: #3f3f3a; }
body[data-theme="light"] .calendar-day.level-4 { background: #b6b4ad; color: #252525; }
body[data-theme="light"] .calendar-day.level-5 { background: var(--text-primary); color: var(--bg-primary); }

body[data-theme="light"] .calendar-day.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(60, 60, 60, 0.08) 0,
        rgba(60, 60, 60, 0.08) 4px,
        rgba(255, 255, 255, 0.8) 4px,
        rgba(255, 255, 255, 0.8) 8px
    );
    color: #8a8a8a;
}

body[data-theme="light"] .calendar-day.before-account {
    background: repeating-linear-gradient(
        135deg,
        rgba(60, 60, 60, 0.08) 0,
        rgba(60, 60, 60, 0.08) 2px,
        rgba(255, 255, 255, 0.8) 2px,
        rgba(255, 255, 255, 0.8) 4px
    );
    color: #9a9a92;
    border-color: var(--border-muted);
}

body[data-theme="light"] .calendar-day.future {
    background: var(--surface-3);
    color: var(--text-subtle);
    border-color: var(--border-muted);
}

body[data-theme="light"] .legend-swatch {
    border-color: var(--border-muted);
    background: var(--surface-3);
}

body[data-theme="light"] .legend-swatch.level-0 { background: #f4f3ee; }
body[data-theme="light"] .legend-swatch.level-1 { background: #e7e6df; }
body[data-theme="light"] .legend-swatch.level-2 { background: #d9d7cf; }
body[data-theme="light"] .legend-swatch.level-3 { background: #c8c6bf; }
body[data-theme="light"] .legend-swatch.level-4 { background: #b6b4ad; }

body[data-theme="light"] .nav-btn.active {
    color: var(--accent-success);
}

body[data-theme="light"] .legend-swatch.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(60, 60, 60, 0.08) 0,
        rgba(60, 60, 60, 0.08) 4px,
        rgba(255, 255, 255, 0.8) 4px,
        rgba(255, 255, 255, 0.8) 8px
    );
}

/* ===== Settings ===== */
.settings-section {
    margin-bottom: 0;
    border-bottom: var(--border-width) solid var(--border-color);
}

.settings-section h2 {
    padding: var(--spacing-md);
    background: var(--surface-2);
    font-size: 1rem;
    border-bottom: var(--border-width-thin) solid var(--border-color);
}

.edit-habit-item {
    display: flex;
    align-items: center;
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
    background: var(--bg-primary);
    gap: var(--spacing-md);
}

.drag-handle {
    cursor: grab;
    color: var(--text-muted);
}

.edit-habit-name {
    flex: 1;
    font-weight: 700;
    text-transform: uppercase;
}

.edit-btn {
    width: 30px;
    height: 30px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 0;
}

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

.edit-btn.delete:hover {
    background: var(--accent-danger);
    color: var(--text-primary);
    border-color: var(--accent-danger);
}

.account-info {
    padding: var(--spacing-md);
    font-family: var(--font-mono);
}

.btn-add {
    width: 100%;
    padding: var(--spacing-md);
    background: transparent;
    color: var(--text-primary);
    border: none;
    border-top: 1px dashed var(--border-muted);
    font-family: var(--font-mono);
    text-transform: uppercase;
    cursor: pointer;
}

.btn-add:hover {
    background: var(--surface-2);
    color: var(--accent-success);
}

/* ===== Modals ===== */
.modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

#schedule-modal {
    z-index: 1100; /* Higher than generic modal to appear on top */
}

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.8);
    backdrop-filter: grayscale(100%);
}

.modal-content {
    position: relative;
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border: var(--border-width) solid var(--border-color);
    padding: var(--spacing-lg);
    box-shadow: 20px 20px 0 rgba(255,255,255,0.1);
}

.modal-content h2 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-lg);
    background: var(--text-primary);
    color: var(--bg-primary);
    display: inline-block;
    padding: 4px 8px;
}

.modal-description {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin-bottom: var(--spacing-md);
}

.modal-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-xl);
}

/* Schedule options */
.schedule-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
}

.schedule-type-btn {
    padding: var(--spacing-sm);
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.schedule-type-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
    border-color: var(--text-primary);
}

.day-selector {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: var(--spacing-sm);
}

.day-chip {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.7rem;
}

.day-chip.selected {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

.interval-input {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.interval-row {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.interval-row label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
}

.interval-row input[type="number"],
.interval-row input[type="date"] {
    background: var(--bg-input);
    color: var(--text-primary);
    border: 1px solid var(--border-muted);
    padding: 6px 8px;
    font-family: var(--font-mono);
    font-size: 0.8rem;
}

.interval-date-btn {
    padding: 6px 10px;
}

.interval-date-value {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

.interval-calendar {
    border: 1px solid var(--border-muted);
    padding: var(--spacing-sm);
    background: var(--surface-1);
}

.interval-calendar.hidden {
    display: none;
}

.interval-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-sm);
}

.interval-calendar-label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
}

.interval-calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    font-size: 0.65rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.interval-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.interval-calendar-cell.empty {
    height: 28px;
}

.interval-calendar-day {
    height: 28px;
    border: 1px solid var(--border-muted);
    background: var(--bg-input);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
}

.interval-calendar-day.selected {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

/* ===== Onboarding ===== */
#onboarding-screen {
    background: var(--bg-primary);
    padding-top: var(--safe-top);
}

.onboarding-progress {
    padding: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--border-color);
}

.progress-steps {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.progress-steps .step {
    width: 36px;
    height: 36px;
    border: 2px solid var(--border-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.progress-steps .step.active {
    border-color: var(--text-primary);
    color: var(--text-primary);
    background: var(--surface-2);
}

.progress-steps .step.completed {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

.onboarding-welcome {
    padding: var(--spacing-lg) var(--spacing-md) 0;
}

.onboarding-habit-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-md);
    border: 1px solid var(--border-muted);
    margin-bottom: var(--spacing-sm);
    opacity: 0.5;
}

.onboarding-habit-item.selected {
    opacity: 1;
    border-color: var(--text-primary);
    background: var(--surface-1);
}

/* ===== Settings Redesign ===== */
.settings-controls {
    padding: var(--spacing-md);
    border-bottom: var(--border-width) solid var(--border-color);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.search-bar {
    display: flex;
    align-items: center;
    border: var(--border-width-thin) solid var(--border-color);
    padding: var(--spacing-sm) var(--spacing-md);
    margin-bottom: var(--spacing-md);
    background: var(--bg-primary);
}

.search-icon {
    margin-right: var(--spacing-sm);
    font-size: 0.9rem;
}

.search-bar input {
    border: none;
    background: transparent;
    width: 100%;
    color: var(--text-primary);
    font-family: var(--font-mono);
    text-transform: uppercase;
    font-size: 0.9rem;
    padding: 0;
    outline: none;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

.filter-pills {
    display: flex;
    gap: var(--spacing-sm);
    overflow-x: auto;
    padding-bottom: 4px; /* Scrollbar space */
}

.filter-pill {
    padding: 6px 12px;
    background: transparent;
    border: 1px solid var(--text-secondary);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    white-space: nowrap;
}

.filter-pill.active {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

.settings-habits-container {
    padding: var(--spacing-md);
    min-height: 200px;
}

.settings-group {
    margin-bottom: var(--spacing-xl);
}

.settings-group h3 {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 4px;
    letter-spacing: 1px;
}

.habit-card {
    border: var(--border-width-thin) solid var(--border-color);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    background: var(--bg-primary);
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
}

.habit-card-content {
    flex: 1;
}

.habit-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.habit-card-name {
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.habit-type-badge {
    font-size: 0.65rem;
    padding: 2px 4px;
    background: var(--text-primary);
    color: var(--bg-primary);
    text-transform: uppercase;
    font-weight: 700;
}

.habit-card-details {
    display: flex;
    gap: var(--spacing-sm);
    align-items: center;
}

.schedule-chip {
    font-size: 0.7rem;
    background: var(--surface-2);
    color: var(--text-secondary);
    padding: 2px 6px;
    font-family: var(--font-mono);
}

.habit-card-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.card-action-btn {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 0.8rem;
}

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

/* ===== Drag and Drop ===== */
.habit-card {
    position: relative;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.drag-handle {
    cursor: grab;
    padding: 0 8px;
    color: var(--text-muted);
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
}

.drag-handle:active {
    cursor: grabbing;
}

.habit-card.dragging {
    opacity: 0.5;
    border: 2px dashed var(--accent-primary);
    background: var(--surface-2);
    transform: scale(1.02);
    z-index: 10;
}

.settings-group-list {
    min-height: 20px;
}
/* ===== Sign Up & Password Requirements ===== */
.btn-top-right-signup {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background: var(--accent-success); /* Vibrant yellow/green */
    color: var(--text-inverse); /* Black text */
    border: 2px solid var(--border-color);
    padding: 8px 16px;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-mono);
    z-index: 10;
    box-shadow: 2px 2px 0 var(--border-color);
}

.btn-top-right-signup:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

.signup-content {
    max-width: 400px;
    margin: 0 auto;
    width: 100%;
}

.password-requirements {
    margin: var(--spacing-md) 0;
    border: 1px solid var(--border-muted);
    padding: var(--spacing-md);
    background: var(--surface-1);
}

.req-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: 4px;
    color: var(--text-muted);
    font-size: 0.8rem;
}

.req-checkbox {
    width: 14px;
    height: 14px;
    border: 1px solid var(--text-muted);
    display: inline-block;
}

.req-item.met {
    color: var(--accent-success);
}

.req-item.met .req-checkbox {
    background: var(--accent-success);
    border-color: var(--accent-success);
    box-shadow: 0 0 5px var(--accent-success);
}

/* ===== New Onboarding Styles ===== */
.onboarding-copy {
    color: var(--text-primary);
    margin: 16px 0;
    line-height: 1.5;
}

.brand-highlight {
    background: var(--accent-success);
    color: var(--text-inverse);
    display: inline-block;
    padding: 2px 8px;
}

.goal-selection-container {
    text-align: left;
    margin-top: 32px;
}

.goal-label {
    display: block;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.custom-select-wrapper {
    position: relative;
    border: 2px solid var(--border-color);
    background: var(--bg-input);
}

.custom-select-wrapper::after {
    content: '▼';
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 0.8rem;
}

.goal-select {
    width: 100%;
    padding: 16px;
    background: transparent;
    color: var(--text-primary);
    border: none;
    font-family: var(--font-mono);
    font-size: 1rem;
    appearance: none;
    outline: none;
    cursor: pointer;
}

.goal-description {
    margin-top: 16px;
    font-style: italic;
    color: var(--accent-primary);
    min-height: 24px;
}

.science-summary-box {
    margin-top: 16px;
    margin-bottom: 16px;
    padding: var(--spacing-md);
    border: 1px solid var(--border-muted);
    border-left: 4px solid var(--accent-success);
    background: var(--surface-1);
    display: none;
}

.science-summary-box.visible {
    display: block;
}

.science-summary-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    font-weight: 900;
    color: var(--accent-success);
    letter-spacing: 0.04em;
    margin-bottom: 6px;
}

.science-summary-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Updated Habit Items for Drag & Drop */
.onboarding-habit-item {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    border: 1px solid var(--border-muted);
    margin-bottom: 8px;
    background: var(--bg-input);
    transition: transform 0.2s, background 0.2s;
}

.onboarding-habit-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
}

.onboarding-habit-item.dragging {
    opacity: 0.5;
    background: var(--surface-2);
    border-color: var(--accent-primary);
}

.touch-dragging {
    pointer-events: none;
}

.drag-handle-icon {
    cursor: grab;
    padding: 4px 8px;
    color: var(--text-muted);
    user-select: none;
    font-size: 1.2rem;
}

.drag-handle-icon:active {
    cursor: grabbing;
}

.habit-name-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    padding: 4px;
    border-bottom: 1px solid transparent;
    min-width: 0;
    width: 100%;
    resize: none;
    overflow: hidden;
    line-height: 1.4;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.habit-name-input:focus {
    outline: none;
    border-bottom-color: var(--accent-primary);
}

.habit-actions {
    display: flex;
    gap: 4px;
    align-items: flex-start;
    flex-shrink: 0;
}

.delete-btn {
    width: 24px;
    height: 24px;
    border: 1px solid var(--accent-danger);
    color: var(--accent-danger);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    line-height: 1;
}

.delete-btn:hover {
    background: var(--accent-danger);
    color: var(--text-on-accent);
}

.why-btn {
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 2px 6px;
    text-transform: uppercase;
    cursor: pointer;
    height: 24px;
    min-width: 44px;
}

.why-btn.active {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
    font-weight: 900;
}

.onboarding-habit-item .schedule-btn {
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.7rem;
    padding: 2px 6px;
    text-transform: uppercase;
    cursor: pointer;
    min-height: 24px;
    min-width: 64px;
    max-width: 140px;
    white-space: normal;
    line-height: 1.1;
    text-align: center;
}

.evidence-card {
    display: none;
    width: 100%;
    border-top: 1px dashed var(--border-muted);
    padding: 12px;
    background: var(--surface-1);
}

.evidence-card.open {
    display: block;
}

.evidence-source {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent-primary);
    font-weight: 900;
    margin-bottom: 6px;
    display: block;
}

.evidence-summary {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 8px;
}

.evidence-link {
    font-size: 0.75rem;
    color: var(--text-primary);
    text-decoration: underline;
    font-weight: 700;
}

.empty-msg {
    color: var(--text-muted);
    font-style: italic;
    padding: 16px;
    text-align: center;
    border: 1px dashed var(--border-muted);
}

/* ===== Onboarding Improvements ===== */

/* 1. Dropdown Text Color Fix */
.goal-select option {
    background: var(--bg-input);
    color: var(--text-primary);
    padding: 8px;
}

/* 2. + Add Habit Button Style */
.btn-add-onboarding {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--accent-success);
    color: var(--text-inverse);
    border: 2px solid var(--border-color);
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    font-family: var(--font-mono);
    margin-top: 16px;
    box-shadow: 2px 2px 0 var(--border-color);
}

.btn-add-onboarding:active {
    transform: translate(2px, 2px);
    box-shadow: none;
}

/* 3. Habit Card Contrast */
.onboarding-habit-item {
    background: var(--bg-input);
    border: 1px solid var(--text-muted); /* Higher contrast border */
    opacity: 1 !important; /* Ensure full opacity */
    box-shadow: 0 0 5px rgba(255, 255, 255, 0.05);
}

.habit-name-input {
    color: var(--text-primary);
    font-weight: 700; /* Bolder text */
    font-size: 0.95rem;
}

/* 4. Explanatory Copy */
.setup-explanation {
    color: var(--text-secondary);
    font-size: 0.85rem;
    margin: 0 var(--spacing-md) 20px;
    line-height: 1.4;
    border-left: 2px solid var(--accent-primary);
    padding-left: 12px;
}

.habit-setup h2 {
    margin: var(--spacing-md) var(--spacing-md) 8px;
}

.setup-subtitle {
    margin: 0 var(--spacing-md) 12px;
}

.science-toggle-row {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-sm);
    margin: 12px var(--spacing-md) 8px;
}

.science-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.06em;
}

.science-toggle {
    position: relative;
    width: 42px;
    height: 22px;
    border: 1px solid var(--border-muted);
    background: var(--surface-2);
    border-radius: 999px;
    padding: 0;
    cursor: pointer;
}

.science-toggle-handle {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 16px;
    height: 16px;
    background: var(--text-primary);
    border-radius: 50%;
    transition: transform 0.2s ease;
}

.science-toggle.active {
    background: var(--accent-success);
    border-color: var(--accent-success);
}

.science-toggle.active .science-toggle-handle {
    transform: translateX(20px);
    background: var(--bg-primary);
}

/* 5. Summary Page Visuals */
.review-grid {
    display: grid;
    gap: 12px;
    margin-top: 12px;
}

.review-details {
    margin-bottom: var(--spacing-lg);
}

.onboarding-review {
    padding: var(--spacing-lg) var(--spacing-md) 0;
}

.onboarding-review .success-icon {
    margin-bottom: var(--spacing-md);
}

.onboarding-review h2 {
    margin-bottom: var(--spacing-sm);
}

.review-subtitle {
    margin-bottom: var(--spacing-md);
    color: var(--text-secondary);
}

.review-section h3 {
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.review-card {
    background: var(--surface-2);
    border: 1px solid var(--border-muted);
    padding: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.review-card-name {
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.review-card-schedule {
    font-size: 0.7rem;
    background: var(--bg-input);
    padding: 4px 8px;
    border: 1px solid var(--border-strong);
    color: var(--text-secondary);
}

/* ===== INSIGHTS SCREEN ===== */

/* Header */
.insights-header {
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 0 var(--spacing-md);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    height: var(--header-height);
}

.insights-title {
    margin: 0;
}

.insights-controls {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: var(--spacing-md);
    margin-left: auto;
}

.toggle-group {
    display: flex;
    border: var(--border-width-thin) solid var(--border-color);
    height: 44px;
}

.toggle-btn {
    background: transparent;
    border: none;
    border-right: var(--border-width-thin) solid var(--border-color);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-weight: 900;
    font-size: 0.75rem;
    padding: 0 var(--spacing-md);
    cursor: pointer;
    text-transform: uppercase;
    transition: none;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-btn:last-child {
    border-right: none;
}

.toggle-btn.active {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.toggle-btn:hover:not(.active) {
    background: var(--bg-secondary);
}

/* Content Area */
.insights-content {
    padding: 0;
    overflow-y: auto;
}

.insights-main {
    display: block;
}

.insights-tabs {
    border-bottom: var(--border-width) solid var(--border-color);
}

.insights-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl);
    gap: var(--spacing-md);
    color: var(--text-secondary);
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: var(--border-width) solid var(--border-color);
}

.metric-card {
    padding: var(--spacing-lg);
    border-right: 1px solid var(--border-muted);
    border-bottom: 1px solid var(--border-muted);
}

.metric-card:nth-child(2n) {
    border-right: none;
}

.metric-card:nth-child(3),
.metric-card:nth-child(4) {
    border-bottom: none;
}

.metric-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.metric-value {
    font-family: var(--font-sans);
    font-size: 1.8rem;
    font-weight: 900;
    line-height: 1;
    margin-bottom: var(--spacing-xs);
}

.metric-value.positive {
    color: var(--accent-success);
}

.metric-value.negative {
    color: var(--accent-danger);
}

.metric-subtext {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Insight Sections */
.insights-section {
    border-bottom: var(--border-width) solid var(--border-color);
}

.insights-section:last-child {
    border-bottom: none;
}

.section-header {
    font-family: var(--font-sans);
    font-weight: 900;
    font-size: 1rem;
    text-transform: uppercase;
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
}

.section-content {
    padding: var(--spacing-lg);
}

/* Insight Cards */
.insights-scroll {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
    max-height: none;
    overflow: visible;
    width: 100%;
    padding: 0;
}

.insight-card {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--bg-secondary);
    cursor: pointer;
}

.insights-subsection {
    margin-bottom: var(--spacing-lg);
}

.insights-subsection:last-child {
    margin-bottom: 0;
}

.insights-subsection-header {
    margin: 0 0 var(--spacing-sm);
}

.insights-subsection-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.insights-subsection-list .insight-card {
    margin-left: var(--spacing-md);
    width: calc(100% - var(--spacing-md));
}

.insight-header {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    margin: var(--spacing-md);
    background: var(--accent-success);
    color: var(--text-inverse);
}

.insight-icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    color: currentColor;
}

.insight-icon svg {
    width: 24px;
    height: 24px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.insight-type {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: currentColor;
}

.insight-body {
    padding: var(--spacing-md);
}

.insight-text {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: var(--spacing-md);
}

.insight-text strong {
    color: var(--accent-success);
    text-transform: uppercase;
}

.insight-tip {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    background: var(--bg-primary);
    border-left: 2px solid var(--accent-primary);
    padding-left: var(--spacing-md);
}

.insight-tip::before {
    content: 'TIP: ';
    color: var(--accent-primary);
    font-weight: 900;
}

.insight-expand {
    display: none;
    padding: var(--spacing-md);
    border-top: 1px solid var(--border-muted);
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.insight-card.expanded .insight-expand {
    display: block;
}

.expand-btn {
    display: block;
    width: 100%;
    padding: var(--spacing-sm);
    background: transparent;
    border: none;
    border-top: 1px solid var(--border-muted);
    color: var(--text-muted);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    cursor: pointer;
    text-transform: uppercase;
}

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

.insight-card.expanded .expand-btn {
    display: none;
}

/* Weekday Grid */
.weekday-patterns {
    display: block;
}

.weekday-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: var(--spacing-xs);
}

.weekday-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-xs);
}

.weekday-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
}

.weekday-bar-container {
    width: 100%;
    height: 80px;
    border: var(--border-width-thin) solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    position: relative;
    background: var(--surface-1);
}

.weekday-bar {
    width: 100%;
    transition: height 0.3s steps(10);
}

.weekday-bar.best {
    background: var(--accent-success);
}

.weekday-bar.normal {
    background: var(--text-secondary);
}

.weekday-bar.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 4px,
        rgba(10, 10, 10, 0.8) 4px,
        rgba(10, 10, 10, 0.8) 8px
    );
}

.weekday-value {
    font-size: 0.75rem;
    font-weight: 900;
    margin-top: var(--spacing-xs);
}

.weekday-value.best {
    color: var(--accent-success);
}

.weekday-value.na {
    color: var(--text-muted);
}

.weekday-badge {
    font-size: 0.55rem;
    padding: 2px 4px;
    text-transform: uppercase;
    font-weight: 900;
    margin-top: 2px;
}

.weekday-badge.best {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.weekday-patterns[data-type="evening"] .weekday-bar.best {
    background: var(--accent-primary);
}

.weekday-patterns[data-type="evening"] .weekday-value.best {
    color: var(--accent-primary);
}

.weekday-patterns[data-type="evening"] .weekday-badge.best {
    background: var(--accent-primary);
    color: var(--text-on-accent);
}

.weekday-legend {
    display: flex;
    justify-content: flex-end;
    margin-top: var(--spacing-sm);
    font-size: 0.7rem;
    color: var(--text-secondary);
}

.weekday-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.weekday-legend-swatch {
    width: 14px;
    height: 14px;
    border: 1px solid var(--border-color);
    background: var(--surface-1);
}

.weekday-legend-swatch.na {
    background: repeating-linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.15) 0,
        rgba(255, 255, 255, 0.15) 4px,
        rgba(10, 10, 10, 0.8) 4px,
        rgba(10, 10, 10, 0.8) 8px
    );
}

/* Correlation Matrix */
.matrix-container {
    overflow-x: auto;
}

.correlation-matrix {
    display: grid;
    gap: 2px;
    font-size: 0.65rem;
}

.matrix-cell {
    width: 45px;
    height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--text-muted);
    font-weight: 900;
    text-transform: uppercase;
    position: relative;
    cursor: pointer;
}

.matrix-cell.header {
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-size: 0.55rem;
}

.matrix-cell.diagonal {
    background: var(--text-primary);
    color: var(--bg-primary);
}

.matrix-cell.positive {
    background: var(--accent-success);
    color: var(--text-inverse);
}

.matrix-cell.weak {
    background: var(--bg-secondary);
    color: var(--text-muted);
}

.matrix-cell.negative {
    background: var(--accent-danger);
    color: var(--text-primary);
}

.matrix-cell:hover:not(.header):not(.diagonal) {
    border-color: var(--accent-primary);
    border-width: 2px;
}

.matrix-legend {
    display: flex;
    gap: var(--spacing-md);
    justify-content: center;
    margin-top: var(--spacing-md);
    font-size: 0.75rem;
    flex-wrap: wrap;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.legend-color {
    width: 16px;
    height: 16px;
    border: 1px solid var(--border-color);
}

.legend-color.positive {
    background: var(--accent-success);
}

.legend-color.neutral {
    background: var(--bg-secondary);
}

.legend-color.negative {
    background: var(--accent-danger);
}

/* Trend Chart */
.insights-chart {
    height: 200px;
    border: 1px dashed var(--text-muted);
    padding: var(--spacing-sm);
}

.chart-legend {
    display: flex;
    gap: var(--spacing-lg);
    justify-content: center;
    margin-top: var(--spacing-md);
    font-size: 0.85rem;
}

.legend-line {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.legend-line-sample {
    width: 24px;
    height: 3px;
}

.legend-line-sample.morning {
    background: var(--accent-success);
}

.legend-line-sample.evening {
    background: var(--accent-primary);
}

.legend-line-sample.goal {
    background: var(--text-muted);
    border-top: 2px dashed var(--text-muted);
    height: 0;
}

/* Habit Strength */
.strength-section {
    margin-top: var(--spacing-md);
}

.strength-section:first-of-type {
    margin-top: 0;
}

.strength-subtitle {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-sm);
}

.strength-list {
    display: flex;
    flex-direction: column;
}

.strength-item {
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--border-muted);
}

.strength-item:last-child {
    border-bottom: none;
}

.strength-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-sm);
}

.strength-streaks {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: var(--spacing-sm);
}

.strength-streaks .streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.strength-name {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.9rem;
}

.strength-status {
    font-size: 0.7rem;
    font-weight: 900;
    padding: 3px 8px;
    text-transform: uppercase;
}

.strength-status.mastered {
    background: var(--strength-mastered);
    color: var(--strength-mastered-text);
}

.strength-status.strong {
    background: var(--strength-strong);
    color: var(--strength-strong-text);
}

.strength-status.building {
    background: var(--strength-building);
    color: var(--strength-building-text);
}

.strength-status.fragile {
    background: var(--strength-fragile);
    color: var(--strength-fragile-text);
}

.strength-bar-container {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.strength-bar {
    flex: 1;
    height: 20px;
    border: var(--border-width-thin) solid var(--border-color);
    position: relative;
}

.strength-fill {
    height: 100%;
    transition: width 0.5s steps(20);
}

.strength-fill.mastered {
    background: var(--strength-mastered);
}

.strength-fill.strong {
    background: var(--strength-strong);
}

.strength-fill.building {
    background: var(--strength-building);
}

.strength-fill.fragile {
    background: var(--strength-fragile);
}

.strength-value {
    font-size: 0.9rem;
    font-weight: 900;
    width: 40px;
    text-align: right;
}

.strength-description {
    font-size: 0.85rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

/* Weekly Goals Trend */
.weekly-goal-filter {
    margin-bottom: var(--spacing-md);
}

.weekly-goal-dropdown {
    position: relative;
    display: inline-block;
}

.weekly-goal-dropdown .dropdown-toggle {
    padding: 6px 10px;
    border: 1px solid var(--border-muted);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
}

.weekly-goal-dropdown .dropdown-panel {
    position: absolute;
    top: 110%;
    left: 0;
    min-width: 240px;
    padding: 8px;
    border: 1px solid var(--border-muted);
    background: var(--surface-1);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.weekly-goal-dropdown .dropdown-panel.hidden {
    display: none;
}

.weekly-goal-dropdown .dropdown-action {
    padding: 6px 8px;
    border: 1px solid var(--border-muted);
    background: var(--bg-input);
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
}

.weekly-goal-dropdown .dropdown-save {
    padding: 6px 10px;
    border: 1px solid var(--border-strong);
    background: var(--surface-2);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.7rem;
    text-transform: uppercase;
    cursor: pointer;
}

.weekly-goal-dropdown .dropdown-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.weekly-goal-dropdown .dropdown-item input {
    accent-color: var(--accent-primary);
}

.weekly-goal-filter[data-type="morning"] .dropdown-item input {
    accent-color: var(--accent-success);
}

/* Data Notice */
.data-notice {
    padding: var(--spacing-xl);
    text-align: center;
    border: 2px dashed var(--text-muted);
    margin: var(--spacing-md);
}

.data-notice-icon {
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.data-notice-title {
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: var(--spacing-sm);
}

.data-notice-text {
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

.data-progress {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    justify-content: center;
}

.data-progress-bar {
    width: 150px;
    height: 12px;
    border: var(--border-width-thin) solid var(--border-color);
}

.data-progress-fill {
    height: 100%;
    background: var(--accent-primary);
    width: 0%;
}

.data-progress-text {
    font-size: 0.8rem;
    font-weight: 900;
}

/* =========================================
   POWER CELLS VISUALIZATION
   ========================================= */
.power-cells-notice {
    padding: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 500px;
}

.vis-promo-header {
    font-family: var(--font-sans);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.1rem;
    line-height: 1.2;
    margin-bottom: var(--spacing-lg);
    color: var(--text-primary);
    letter-spacing: 0.5px;
    text-align: center;
}

.vis-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md) 0;
    width: 100%;
}

/* The container for the 7 bars */
.power-grid {
    width: 100%;
    max-width: 280px;
    height: 350px;
    display: flex;
    flex-direction: column-reverse; /* Build from bottom up */
    gap: 12px; /* Spacing between the 7 main bars */
}

/* Each of the 7 bars */
.power-row {
    flex: 1; /* Distribute height evenly */
    display: flex;
    gap: 2px; /* Small gap between internal units */
    transform: skewX(-15deg); /* Retain the dynamic angle */
    border: 1px solid var(--text-muted);
    padding: 2px;
    background: var(--bg-primary);
}

/* The internal units/cells within a bar */
.power-unit {
    flex: 1;
    height: 100%;
    background: var(--surface-3);
    transition: all 0.3s ease;
    position: relative;
}

/* Completed State - ACID GREEN */
.power-unit.filled {
    background-color: var(--accent-success) !important;
    box-shadow: 0 0 8px var(--accent-success-glow);
    z-index: 1;
}

/* Current Day - Pulsing White */
.power-unit.current {
    background: var(--text-primary);
    animation: pulse-unit 1.5s infinite;
    z-index: 2;
}

@keyframes pulse-unit {
    0% { opacity: 0.8; box-shadow: 0 0 5px var(--text-primary); }
    50% { opacity: 0.4; box-shadow: 0 0 10px var(--text-primary); }
    100% { opacity: 0.8; box-shadow: 0 0 5px var(--text-primary); }
}

.copy-container {
    margin-top: var(--spacing-lg);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: center;
}

.motivational-copy {
    font-family: var(--font-sans);
    font-weight: 900;
    text-transform: uppercase;
    font-size: 1.3rem;
    line-height: 1.1;
    min-height: 2.4em;
    margin: 0;
    color: var(--text-primary);
}

.copy-sub {
    font-size: 0.8rem;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 2px;
    margin: 0;
    font-weight: 900;
}

/* No Insights Message */
.no-insights {
    text-align: center;
    padding: var(--spacing-lg);
    color: var(--text-secondary);
}

/* Scrollbar for insights */
.insights-scroll::-webkit-scrollbar {
    width: 8px;
}

.insights-scroll::-webkit-scrollbar-track {
    background: var(--bg-primary);
    border: 1px solid var(--text-muted);
}

.insights-scroll::-webkit-scrollbar-thumb {
    background: var(--text-muted);
}

.insights-scroll::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* ===== PROFILE SCREEN STYLES ===== */

/* Profile Icon Animation */
.nav-profile .profile-person-v2 path,
.nav-profile .profile-person-v2 circle {
    fill: none;
    stroke: currentColor;
    transition: fill 0.3s ease, stroke 0.3s ease, transform 0.3s ease;
    transform-origin: center;
}

.nav-btn.active .nav-profile .profile-person-v2 path,
.nav-btn.active .nav-profile .profile-person-v2 circle {
    fill: currentColor;
    stroke: currentColor;
    transform: scale(1.05);
}

/* Profile Screen Container */
#profile-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
}

#profile-screen.subscreen-active > .app-header {
    display: none;
}

/* Profile Content */
.profile-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* User Card */
.profile-user-card {
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: var(--border-width) solid var(--border-color);
    text-align: center;
    background: var(--surface-1);
}

.profile-user-name {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.profile-subscription-badge {
    display: inline-block;
    background: var(--accent-success);
    color: var(--text-inverse);
    padding: 4px 12px;
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Profile Menu */
.profile-menu {
    display: flex;
    flex-direction: column;
}

.account-hub-menu {
    margin-bottom: var(--spacing-lg);
}

.account-hub-item {
    border-bottom: var(--border-width-thin) solid var(--border-color);
}

.account-hub-signout {
    margin-top: auto;
    padding-bottom: var(--spacing-lg);
}

.profile-menu-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--spacing-lg) var(--spacing-md);
    background: transparent;
    border: none;
    border-bottom: var(--border-width-thin) solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    cursor: pointer;
    transition: padding-left 0.2s ease, background-color 0.2s ease;
}

.profile-menu-item:hover {
    padding-left: var(--spacing-lg);
    background: rgba(255, 255, 255, 0.03);
}

.profile-menu-item:active {
    background: rgba(255, 255, 255, 0.06);
}

.profile-menu-label {
    display: flex;
    align-items: center;
}

.profile-menu-label::before {
    content: '// ';
    color: var(--accent-primary);
    margin-right: var(--spacing-sm);
}

.profile-menu-arrow {
    font-size: 1.5rem;
    color: var(--text-secondary);
    transition: transform 0.2s ease;
}

.profile-menu-item:hover .profile-menu-arrow {
    transform: translateX(4px);
}

/* Profile Sub-Screens */
.profile-sub-screen {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--bg-primary);
    display: none;
    flex-direction: column;
    z-index: 150;
}

.profile-sub-screen.active {
    display: flex;
}

.profile-sub-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: var(--header-height);
    border-bottom: var(--border-width) solid var(--border-color);
    padding: 0 var(--spacing-sm);
    background: var(--bg-primary);
    position: sticky;
    top: 0;
    z-index: 10;
}

.profile-sub-header h2 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.profile-back-btn {
    font-size: 1.8rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.profile-back-btn span {
    line-height: 1;
}

.profile-sub-content {
    flex: 1;
    padding: var(--spacing-md);
    padding-bottom: calc(64px + var(--safe-bottom));
}

.account-hub-content {
    display: flex;
    flex-direction: column;
}

/* Profile Form */
.profile-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
}

.profile-section {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: var(--border-width-thin) solid var(--border-color);
}

#change-password-screen .profile-section {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.profile-section-title {
    font-size: 0.95rem;
    font-weight: 900;
    text-transform: uppercase;
    margin-bottom: var(--spacing-xs);
}

.profile-section-note {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
}

#profile-completion-note {
    border: var(--border-width-thin) dashed var(--accent-warning);
    color: var(--accent-warning);
    padding: var(--spacing-sm);
    margin-bottom: var(--spacing-md);
    text-transform: uppercase;
    font-size: 0.75rem;
}

#change-password-form {
    margin-top: var(--spacing-sm);
}

#change-password-btn {
    margin-top: var(--spacing-sm);
}

.change-password-btn {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

.change-password-btn:hover {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

body[data-theme="light"] .change-password-btn {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

body[data-theme="light"] .change-password-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

.theme-options {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
}

.theme-option {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-secondary);
    padding: var(--spacing-sm);
    text-transform: uppercase;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    cursor: pointer;
}

.theme-option.active {
    background: var(--accent-primary);
    border-color: var(--accent-primary);
    color: var(--text-on-accent);
}

.theme-hint {
    margin-top: var(--spacing-sm);
    font-size: 0.8rem;
    color: var(--text-muted);
}

.profile-form .input-group input {
    width: 100%;
    background: var(--bg-primary);
    border: var(--border-width-thin) solid var(--border-color);
    color: var(--text-primary);
    padding: var(--spacing-md);
    font-size: 1rem;
}

.profile-form .input-group input:focus {
    background: var(--bg-primary);
    border-color: var(--accent-primary);
    outline: none;
}

.profile-form .input-group input[readonly] {
    color: var(--text-muted);
    cursor: not-allowed;
    background: var(--surface-2);
}

/* Email Verification Section */
.email-verification-section {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: var(--border-width-thin) solid var(--border-color);
}

.verification-status {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-size: 0.85rem;
}

.verification-status.verified {
    background: rgba(204, 255, 0, 0.1);
    border: var(--border-width-thin) solid var(--accent-success);
}

.verification-status.unverified {
    flex-direction: column;
    align-items: stretch;
    gap: var(--spacing-sm);
}

.verification-message {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.verification-status.verified .verification-icon {
    color: var(--accent-success);
    font-size: 1rem;
    font-weight: bold;
}

.verification-status.unverified .verification-icon {
    color: var(--accent-warning);
    font-size: 1rem;
}

.verification-status.verified .verification-text {
    color: var(--accent-success);
    font-weight: 500;
}

.verification-status.unverified .verification-text {
    color: var(--text-secondary);
}

.verification-status.unverified .btn {
    width: 100%;
    margin-top: 0;
}

/* Profile Sign Out Section */
.profile-signout-section {
    margin-top: var(--spacing-sm);
    padding-top: 0;
    border-top: none;
}

/* Profile Save Bar */
.profile-save-bar {
    position: sticky;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--nav-bottom-extra));
    left: 0;
    right: 0;
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--bg-primary);
    border-top: var(--border-width-thin) solid var(--border-color);
}

.profile-save-btn {
    width: 100%;
    padding: 10px var(--spacing-md);
    font-size: 0.85rem;
    border-width: var(--border-width-thin);
    transition: background-color 0.3s ease, color 0.3s ease;
}

.profile-save-btn.saved {
    background: var(--accent-success) !important;
    color: var(--text-inverse) !important;
    border-color: var(--accent-success) !important;
}

body[data-theme="light"] .profile-save-btn {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

body[data-theme="light"] .profile-save-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

body[data-theme="light"] .profile-save-btn:active {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

/* Routines Sub-Screen */
.routines-content {
    padding: 0;
}

.routines-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-bottom: var(--border-width) solid var(--border-color);
}

.routines-search-bar {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    border-bottom: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-1);
}

.routines-search-bar .search-icon {
    width: 24px;
    height: 24px;
    color: var(--text-secondary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.routines-search-bar .search-icon svg {
    width: 20px;
    height: 20px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.5;
    stroke-linecap: square;
    stroke-linejoin: miter;
}

.routines-search-bar input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.9rem;
    text-transform: uppercase;
    outline: none;
}

.routines-search-bar input::placeholder {
    color: var(--text-muted);
}

.routines-add-btn {
    display: block;
    width: calc(100% - (var(--spacing-md) * 2));
    margin: var(--spacing-md);
    padding: 10px var(--spacing-md);
    font-size: 0.85rem;
    border-width: var(--border-width-thin);
}

.routines-habits-container {
    padding: 0 var(--spacing-md);
    padding-bottom: var(--spacing-md);
}

/* Routine Habit Groups */
.routine-group {
    margin-bottom: var(--spacing-md);
}

.routine-group-header {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    padding: var(--spacing-sm) 0;
    border-bottom: 1px solid var(--border-muted);
    margin-bottom: var(--spacing-sm);
}

/* Routine Habit Card */
.routine-habit-card {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-sm);
    padding: var(--spacing-md);
    background: var(--surface-1);
    border: 1px solid var(--border-muted);
    margin-bottom: var(--spacing-sm);
    transition: border-color 0.2s ease;
}

.routine-habit-card:hover {
    border-color: var(--accent-primary);
}

.routine-habit-card.dragging {
    opacity: 0.5;
    border-color: var(--accent-primary);
}

#manage-routines-screen[data-routine-type="morning"] .routines-add-btn:hover,
#manage-routines-screen[data-routine-type="morning"] #save-routines-btn:hover {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

body[data-theme="light"] #manage-routines-screen[data-routine-type="morning"] #save-routines-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

#manage-routines-screen[data-routine-type="morning"] .routines-add-btn {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

#manage-routines-screen[data-routine-type="morning"] .routines-add-btn:hover {
    background: var(--accent-success);
    color: var(--text-inverse);
    border-color: var(--accent-success);
}

#manage-routines-screen[data-routine-type="evening"] .routines-add-btn {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

#manage-routines-screen[data-routine-type="evening"] .routines-add-btn:hover {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

#manage-routines-screen[data-routine-type="morning"] .routine-habit-card:hover,
#manage-routines-screen[data-routine-type="morning"] .routine-habit-card.dragging {
    border-color: var(--accent-success);
}

.routine-drag-handle {
    cursor: grab;
    padding: 4px;
    color: var(--text-muted);
    user-select: none;
    font-size: 1.2rem;
}

.routine-drag-handle:active {
    cursor: grabbing;
}

.routine-habit-number {
    min-width: 24px;
    font-weight: 900;
    color: var(--text-secondary);
}

.routine-habit-info {
    flex: 1;
    min-width: 0;
}

.routine-habit-name {
    font-weight: 700;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    word-break: break-word;
}

.routine-habit-schedule {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    margin-top: 4px;
    padding: 2px 6px;
    background: var(--surface-2);
    border: 1px solid var(--border-muted);
}

.routine-habit-actions {
    display: flex;
    gap: 4px;
    flex-shrink: 0;
}

.routine-action-btn {
    width: 28px;
    height: 28px;
    border: 1px solid var(--border-muted);
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.routine-action-btn:hover {
    border-color: var(--text-primary);
    color: var(--text-primary);
}

.routine-action-btn.delete:hover {
    border-color: var(--accent-danger);
    color: var(--accent-danger);
}

/* Subscription Screen */
.subscription-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-top: var(--spacing-xl);
}

.subscription-card {
    width: 100%;
    max-width: 400px;
    border: var(--border-width) solid var(--border-color);
    padding: var(--spacing-xl) var(--spacing-lg);
    text-align: center;
}

.subscription-tier {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent-success);
    margin-bottom: var(--spacing-md);
}

.subscription-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: var(--spacing-lg);
}

.subscription-features {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    text-align: left;
}

.subscription-feature {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    font-size: 0.85rem;
}

.feature-check {
    color: var(--accent-success);
    font-weight: 900;
}

/* Empty State for Routines */
.routines-empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
}

/* ========== TIPS SCREEN (V5) ========== */

#tips-screen .tips-header-bar {
    gap: var(--spacing-sm);
}

#tips-screen .tips-header-bar h1 {
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0;
}

#tips-screen .tips-nav {
    display: flex;
    gap: var(--spacing-xs);
}

#tips-screen .tips-nav .btn-icon {
    width: 38px;
    height: 38px;
}

#tips-screen .tips-page {
    padding: var(--spacing-md);
    padding-bottom: calc(var(--spacing-xl) + var(--nav-height) + var(--nav-bottom-extra));
    background: var(--bg-primary);
    min-height: 100vh;
}

#tips-screen .tips-content {
    max-width: 640px;
    margin: 0 auto;
    display: grid;
    gap: var(--spacing-md);
}

#tips-screen .tips-card {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-1);
    padding: var(--spacing-md);
    display: grid;
    gap: var(--spacing-sm);
}

#tips-screen .tips-card--overview {
    background: var(--surface-2);
}

#tips-screen .card-title {
    font-size: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.3px;
}

#tips-screen .card-claim {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
}

#tips-screen .progress-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.6rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--text-secondary);
}

#tips-screen .progress-track {
    height: 6px;
    background: var(--surface-4);
    border-radius: 999px;
    overflow: hidden;
}

#tips-screen .progress-fill {
    height: 100%;
    background: var(--accent-primary);
}

#tips-screen .tip-title {
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.2px;
}

#tips-screen .tip-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
}

#tips-screen .metric-chip {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-2);
    padding: 6px 8px;
    display: grid;
    gap: 4px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.6rem;
    min-width: 120px;
}

#tips-screen .metric-chip span {
    color: var(--text-secondary);
    font-size: 0.55rem;
}

#tips-screen .tip-section {
    display: grid;
    gap: 6px;
    font-size: 0.78rem;
    color: var(--text-primary);
}

#tips-screen .tip-section {
    --section-body-indent: 10px;
}

#tips-screen .section-title {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-success);
    color: #000000;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
}

body[data-theme="light"] #tips-screen .section-title {
    color: var(--text-on-accent);
}

#tips-screen .tip-section ul {
    list-style: none;
    display: grid;
    gap: 6px;
    padding-left: var(--section-body-indent);
}

#tips-screen .tip-section li::before {
    content: "-";
    position: absolute;
    left: 0;
    color: var(--accent-primary);
}

#tips-screen .tip-section li {
    display: block;
    position: relative;
    padding-left: 14px;
    line-height: 1.4;
}

#tips-screen .tip-text {
    line-height: 1.4;
    padding-left: var(--section-body-indent);
}

#tips-screen .tips-table {
    display: grid;
    gap: 6px;
    width: 100%;
}

#tips-screen .tips-table-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
    gap: 6px;
    border-bottom: 1px solid var(--border-muted);
    padding-bottom: 6px;
}

#tips-screen .tips-table-row span:first-child {
    padding-left: var(--section-body-indent);
}

#tips-screen .tips-table-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

/* Table header row styling */
#tips-screen .tips-table-header {
    font-weight: 700;
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    margin-bottom: 2px;
}

body[data-theme="light"] #tips-screen .tips-table-header {
    background: #f5f0e6;
    margin: 0 0 4px 0;
    padding: 8px 0;
    border-radius: 4px 4px 0 0;
}

body[data-theme="dark"] #tips-screen .tips-table-header {
    background: var(--surface-2);
    margin: 0 0 4px 0;
    padding: 8px 0;
    border-radius: 4px 4px 0 0;
}

/* Template section styling */
#tips-screen .tip-section--template {
    margin-top: var(--spacing-xs);
}

#tips-screen .template-content {
    background: var(--surface-2);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: var(--spacing-sm) var(--spacing-md);
    font-family: monospace;
    font-size: 0.72rem;
    line-height: 1.6;
    white-space: pre-wrap;
    color: var(--text-primary);
}

#tips-screen .mulberry-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--accent-primary);
    color: var(--text-on-accent);
    font-size: 0.55rem;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    font-weight: 700;
}

#tips-screen .evidence-card {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-1);
    padding: var(--spacing-md);
    display: grid;
    gap: var(--spacing-sm);
    --section-body-indent: 10px;
}

#tips-screen .evidence-summary {
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
    padding-left: var(--section-body-indent);
}

#tips-screen .source-card {
    border: var(--border-width-thin) solid var(--border-color);
    background: var(--surface-2);
    padding: var(--spacing-md);
    display: grid;
    gap: var(--spacing-sm);
}

#tips-screen .source-name {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding-left: var(--section-body-indent);
}

#tips-screen .source-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 7px 12px;
    background: var(--accent-success);
    color: var(--text-inverse);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.55rem;
    text-decoration: none;
}

#tips-screen .evidence-disclaimer {
    font-size: 0.7rem;
    color: var(--text-secondary);
    line-height: 1.4;
    padding-left: var(--section-body-indent);
}

#tips-screen .tip-image-container {
    position: relative;
    width: 100%;
    background: var(--surface-2);
    overflow: hidden;
}

#tips-screen .tip-image-triptych {
    aspect-ratio: 3 / 1;
}

#tips-screen .tip-image-single {
    aspect-ratio: 4 / 3;
}

#tips-screen .tip-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease;
}

#tips-screen .tip-image.loaded {
    opacity: 1;
}

#tips-screen .tip-image-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    font-size: 0.55rem;
    color: var(--text-secondary);
}

#tips-screen .tip-image.loaded + .tip-image-placeholder {
    display: none;
}

#tips-screen .tips-empty-state {
    text-align: center;
    padding: var(--spacing-xl);
    color: var(--text-secondary);
}

#tips-screen .tips-empty-state p {
    margin: 0 0 var(--spacing-sm) 0;
}

#tips-screen .tips-empty-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
}

/* ===== Toast Notifications ===== */

#toast-container {
    position: fixed;
    bottom: calc(var(--nav-height) + var(--safe-bottom) + var(--nav-bottom-extra) + var(--spacing-md));
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 600px;
    z-index: 2000;
    pointer-events: none;
}

.toast {
    position: relative;
    display: flex;
    align-items: center;
    background: var(--surface-2);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: 14px 44px 14px 20px;
    overflow: hidden;
    pointer-events: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.toast-enter {
    opacity: 1;
    transform: translateY(0);
}

.toast.toast-exit {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Left accent stripe */
.toast-routine::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    border-radius: 12px 0 0 12px;
}

.toast-routine.morning::before {
    background: var(--accent-success);
}

.toast-routine.evening::before {
    background: var(--accent-primary);
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-primary);
    line-height: 1.3;
}

.toast-sub {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 2px;
}

.toast-close {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    opacity: 0.6;
    transition: opacity 0.15s ease;
}

.toast-close:hover {
    opacity: 1;
}

/* ===== Notification Settings ===== */

.notification-settings-content {
    padding: var(--spacing-md);
}

.notif-permission-banner {
    background: var(--surface-2);
    border: 1px solid var(--accent-primary);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    text-align: center;
}

.notif-permission-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    line-height: 1.5;
}

.notif-blocked-banner {
    background: var(--surface-2);
    border: 1px solid var(--accent-danger);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.notif-blocked-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notif-ios-notice {
    background: var(--surface-2);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.notif-ios-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.notif-ios-text {
    font-size: 0.8rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

.notif-section {
    margin-bottom: var(--spacing-lg);
}

.notif-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    font-weight: 700;
    margin-bottom: 4px;
}

.notif-section-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: var(--spacing-md);
    line-height: 1.4;
}

.notif-reminder-card {
    background: var(--surface-2);
    border: 1px solid var(--border-muted);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
}

.notif-reminder-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.notif-reminder-info {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
}

.notif-reminder-label {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.notif-reminder-time-preview {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.notif-reminder-details {
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border-muted);
}

.notif-time-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.notif-input-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    font-weight: 700;
}

.notif-time-input {
    background: var(--surface-3);
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    color: var(--text-primary);
    padding: 8px 12px;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
}

.notif-time-input:focus {
    outline: none;
    border-color: var(--accent-primary);
}

.notif-days-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notif-days-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
}

.notif-day-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    aspect-ratio: 1;
    max-width: 40px;
    border: 1px solid var(--border-muted);
    border-radius: 8px;
    background: var(--surface-3);
    color: var(--text-secondary);
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.notif-day-btn.active {
    background: var(--accent-primary);
    color: var(--text-on-accent);
    border-color: var(--accent-primary);
}

.notif-day-btn:hover {
    border-color: var(--text-secondary);
}
