@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

/* ─────────────────────────────────────────────
   THEME VARIABLES
───────────────────────────────────────────── */

:root {
    --font: 'Outfit', sans-serif;
    /* Default: Deep Space */
    --app-bg: linear-gradient(160deg, #090d16 0%, #111827 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #38bdf8;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #fb7185;
    --accent-general: #34d399;
    --dock-bg: rgba(10, 15, 30, 0.7);
    --overlay-bg: #090d16;
    --input-bg: rgba(255,255,255,0.06);
}

.theme-deep-space {
    --app-bg: linear-gradient(160deg, #090d16 0%, #111827 100%);
    --card-bg: rgba(30, 41, 59, 0.5);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-primary: #38bdf8;
    --accent-secondary: #a78bfa;
    --accent-tertiary: #fb7185;
    --accent-general: #34d399;
    --dock-bg: rgba(10, 15, 30, 0.75);
    --overlay-bg: #090d16;
    --input-bg: rgba(255,255,255,0.06);
}

.theme-sunset-rose {
    --app-bg: linear-gradient(160deg, #1c1015 0%, #2e121b 100%);
    --card-bg: rgba(76, 29, 45, 0.45);
    --card-border: rgba(244, 63, 94, 0.15);
    --text-primary: #fff1f2;
    --text-secondary: #fda4af;
    --accent-primary: #fb7185;
    --accent-secondary: #f43f5e;
    --accent-tertiary: #fb923c;
    --accent-general: #f472b6;
    --dock-bg: rgba(28, 10, 16, 0.8);
    --overlay-bg: #1a0b11;
    --input-bg: rgba(251,113,133,0.06);
}

.theme-cyberpunk {
    --app-bg: linear-gradient(160deg, #030712 0%, #0c0a0f 100%);
    --card-bg: rgba(17, 12, 28, 0.85);
    --card-border: rgba(236, 72, 153, 0.25);
    --text-primary: #fdf2ff;
    --text-secondary: #d8b4fe;
    --accent-primary: #06b6d4;
    --accent-secondary: #d946ef;
    --accent-tertiary: #a855f7;
    --accent-general: #facc15;
    --dock-bg: rgba(3, 7, 18, 0.85);
    --overlay-bg: #070411;
    --input-bg: rgba(217,70,239,0.06);
}

.theme-emerald-forest {
    --app-bg: linear-gradient(160deg, #051410 0%, #061f17 100%);
    --card-bg: rgba(6, 78, 59, 0.28);
    --card-border: rgba(52, 211, 153, 0.14);
    --text-primary: #f0fdf4;
    --text-secondary: #a7f3d0;
    --accent-primary: #34d399;
    --accent-secondary: #059669;
    --accent-tertiary: #fbbf24;
    --accent-general: #6ee7b7;
    --dock-bg: rgba(5, 14, 10, 0.8);
    --overlay-bg: #040f0c;
    --input-bg: rgba(52,211,153,0.06);
}
.theme-morning-light {
    --app-bg: linear-gradient(160deg, #f8fafc 0%, #eef6ff 48%, #f7f3ff 100%);
    --card-bg: rgba(255, 255, 255, 0.72);
    --card-border: rgba(15, 23, 42, 0.1);
    --text-primary: #0f172a;
    --text-secondary: #64748b;
    --accent-primary: #0284c7;
    --accent-secondary: #7c3aed;
    --accent-tertiary: #e11d48;
    --accent-general: #059669;
    --dock-bg: rgba(255, 255, 255, 0.82);
    --overlay-bg: #f8fafc;
    --input-bg: rgba(15, 23, 42, 0.04);
}

/* ─────────────────────────────────────────────
   GLOBAL RESET & BASE
───────────────────────────────────────────── */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    width: 100%;
    height: 100%;
    font-family: var(--font);
    -webkit-font-smoothing: antialiased;
    overflow: hidden; /* App-style: no page scroll, content scrolls inside */
}

/* ─────────────────────────────────────────────
   APP SHELL — fills full device screen
───────────────────────────────────────────── */

#app-shell {
    position: fixed;
    inset: 0;
    background: var(--app-bg);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: background 0.35s ease;
    /* Respect iOS safe areas (notch / home indicator) */
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
    padding-right: env(safe-area-inset-right, 0px);
}

/* ─────────────────────────────────────────────
   TOP STATUS BAR (minimal, no fake icons)
───────────────────────────────────────────── */

.app-status-bar {
    height: 52px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.status-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.app-logo-icon {
    width: 32px;
    height: 32px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.app-logo-icon i {
    width: 16px;
    height: 16px;
    color: #fff;
}

.app-brand-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.status-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.notif-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    position: relative;
}

.notif-btn i { width: 16px; height: 16px; }

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 7px;
    height: 7px;
    background: var(--accent-tertiary);
    border-radius: 50%;
    border: 1.5px solid var(--overlay-bg);
}

/* ─────────────────────────────────────────────
   SCROLLABLE MAIN CONTENT
───────────────────────────────────────────── */

#main-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    padding: 4px 16px 100px 16px;
}

/* Hide scrollbar */
#main-content::-webkit-scrollbar { display: none; }
#main-content { scrollbar-width: none; }

/* ─────────────────────────────────────────────
   STUDENT HEADER
───────────────────────────────────────────── */

.header-section {
    margin-bottom: 20px;
}

.user-profile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.user-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 2px;
}

.user-info h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    line-height: 1.2;
}

.stream-badge {
    white-space: nowrap;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid var(--card-border);
    color: var(--accent-primary);
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    cursor: pointer;
    transition: opacity 0.2s;
    max-width: 140px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─────────────────────────────────────────────
   DAILY TIP / FORMULA WIDGET
───────────────────────────────────────────── */

.quote-widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    overflow: hidden;
}

.quote-widget::before {
    content: '';
    position: absolute;
    top: 0; left: 0;
    width: 4px; height: 100%;
    background: linear-gradient(to bottom, var(--accent-primary), var(--accent-secondary));
}

.quote-icon {
    color: var(--accent-secondary);
    flex-shrink: 0;
}

.quote-icon i { width: 22px; height: 22px; }

.quote-text p {
    font-size: 0.72rem;
    color: var(--text-secondary);
    line-height: 1.3;
}

.quote-text span {
    display: block;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-top: 3px;
}

/* ─────────────────────────────────────────────
   SECTION TITLES
───────────────────────────────────────────── */

.section-title {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 12px;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

/* ─────────────────────────────────────────────
   WIDGET ROW (mini trackers)
───────────────────────────────────────────── */

.widgets-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 22px;
}

.mini-widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 18px;
    padding: 14px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 92px;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
    cursor: pointer;
}

