/* =========================================================
   UNBREAKABLE — Design System
   Clean, native, data-forward. Restraint over glow.
   ========================================================= */
:root {
    /* Ground & surfaces (neutral, faint warm bias) */
    --bg: #0b0b0c;
    --bg-soft: #101012;
    --surface: #151517;
    --surface-2: #1d1d20;
    --surface-3: #26262a;

    /* Hairlines */
    --border: rgba(255, 255, 255, 0.07);
    --border-strong: rgba(255, 255, 255, 0.13);

    /* Text */
    --text: #fafafa;
    --text-secondary: #9a9aa0;
    --text-muted: #6a6a70;

    /* Accent — used functionally, not decoratively */
    --accent: #ff453a;
    --accent-hover: #ff5c52;
    --accent-soft: rgba(255, 69, 58, 0.12);

    /* Premium tier */
    --gold: #d8b878;
    --gold-deep: #b8923f;
    --gold-soft: rgba(216, 184, 120, 0.12);

    /* Semantic */
    --success: #32d74b;
    --success-soft: rgba(50, 215, 75, 0.12);

    /* Radius */
    --r-sm: 10px;
    --r-md: 14px;
    --r-lg: 18px;
    --r-xl: 24px;
    --r-pill: 100px;

    /* Elevation (soft, neutral — no colored glow) */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 20px rgba(0, 0, 0, 0.35);
    --shadow-lg: 0 16px 40px rgba(0, 0, 0, 0.5);

    /* Type */
    --font-display: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-ui: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', 'Outfit', sans-serif;

    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --safe-top: env(safe-area-inset-top, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-ui);
    background-color: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    position: relative;
    line-height: 1.5;
    letter-spacing: -0.01em;
}

/* Quiet ground: a single faint top-accent wash, nothing floating */
.ambient-background {
    position: fixed; inset: 0; z-index: -2; background: var(--bg);
    background-image: radial-gradient(120% 60% at 50% -10%, rgba(255, 69, 58, 0.06) 0%, transparent 60%);
}
.ambient-orb, .noise-overlay, .background-glow { display: none !important; }

::selection { background: var(--accent-soft); color: var(--text); }

/* =========================================
   APP BAR
   ========================================= */
.header {
    padding: calc(0.9rem + var(--safe-top)) 1.25rem 0.9rem;
    display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
    gap: 0.75rem; z-index: 20; width: 100%;
    position: relative;
}
.logo {
    font-family: var(--font-display);
    font-size: 1.05rem; font-weight: 800; letter-spacing: 0.18em;
    color: var(--text); justify-self: center; text-align: center;
    padding-left: 0.18em; /* optisch: kompensiert das Letter-Spacing am Wortende */
}
.lang-selector {
    display: flex; background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--r-pill); padding: 0.2rem; justify-self: start;
}
.lang-btn {
    background: none; border: none; color: var(--text-muted);
    padding: 0.35rem 0.7rem; border-radius: var(--r-pill);
    font-weight: 600; cursor: pointer; transition: color 0.2s, background 0.2s; font-size: 0.75rem;
    font-family: var(--font-ui);
}
.lang-btn.active { background: var(--surface-3); color: var(--text); }

.settings-icon {
    background: none; border: none; color: var(--text-secondary); cursor: pointer;
    transition: color 0.2s; padding: 0.4rem; display: flex; align-items: center;
    justify-self: end;
}
.settings-icon:hover { color: var(--text); }
.gear-svg { width: 22px; height: 22px; transition: transform 0.4s ease; }
.settings-icon:hover .gear-svg { transform: rotate(45deg); }

.container {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    padding: 1.5rem 1.25rem; width: 100%; max-width: 1200px; margin: 0 auto; z-index: 5;
}

/* =========================================
   TYPOGRAPHY & UTILITIES
   ========================================= */
.text-center { text-align: center; align-items: center; }
.text-left { text-align: left; }
.text-sm { font-size: 0.9rem; }
.text-muted { color: var(--text-secondary); }
.warning-text { color: var(--accent); }
.mt-1 { margin-top: 1rem; } .mt-2 { margin-top: 1.75rem; } .w-100 { width: 100%; }
.hidden { display: none !important; }

