/* ===================== LUNA — Women's Health App ===================== */
/* Design: Cosmic / Lunar theme, mobile-first */

:root {
    --primary: #7C3AED;
    --primary-light: #A78BFA;
    --secondary: #EC4899;
    --accent: #818CF8;
    --success: #34D399;
    --warning: #FBBF24;
    --error: #F87171;
    --bg: #0F0B1E;
    --bg-card: rgba(255, 255, 255, 0.06);
    --bg-card-hover: rgba(255, 255, 255, 0.1);
    --border: rgba(255, 255, 255, 0.08);
    --text: #E8E0F0;
    --text-dim: rgba(232, 224, 240, 0.5);
    --text-bright: #FFFFFF;
    /* Cycle phase colors */
    --phase-menstrual: #EF4444;
    --phase-follicular: #F59E0B;
    --phase-ovulatory: #10B981;
    --phase-luteal: #8B5CF6;
    --tab-height: 70px;
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
    height: 100%;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Segoe UI', Roboto, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

body { padding-bottom: calc(var(--tab-height) + var(--safe-bottom)); }

/* ===================== VIEWS ===================== */
.view { display: none; min-height: 100vh; padding: 20px 16px; animation: viewSlideIn 0.3s ease; }
.view.active { display: block; }
@keyframes viewSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Smooth transitions for interactive elements */
button, .tab, .cal-day, .profile-menu-item, .symptom-chips button, .mood-selector button, .flow-btn {
    transition: transform 0.12s ease, background 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}
button:active, .tab:active, .profile-menu-item:active {
    transform: scale(0.97);
}

/* ===================== SPLASH ===================== */
#splash { align-items: center; justify-content: center; background: linear-gradient(135deg, #0F0B1E 0%, #1a1040 50%, #0F0B1E 100%); }
#splash.active { display: flex; }
.splash-content { text-align: center; }
.splash-moon { font-size: 80px; animation: float 3s ease-in-out infinite; }
@keyframes float { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }
.splash-content h1 { font-size: 42px; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; margin: 12px 0 8px; font-weight: 700; letter-spacing: 2px; }
.splash-content p { color: var(--text-dim); font-size: 15px; }
.splash-loader { margin-top: 40px; }
.dot-pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--primary-light); animation: pulse 1.4s ease-in-out infinite; margin: 0 auto; }
@keyframes pulse { 0%,100% { opacity: 0.3; transform: scale(0.8); } 50% { opacity: 1; transform: scale(1.2); } }

/* ===================== AUTH ===================== */
.auth-container { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 20px; }
.auth-header { text-align: center; margin-bottom: 40px; }
.auth-moon { font-size: 60px; }
.auth-header h1 { font-size: 36px; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.auth-header p { color: var(--text-dim); margin-top: 8px; }
.auth-tabs { display: flex; gap: 0; margin-bottom: 24px; background: var(--bg-card); border-radius: 12px; padding: 4px; }
.auth-tab { flex: 1; padding: 12px; border: none; background: transparent; color: var(--text-dim); font-size: 15px; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.auth-tab.active { background: var(--primary); color: white; }
.tab-content { display: none; }
.tab-content.active { display: flex; flex-direction: column; gap: 12px; }
.auth-form input {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px 16px; color: var(--text); font-size: 16px; outline: none; transition: border-color 0.2s;
}
.auth-form input:focus { border-color: var(--primary); }
.error-msg { color: var(--error); font-size: 13px; text-align: center; min-height: 20px; margin-top: 4px; }

/* ===================== BUTTONS ===================== */
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; border: none; border-radius: 14px; padding: 15px 24px;
    font-size: 16px; font-weight: 600; cursor: pointer; width: 100%;
    transition: transform 0.15s, opacity 0.15s;
}
.btn-primary:active { transform: scale(0.97); opacity: 0.9; }
.btn-outline {
    background: transparent; border: 1px solid var(--primary); color: var(--primary-light);
    border-radius: 12px; padding: 12px 20px; font-size: 14px; cursor: pointer;
}
.btn-text { background: none; border: none; color: var(--text-dim); font-size: 14px; cursor: pointer; padding: 12px; }
.btn-text:hover { color: var(--text); }

/* ===================== ONBOARDING ===================== */
.onboard-container { min-height: 100vh; display: flex; flex-direction: column; justify-content: center; padding: 40px 20px; }
.onboard-step { text-align: center; }
.onboard-step.hidden { display: none; }
.onboard-icon { font-size: 60px; margin-bottom: 16px; }
.onboard-step h2 { font-size: 22px; margin-bottom: 8px; }
.onboard-step p { color: var(--text-dim); margin-bottom: 24px; }
.onboard-step label { display: block; color: var(--text-dim); font-size: 14px; margin-top: 20px; margin-bottom: 8px; }
.cycle-picker { display: flex; align-items: center; justify-content: center; gap: 20px; margin-bottom: 12px; }
.cycle-picker button { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border); background: var(--bg-card); color: var(--text); font-size: 22px; cursor: pointer; }
.cycle-picker span { font-size: 32px; font-weight: 700; min-width: 50px; color: var(--primary-light); }
.onboard-step input[type="date"] {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 14px; color: var(--text); font-size: 16px; width: 100%; text-align: center;
}
.hint { color: var(--text-dim); font-size: 12px; margin-top: 4px; }
.import-options { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }

