/* OLPW:css/index.css | styles for index */
:root {
            color-scheme: dark;
            --accent: #FF4500;
            --accent-hover: color-mix(in srgb, var(--accent) 82%, #000);
            --accent-soft: color-mix(in srgb, var(--accent) 16%, transparent);
            --bg: #0B0F19; --surface: #151B2B; --surface-light: #1E2538; --field: #0B0F19;
            --text-main: #E2E8F0; --text-muted: #94A3B8; --text-strong: #FFFFFF;
            --border: #2D3650; --radius: 12px; --nav-bg: rgba(11, 15, 25, 0.8);
            --shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
        }
        [data-theme="light"] {
            color-scheme: light;
            --bg: #F4F6FB; --surface: #FFFFFF; --surface-light: #EEF1F7; --field: #F6F8FC;
            --text-main: #1E293B; --text-muted: #64748B; --text-strong: #0F172A;
            --border: #DCE2EC; --nav-bg: rgba(244, 246, 251, 0.88);
            --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
        }
        * { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Inter', sans-serif; }
        body { background-color: var(--bg); color: var(--text-main); -webkit-font-smoothing: antialiased; overflow-x: hidden; }
        .hidden { display: none !important; }
        h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; }

        /* Auth Screen */
        #authScreen { min-height: 100vh; display: flex; justify-content: center; align-items: center; background: radial-gradient(circle at top right, var(--surface-light) 0%, var(--bg) 100%); padding: 20px; }
        .auth-card { background: var(--surface); border: 1px solid var(--border); padding: 40px; width: 100%; max-width: 420px; border-radius: var(--radius); box-shadow: var(--shadow); }
        .auth-header { border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 30px; }
        .auth-logo { font-size: 28px; font-weight: 700; color: var(--text-strong); font-family: 'Space Grotesk', sans-serif; }
        .auth-logo span { color: var(--accent); }
        .auth-sub { font-size: 14px; color: var(--text-muted); margin-top: 5px; }
        .form-group { margin-bottom: 24px; }
        .form-group label { display: block; font-size: 14px; color: var(--text-main); margin-bottom: 8px; font-weight: 500; }
        .form-input { width: 100%; background: var(--field); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; color: var(--text-main); font-size: 15px; transition: all 0.2s; }
        .form-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
        .auth-btn { width: 100%; padding: 14px; background: var(--accent); color: #fff; border: none; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 16px; transition: all 0.2s; margin-top: 10px; }
        .auth-btn:hover { background: var(--accent-hover); transform: translateY(-1px); }
        .auth-btn:disabled { background: #4a4a4a; cursor: not-allowed; transform: none; }
        .toggle-auth { text-align: center; margin-top: 24px; font-size: 14px; color: var(--text-muted); }
        .toggle-auth span { color: var(--accent); cursor: pointer; font-weight: 600; }
        .alert { color: #F87171; font-size: 14px; margin-bottom: 20px; padding: 12px; background: rgba(239, 68, 68, 0.1); border-radius: 8px; text-align: center; }
        .google-btn { width: 100%; display: flex; align-items: center; justify-content: center; gap: 12px; padding: 13px 14px; background: #fff; color: #1f1f1f; border: 1px solid #dadce0; border-radius: 8px; cursor: pointer; font-weight: 600; font-size: 15px; font-family: inherit; transition: all 0.2s; }
        .google-btn svg { width: 20px; height: 20px; flex: none; }
        .google-btn:hover { background: #f7f8fa; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12); transform: translateY(-1px); }
        .google-btn:disabled { opacity: 0.6; cursor: not-allowed; transform: none; box-shadow: none; }
        .auth-or { display: flex; align-items: center; gap: 12px; margin: 22px 0; font-size: 13px; color: var(--text-muted); }
        .auth-or::before, .auth-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
        .forgot-link { text-align: right; margin-top: -16px; margin-bottom: 24px; }
        .forgot-link span { font-size: 14px; color: var(--text-muted); cursor: pointer; transition: color 0.2s; }
        .forgot-link span:hover { color: var(--accent); }

        /* Dashboard */
        .nav-wrapper { position: sticky; top: 0; z-index: 100; background: var(--nav-bg); backdrop-filter: blur(10px); border-bottom: 1px solid var(--border); }
        .nav-header { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; }
        .brand { font-size: 24px; font-weight: 700; color: var(--text-strong); font-family: 'Space Grotesk', sans-serif; }
        .brand span { color: var(--accent); }
        .nav-right { display: flex; align-items: center; gap: 12px; }
        .user-info { display: flex; align-items: center; gap: 12px; }
        .welcome { font-size: 14px; color: var(--text-muted); }
        .welcome b { color: var(--text-strong); font-weight: 600; }
        .avatar { width: 36px; height: 36px; background: var(--surface-light); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; color: var(--accent); border: 1px solid var(--border); flex-shrink: 0; }
        .logout-btn, .icon-btn { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 10px 20px; border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.2s; }
        .icon-btn { padding: 0; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center; }
        .icon-btn svg { width: 18px; height: 18px; }
        .logout-btn:hover, .icon-btn:hover { border-color: var(--accent); color: var(--accent); }
        .container { max-width: 1200px; margin: 0 auto; padding: 40px 24px; }
        .hero { background: linear-gradient(135deg, var(--accent-soft), var(--surface) 55%); border: 1px solid var(--border); border-radius: var(--radius); padding: 40px 48px; margin-bottom: 40px; display: flex; justify-content: space-between; align-items: center; gap: 24px; flex-wrap: wrap; }
        .hero-title { font-size: 32px; font-weight: 700; color: var(--text-strong); margin-bottom: 8px; }
        .hero-sub { font-size: 16px; color: var(--text-muted); max-width: 500px; }
        .hero-badges { display: flex; gap: 10px; flex-wrap: wrap; }
        .badge-pill { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); }
        .badge-pill svg { width: 16px; height: 16px; }
        .badge-pill.streak { color: #F59E0B; background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.35); }
        .badge-pill.streak.cold { color: var(--text-muted); background: var(--surface); border-color: var(--border); }
        .badge-pill.focus { color: var(--accent); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); font-variant-numeric: tabular-nums; }
        .section-header { margin-bottom: 24px; }
        .section-title { font-size: 24px; font-weight: 700; color: var(--text-strong); }
        .section-sub { font-size: 14px; color: var(--text-muted); margin-top: 4px; }
        .grid-menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; }
        .card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text-main); transition: all 0.2s; display: flex; flex-direction: column; gap: 12px; }
        .card:hover { background: var(--surface-light); border-color: var(--accent); transform: translateY(-3px); }
        .card-title { font-size: 18px; font-weight: 600; color: var(--text-strong); }
        .card-desc { font-size: 14px; color: var(--text-muted); line-height: 1.5; }
        .card-progress { --c: var(--accent); margin-top: auto; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-muted); font-weight: 600; }
        .card-progress .bar { flex: 1; }
        .more-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
        .more-search { padding: 10px 14px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: var(--text-main); font: inherit; font-size: 14px; min-width: 220px; outline: none; }
        .more-search:focus { border-color: var(--accent); }
        .card-title .dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; vertical-align: middle; background: var(--c); }
        .more-empty { color: var(--text-muted); font-size: 14px; padding: 12px 0; }
        .card.featured { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: linear-gradient(135deg, var(--accent-soft), var(--surface) 60%); }

        /* Today widget */
        .today-section { margin-bottom: 40px; }
        .today-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
        .today-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
        .sync-pill { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-muted); padding: 7px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); }
        .sync-pill::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: #F59E0B; }
        .sync-pill.ok::before { background: #3b82f6; box-shadow: 0 0 8px #3b82f6; }
        .sync-pill.busy::before { background: #38BDF8; }
        .btn-small { background: transparent; border: 1px solid var(--border); color: var(--text-main); padding: 8px 14px; border-radius: 8px; cursor: pointer; font-size: 13px; font-weight: 500; text-decoration: none; transition: all 0.2s; white-space: nowrap; }
        .btn-small:hover { border-color: var(--accent); color: var(--accent); }
        .btn-small.on { border-color: rgba(34, 197, 94, 0.5); color: #3b82f6; }
        .btn-small.accent { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
        .btn-small.accent:hover { background: var(--accent-hover); color: #fff; }
        .today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
        .today-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; min-height: 160px; }
        .today-card-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-muted); margin-bottom: 14px; display: flex; justify-content: space-between; align-items: center; }
        .today-card-title b { color: var(--accent); }
        .today-card-title a { color: var(--accent); text-decoration: none; text-transform: none; letter-spacing: 0; }
        .today-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
        .today-item { --c: #94A3B8; display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text-strong); padding: 8px 10px; border-radius: 8px; background: var(--field); border-left: 3px solid var(--c); }
        .today-item input { width: 16px; height: 16px; margin-top: 2px; accent-color: var(--c); cursor: pointer; flex-shrink: 0; }
        .today-item .ti-main { flex: 1; min-width: 0; word-wrap: break-word; white-space: pre-line; }
        .today-item small { display: block; color: var(--text-muted); font-size: 12px; margin-top: 2px; }
        .today-item small.red { color: #EF4444; font-weight: 600; }
        .today-item .count { font-family: 'Space Grotesk', sans-serif; font-weight: 700; font-size: 20px; color: var(--c); min-width: 44px; text-align: center; line-height: 1.1; }
        .today-item .count span { display: block; font-size: 10px; color: var(--text-muted); text-transform: uppercase; font-family: 'Inter', sans-serif; }
        .today-empty { font-size: 13px; color: var(--text-muted); }
        .today-empty a { color: var(--accent); text-decoration: none; font-weight: 600; }
        .progress-rows { display: flex; flex-direction: column; gap: 11px; }
        .progress-row { --c: #94A3B8; }
        .progress-row .top { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 5px; }
        .progress-row .top b { color: var(--text-muted); font-weight: 500; }
        .bar { height: 7px; background: var(--field); border: 1px solid var(--border); border-radius: 999px; overflow: hidden; }
        .bar i { display: block; height: 100%; background: var(--c); border-radius: 999px; }
        .streak-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 14px; }
        .streak-grid div { background: var(--field); border: 1px solid var(--border); border-radius: 10px; padding: 10px 6px; text-align: center; }
        .streak-grid b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 20px; color: var(--text-strong); }
        .streak-grid span { font-size: 10px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
        .streak-card .btn-small { display: block; text-align: center; }

        /* Landing page (logged-out visitors) */
        .brand-logo { width: 34px; height: 34px; border-radius: 50%; display: block; }
        .brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
        .brand-text { font-weight: 700; }
        .auth-logo { display: flex; align-items: center; gap: 10px; }
        .auth-logo img { width: 40px; height: 40px; border-radius: 50%; }
        .auth-back { display: inline-block; margin-bottom: 18px; font-size: 14px; color: var(--text-muted); cursor: pointer; background: none; border: none; font-family: inherit; padding: 0; }
        .auth-back:hover { color: var(--accent); }
        .auth-note { font-size: 14px; color: var(--text-main); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-radius: 8px; padding: 10px 12px; margin-bottom: 20px; }
        .alert.ok { color: #15803d; background: rgba(34, 197, 94, 0.12); }
        .land-nav .nav-header { padding: 14px 24px; }
        .land-links { display: flex; align-items: center; gap: 22px; }
        .land-links a { color: var(--text-main); text-decoration: none; font-size: 14px; font-weight: 500; }
        .land-links a:hover { color: var(--accent); }
        .btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 22px; border-radius: 999px; font-weight: 600; font-size: 15px; cursor: pointer; border: 1px solid transparent; text-decoration: none; transition: transform 0.15s, background 0.15s, border-color 0.15s, color 0.15s; font-family: inherit; }
        .btn-primary { background: var(--accent); color: #fff; box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 30%, transparent); }
        .btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
        .btn-ghost { background: var(--surface); color: var(--text-strong); border-color: var(--border); }
        .btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
        .btn-sm { padding: 9px 16px; font-size: 14px; }
        .land-hero { max-width: 1200px; margin: 0 auto; padding: 56px 24px 40px; display: grid; grid-template-columns: 1fr 1.15fr; gap: 40px; align-items: center; }
        .land-eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); padding: 7px 14px; border-radius: 999px; margin-bottom: 20px; }
        .land-hero h1 { font-size: clamp(34px, 5vw, 56px); line-height: 1.05; color: var(--text-strong); letter-spacing: -1px; margin-bottom: 18px; }
        .land-hero h1 span { color: var(--accent); }
        .land-hero p { font-size: 18px; line-height: 1.6; color: var(--text-muted); max-width: 520px; margin-bottom: 28px; }
        .land-cta { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 32px; }
        .land-stats { display: flex; gap: 32px; flex-wrap: wrap; }
        .land-stats b { display: block; font-family: 'Space Grotesk', sans-serif; font-size: 28px; color: var(--text-strong); }
        .land-stats span { font-size: 13px; color: var(--text-muted); }
        .land-hero-img { width: 100%; height: auto; border-radius: 24px; display: block; box-shadow: var(--shadow); }
        .land-section { max-width: 1200px; margin: 0 auto; padding: 48px 24px; }
        .land-section h2 { font-size: clamp(26px, 3.4vw, 36px); color: var(--text-strong); margin-bottom: 10px; text-align: center; }
        .land-section .lead { text-align: center; color: var(--text-muted); font-size: 16px; max-width: 640px; margin: 0 auto 36px; line-height: 1.6; }
        .feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
        .feature { background: var(--surface); border: 1px solid var(--border); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; }
        .feature img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; background: var(--surface-light); }
        .feature-body { padding: 20px 22px 24px; }
        .feature h3 { font-size: 20px; color: var(--text-strong); margin-bottom: 8px; }
        .feature p { font-size: 15px; line-height: 1.6; color: var(--text-muted); }
        .feature ul { margin-top: 12px; padding-left: 18px; color: var(--text-main); font-size: 14px; line-height: 1.8; }
        .subject-cloud { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
        .subject-chip { display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); font-size: 14px; font-weight: 500; color: var(--text-main); }
        .subject-chip i { width: 9px; height: 9px; border-radius: 50%; background: var(--c, var(--accent)); }
        .steps { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; counter-reset: step; }
        .step { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 24px; position: relative; }
        .step::before { counter-increment: step; content: counter(step); display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-family: 'Space Grotesk', sans-serif; margin-bottom: 14px; }
        .step h3 { font-size: 18px; color: var(--text-strong); margin-bottom: 6px; }
        .step p { font-size: 14px; color: var(--text-muted); line-height: 1.6; }
        .cta-band { max-width: 1152px; margin: 24px auto 56px; padding: 44px 32px; border-radius: 28px; text-align: center; background: linear-gradient(135deg, #F97316, #EA580C 55%, #C2410C); color: #fff; box-shadow: 0 20px 50px rgba(234, 88, 12, 0.28); }
        .cta-band h2 { font-size: clamp(24px, 3.2vw, 34px); margin-bottom: 10px; }
        .cta-band p { opacity: 0.92; margin-bottom: 22px; }
        .cta-band .btn { background: #fff; color: #C2410C; }
        .cta-band .btn:hover { background: #FFF1E4; }
        .land-footer { border-top: 1px solid var(--border); padding: 28px 24px 90px; text-align: center; color: var(--text-muted); font-size: 13px; }
        .land-footer img { width: 44px; height: 44px; border-radius: 50%; margin-bottom: 8px; }

        @media (max-width: 980px) {
            .today-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
            .land-hero { grid-template-columns: 1fr; padding-top: 32px; }
            .land-hero-img { order: -1; }
            .feature-grid, .steps { grid-template-columns: 1fr; }
            .feature { flex-direction: row; }
            .feature img { width: 40%; aspect-ratio: auto; min-height: 100%; }
            .land-links a { display: none; }
        }
        @media (max-width: 640px) {
            .feature { flex-direction: column; }
            .feature img { width: 100%; aspect-ratio: 4 / 3; }
            .land-hero p { font-size: 16px; }
            .land-nav .nav-header { padding: 12px 14px; }
            .land-links { gap: 8px; }
            .cta-band { margin: 16px 14px 40px; padding: 32px 20px; }
        }
        .land-section { scroll-margin-top: 70px; }
        @media (max-width: 640px) {
            .nav-header { padding: 12px 14px; }
            .welcome { display: none; }
            .logout-btn { padding: 9px 14px; }
            .container { padding: 20px 14px calc(40px + env(safe-area-inset-bottom)); }
            .hero { padding: 24px 20px; margin-bottom: 28px; }
            .hero-title { font-size: 26px; }
            .hero-sub { font-size: 14px; }
            .section-title { font-size: 20px; }
            .section-header { margin-bottom: 16px; }
            .today-section { margin-bottom: 28px; }
            .today-head { align-items: flex-start; }
            .today-actions { width: 100%; }
            .today-actions .btn-small.accent { margin-left: auto; }
            .today-grid { grid-template-columns: 1fr; gap: 12px; }
            .today-card { min-height: 0; padding: 16px; }
            .grid-menu { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
            .card { padding: 16px; gap: 8px; }
            .card-title { font-size: 15px; }
            .card-desc { font-size: 12px; }
            .auth-card { padding: 28px 22px; }
        }