.main-title {
    font-family: var(--font-display);
    font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.1;
    letter-spacing: -0.03em; text-wrap: balance; color: var(--text);
}
.main-title.huge {
    font-size: clamp(2.4rem, 8vw, 4rem); font-weight: 800;
    text-transform: none; letter-spacing: -0.04em; line-height: 1.02;
}
.warning-text.main-title { color: var(--accent); }
.subtitle {
    font-size: 1.05rem; color: var(--text-secondary); margin-bottom: 2.25rem;
    font-weight: 400; line-height: 1.55; text-wrap: balance; max-width: 34ch; margin-left: auto; margin-right: auto;
}

/* =========================================
   CARD  (class kept: .glass-panel)
   ========================================= */
.glass-panel {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-xl);
    padding: 1.5rem;
    margin-bottom: 1rem;
    position: relative;
    transition: border-color 0.2s ease, transform 0.2s ease;
}
.glass-panel h3 {
    font-family: var(--font-ui);
    font-size: 0.8rem; font-weight: 700; margin-bottom: 0.35rem;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--text-secondary);
}

/* =========================================
   BUTTONS
   ========================================= */
.btn-primary {
    padding: 1rem 1.75rem; font-size: 1rem; font-weight: 700; color: #fff;
    background: var(--accent); border: none; border-radius: var(--r-md);
    cursor: pointer; transition: background 0.2s, transform 0.1s;
    letter-spacing: 0.01em; font-family: var(--font-ui);
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
}
.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:active { transform: scale(0.985); }

.btn-secondary {
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 0.95rem 1.25rem; border-radius: var(--r-md);
    cursor: pointer; font-size: 0.95rem; font-weight: 600; transition: background 0.2s, border-color 0.2s;
    font-family: var(--font-ui);
}
.btn-secondary:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn-secondary:active { transform: scale(0.985); }

.btn-text {
    background: none; border: none; color: var(--text-muted); font-size: 0.9rem; cursor: pointer;
    margin-top: 0.9rem; transition: color 0.2s; display: inline-block; padding: 0.5rem; font-family: var(--font-ui);
}
.btn-text:hover { color: var(--text-secondary); }

/* Pulse retired for a calm, deliberate feel */
.pulse-btn { animation: none; }

/* =========================================
   FORMS
   ========================================= */