.mini-widget:active {
    transform: scale(0.96);
}

.widget-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.widget-header span {
    font-size: 0.65rem;
    color: var(--text-secondary);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.widget-icon-box {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.widget-icon-box i { width: 13px; height: 13px; }

.physics-bg { background: rgba(56, 189, 248, 0.2); color: #38bdf8; }
.general-bg { background: rgba(52, 211, 153, 0.2); color: #34d399; }

.widget-value {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
    line-height: 1;
}

.widget-footer {
    font-size: 0.62rem;
    color: var(--text-secondary);
    margin-top: 4px;
    line-height: 1.3;
}

/* ─────────────────────────────────────────────
   APPS GRID
───────────────────────────────────────────── */

.apps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 6px;
    margin-bottom: 24px;
}

@media (max-width: 340px) {
    .apps-grid { grid-template-columns: repeat(3, 1fr); }
}

.app-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    cursor: pointer;
    position: relative;
    padding: 4px 2px;
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    -webkit-user-select: none;
    user-select: none;
}

.app-card:active {
    transform: scale(0.88);
}

.app-icon-wrapper {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 6px;
    overflow: hidden;
}

.app-icon-wrapper::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(to bottom, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
}

.app-card i { width: 26px; height: 26px; }

.study-app i  { color: var(--accent-primary); }
.dream-app i  { color: var(--accent-tertiary); }
.money-app i  { color: var(--accent-general); }
.sports-app i { color: #f59e0b; }
.career-app i { color: #06b6d4; }
.school-app i { color: var(--accent-secondary); }
.ai-app i     { color: #ec4899; }
.health-app i { color: #14b8a6; }

.app-label {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
    max-width: 70px;
}

/* Notification badge */
.app-badge {
    position: absolute;
    top: 0px;
    right: 4px;
    background: #ef4444;
    color: white;
    font-size: 0.58rem;
    font-weight: 800;
    min-width: 17px;
    height: 17px;
    border-radius: 9px;
    padding: 0 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--overlay-bg, #090d16);
    z-index: 2;
    animation: pulse 2.2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.12); }
}

/* ─────────────────────────────────────────────
   BOTTOM NAVIGATION DOCK
───────────────────────────────────────────── */

.dock-container {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    /* Respect iOS home bar */
    padding-bottom: max(env(safe-area-inset-bottom, 0px), 8px);
    padding-top: 10px;
    padding-left: 16px;
    padding-right: 16px;
    background: var(--dock-bg);
    border-top: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: space-around;
}

.dock-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 8px 18px;
    border-radius: 14px;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
    position: relative;
}

.dock-item i { width: 22px; height: 22px; }

.dock-item.active {
    color: var(--accent-primary);
    background: rgba(255, 255, 255, 0.06);
}

.dock-item .dock-label {
    font-size: 0.6rem;
    font-weight: 600;
    opacity: 0.7;
}

.dock-item.active .dock-label {
    opacity: 1;
    color: var(--accent-primary);
}

/* ─────────────────────────────────────────────
   FULL-SCREEN OVERLAY SCREENS
───────────────────────────────────────────── */

.screen-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay-bg, #090d16);
    z-index: 95;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.38s cubic-bezier(0.16, 1, 0.3, 1);
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}

.screen-overlay.open {
    transform: translateX(0);
}

.overlay-header {
    height: 60px;
    padding: 0 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--card-border);
    flex-shrink: 0;
}

.back-btn {
    background: none;
    border: none;
    color: var(--accent-primary);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
    font-family: var(--font);
    padding: 4px 0;
}

.back-btn i { width: 18px; height: 18px; }

.overlay-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
}