/* ===================== DASHBOARD ===================== */
.dash-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-top: 8px; }
.dash-header h2 { font-size: 24px; font-weight: 700; }
.subtext { color: var(--text-dim); font-size: 13px; }
.dash-moon-badge { width: 44px; height: 44px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; font-size: 24px; cursor: pointer; border: 1px solid var(--border); }

/* Cycle Ring */
.cycle-ring-card { background: var(--bg-card); border-radius: 20px; padding: 24px; text-align: center; margin-bottom: 16px; backdrop-filter: blur(10px); border: 1px solid var(--border); }
.cycle-ring-container { position: relative; width: 220px; height: 220px; margin: 0 auto 16px; }
.cycle-ring-center { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.cycle-day { font-size: 48px; font-weight: 700; color: var(--text-bright); line-height: 1; }
.cycle-day-label { font-size: 13px; color: var(--text-dim); }
.phase-badge { display: inline-flex; align-items: center; gap: 8px; padding: 8px 16px; border-radius: 20px; background: rgba(255,255,255,0.06); font-size: 15px; font-weight: 500; }
.prediction-row { margin-top: 8px; color: var(--text-dim); font-size: 14px; }
.prediction-row strong { color: var(--text-bright); }

/* Period start button */
.btn-period-start {
    width: 100%; padding: 16px; border-radius: 16px; border: 2px dashed var(--phase-menstrual);
    background: rgba(239, 68, 68, 0.08); color: var(--phase-menstrual);
    font-size: 16px; font-weight: 600; cursor: pointer; margin-bottom: 16px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    transition: background 0.2s;
}
.btn-period-start:active { background: rgba(239, 68, 68, 0.15); }
.btn-period-icon { font-size: 20px; }

/* Tip card */
.tip-card { background: var(--bg-card); border-radius: 16px; padding: 16px; margin-bottom: 16px; border: 1px solid var(--border); }
.tip-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
.tip-icon { font-size: 18px; }
.tip-sections { display: flex; flex-direction: column; gap: 10px; }
.tip-section { }
.tip-label { font-size: 12px; color: var(--text-dim); margin-bottom: 2px; }
.tip-text { font-size: 14px; line-height: 1.4; }

/* Moon card */
.moon-card { background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(129,140,248,0.1)); border-radius: 16px; padding: 16px; display: flex; gap: 16px; cursor: pointer; border: 1px solid var(--border); margin-bottom: 16px; }
.moon-card-left { text-align: center; }
.moon-big-emoji { font-size: 48px; }
.moon-illumination { font-size: 12px; color: var(--text-dim); }
.moon-card-right { flex: 1; }
.moon-phase-name { font-size: 16px; font-weight: 600; margin-bottom: 4px; }
.moon-insight { font-size: 13px; color: var(--text-dim); line-height: 1.4; }