input[type="text"], input[type="password"], input[type="email"] {
    width: 100%; padding: 0.95rem 1rem; font-size: 1rem; font-family: var(--font-ui);
    background: var(--surface-2); border: 1px solid var(--border);
    border-radius: var(--r-md); color: var(--text); transition: border-color 0.2s, background 0.2s;
}
input::placeholder { color: var(--text-muted); }
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus {
    outline: none; border-color: var(--border-strong); background: var(--surface-3);
}
.auth-error { margin-top: 0.75rem; padding: 0.6rem 0.85rem; background: var(--accent-soft); border: 1px solid rgba(255,69,58,0.3); border-radius: var(--r-md); color: #ff8a84; font-size: 0.85rem; text-align: left; }
.auth-error.auth-ok { background: rgba(48,209,88,0.12); border-color: rgba(48,209,88,0.35); color: #7ee2a0; }

/* =========================================
   FUNNEL & QUIZ
   ========================================= */
.funnel-step { display: none; width: 100%; max-width: 560px; margin: 0 auto; }
.funnel-step.active { display: block; }
.fade-in { animation: fadeIn 0.5s ease forwards; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

.quiz-progress { width: 100%; height: 4px; background: var(--surface-2); border-radius: 2px; margin-bottom: 2.25rem; overflow: hidden; }
.quiz-bar-fill { height: 100%; width: 10%; background: var(--accent); border-radius: 2px; transition: width 0.45s ease; }
.quiz-card { display: none; }
.quiz-card.active { display: block; animation: fadeIn 0.4s ease forwards; }
.quiz-card h2 {
    font-family: var(--font-display); font-size: 1.6rem; margin-bottom: 2rem; line-height: 1.2;
    font-weight: 700; letter-spacing: -0.02em; text-wrap: balance;
}
.quiz-options { display: flex; flex-direction: column; gap: 0.75rem; }
.quiz-btn {
    background: var(--surface); border: 1px solid var(--border); color: var(--text);
    padding: 1.15rem 1.25rem; border-radius: var(--r-md); font-size: 1rem; font-weight: 500;
    cursor: pointer; transition: border-color 0.2s, background 0.2s; text-align: left; font-family: var(--font-ui);
}
.quiz-btn:hover { background: var(--surface-2); border-color: var(--border-strong); }
.quiz-btn:active { transform: scale(0.99); }

/* Diagnosis box */
.diagnosis-box { text-align: left; }
.diag-stat { font-size: 1.05rem; line-height: 1.5; margin-bottom: 0.6rem; font-weight: 500; color: var(--text-secondary); }
.diag-stat span:first-child { font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }
.diag-stat.highlight-red span:first-child { color: var(--accent); }
.diagnosis-box hr { border: none; border-top: 1px solid var(--border); margin: 1.1rem 0; }
.diag-summary { font-size: 0.95rem; line-height: 1.6; color: var(--text-secondary); font-weight: 400; }

.pitch-list { list-style: none; padding: 0; margin: 1.5rem auto; text-align: left; display: flex; flex-direction: column; gap: 0.8rem; width: fit-content; }
.pitch-list li { font-size: 1rem; font-weight: 500; color: var(--text); display: flex; align-items: center; gap: 0.7rem; }

/* =========================================
   PRICING (Anchoring)
   ========================================= */
.pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.7rem; margin: 1.75rem 0 1.1rem; text-align: center; }
.price-card {
    position: relative; padding: 1.5rem 0.7rem 1.2rem; border-radius: var(--r-lg);
    background: var(--surface); border: 1.5px solid var(--border);
    cursor: pointer; transition: border-color 0.2s, background 0.2s;
    display: flex; flex-direction: column; align-items: center; gap: 0.25rem;
}
.price-card:hover { border-color: var(--border-strong); }
.price-card.selected { border-color: var(--gold); background: var(--gold-soft); }
.price-flag {
    position: absolute; top: -10px; left: 50%; transform: translateX(-50%);
    background: var(--gold); color: #1a1204; font-size: 0.58rem; font-weight: 800;
    letter-spacing: 0.03em; white-space: nowrap; padding: 0.28rem 0.65rem; border-radius: var(--r-pill);
}
.price-plan { font-size: 0.75rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.price-card.selected .price-plan { color: var(--gold); }
.price-amount { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.price-per { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0; }
.price-note { font-size: 0.68rem; color: var(--text-muted); line-height: 1.35; margin-top: 0.15rem; }
.trust-row { display: flex; justify-content: center; gap: 1.25rem; flex-wrap: wrap; margin-bottom: 1.25rem; font-size: 0.82rem; color: var(--text-secondary); font-weight: 500; }

/* Plan rows (vertical selector, used in paywall modal) */
.plan-list { display: flex; flex-direction: column; gap: 0.6rem; margin: 1.25rem 0; text-align: left; }
.plan-row { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; width: 100%; padding: 0.85rem 1rem; border-radius: var(--r-md); background: var(--surface); border: 1.5px solid var(--border); cursor: pointer; transition: border-color 0.2s, background 0.2s; font-family: var(--font-ui); color: var(--text); }
.plan-row:hover { border-color: var(--border-strong); }
.plan-row.selected { border-color: var(--gold); background: var(--gold-soft); }
.plan-row-info { display: flex; flex-direction: column; gap: 0.12rem; min-width: 0; }
.plan-row-name { font-weight: 700; font-size: 0.95rem; }
.plan-row-note { font-size: 0.72rem; color: var(--text-muted); }
.plan-row-price { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.plan-row-price span { font-size: 0.7rem; font-weight: 500; color: var(--text-muted); }
.plan-row-flag { position: absolute; top: -9px; left: 1rem; background: var(--gold); color: #1a1204; font-size: 0.56rem; font-weight: 800; letter-spacing: 0.03em; padding: 0.2rem 0.5rem; border-radius: 100px; }

/* Diagnose: unterstützende Notiz (bei niedriger Stimmung) */
.diag-support { max-width: 560px; margin: 0 auto 1.5rem; padding: 1rem 1.2rem; background: rgba(50,215,75,0.06); border: 1px solid rgba(50,215,75,0.3); border-radius: var(--r-md); text-align: left; }
.diag-support p { font-size: 0.9rem; line-height: 1.55; color: var(--text); margin: 0; }
.diag-support b { color: #86efac; }

/* Spinner */
.spinner { width: 44px; height: 44px; border: 2.5px solid var(--surface-3); border-radius: 50%; border-top-color: var(--accent); animation: spin 0.8s linear infinite; margin: 0 auto 1.5rem auto; }
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================
   DASHBOARD
   ========================================= */
.dashboard { max-width: 1200px; width: 100%; }
.dashboard.active .stagger-item { opacity: 0; animation: rise 0.5s ease forwards; }
.dashboard.active .stagger-item:nth-child(1) { animation-delay: 0.04s; }
.dashboard.active .stagger-item:nth-child(2) { animation-delay: 0.09s; }
.dashboard.active .stagger-item:nth-child(3) { animation-delay: 0.14s; }
.dashboard.active .stagger-item:nth-child(4) { animation-delay: 0.19s; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.dashboard-header { margin-bottom: 1.75rem; position: relative; }
.dashboard-header h2 { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; letter-spacing: -0.03em; }
.pro-badge-small { position: absolute; top: -6px; right: 0; background: var(--gold); color: #1a1204; padding: 0.25rem 0.7rem; border-radius: var(--r-pill); font-weight: 800; font-size: 0.7rem; letter-spacing: 0.08em; }

.grid-layout { display: grid; grid-template-columns: 1fr; gap: 1rem; }

/* =========================================
   STREAK BANNER (Loss Aversion, restrained)
   ========================================= */
.streak-banner {
    display: flex; align-items: center; gap: 1rem;
    max-width: 1200px; margin: 0 auto 1.25rem; padding: 1rem 1.25rem;
    border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--border);
    transition: border-color 0.3s ease;
}
.streak-flame { font-size: 1.9rem; line-height: 1; filter: grayscale(1) opacity(0.4); transition: filter 0.3s; }
.streak-info { flex: 1; display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
.streak-count-row { display: flex; align-items: baseline; gap: 0.4rem; }
.streak-count { font-family: var(--font-display); font-size: 1.7rem; font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.streak-unit { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.08em; }
.streak-status { font-size: 0.82rem; font-weight: 500; color: var(--text-secondary); line-height: 1.3; }
.streak-best { font-size: 0.72rem; font-weight: 600; color: var(--text-muted); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

.streak-banner.secured { border-color: rgba(216, 184, 120, 0.4); }
.streak-banner.secured .streak-flame { filter: none; }
.streak-banner.secured .streak-count { color: var(--gold); }
.streak-banner.secured .streak-status { color: var(--gold); }

.streak-banner.danger { border-color: rgba(255, 69, 58, 0.45); }
.streak-banner.danger .streak-flame { filter: none; }
.streak-banner.danger .streak-count { color: var(--accent); }
.streak-banner.danger .streak-status { color: var(--accent); }

/* =========================================
   MONK TIMER
   ========================================= */
.timer-display {
    font-family: var(--font-display); font-size: 3.75rem; font-weight: 800; font-variant-numeric: tabular-nums;
    margin: 0.75rem 0; color: var(--text); letter-spacing: -0.04em;
}
.timer-options { display: flex; gap: 0.5rem; justify-content: center; margin-bottom: 1rem; width: 100%; }
.timer-pill {
    background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary);
    padding: 0.5rem 0.85rem; border-radius: var(--r-pill); font-weight: 600; cursor: pointer;
    transition: border-color 0.2s, color 0.2s, background 0.2s; display: flex; align-items: center; gap: 0.4rem; font-size: 0.85rem; font-family: var(--font-ui);
}
.timer-pill:hover { background: var(--surface-3); }
.timer-pill.active { background: var(--accent-soft); border-color: rgba(255, 69, 58, 0.4); color: var(--text); }
.pro-tag { background: var(--gold); color: #1a1204; font-size: 0.55rem; font-weight: 800; padding: 0.12rem 0.35rem; border-radius: 4px; letter-spacing: 0.06em; }

/* Quote */
.quote-text {
    font-size: 1rem; font-weight: 400; color: var(--text); line-height: 1.55; margin-top: 0.9rem;
    padding-left: 0.9rem; border-left: 2px solid var(--accent); font-style: normal;
}

/* Focus stat under timer */
.focus-stat { margin-top: 0.9rem; font-size: 0.78rem; color: var(--text-muted); font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }

/* Weekly Report */
.report-box h3, .blueprint-box h3 { display: flex; align-items: center; gap: 0.5rem; }
.report-chart { display: flex; align-items: flex-end; gap: 0.5rem; height: 100px; margin: 0.5rem 0 1.5rem; }
.rc-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; height: 100%; }
.rc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.rc-bar { width: 100%; border-radius: 5px 5px 3px 3px; background: var(--surface-3); transition: height 0.4s ease; }
.rc-bar.done { background: var(--accent); }
.rc-label { font-size: 0.62rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.04em; }
.rc-label.on { color: var(--text-secondary); }

.report-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0.7rem; margin-bottom: 1.5rem; }
.rs { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.9rem 1rem; }
.rs-num { font-family: var(--font-display); font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; line-height: 1.1; }
.rs-num span { font-size: 0.9rem; font-weight: 600; color: var(--text-muted); }
.rs-lab { font-size: 0.72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; margin-top: 0.2rem; }
.report-verdict { font-size: 0.95rem; line-height: 1.55; color: var(--text); padding: 0.9rem 1rem; background: var(--surface-2); border-left: 2px solid var(--gold); border-radius: 0 var(--r-md) var(--r-md) 0; margin-bottom: 1.25rem; }

/* =========================================
   REFLEXION (Journal) & WAR ROOM
   ========================================= */
.warroom-box h3 { display: flex; align-items: center; gap: 0.5rem; }

.period-pills { display: flex; gap: 0.4rem; margin: 0.5rem 0 1rem; }
.period-pill { flex: 1; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); padding: 0.5rem 0.4rem; border-radius: var(--r-sm); font-weight: 600; font-size: 0.82rem; cursor: pointer; transition: all 0.2s; font-family: var(--font-ui); }
.period-pill:hover { background: var(--surface-3); }
.period-pill.active { background: var(--accent-soft); border-color: rgba(255,69,58,0.4); color: var(--text); }

.journal-prompt { line-height: 1.45; margin-bottom: 0.75rem; font-style: italic; }
.journal-textarea {
    width: 100%; padding: 0.9rem 1rem; font-size: 0.95rem; font-family: var(--font-ui); line-height: 1.55;
    background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); color: var(--text);
    resize: vertical; min-height: 90px; margin-bottom: 0.85rem; transition: border-color 0.2s;
}
.journal-textarea::placeholder { color: var(--text-muted); }
.journal-textarea:focus { outline: none; border-color: var(--border-strong); background: var(--surface-3); }

.journal-ai-section { margin-top: 1.1rem; }
.journal-ai-section .btn-secondary { display: flex; align-items: center; justify-content: center; gap: 0.5rem; }
.ai-review-output { margin-top: 0.85rem; padding: 1rem 1.1rem; background: var(--surface-2); border: 1px solid var(--border); border-left: 2px solid var(--gold); border-radius: 0 var(--r-md) var(--r-md) 0; }
.ai-review-text { font-size: 0.95rem; line-height: 1.6; color: var(--text); white-space: pre-wrap; }

.journal-entries { margin-top: 1.25rem; }
.journal-entries-head { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); margin-bottom: 0.6rem; }
.journal-entry { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-md); padding: 0.75rem 0.9rem; margin-bottom: 0.6rem; }
.je-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.je-meta { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; }
.je-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0.15rem 0.4rem; border-radius: 5px; }
.je-del:hover { color: var(--accent); background: var(--accent-soft); }
.je-text { font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary); white-space: pre-wrap; }

.warroom-disclaimer { text-align: center; margin: 1rem 0 0.25rem; font-size: 0.75rem; }
.crisis-box { margin-top: 1rem; padding: 1.1rem 1.2rem; background: rgba(50,215,75,0.06); border: 1px solid rgba(50,215,75,0.35); border-radius: var(--r-md); }
.crisis-box h3 { font-size: 1rem; font-weight: 700; color: #4ade80; margin-bottom: 0.5rem; text-transform: none; letter-spacing: 0; }
.crisis-box p { font-size: 0.88rem; line-height: 1.55; color: var(--text); margin-bottom: 0.6rem; }
.crisis-contact { font-weight: 600; color: #86efac !important; }

/* Coach / Typewriter */
.advice-box { flex: 1; }
.typewriter-text {
    font-family: 'SF Mono', ui-monospace, 'Cascadia Code', monospace; font-size: 0.95rem; color: var(--text);
    line-height: 1.65; min-height: 80px; margin-top: 0.9rem; font-weight: 400;
}
.typewriter-text::after { content: '▌'; animation: blink 1.1s step-end infinite; color: var(--accent); margin-left: 3px; }
@keyframes blink { 50% { opacity: 0; } }

/* Blueprint */
#blueprint-summary { font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary); }

/* Detox */
.detox-list { list-style: none; margin-top: 1.1rem; text-align: left; }
.detox-list li { display: flex; align-items: flex-start; margin-bottom: 1rem; color: var(--text); font-size: 0.95rem; line-height: 1.45; font-weight: 500; }
.detox-list li:last-child { margin-bottom: 0; }
.detox-list li.completed .detox-text { text-decoration: line-through; color: var(--text-muted); }
.detox-list li { gap: 0.6rem; }
.detox-text { flex: 1; }
.detox-del { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.75rem; padding: 0.1rem 0.4rem; border-radius: 5px; flex-shrink: 0; transition: color 0.2s, background 0.2s; }
.detox-del:hover { color: var(--accent); background: var(--accent-soft); }
.detox-add { display: flex; gap: 0.5rem; margin-top: 1rem; align-items: center; }
.detox-add input { flex: 1; padding: 0.7rem 0.9rem; font-size: 0.9rem; }
.detox-add .btn-secondary { padding: 0.7rem 1rem; flex-shrink: 0; font-size: 1.1rem; line-height: 1; }

/* =========================================
   CHECKLIST / PROGRESS RING
   ========================================= */
.checklist-box { display: flex; flex-direction: column; }
.checklist { list-style: none; flex: 1; width: 100%; max-height: 320px; overflow-y: auto; margin: 1.25rem 0; padding-right: 6px; }
.checklist::-webkit-scrollbar { width: 3px; }
.checklist::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 2px; }
.checklist-item { display: flex; align-items: center; padding: 0.85rem 0; border-bottom: 1px solid var(--border); gap: 0.85rem; }
.checklist-item:last-child { border-bottom: none; }
.check-input {
    appearance: none; -webkit-appearance: none; width: 22px; height: 22px;
    border: 1.5px solid var(--border-strong); border-radius: 7px; cursor: pointer;
    transition: background 0.2s, border-color 0.2s; position: relative; background: transparent; flex-shrink: 0;
}
.check-input:checked { background: var(--accent); border-color: var(--accent); }
.check-input:checked::after { content: ''; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.task-text { font-size: 0.95rem; font-weight: 500; flex: 1; transition: color 0.2s; }
.checklist-item.completed .task-text { text-decoration: line-through; color: var(--text-muted); }
.delete-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 0.85rem; padding: 0.25rem 0.5rem; border-radius: 6px; transition: color 0.2s, background 0.2s; }
.delete-btn:hover { color: var(--accent); background: var(--accent-soft); }

.svg-progress-wrapper { position: relative; width: 128px; height: 128px; margin: 1.25rem auto 0.5rem; }
.progress-ring { transform: rotate(-90deg); }
.progress-ring__circle { stroke: var(--accent); stroke-dasharray: 377 377; stroke-dashoffset: 377; transition: stroke-dashoffset 0.9s ease; stroke-linecap: round; }
.progress-text-center { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums; }

/* Feature lock */
.feature-lock {
    position: absolute; inset: 0; background: rgba(11, 11, 12, 0.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
    display: flex; align-items: center; justify-content: center; border-radius: var(--r-xl); cursor: pointer; transition: background 0.2s; z-index: 5;
}
.feature-lock:hover { background: rgba(11, 11, 12, 0.6); }
.feature-lock span { background: var(--gold); color: #1a1204; padding: 0.6rem 1.4rem; border-radius: var(--r-pill); font-weight: 700; font-size: 0.9rem; letter-spacing: 0.02em; display: inline-flex; align-items: center; gap: 0.4rem; }
.feature-lock span::before { content: '🔒'; font-size: 0.85rem; }

/* =========================================
   MODALS
   ========================================= */
.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.65); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 1.25rem; }
.modal-content { max-width: 440px; width: 100%; transform: translateY(12px); opacity: 0; transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease; max-height: 90vh; overflow-y: auto; }
.modal-overlay:not(.hidden) .modal-content { transform: translateY(0); opacity: 1; }
.modal-content h2 { font-family: var(--font-display); font-size: 1.4rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 0.5rem; }
.modal-content input { margin: 0.85rem 0; }

/* =========================================
   INSTALL / ADD TO HOME SCREEN
   ========================================= */
.install-banner {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem;
    z-index: 150; width: calc(100% - 2rem); max-width: 520px;
    background: var(--surface-2); border: 1px solid var(--gold);
    border-radius: var(--r-lg); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-lg);
    display: flex; align-items: flex-start; gap: 0.9rem; animation: rise 0.4s ease;
}
.install-icon { font-size: 1.5rem; line-height: 1; flex-shrink: 0; }
.install-text { flex: 1; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0; }
.install-text strong { font-size: 0.95rem; font-weight: 700; }
.install-text span { font-size: 0.82rem; color: var(--text-secondary); line-height: 1.45; }
.install-ios b { color: var(--text); }
.install-actions { display: flex; flex-direction: column; gap: 0.4rem; flex-shrink: 0; align-items: stretch; }
.install-cta { padding: 0.55rem 1.1rem; font-size: 0.85rem; white-space: nowrap; }
.install-dismiss { margin: 0; font-size: 0.8rem; padding: 0.3rem; }
@media (max-width: 640px) { .install-banner { bottom: calc(84px + var(--safe-bottom)); } }

/* =========================================
   COOKIE / STORAGE NOTICE
   ========================================= */
.cookie-banner {
    position: fixed; left: 50%; transform: translateX(-50%); bottom: 1rem;
    z-index: 150; width: calc(100% - 2rem); max-width: 520px;
    background: var(--surface-2); border: 1px solid var(--border-strong);
    border-radius: var(--r-lg); padding: 1.1rem 1.25rem; box-shadow: var(--shadow-lg);
    display: flex; flex-direction: column; gap: 0.85rem;
    animation: rise 0.4s ease;
}
.cookie-text { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; }
.cookie-actions { display: flex; align-items: center; justify-content: flex-end; gap: 1.1rem; }
.cookie-link { color: var(--text-secondary); font-size: 0.85rem; text-decoration: underline; white-space: nowrap; }
.cookie-link:hover { color: var(--text); }
.cookie-btn { padding: 0.6rem 1.5rem; font-size: 0.9rem; }
@media (max-width: 640px) { .cookie-banner { bottom: calc(84px + var(--safe-bottom)); } }

/* =========================================
   SETTINGS (full page)
   ========================================= */
.settings-page {
    position: fixed; inset: 0; z-index: 200; background: var(--bg);
    display: flex; flex-direction: column; overflow: hidden;
}
.settings-topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: calc(1rem + var(--safe-top)) 1.25rem 1rem; border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.settings-page-title { font-family: var(--font-display); font-size: 1.15rem; font-weight: 800; letter-spacing: -0.01em; }
.settings-close { background: var(--surface-2); border: 1px solid var(--border); color: var(--text-secondary); width: 34px; height: 34px; border-radius: 50%; font-size: 0.9rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: color 0.2s, background 0.2s; }
.settings-close:hover { color: var(--text); background: var(--surface-3); }
.settings-page-inner {
    flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
    width: 100%; max-width: 560px; margin: 0 auto;
    padding: 1.5rem 1.25rem calc(2.5rem + var(--safe-bottom));
    display: flex; flex-direction: column; gap: 1rem;
}
.settings-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 1.25rem; }
.settings-section-label { font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.85rem; }
.settings-section .btn-secondary { margin-top: 1rem; }
.settings-section .settings-row { margin: 0; }

/* Settings toggle row */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; text-align: left; margin: 1.1rem 0 0.5rem; }
.settings-row-title { font-weight: 700; font-size: 0.95rem; }
.settings-row-sub { margin-top: 0.15rem; line-height: 1.4; }
.toggle-switch { flex-shrink: 0; width: 48px; height: 28px; border-radius: var(--r-pill); border: none; background: var(--surface-3); cursor: pointer; position: relative; transition: background 0.25s; padding: 0; }
.toggle-switch[aria-pressed="true"] { background: var(--success); }
.toggle-knob { position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: var(--shadow-sm); }
.toggle-switch[aria-pressed="true"] .toggle-knob { transform: translateX(20px); }

/* Legal links */
.legal-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1rem; justify-content: center; margin-bottom: 1rem; }
.legal-links a { color: var(--text-secondary); font-size: 0.82rem; text-decoration: none; }
.legal-links a:hover { color: var(--text); text-decoration: underline; }
.paywall-legal { margin-top: 1rem; font-size: 0.72rem; color: var(--text-muted); line-height: 1.5; text-align: center; }
.paywall-legal a { color: var(--text-secondary); text-decoration: underline; }
.paywall-legal a:hover { color: var(--text); }