.overlay-body {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 16px 40px;
}

.overlay-body::-webkit-scrollbar { display: none; }

/* ─────────────────────────────────────────────
   SETTINGS INPUTS
───────────────────────────────────────────── */

.settings-group {
    margin-bottom: 18px;
}

.settings-label {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.settings-input, .settings-select {
    width: 100%;
    background: var(--input-bg, rgba(255,255,255,0.06));
    border: 1px solid var(--card-border);
    border-radius: 12px;
    color: var(--text-primary);
    padding: 13px 14px;
    font-size: 0.9rem;
    font-family: var(--font);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.settings-input:focus, .settings-select:focus {
    border-color: var(--accent-primary);
}

.settings-select option {
    background: #111827;
    color: #fff;
}

/* ─────────────────────────────────────────────
   PROFILE CARDS
───────────────────────────────────────────── */

.profile-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 14px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.profile-card:active { transform: scale(0.97); }

.profile-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-primary);
}

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

/* ─────────────────────────────────────────────
   THEME PICKER
───────────────────────────────────────────── */

.theme-picker {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(64px, 1fr));
    gap: 10px;
    margin-top: 8px;
}

.theme-btn {
    height: 48px;
    border-radius: 12px;
    border: 2px solid transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
    font-family: var(--font);
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.theme-btn.active {
    border-color: #fff;
    box-shadow: 0 0 12px rgba(255,255,255,0.2);
}

/* ─────────────────────────────────────────────
   BUTTONS
───────────────────────────────────────────── */

.primary-btn {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: #fff;
    padding: 14px 20px;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    transition: opacity 0.2s, transform 0.15s;
    display: inline-block;
    text-align: center;
    -webkit-tap-highlight-color: transparent;
}

.primary-btn:active { opacity: 0.85; transform: scale(0.97); }

/* ─────────────────────────────────────────────
   SETTINGS ACCOUNT CARD & LOGOUT
───────────────────────────────────────────── */

.account-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
}