/* ===================== CALENDAR ===================== */
.cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; padding-top: 8px; }
.cal-header h2 { font-size: 20px; }
.cal-nav { background: none; border: none; color: var(--text); font-size: 28px; padding: 8px 16px; cursor: pointer; }
.cal-legend { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-size: 11px; color: var(--text-dim); flex-wrap: wrap; }
.legend-dot { width: 10px; height: 10px; border-radius: 50%; display: inline-block; margin-left: 8px; }
.legend-dot.period { background: var(--phase-menstrual); }
.legend-dot.fertile { background: var(--phase-ovulatory); }
.legend-dot.ovulation { background: var(--success); }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; color: var(--text-dim); margin-bottom: 8px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-day {
    aspect-ratio: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    border-radius: 12px; font-size: 14px; cursor: pointer; position: relative; transition: background 0.15s;
}
.cal-day:active { background: var(--bg-card-hover); }
.cal-day.today { border: 2px solid var(--primary); }
.cal-day.period { background: rgba(239, 68, 68, 0.2); color: var(--phase-menstrual); font-weight: 600; }
.cal-day.predicted-period { background: rgba(239, 68, 68, 0.08); border: 1px dashed rgba(239, 68, 68, 0.3); }
.cal-day.fertile { background: rgba(16, 185, 129, 0.12); }
.cal-day.ovulation { background: rgba(16, 185, 129, 0.25); color: var(--success); font-weight: 600; }
.cal-day.has-log::after { content: ''; position: absolute; bottom: 4px; width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.cal-day .cal-moon { font-size: 8px; line-height: 1; margin-top: 2px; }
.cal-day.empty { cursor: default; }

.cal-day-detail { background: var(--bg-card); border-radius: 16px; padding: 16px; margin-top: 16px; border: 1px solid var(--border); }
.cal-detail-date { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.cal-detail-moon { font-size: 13px; color: var(--text-dim); margin-bottom: 8px; }
.hidden { display: none !important; }

/* ===================== LOG ===================== */
.log-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-top: 8px; }
.log-header h2 { font-size: 24px; }
.log-header input[type="date"] { background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 12px; color: var(--text); font-size: 14px; }
.log-section { margin-bottom: 20px; }
.log-section h3 { font-size: 15px; margin-bottom: 10px; font-weight: 600; }
.log-row { display: flex; gap: 12px; }
.log-half { flex: 1; }
.log-half input { width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px; padding: 12px; color: var(--text); font-size: 16px; }

/* Flow selector */
.flow-selector { display: flex; gap: 6px; flex-wrap: wrap; }
.flow-btn {
    padding: 10px 14px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 13px; cursor: pointer;
    display: flex; flex-direction: column; align-items: center; gap: 4px; transition: all 0.15s;
}
.flow-btn.active { border-color: var(--phase-menstrual); background: rgba(239, 68, 68, 0.15); color: var(--phase-menstrual); }
.flow-drops { font-size: 11px; }

/* Mood selector */
.mood-selector { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.mood-selector button {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 12px 8px; border-radius: 12px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 24px; cursor: pointer; transition: all 0.15s;
}
.mood-selector button span { font-size: 10px; color: var(--text-dim); }
.mood-selector button.active { border-color: var(--primary); background: rgba(124, 58, 237, 0.15); }

/* Sliders */
.slider-row { display: flex; align-items: center; gap: 12px; }
.range-slider { flex: 1; -webkit-appearance: none; height: 6px; border-radius: 3px; background: var(--bg-card); outline: none; }
.range-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); cursor: pointer; }
.slider-val { font-size: 18px; font-weight: 600; min-width: 24px; text-align: center; color: var(--primary-light); }