#error-log { font-family: 'SF Mono', monospace; background: var(--accent-soft); border: 1px solid rgba(255, 69, 58, 0.3); padding: 0.85rem; border-radius: var(--r-md); font-size: 0.8rem; text-align: left; word-break: break-word; margin-top: 0.85rem; color: #ff8a84; }

/* =========================================
   DISCIPLINE MATRIX
   ========================================= */
.heatmap-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 1.1rem; }
.heat-box { aspect-ratio: 1; border-radius: 5px; background: var(--surface-2); transition: transform 0.15s, background 0.2s; }
.heat-box:hover { transform: scale(1.12); }
.heat-box.active { background: var(--accent); }
.heat-box.today { box-shadow: inset 0 0 0 1.5px var(--border-strong); }
.heat-box.active.today { box-shadow: inset 0 0 0 1.5px rgba(255, 255, 255, 0.6); }

/* =========================================
   MOBILE NAV (native tab bar)
   ========================================= */
.mobile-nav { display: none; }
.hidden-desktop { display: none !important; }

/* =========================================
   DESKTOP GRID
   ========================================= */
@media (min-width: 1024px) {
    .grid-layout { grid-template-columns: 1fr 1.15fr 1fr; align-items: start; gap: 1rem; }
    .left-column, .right-column { display: flex; flex-direction: column; gap: 1rem; }
    .grid-layout .glass-panel { margin-bottom: 0; }
    .glass-panel:hover { border-color: var(--border-strong); }
}