.account-avatar {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-avatar i { width: 20px; height: 20px; color: #fff; }

.logout-btn {
    width: 100%;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
    padding: 14px;
    border-radius: 13px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.logout-btn:active { background: rgba(239, 68, 68, 0.2); }
.logout-btn i { width: 17px; height: 17px; }

/* ─────────────────────────────────────────────
   WELCOME / LOGIN SCREEN (fixed full-screen)
───────────────────────────────────────────── */

#welcome-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: linear-gradient(155deg, #0f172a 0%, #1e1b4b 55%, #2e1040 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 20px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-top: max(env(safe-area-inset-top, 24px), 24px);
    padding-bottom: max(env(safe-area-inset-bottom, 24px), 24px);
}

.welcome-inner {
    width: 100%;
    max-width: 420px;
}

.welcome-logo {
    text-align: center;
    margin-bottom: 28px;
}

.welcome-logo-icon {
    width: 76px;
    height: 76px;
    border-radius: 22px;
    background: linear-gradient(135deg, #38bdf8, #a78bfa);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    box-shadow: 0 14px 36px rgba(56, 189, 248, 0.3);
}

.welcome-logo-icon i { width: 36px; height: 36px; color: #fff; }

.welcome-logo h1 {
    font-size: 1.8rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.5px;
    font-family: var(--font);
}

.welcome-logo p {
    color: #94a3b8;
    font-size: 0.85rem;
    margin-top: 6px;
    font-family: var(--font);
    line-height: 1.4;
}

.welcome-card {
    background: rgba(30, 41, 59, 0.5);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 22px;
    padding: 20px;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    margin-bottom: 14px;
}

.welcome-divider {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 14px 0;
}

.welcome-divider div {
    flex: 1;
    height: 1px;
    background: rgba(255,255,255,0.08);
}

.welcome-divider span {
    font-size: 0.75rem;
    color: #64748b;
    font-family: var(--font);
}

.welcome-join-btn {
    width: 100%;
    background: linear-gradient(135deg, #38bdf8, #a78bfa);
    color: #fff;
    padding: 16px;
    border-radius: 16px;
    font-weight: 700;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    font-family: var(--font);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.2s;
}

.welcome-join-btn:active { opacity: 0.85; }
.welcome-join-btn i { width: 18px; height: 18px; }

/* ─────────────────────────────────────────────
   REGISTER MODAL (bottom sheet)
───────────────────────────────────────────── */

#register-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: none;
    align-items: flex-end;
    justify-content: center;
}

.modal-sheet {
    width: 100%;
    max-width: 480px;
    background: #111827;
    border-radius: 26px 26px 0 0;
    padding: 24px 20px max(env(safe-area-inset-bottom, 24px), 24px);
    max-height: 90vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.modal-handle {
    width: 36px;
    height: 4px;
    background: rgba(255,255,255,0.18);
    border-radius: 2px;
    margin: 0 auto 20px;
}

.modal-sheet h3 {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 6px;
    font-family: var(--font);
}

.modal-sheet p {
    color: #94a3b8;
    font-size: 0.8rem;
    margin-bottom: 20px;
    font-family: var(--font);
    line-height: 1.45;
}

.modal-cancel-btn {
    width: 100%;
    margin-top: 12px;
    background: none;
    border: none;
    color: #94a3b8;
    font-size: 0.9rem;
    cursor: pointer;
    font-family: var(--font);
    padding: 10px;
}

/* ─────────────────────────────────────────────
   APP BODY CARD STYLES (used inside sub-apps)
───────────────────────────────────────────── */

.sub-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 14px;
}

.progress-bar-bg {
    background: rgba(255,255,255,0.07);
    height: 6px;
    border-radius: 3px;
    overflow: hidden;
    margin-top: 6px;
}

.progress-bar-fill {
    height: 100%;
    border-radius: 3px;
}

/* Mobile fit and polish */
@media (max-width: 430px) {
    .app-status-bar {
        height: 48px;
        padding: 0 16px;
    }

    #main-content {
        padding: 6px 14px 92px;
    }

    .header-section {
        margin-bottom: 16px;
    }

    .user-profile-row {
        align-items: flex-start;
    }

    .user-info {
        min-width: 0;
    }

    .user-info h2 {
        font-size: 1.22rem;
        overflow-wrap: anywhere;
    }

    .stream-badge {
        max-width: 122px;
        padding: 5px 8px;
    }

    .quote-widget {
        border-radius: 16px;
        padding: 13px 14px;
        margin-bottom: 16px;
    }

    .quote-text {
        min-width: 0;
    }

    .quote-text span,
    .widget-value,
    .widget-footer,
    .widget-header span,
    .app-label,
    .dock-label {
        overflow-wrap: anywhere;
    }

    .widgets-row {
        gap: 9px;
        margin-bottom: 18px;
    }

    .mini-widget {
        border-radius: 16px;
        min-height: 88px;
        padding: 12px;
    }

    .widget-header {
        gap: 8px;
    }

    .widget-header span {
        min-width: 0;
        line-height: 1.15;
    }

    .widget-value {
        font-size: 0.98rem;
        line-height: 1.12;
    }

    .apps-grid {
        gap: 12px 6px;
        margin-bottom: 18px;
    }

    .app-card {
        min-width: 0;
        padding: 2px 0;
    }

    .app-icon-wrapper {
        width: clamp(50px, 15vw, 58px);
        height: clamp(50px, 15vw, 58px);
        border-radius: 15px;
    }

    .app-card i {
        width: 24px;
        height: 24px;
    }

    .app-label {
        max-width: 76px;
        min-height: 1.65em;
        font-size: 0.66rem;
    }

    .dock-container {
        padding: 8px 12px max(env(safe-area-inset-bottom, 0px), 8px);
    }

    .dock-item {
        min-width: 72px;
        padding: 7px 10px;
        border-radius: 12px;
    }

    .overlay-header {
        height: 56px;
        padding: 0 14px;
    }

    .overlay-title {
        max-width: 48vw;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
        text-align: center;
    }

    .overlay-body {
        padding: 16px 14px 32px;
    }

    #welcome-overlay {
        align-items: flex-start;
        padding: 46px 20px 22px;
    }

    .welcome-inner {
        max-width: 390px;
        margin: 0 auto;
    }

    .welcome-logo {
        margin-bottom: 22px;
    }

    .welcome-logo-icon {
        width: 66px;
        height: 66px;
        border-radius: 20px;
        margin-bottom: 14px;
    }

    .welcome-logo h1 {
        font-size: 1.62rem;
    }

    .welcome-card {
        border-radius: 18px;
        padding: 16px;
        margin-bottom: 12px;
    }

    #welcome-profiles-list {
        max-height: 292px;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
    }

    .welcome-divider {
        margin: 12px 0;
    }

    .welcome-join-btn {
        min-height: 52px;
        border-radius: 15px;
        padding: 14px 16px;
        line-height: 1.2;
    }

    .modal-sheet {
        border-radius: 22px 22px 0 0;
        padding: 20px 18px max(env(safe-area-inset-bottom, 20px), 20px);
    }
}

@media (max-width: 360px) {
    #main-content {
        padding-left: 12px;
        padding-right: 12px;
    }

    .widgets-row {
        grid-template-columns: 1fr;
    }

    .apps-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .stream-badge {
        max-width: 104px;
    }

    .dock-item {
        min-width: 64px;
        padding-left: 8px;
        padding-right: 8px;
    }
}