/* Symptom chips */
.symptom-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.symptom-chips button {
    padding: 8px 14px; border-radius: 20px; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 13px; cursor: pointer; transition: all 0.15s;
}
.symptom-chips button.active { border-color: var(--secondary); background: rgba(236, 72, 153, 0.15); color: var(--secondary); }

textarea {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border); border-radius: 12px;
    padding: 12px; color: var(--text); font-size: 14px; resize: none; font-family: inherit;
}
textarea:focus { border-color: var(--primary); outline: none; }

.btn-save-log { margin-bottom: 100px; }

/* ===================== INSIGHTS ===================== */
.view-title { font-size: 24px; padding-top: 8px; margin-bottom: 16px; }
.chart-tabs { display: flex; gap: 0; background: var(--bg-card); border-radius: 12px; padding: 4px; margin-bottom: 16px; }
.chart-tab { flex: 1; padding: 10px; border: none; background: transparent; color: var(--text-dim); font-size: 13px; border-radius: 10px; cursor: pointer; transition: all 0.2s; }
.chart-tab.active { background: var(--primary); color: white; }
.chart-container { background: var(--bg-card); border-radius: 16px; padding: 16px; border: 1px solid var(--border); margin-bottom: 16px; min-height: 250px; }
.insight-cards { display: flex; flex-direction: column; gap: 12px; }
.insight-card { background: var(--bg-card); border-radius: 12px; padding: 14px; border: 1px solid var(--border); }
.insight-card h4 { font-size: 14px; margin-bottom: 4px; }
.insight-card p { font-size: 13px; color: var(--text-dim); }