/* =========================================
   MOBILE  (native app shell)
   ========================================= */
@media (max-width: 640px) {
    body.in-app .hidden-desktop.mobile-nav { display: flex !important; }
    body { height: 100vh; height: 100dvh; overflow: hidden; }

    .logo { font-size: 0.95rem; letter-spacing: 0.16em; }
    .container { padding: 0 1rem; height: calc(100dvh - 56px - var(--safe-top)); display: flex; flex-direction: column; overflow: hidden; }

    .funnel-step { height: 100%; overflow-y: auto; padding: 0.5rem 0 2rem; }
    .main-title.huge { font-size: clamp(1.9rem, 8vw, 2.6rem); margin-top: 0.5rem; }
    .subtitle { font-size: 0.95rem; margin-bottom: 1.5rem; }

    /* Dashboard becomes a scrollable card feed under a fixed tab bar */
    .dashboard.active { display: flex; flex-direction: column; overflow: hidden; height: 100%; }
    .dashboard-header { display: none; }
    .streak-banner { margin: 0.5rem 0 0.75rem; flex-shrink: 0; }
    .grid-layout { display: flex; flex-direction: column; gap: 0.75rem; flex: 1; overflow-y: auto; padding-bottom: calc(90px + var(--safe-bottom)); -webkit-overflow-scrolling: touch; }
    .left-column, .right-column { display: contents; }
    .glass-panel.hidden-mobile { display: none !important; }

    .glass-panel { padding: 1.25rem; margin-bottom: 0; flex-shrink: 0; }
    .timer-display { font-size: 3rem; }
    .typewriter-text { min-height: 60px; font-size: 0.9rem; }
    .checklist { max-height: none; overflow: visible; }
    .checklist-box { overflow: visible; }

    /* Fixed bottom tab bar */
    .mobile-nav {
        position: fixed; bottom: 0; left: 0; width: 100%;
        background: rgba(16, 16, 18, 0.85); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
        border-top: 1px solid var(--border); display: flex; justify-content: space-around;
        padding: 0.5rem 0.5rem calc(0.5rem + var(--safe-bottom)); z-index: 100;
    }
    .nav-tab { background: none; border: none; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 0.2rem; cursor: pointer; transition: color 0.2s; flex: 1; padding: 0.35rem 0; }
    .nav-tab svg { width: 22px; height: 22px; stroke-width: 1.9; }
    .nav-tab.active { color: var(--accent); }
    .nav-tab .tab-text { font-size: 0.62rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; }

    .pro-badge-small { position: static; display: inline-block; margin-top: 0.5rem; }
    .heatmap-grid { max-width: 280px; margin: 1.1rem auto 0; }
    .modal-content { max-width: 100%; }
}

/* =========================================
   MOTION PREFERENCES
   ========================================= */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
    .typewriter-text::after { animation: none; }
}