/* Lucide renders inline SVGs, so keep generated icons aligned with the original icon rules. */
.app-logo-icon svg,
.welcome-logo-icon svg {
    color: #fff;
}

.app-logo-icon svg,
.notif-btn svg {
    width: 16px;
    height: 16px;
}

.quote-icon svg {
    width: 22px;
    height: 22px;
}

.widget-icon-box svg {
    width: 13px;
    height: 13px;
}

.app-card svg {
    width: 26px;
    height: 26px;
}

.study-app svg  { color: var(--accent-primary); }
.dream-app svg  { color: var(--accent-tertiary); }
.money-app svg  { color: var(--accent-general); }
.sports-app svg { color: #f59e0b; }
.career-app svg { color: #06b6d4; }
.school-app svg { color: var(--accent-secondary); }
.ai-app svg     { color: #ec4899; }
.health-app svg { color: #14b8a6; }

.dock-item svg {
    width: 22px;
    height: 22px;
}

.back-btn svg {
    width: 18px;
    height: 18px;
}

.account-avatar svg {
    width: 20px;
    height: 20px;
    color: #fff;
}

.logout-btn svg,
.welcome-join-btn svg {
    width: 18px;
    height: 18px;
}

@media (max-width: 430px) {
    .app-card svg {
        width: 24px;
        height: 24px;
    }
}

.theme-morning-light .notif-btn,
.theme-morning-light .quote-widget,
.theme-morning-light .mini-widget,
.theme-morning-light .app-icon-wrapper,
.theme-morning-light .account-card,
.theme-morning-light .profile-card,
.theme-morning-light .sub-card {
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.theme-morning-light .dock-item.active {
    background: rgba(2, 132, 199, 0.1);
}

.theme-morning-light .app-badge,
.theme-morning-light .notif-dot {
    border-color: #f8fafc;
}

.theme-morning-light .theme-btn.active {
    border-color: #0f172a;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.16);
}

.theme-morning-light .settings-select option {
    background: #ffffff;
    color: #0f172a;
}

.theme-btn[data-theme="morning-light"] {
    border-color: #cbd5e1;
}

.theme-btn.active {
    border-color: #fff !important;
}

.theme-morning-light .theme-btn.active {
    border-color: #0f172a !important;
}

.empty-profile-state {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 14px;
    border: 1px dashed rgba(148, 163, 184, 0.35);
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    color: #cbd5e1;
    font-family: var(--font);
}

.empty-profile-state strong {
    color: #fff;
    font-size: 0.9rem;
}

.empty-profile-state span {
    color: #94a3b8;
    font-size: 0.76rem;
    line-height: 1.35;
}