/* ===================== ASSISTANT ===================== */
#assistant-view { display: none; padding: 0; }
#assistant-view.active { display: flex; flex-direction: column; height: 100vh; }
.chat-header { padding: 16px; padding-top: 24px; text-align: center; }
.chat-header h2 { font-size: 20px; }
.chat-messages {
    flex: 1; overflow-y: auto; padding: 0 16px 16px; display: flex; flex-direction: column; gap: 12px;
    -webkit-overflow-scrolling: touch;
}
.chat-msg { display: flex; }
.chat-msg.user { justify-content: flex-end; }
.chat-bubble {
    max-width: 85%; padding: 12px 16px; border-radius: 16px; font-size: 14px; line-height: 1.5;
    word-wrap: break-word;
}
.chat-msg.assistant .chat-bubble { background: var(--bg-card); border: 1px solid var(--border); border-bottom-left-radius: 4px; }
.chat-msg.user .chat-bubble { background: linear-gradient(135deg, var(--primary), #6D28D9); color: white; border-bottom-right-radius: 4px; }
.chat-msg.typing .chat-bubble { color: var(--text-dim); }
.chat-input-row {
    display: flex; gap: 8px; padding: 12px 16px;
    padding-bottom: calc(12px + var(--tab-height) + var(--safe-bottom));
    background: rgba(15, 11, 30, 0.95); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
}
.chat-input-row input {
    flex: 1; background: var(--bg-card); border: 1px solid var(--border); border-radius: 24px;
    padding: 12px 18px; color: var(--text); font-size: 15px; outline: none;
}
.chat-input-row input:focus { border-color: var(--primary); }
.chat-send-btn {
    width: 48px; height: 48px; border-radius: 50%; border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white; font-size: 20px; cursor: pointer; flex-shrink: 0;
}

/* ===================== LUNAR ===================== */
.lunar-header { padding-top: 8px; margin-bottom: 20px; }
.lunar-header h2 { font-size: 24px; }
.lunar-today { text-align: center; margin-bottom: 20px; }
.lunar-big-moon { font-size: 80px; }
.lunar-phase-name { font-size: 22px; font-weight: 600; margin-top: 8px; }
.lunar-illumination { color: var(--text-dim); margin-top: 4px; }
.lunar-insight-card { background: linear-gradient(135deg, rgba(124,58,237,0.12), rgba(129,140,248,0.08)); border-radius: 16px; padding: 20px; border: 1px solid var(--border); margin-bottom: 16px; }
.lunar-insight-card h3 { font-size: 17px; margin-bottom: 8px; }
.lunar-insight-card p { font-size: 14px; color: var(--text-dim); line-height: 1.5; margin-bottom: 8px; }
.lunar-tip { background: rgba(255,255,255,0.05); border-radius: 10px; padding: 10px 14px; font-size: 13px; }
.lunar-upcoming { display: flex; gap: 12px; margin-bottom: 20px; }
.lunar-event { flex: 1; background: var(--bg-card); border-radius: 12px; padding: 14px; text-align: center; border: 1px solid var(--border); font-size: 14px; display: flex; flex-direction: column; gap: 6px; }
.lunar-science { background: var(--bg-card); border-radius: 16px; padding: 20px; border: 1px solid var(--border); }
.lunar-science h3 { font-size: 16px; margin-bottom: 10px; }
.lunar-science p { font-size: 13px; color: var(--text-dim); line-height: 1.6; margin-bottom: 8px; }

/* ===================== PROFILE ===================== */
.profile-header { text-align: center; padding-top: 20px; margin-bottom: 24px; }
.profile-avatar { font-size: 60px; margin-bottom: 8px; }
.profile-header h2 { font-size: 22px; }
.profile-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 24px; }
.stat-card { background: var(--bg-card); border-radius: 14px; padding: 16px 10px; text-align: center; border: 1px solid var(--border); }
.stat-value { font-size: 28px; font-weight: 700; color: var(--primary-light); }
.stat-label { font-size: 11px; color: var(--text-dim); margin-top: 4px; }
.profile-menu { display: flex; flex-direction: column; gap: 8px; }
.profile-menu-item {
    display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px;
    background: var(--bg-card); border: 1px solid var(--border); color: var(--text);
    font-size: 15px; cursor: pointer; text-align: left; width: 100%;
}
.profile-menu-item span { font-size: 20px; width: 28px; text-align: center; }
.profile-menu-item.logout { color: var(--error); border-color: rgba(248, 113, 113, 0.2); }
.btn-edit-profile {
    background: none; border: 1px solid var(--border); color: var(--text-dim);
    font-size: 13px; padding: 6px 16px; border-radius: 20px; cursor: pointer; margin-top: 8px;
}
.btn-edit-profile:active { background: var(--bg-card); }
.profile-edit h3 { margin-bottom: 16px; text-align: center; }
.edit-field { margin-bottom: 16px; }
.edit-field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.edit-field input[type="text"] {
    width: 100%; background: var(--bg-card); border: 1px solid var(--border);
    color: var(--text); padding: 12px; border-radius: 12px; font-size: 15px;
}

/* PWA Banner */
.pwa-banner { background: linear-gradient(135deg, rgba(124,58,237,0.25), rgba(236,72,153,0.15)); border-radius: 16px; padding: 16px; margin-top: 24px; display: flex; align-items: center; gap: 12px; border: 1px solid rgba(124,58,237,0.3); }
.pwa-banner-icon { font-size: 28px; flex-shrink: 0; }
.pwa-banner-text { flex: 1; }
.pwa-banner-text strong { display: block; margin-bottom: 2px; font-size: 14px; }
.pwa-banner-text p { font-size: 12px; color: var(--text-dim); margin: 0; }
.pwa-banner .btn-outline { white-space: nowrap; flex-shrink: 0; }

/* ===================== TAB BAR ===================== */
#tab-bar {
    position: fixed; bottom: 0; left: 0; right: 0; height: var(--tab-height);
    padding-bottom: var(--safe-bottom);
    background: rgba(15, 11, 30, 0.95); backdrop-filter: blur(20px);
    border-top: 1px solid var(--border); display: flex; justify-content: space-around; align-items: center;
    z-index: 100;
}
#tab-bar.hidden { display: none; }
.tab {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    background: none; border: none; color: var(--text-dim); font-size: 10px; cursor: pointer;
    padding: 8px 12px; min-width: 56px; transition: color 0.2s;
}
.tab.active { color: var(--primary-light); }
.tab svg { width: 22px; height: 22px; }
.tab-center { position: relative; }
.tab-center-circle {
    width: 52px; height: 52px; border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex; align-items: center; justify-content: center;
    box-shadow: 0 4px 15px rgba(124, 58, 237, 0.4);
    margin-top: -20px;
}
.tab-center-circle svg { color: white; }
.tab-center span { margin-top: 2px; }

/* ===================== TOAST ===================== */
.toast {
    position: fixed; bottom: calc(var(--tab-height) + 20px + var(--safe-bottom));
    left: 50%; transform: translateX(-50%); padding: 12px 24px; border-radius: 12px;
    background: rgba(52, 211, 153, 0.95); color: #064E3B; font-size: 14px; font-weight: 500;
    z-index: 200; animation: toastIn 0.3s ease;
}
.toast.error { background: rgba(248, 113, 113, 0.95); color: #7F1D1D; }
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 10px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* ===================== MODAL ===================== */
.modal {
    position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 300;
    display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal.hidden { display: none; }
.modal-content {
    background: #1a1040; border-radius: 20px; padding: 28px; max-width: 360px; width: 100%;
    border: 1px solid var(--border);
}
.modal-content h3 { font-size: 20px; margin-bottom: 20px; text-align: center; }

/* Install guide */
.install-guide { max-width: 400px; max-height: 85vh; overflow-y: auto; }
.install-guide-header { text-align: center; margin-bottom: 20px; }
.install-guide-header .install-guide-icon { font-size: 40px; display: block; margin-bottom: 8px; }
.install-guide-header h3 { margin-bottom: 6px; }
.install-guide-header .subtext { font-size: 13px; color: var(--text-dim); }
.install-platform { background: var(--bg-card); border-radius: 12px; padding: 16px; margin-bottom: 12px; border: 1px solid var(--border); }
.install-platform-title { font-size: 13px; font-weight: 600; color: var(--primary-light); margin-bottom: 12px; text-transform: uppercase; letter-spacing: 0.5px; }
.install-steps { display: flex; flex-direction: column; gap: 10px; }
.install-step { display: flex; gap: 12px; align-items: flex-start; }
.step-num { width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: white; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; flex-shrink: 0; }
.install-step p { font-size: 13px; line-height: 1.4; }
.install-icon-hint { font-size: 14px; }
.install-result { font-size: 13px; color: var(--text-dim); text-align: center; margin: 16px 0; line-height: 1.5; padding: 12px; background: rgba(52,211,153,0.08); border-radius: 10px; border: 1px solid rgba(52,211,153,0.15); }
.install-dismiss { font-size: 12px; color: var(--text-dim); margin-top: 8px; }

/* ===================== CONTEXTUAL HINTS ===================== */
.luna-hint {
    display: flex; align-items: center; gap: 10px; padding: 12px 16px; margin: 8px 0 12px;
    background: linear-gradient(135deg, rgba(124,58,237,0.15), rgba(129,140,248,0.1));
    border-radius: 12px; border: 1px solid rgba(124,58,237,0.2);
    animation: hintSlideIn 0.3s ease;
}
.luna-hint-icon { font-size: 20px; flex-shrink: 0; }
.luna-hint-text { font-size: 13px; line-height: 1.4; flex: 1; color: var(--text); }
.luna-hint-close {
    background: none; border: none; color: var(--text-dim); font-size: 18px; cursor: pointer;
    padding: 4px 8px; flex-shrink: 0;
}
.luna-hint-fade { opacity: 0; transition: opacity 0.3s; }
@keyframes hintSlideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }

/* ===================== VOICE BUTTON ===================== */
.voice-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 20px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    transition: all 0.2s;
}
.voice-btn.recording {
    background: rgba(239, 68, 68, 0.2); border-color: var(--error);
    color: var(--error); animation: voicePulse 1.5s ease-in-out infinite;
    font-size: 14px; font-weight: 600;
}
@keyframes voicePulse { 0%,100% { box-shadow: 0 0 0 0 rgba(239,68,68,0.3); } 50% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } }
.notes-row { display: flex; gap: 8px; align-items: flex-start; }
.notes-row textarea { flex: 1; }

/* ===================== AI INSIGHT CARD ===================== */
.ai-insight-card {
    background: linear-gradient(135deg, rgba(16,185,129,0.12), rgba(52,211,153,0.08));
    border-radius: 16px; padding: 14px 16px; margin-bottom: 16px; border: 1px solid rgba(52,211,153,0.2);
}
.ai-insight-header { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-weight: 600; font-size: 14px; }
.ai-insight-icon { font-size: 18px; }
.ai-insight-text { font-size: 14px; line-height: 1.5; color: var(--text); }

/* ===================== CALENDAR DETAIL ACTIONS ===================== */
.cal-detail-actions { display: flex; gap: 8px; margin-top: 12px; }
.btn-sm { padding: 8px 14px; font-size: 12px; }
.btn-danger { border-color: rgba(248, 113, 113, 0.3); color: var(--error); }
.btn-danger:hover { background: rgba(248, 113, 113, 0.1); }

/* ===================== PARTNER LINKS ===================== */
.partner-link-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 0; border-bottom: 1px solid var(--border);
}
.partner-link-item:last-child { border-bottom: none; }

/* ===================== ACHIEVEMENTS ===================== */
.achievement-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.achievement-item:last-child { border-bottom: none; }
.achievement-icon { font-size: 28px; width: 40px; text-align: center; }
.achievement-info { flex: 1; }
.achievement-name { font-size: 14px; font-weight: 600; }
.achievement-desc { font-size: 12px; color: var(--text-dim); }
.achievement-locked { opacity: 0.4; filter: grayscale(100%); }
.streak-badge {
    display: inline-flex; align-items: center; gap: 6px;
    background: linear-gradient(135deg, rgba(251,191,36,0.2), rgba(239,68,68,0.1));
    padding: 4px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
    color: var(--warning);
}

/* ===================== PIN LOCK ===================== */
.pin-lock-screen {
    position: fixed; inset: 0; z-index: 500;
    background: var(--bg); display: flex; align-items: center; justify-content: center;
}
.pin-lock-content { text-align: center; padding: 20px; }
.pin-lock-icon { font-size: 48px; margin-bottom: 12px; }
.pin-lock-content h2 { font-size: 28px; margin-bottom: 8px; background: linear-gradient(135deg, var(--primary-light), var(--secondary)); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.pin-lock-content p { color: var(--text-dim); margin-bottom: 24px; }
.pin-dots { display: flex; gap: 16px; justify-content: center; margin-bottom: 16px; }
.pin-dot { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--primary); transition: all 0.15s; }
.pin-dot.filled { background: var(--primary); }
.pin-error { color: var(--error); font-size: 13px; margin-bottom: 8px; }
.pin-keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 0 auto; }
.pin-key {
    width: 72px; height: 72px; border-radius: 50%; border: 1px solid var(--border);
    background: var(--bg-card); color: var(--text); font-size: 24px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; margin: 0 auto;
    transition: background 0.15s;
}
.pin-key:active { background: var(--bg-card-hover); }
.pin-key.empty { border: none; background: none; cursor: default; }

/* ===================== SCROLLBAR ===================== */
::-webkit-scrollbar { width: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* ===================== MEDIA ===================== */
@media (min-width: 480px) {
    .view { max-width: 440px; margin: 0 auto; }
    #tab-bar { max-width: 440px; left: 50%; transform: translateX(-50%); border-radius: 20px 20px 0 0; }
}
