/* ========== VARIABLES & RESET ========== */
:root {
    /* Warm dark backgrounds — softer on the eyes than pure black */
    --bg-deepest: #111009;   /* dark walnut, not black */
    --bg-deep:    #181610;
    --bg-base:    #1e1c15;
    --bg-raised:  #252319;
    --bg-surface: #2d2a20;
    --bg-hover:   #353228;

    /* Glass — warm dark tint */
    --glass:        rgba(24, 22, 16, 0.65);
    --glass-strong: rgba(24, 22, 16, 0.85);
    --glass-subtle: rgba(24, 22, 16, 0.38);
    --glass-border: rgba(255, 248, 220, 0.07);  /* warm white, not cold */
    --glass-border-hover: rgba(255, 248, 220, 0.13);
    --blur: blur(24px);
    --blur-strong: blur(40px);

    /* Accent — muted warm amber, low saturation so it doesn't distract */
    --accent:      #a87840;  /* desaturated, softer than bright amber */
    --accent-glow: rgba(168, 120, 64, 0.16);
    --accent-soft: #6a4e28;
    --accent-2:    #956830;
    --accent-3:    #807060;
    --accent-4:    #507858;  /* muted green */
    --accent-5:    #a89040;  /* muted gold */

    --text:           #efefef;
    --text-secondary: #b0b0a8;
    --text-muted:     #787068;
    --border:         rgba(255, 255, 255, 0.07);
    --border-light:   rgba(255, 255, 255, 0.13);
    --red:  #c06060;
    --gold: #c09840;

    --radius: 18px;
    --radius-sm: 12px;
    --radius-xs: 8px;
    --shadow:      0 4px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg:   0 16px 56px rgba(0, 0, 0, 0.65);
    --shadow-glow: 0 0 48px rgba(200, 136, 58, 0.07);
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --bounce: 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);

    --font: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-accent: 'Caveat', cursive;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font);
    background: var(--bg-deepest);
    color: var(--text);
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 15px;
}

::selection {
    background: rgba(200, 136, 58, 0.3);
    color: var(--text);
}

::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--accent-soft); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--accent); }

/* ========== AUTH SCREEN ========== */
.auth-screen {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-deepest);
    z-index: 9999;
    overflow: hidden;
}

.auth-bg-orbs { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.35;
    animation: orbFloat 14s ease-in-out infinite;
}
.orb-1 { width: 550px; height: 550px; background: var(--accent); top: -15%; right: -8%; opacity: 0.18; }
.orb-2 { width: 450px; height: 450px; background: var(--accent-5); bottom: -12%; left: -8%; animation-delay: -5s; opacity: 0.12; }
.orb-3 { width: 350px; height: 350px; background: #ffffff; top: 50%; left: 50%; transform: translate(-50%, -50%); animation-delay: -9s; opacity: 0.04; }

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(40px, -50px) scale(1.08); }
    66% { transform: translate(-30px, 30px) scale(0.94); }
}

.auth-container {
    position: relative; z-index: 2; width: 100%; max-width: 420px; padding: 24px;
    animation: authIn 0.9s ease both;
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(40px) scale(0.96); filter: blur(8px); }
    to { opacity: 1; transform: translateY(0) scale(1); filter: blur(0); }
}

.auth-brand { text-align: center; margin-bottom: 44px; }

.auth-brand-icon {
    font-size: 52px; display: block; margin-bottom: 8px;
    animation: iconFloat 4s ease-in-out infinite;
    filter: drop-shadow(0 0 24px var(--accent-glow));
}
@keyframes iconFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-8px) rotate(6deg); }
}

.auth-brand-name { font-size: 44px; font-weight: 900; letter-spacing: -1.5px; color: var(--text); }
.auth-brand-tagline { color: var(--text-muted); font-size: 14px; letter-spacing: 4px; text-transform: uppercase; margin-top: 6px; }

.auth-card {
    background: var(--glass-strong);
    backdrop-filter: var(--blur-strong);
    -webkit-backdrop-filter: var(--blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    box-shadow: var(--shadow-lg), var(--shadow-glow), inset 0 1px 0 rgba(255,255,255,0.04);
    animation: cardUp 0.6s ease 0.3s both;
}
@keyframes cardUp {
    from { opacity: 0; transform: translateY(24px); }
    to { opacity: 1; transform: translateY(0); }
}

.auth-card h2 { font-size: 24px; font-weight: 800; margin-bottom: 4px; }
.auth-subtitle { color: var(--text-secondary); font-size: 15px; margin-bottom: 28px; }
.auth-field { margin-bottom: 20px; }
.auth-field label { display: block; font-size: 13px; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }

.auth-input-wrap { position: relative; display: flex; align-items: center; }
.auth-input-icon { position: absolute; left: 14px; font-size: 15px; opacity: 0.75; pointer-events: none; color: var(--text-secondary); }

.auth-input-wrap input {
    width: 100%; padding: 13px 14px 13px 40px;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    color: var(--text); font-family: var(--font); font-size: 15px;
    transition: all var(--transition);
    backdrop-filter: var(--blur);
}
.auth-input-wrap input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.08);
    background: rgba(0, 0, 0, 0.7);
}

.auth-toggle-pw { position: absolute; right: 10px; background: none; border: none; cursor: pointer; font-size: 16px; opacity: 0.4; padding: 4px; transition: opacity var(--transition); }
.auth-toggle-pw:hover { opacity: 0.8; }

.password-strength { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.strength-bar { flex: 1; height: 3px; background: var(--bg-surface); border-radius: 2px; overflow: hidden; }
.strength-fill { height: 100%; border-radius: 2px; transition: all 0.4s ease; width: 0%; }
.strength-text { font-size: 12px; font-weight: 600; min-width: 50px; text-align: right; }

.auth-error { font-size: 14px; color: var(--red); min-height: 20px; margin-bottom: 8px; display: flex; align-items: center; gap: 6px; animation: shake 0.4s ease; }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 75% { transform: translateX(6px); } }

.auth-btn {
    width: 100%; padding: 14px;
    background: var(--accent);
    border: none; border-radius: var(--radius-sm);
    color: var(--bg-deepest); font-family: var(--font); font-size: 15px; font-weight: 700;
    cursor: pointer; transition: all var(--transition);
    position: relative; overflow: hidden;
}
.auth-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 32px var(--accent-glow); filter: brightness(1.1); }
.auth-btn:active { transform: translateY(0); }
.auth-btn.loading .auth-btn-text { opacity: 0; }
.auth-btn.loading .auth-btn-loader { opacity: 1; }

.auth-btn-loader { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; opacity: 0; }
.auth-btn-loader::after { content: ''; width: 20px; height: 20px; border: 3px solid rgba(0, 0, 0, 0.2); border-top-color: var(--bg-deepest); border-radius: 50%; animation: spin 0.6s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.auth-footer { text-align: center; margin-top: 24px; font-size: 15px; color: var(--text-muted); }
.auth-footer a { color: var(--accent); text-decoration: none; font-weight: 600; transition: color var(--transition); }
.auth-footer a:hover { color: var(--text); }

/* ========== SIDEBAR ========== */
.sidebar {
    width: 260px; min-height: 100vh;
    background: rgba(12, 12, 12, 0.85);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-right: 1px solid var(--glass-border);
    display: flex; flex-direction: column;
    position: fixed; left: 0; top: 0; bottom: 0; z-index: 100;
    transition: transform var(--transition);
}

.sidebar-brand { padding: 28px 24px; display: flex; align-items: center; gap: 12px; border-bottom: 1px solid var(--glass-border); }

.brand-icon {
    font-size: 26px;
    filter: drop-shadow(0 0 12px var(--accent-glow));
    animation: iconPulse 4s ease-in-out infinite;
}
@keyframes iconPulse {
    0%, 100% { opacity: 0.8; }
    50% { opacity: 1; filter: drop-shadow(0 0 20px rgba(255, 255, 255, 0.26)); }
}

.brand-text { font-size: 22px; font-weight: 900; letter-spacing: -0.5px; color: var(--text); }

.nav-links { list-style: none; padding: 16px 12px; flex: 1; overflow-y: auto; }

.nav-link {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 16px; color: var(--text-muted); text-decoration: none;
    border-radius: var(--radius-sm); transition: all var(--transition);
    font-size: 15px; font-weight: 500; margin-bottom: 2px;
    position: relative;
}
.nav-link::before {
    content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
    background: var(--accent); border-radius: 0 3px 3px 0;
    transform: scaleY(0); transition: transform var(--transition);
}
.nav-link:hover { background: rgba(255, 255, 255, 0.04); color: var(--text-secondary); }
.nav-link.active { background: rgba(255, 255, 255, 0.07); color: var(--text); font-weight: 600; }
.nav-link.active::before { transform: scaleY(1); }
.nav-link.active .nav-icon { color: var(--accent); }

.nav-icon { font-size: 17px; width: 24px; text-align: center; transition: all var(--transition); }
.nav-link:hover .nav-icon { transform: scale(1.15); color: var(--accent); }

.sidebar-footer { padding: 16px; border-top: 1px solid var(--glass-border); display: flex; flex-direction: column; gap: 12px; }

.streak-badge {
    display: flex; align-items: center; gap: 8px;
    background: rgba(196, 164, 109, 0.06);
    backdrop-filter: var(--blur);
    border: 1px solid rgba(196, 164, 109, 0.1);
    padding: 10px 16px; border-radius: var(--radius-sm);
}
.streak-fire { font-size: 20px; }
.streak-count { font-size: 22px; font-weight: 800; color: var(--accent-5); }
.streak-label { font-size: 13px; color: var(--text-muted); }

.user-profile {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 12px;
    background: rgba(40, 40, 40, 0.5);
    backdrop-filter: var(--blur);
    border-radius: var(--radius-sm);
    border: 1px solid var(--glass-border);
}
.user-avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; flex-shrink: 0; color: var(--text); }
.user-info { flex: 1; min-width: 0; }
.user-name { display: block; font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-email { display: block; font-size: 12px; color: var(--text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.logout-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 4px 6px; border-radius: var(--radius-xs); transition: all var(--transition); }
.logout-btn:hover { color: var(--red); background: rgba(190, 100, 100, 0.1); }

.mobile-toggle {
    display: none; position: fixed; top: 16px; left: 16px; z-index: 200;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    color: var(--text); border: 1px solid var(--glass-border);
    width: 44px; height: 44px; border-radius: var(--radius-sm); font-size: 20px;
    cursor: pointer; box-shadow: var(--shadow); transition: all var(--transition);
}
.mobile-toggle:hover { background: var(--accent); color: var(--bg-deepest); }

/* ========== MAIN ========== */
.app-shell { display: flex; min-height: 100vh; width: 100%; }

.main-content { flex: 1; margin-left: 260px; padding: 36px 44px; min-height: 100vh; min-width: 0; }

.page { display: none; animation: pageIn 0.45s ease; }
.page.active { display: block; }
@keyframes pageIn {
    from { opacity: 0; transform: translateY(20px); filter: blur(4px); }
    to { opacity: 1; transform: translateY(0); filter: blur(0); }
}

/* ========== PAGE HEADER ========== */
.page-header { margin-bottom: 36px; display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; }
.page-header h1 { font-size: 30px; font-weight: 800; letter-spacing: -0.5px; color: var(--text); }
.greeting { font-size: 34px !important; }
.subtitle { color: var(--text-muted); font-size: 15px; margin-top: 4px; }
.header-quote { font-family: var(--font-accent); font-size: 18px; color: var(--text-muted); max-width: 380px; text-align: right; line-height: 1.4; }

/* ========== GLASS CARDS ========== */
.card, .glass-card {
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.03);
    border: 1px solid var(--glass-border);
    transition: all var(--transition);
}
.card:hover, .glass-card:hover {
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255,255,255,0.04);
}

.card h3 {
    font-size: 12px; font-weight: 700; margin-bottom: 18px;
    color: var(--text-muted); text-transform: uppercase; letter-spacing: 1px;
}

/* ========== DASHBOARD ========== */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }

.stat-card {
    background: var(--glass);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius);
    padding: 22px;
    display: flex; align-items: center; gap: 16px;
    position: relative; overflow: hidden;
    border: 1px solid var(--glass-border);
    transition: all var(--bounce);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.03);
}
.stat-card:hover { transform: translateY(-5px) scale(1.02); border-color: var(--glass-border-hover); }

.stat-glow { position: absolute; width: 130px; height: 130px; border-radius: 50%; filter: blur(50px); opacity: 0.2; top: -40px; right: -40px; transition: opacity 0.5s ease; }
.stat-card:hover .stat-glow { opacity: 0.35; }
.stat-card-1 .stat-glow { background: var(--accent); }
.stat-card-2 .stat-glow { background: var(--accent-2); }
.stat-card-3 .stat-glow { background: var(--accent-4); }
.stat-card-4 .stat-glow { background: var(--accent-5); }

.stat-icon {
    font-size: 26px; width: 50px; height: 50px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: var(--blur);
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    position: relative; z-index: 1;
    border: 1px solid var(--glass-border);
}
.stat-info { position: relative; z-index: 1; }
.stat-value { font-size: 26px; font-weight: 800; display: block; }
.stat-card-1 .stat-value { color: var(--accent); }
.stat-card-2 .stat-value { color: var(--accent-2); }
.stat-card-3 .stat-value { color: var(--accent-4); }
.stat-card-4 .stat-value { color: var(--accent-5); }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }

.dashboard-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 24px; }

.weekly-bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding-top: 16px; }
.weekly-bar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 8px; height: 100%; justify-content: flex-end; }
.weekly-bar { width: 100%; max-width: 40px; border-radius: 8px 8px 4px 4px; background: var(--accent-soft); transition: height 0.8s var(--bounce); min-height: 4px; box-shadow: 0 0 10px rgba(255, 255, 255, 0.1); }
.weekly-bar-label { font-size: 12px; font-weight: 600; color: var(--text-muted); }
.weekly-bar-value { font-size: 10px; font-weight: 700; color: var(--accent); }

.task-preview-list { display: flex; flex-direction: column; gap: 6px; }
.task-preview-item {
    display: flex; align-items: center; gap: 12px; padding: 10px 14px;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: var(--blur);
    border-radius: var(--radius-sm); font-size: 14px;
    border: 1px solid transparent; transition: all var(--transition);
}
.task-preview-item:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--glass-border); transform: translateX(4px); }
.task-preview-priority { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.task-preview-due { font-size: 12px; color: var(--text-muted); margin-left: auto; white-space: nowrap; }

.quick-action-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick-btn {
    padding: 18px 16px;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); font-size: 14px; font-weight: 600;
    color: var(--text-secondary); cursor: pointer; transition: all var(--bounce); font-family: var(--font);
}
.quick-btn:hover { border-color: var(--accent); color: var(--text); transform: translateY(-3px); box-shadow: 0 8px 24px rgba(255, 255, 255, 0.07); }
.quick-btn-icon { display: block; font-size: 20px; margin-bottom: 6px; }

.activity-list { display: flex; flex-direction: column; gap: 4px; max-height: 200px; overflow-y: auto; }
.activity-item { display: flex; align-items: center; gap: 10px; padding: 8px 12px; font-size: 14px; color: var(--text-secondary); border-left: 2px solid var(--accent-soft); border-radius: 0 var(--radius-xs) var(--radius-xs) 0; transition: all var(--transition); }
.activity-item:hover { background: rgba(255, 255, 255, 0.03); }
.activity-icon { font-size: 15px; }
.activity-time { margin-left: auto; font-size: 10px; color: var(--text-muted); white-space: nowrap; }

/* ── Insights Row (replaces heatmap) ── */
.insights-row {
    display: grid; grid-template-columns: repeat(3, 1fr);
    gap: 14px; margin-bottom: 24px;
}
.insights-card { padding: 20px 22px; }
.insights-label {
    font-size: 11px; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 16px;
}

/* Monthly stats grid */
.insights-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.ins-stat-val { font-size: 26px; font-weight: 800; color: var(--accent); line-height: 1; }
.ins-stat-lbl { font-size: 12px; color: var(--text-muted); margin-top: 4px; }

/* Subject bars */
.ins-subject-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.ins-subject-row:last-child { margin-bottom: 0; }
.ins-subject-name { font-size: 13px; font-weight: 600; width: 90px; flex-shrink: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.ins-subject-bar-wrap { flex: 1; height: 8px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; }
.ins-subject-bar { height: 100%; border-radius: 4px; transition: width 0.6s var(--bounce); min-width: 4px; }
.ins-subject-mins { font-size: 12px; color: var(--text-muted); width: 32px; text-align: right; flex-shrink: 0; }

/* Records */
.ins-record { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--glass-border); }
.ins-record:last-child { border-bottom: none; }
.ins-record-icon { font-size: 20px; width: 28px; text-align: center; flex-shrink: 0; }
.ins-record-val { font-size: 16px; font-weight: 700; color: var(--text); }
.ins-record-lbl { font-size: 12px; color: var(--text-muted); }

.ins-empty { font-size: 13px; color: var(--text-muted); text-align: center; padding: 20px 0; }

.heatmap-card { margin-bottom: 24px; }
.heatmap-container {
    display: flex; justify-content: space-between;
    width: 100%; padding: 8px 0 4px;
    gap: 4px;
}
.heatmap-week {
    display: flex; flex-direction: column; gap: 4px;
    flex: 1; max-width: 22px;
}
.heatmap-day {
    width: 100%; aspect-ratio: 1;
    border-radius: 3px;
    transition: transform 0.15s ease, filter 0.15s ease;
    cursor: default; position: relative;
}
.heatmap-day:hover { transform: scale(1.25); z-index: 2; filter: brightness(1.4); }
.heatmap-day[title]:hover::after {
    content: attr(title);
    position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
    background: var(--bg-surface); color: var(--text);
    padding: 5px 10px; border-radius: 8px; font-size: 12px;
    white-space: nowrap; z-index: 10; pointer-events: none;
    border: 1px solid var(--glass-border); box-shadow: var(--shadow);
}

.heatmap-0 { background: rgba(255, 255, 255, 0.05); }
.heatmap-1 { background: rgba(168, 120, 64, 0.30); }
.heatmap-2 { background: rgba(168, 120, 64, 0.55); }
.heatmap-3 { background: rgba(168, 120, 64, 0.80); }
.heatmap-4 { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }

.heatmap-legend {
    display: flex; align-items: center; gap: 5px;
    justify-content: flex-end; margin-top: 12px;
    font-size: 12px; color: var(--text-muted);
}
.heatmap-box { width: 13px; height: 13px; border-radius: 3px; display: inline-block; flex-shrink: 0; }

/* ========== TIMER ========== */
.timer-layout { display: grid; grid-template-columns: 1fr 340px; gap: 20px; align-items: start; }
.timer-main-card { text-align: center; }

.timer-mode-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; flex-wrap: wrap; }
.timer-tab {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 999px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition); font-family: var(--font); color: var(--text-muted);
}
.timer-tab:hover { border-color: var(--accent); color: var(--text); }
.timer-tab.active { background: var(--accent); color: var(--bg-deepest); border-color: transparent; box-shadow: 0 4px 20px var(--accent-glow); }

.custom-time-input { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 16px; color: var(--text-secondary); }
.custom-time-input input { width: 80px; padding: 8px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-size: 16px; font-family: var(--font); text-align: center; color: var(--text); }
.custom-time-input input:focus { outline: none; border-color: var(--accent); }

.timer-circle-container { display: flex; justify-content: center; padding: 24px 0; }
.timer-circle { width: 260px; height: 260px; position: relative; filter: drop-shadow(0 0 40px rgba(255, 255, 255, 0.08)); }
.timer-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-bg-circle { fill: none; stroke: rgba(40, 40, 40, 0.5); stroke-width: 6; }
.timer-progress-circle { fill: none; stroke: var(--accent); stroke-width: 6; stroke-linecap: round; stroke-dasharray: 753.98; stroke-dashoffset: 0; transition: stroke-dashoffset 1s linear; }
.timer-display { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); text-align: center; }
.timer-time { font-size: 54px; font-weight: 800; color: var(--text); letter-spacing: -2px; display: block; font-variant-numeric: tabular-nums; }
.timer-label { font-size: 13px; color: var(--text-muted); font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.timer-subject-select { margin: 16px auto; display: flex; align-items: center; gap: 8px; justify-content: center; font-size: 14px; color: var(--text-muted); }
.timer-subject-select select { padding: 6px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-family: var(--font); font-size: 14px; color: var(--text); }

.timer-controls { display: flex; gap: 12px; justify-content: center; margin: 24px 0; }
.timer-btn { padding: 14px 36px; border: none; border-radius: 999px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all var(--transition); font-family: var(--font); }
.timer-btn-start { background: var(--accent); color: var(--bg-deepest); box-shadow: 0 4px 24px var(--accent-glow); }
.timer-btn-start:hover { transform: translateY(-2px); box-shadow: 0 8px 36px var(--accent-glow); filter: brightness(1.1); }
.timer-btn-start.running { background: var(--accent-2); animation: glow-pulse 2.5s ease-in-out infinite; }
@keyframes glow-pulse { 0%, 100% { box-shadow: 0 4px 20px rgba(176, 122, 170, 0.2); } 50% { box-shadow: 0 4px 36px rgba(176, 122, 170, 0.4); } }

.timer-btn-reset { background: rgba(0, 0, 0, 0.3); backdrop-filter: var(--blur); color: var(--text-muted); border: 1px solid var(--glass-border); }
.timer-btn-reset:hover { border-color: var(--accent); color: var(--text); }

.pomodoro-counter { font-size: 14px; color: var(--text-muted); margin-top: 8px; }
.tomato-icons { display: inline-flex; gap: 2px; margin-left: 4px; }

.timer-sidebar { display: flex; flex-direction: column; gap: 14px; }

.ambient-freq-hint { font-size: 12px; color: var(--text-muted); }
.ambient-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-bottom: 4px; }
.ambient-btn {
    padding: 10px 8px; background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border); border-radius: var(--radius-sm);
    font-size: 13px; cursor: pointer; transition: all var(--transition);
    font-family: var(--font); color: var(--text-muted);
    display: flex; flex-direction: column; align-items: center; gap: 2px;
}
.ambient-btn:hover  { border-color: var(--accent); color: var(--text); }
.ambient-btn.active { border-color: var(--accent); background: rgba(255,255,255,0.06); color: var(--accent); box-shadow: 0 0 10px var(--accent-glow); }
.ambient-freq { font-weight: 700; font-size: 12px; }
.freq-sub { font-size: 10px; font-weight: 400; color: var(--text-muted); }
.ambient-freq.active .freq-sub { color: inherit; opacity: 0.75; }
.volume-control { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.volume-control input[type="range"] { flex: 1; -webkit-appearance: none; height: 3px; background: var(--accent-soft); border-radius: 2px; outline: none; }



.setting-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--glass-border); font-size: 14px; color: var(--text-secondary); }
.setting-row:last-child { border-bottom: none; }
.setting-row select { padding: 4px 8px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-family: var(--font); font-size: 14px; color: var(--text); }

.toggle-switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider { position: absolute; cursor: pointer; inset: 0; background: rgba(0, 0, 0, 0.5); border-radius: 24px; transition: var(--transition); border: 1px solid var(--glass-border); }
.toggle-slider::before { content: ""; position: absolute; height: 18px; width: 18px; left: 2px; bottom: 2px; background: var(--text-muted); border-radius: 50%; transition: var(--transition); }
.toggle-switch input:checked + .toggle-slider { background: var(--accent); border-color: var(--accent); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(20px); background: var(--bg-deepest); }

.focus-summary p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

/* ========== FORMS ========== */
.log-form-card, .task-form-card, .habit-form-card, .goal-form-card, .subject-form-card { margin-bottom: 20px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }
.form-grid .form-group { margin-bottom: 0; }
.form-group label { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.form-group input, .form-group select, .form-group textarea {
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.4); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); font-family: var(--font); font-size: 15px; color: var(--text);
    transition: all var(--transition); resize: vertical;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07); }

.star-rating { display: flex; gap: 4px; padding-top: 4px; }
.star { font-size: 22px; cursor: pointer; color: var(--accent-soft); transition: all var(--transition); }
.star.active { color: var(--gold); filter: drop-shadow(0 0 4px rgba(196, 164, 109, 0.4)); }
.star:hover { color: var(--gold); }

.session-filters { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px; }
.filter-group { display: flex; gap: 8px; }
.filter-group select { padding: 8px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-family: var(--font); font-size: 14px; color: var(--text); }

.sessions-list { display: flex; flex-direction: column; gap: 4px; max-height: 600px; overflow-y: auto; }
.session-item {
    display: flex; align-items: center; gap: 16px; padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25); backdrop-filter: var(--blur);
    border-radius: var(--radius-sm); transition: all var(--transition); border: 1px solid transparent;
}
.session-item:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--glass-border); transform: translateX(4px); }
.session-subject-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.session-info { flex: 1; }
.session-subject-name { font-weight: 600; font-size: 15px; }
.session-notes-text { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.session-meta { text-align: right; font-size: 14px; }
.session-duration { font-weight: 700; color: var(--accent); }
.session-date { font-size: 12px; color: var(--text-muted); }
.session-rating-stars { color: var(--gold); font-size: 12px; }

.session-delete, .task-delete, .habit-delete, .subject-delete { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 15px; padding: 4px 8px; border-radius: var(--radius-xs); transition: all var(--transition); }
.session-delete:hover, .task-delete:hover { color: var(--red); background: rgba(190, 100, 100, 0.08); }

/* ========== NOTES ========== */
.notes-toolbar { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.notes-toolbar input { flex: 1; min-width: 200px; padding: 10px 16px; background: var(--glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: 999px; font-family: var(--font); font-size: 15px; color: var(--text); }
.notes-toolbar input:focus { outline: none; border-color: var(--accent); }
.notes-toolbar select { padding: 10px 16px; background: var(--glass); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); border-radius: 999px; font-family: var(--font); font-size: 15px; color: var(--text); }

.notes-layout { display: grid; grid-template-columns: 1fr; gap: 24px; }
.notes-layout.editing { grid-template-columns: 300px 1fr; }
.notes-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.notes-layout.editing .notes-grid { grid-template-columns: 1fr; }

.note-card {
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius); padding: 20px; border: 1px solid var(--glass-border);
    cursor: pointer; transition: all var(--bounce); position: relative; min-height: 120px;
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.02);
}
.note-card:hover { transform: translateY(-4px) scale(1.01); border-color: var(--accent); box-shadow: var(--shadow-lg), 0 0 24px rgba(255, 255, 255, 0.05); }
.note-card.pinned { border-color: rgba(196, 164, 109, 0.15); }
.note-card-pin { position: absolute; top: 12px; right: 12px; font-size: 15px; }
.note-card-title { font-size: 15px; font-weight: 700; margin-bottom: 8px; }
.note-card-preview { font-size: 13px; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.note-card-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 12px; font-size: 10px; color: var(--text-muted); }
.note-card-subject { padding: 2px 8px; border-radius: 999px; font-size: 10px; font-weight: 600; }

.note-editor-panel {
    background: var(--glass-strong); backdrop-filter: var(--blur-strong); -webkit-backdrop-filter: var(--blur-strong);
    border-radius: var(--radius); box-shadow: var(--shadow-lg); border: 1px solid var(--glass-border);
    display: flex; flex-direction: column; position: sticky; top: 32px; max-height: calc(100vh - 120px);
}
.note-editor-header { padding: 16px 20px; border-bottom: 1px solid var(--glass-border); display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.note-title-input { flex: 1; border: none; font-size: 20px; font-weight: 700; font-family: var(--font); color: var(--text); background: transparent; outline: none; min-width: 200px; }
.note-editor-actions { display: flex; gap: 8px; align-items: center; }
.note-editor-actions select { padding: 4px 10px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-family: var(--font); font-size: 14px; color: var(--text); }

.btn-icon { background: none; border: none; font-size: 16px; cursor: pointer; padding: 6px 8px; border-radius: var(--radius-xs); transition: all var(--transition); color: var(--text-muted); }
.btn-icon:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }

.note-editor-toolbar { padding: 8px 20px; border-bottom: 1px solid var(--glass-border); display: flex; gap: 4px; flex-wrap: wrap; }
.note-editor-toolbar button { padding: 6px 10px; border: none; background: rgba(0, 0, 0, 0.3); border-radius: var(--radius-xs); cursor: pointer; font-size: 14px; color: var(--text-muted); transition: all var(--transition); font-family: var(--font); }
.note-editor-toolbar button:hover { background: var(--accent); color: var(--bg-deepest); }
.toolbar-divider { width: 1px; height: 24px; background: var(--glass-border); margin: 0 4px; }

.note-content-editor { flex: 1; padding: 20px; font-size: 15px; line-height: 1.7; color: var(--text); overflow-y: auto; min-height: 300px; outline: none; }
.note-content-editor:empty::before { content: attr(placeholder); color: var(--text-muted); }
.note-editor-footer { padding: 10px 20px; border-top: 1px solid var(--glass-border); display: flex; justify-content: space-between; font-size: 12px; color: var(--text-muted); }

/* ========== TASKS ========== */
.task-input-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.task-input-row input[type="text"] { flex: 1; min-width: 200px; padding: 10px 16px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-family: var(--font); font-size: 15px; color: var(--text); transition: all var(--transition); }
.task-input-row input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.07); }
.task-input-row input[type="date"], .task-input-row select { padding: 10px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-family: var(--font); font-size: 15px; color: var(--text); }

.task-filters { display: flex; gap: 8px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-chip { padding: 8px 18px; border: 1px solid var(--glass-border); background: var(--glass); backdrop-filter: var(--blur); border-radius: 999px; font-size: 14px; font-weight: 600; cursor: pointer; transition: all var(--transition); font-family: var(--font); color: var(--text-muted); }
.filter-chip:hover { border-color: var(--accent); color: var(--text); }
.filter-chip.active { background: var(--accent); color: var(--bg-deepest); border-color: var(--accent); box-shadow: 0 2px 16px var(--accent-glow); }

.tasks-list { display: flex; flex-direction: column; gap: 4px; }
.task-item {
    display: flex; align-items: center; gap: 14px; padding: 14px 18px;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
    transition: all var(--transition);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}
.task-item:hover { border-color: var(--glass-border-hover); transform: translateX(4px); }
.task-item.completed { opacity: 0.4; }
.task-item.completed .task-title { text-decoration: line-through; }

.task-checkbox { width: 22px; height: 22px; border: 2px solid var(--accent-soft); border-radius: 6px; cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px; transition: all var(--transition); flex-shrink: 0; background: transparent; color: transparent; }
.task-checkbox:hover { border-color: var(--accent); background: rgba(255, 255, 255, 0.05); }
.task-checkbox.checked { background: var(--accent); border-color: var(--accent); color: var(--bg-deepest); }

.task-info { flex: 1; }
.task-title { font-size: 15px; font-weight: 600; }
.task-meta-info { font-size: 12px; color: var(--text-muted); margin-top: 2px; display: flex; gap: 12px; }

.task-priority-badge { padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; }
.priority-low { background: rgba(122, 156, 131, 0.12); color: var(--accent-4); }
.priority-medium { background: rgba(255, 255, 255, 0.08); color: var(--accent-3); }
.priority-high { background: rgba(196, 164, 109, 0.12); color: var(--accent-5); }
.priority-urgent { background: rgba(190, 100, 100, 0.12); color: var(--red); }

.task-summary-bar { margin-top: 20px; text-align: center; font-size: 13px; color: var(--text-muted); }

/* ========== FLASHCARDS ========== */
.flashcard-toolbar { margin-bottom: 24px; }
.decks-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 14px; }

.deck-card {
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius); padding: 24px; border: 1px solid var(--glass-border);
    transition: all var(--bounce);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.02);
}
.deck-card:hover { transform: translateY(-5px); border-color: var(--glass-border-hover); box-shadow: var(--shadow-lg), 0 0 28px rgba(255, 255, 255, 0.04); }

.deck-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.deck-card-title { font-size: 17px; font-weight: 700; }
.deck-card-count { font-size: 12px; color: var(--text-muted); background: rgba(0, 0, 0, 0.3); padding: 4px 10px; border-radius: 999px; }
.deck-card-subject { font-size: 10px; padding: 3px 10px; border-radius: 999px; display: inline-block; margin-bottom: 16px; }

.deck-card-actions { display: flex; gap: 8px; }
.deck-card-actions button { flex: 1; padding: 10px; border: none; border-radius: var(--radius-xs); font-size: 14px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all var(--transition); }
.deck-study-btn { background: var(--accent); color: var(--bg-deepest); }
.deck-study-btn:hover { filter: brightness(1.1); transform: translateY(-1px); box-shadow: 0 4px 16px var(--accent-glow); }
.deck-edit-btn { background: rgba(0, 0, 0, 0.3); color: var(--text-muted); border: 1px solid var(--glass-border) !important; }
.deck-delete-btn { background: rgba(190, 100, 100, 0.08); color: var(--red); max-width: 40px; }

.modal-overlay { position: fixed; inset: 0; background: rgba(0, 0, 0, 0.7); backdrop-filter: blur(12px); display: flex; align-items: center; justify-content: center; z-index: 500; padding: 24px; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal { width: 100%; max-width: 600px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.4s var(--bounce); }
@keyframes modalIn { from { opacity: 0; transform: scale(0.92) translateY(24px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.study-modal { max-width: 520px; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-actions { display: flex; gap: 12px; justify-content: flex-end; margin-top: 20px; }

.card-inputs { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; max-height: 300px; overflow-y: auto; }
.card-input-pair { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: start; }
.card-input-pair input { padding: 8px 12px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--glass-border); border-radius: var(--radius-xs); font-family: var(--font); font-size: 14px; color: var(--text); }
.card-input-pair input:focus { outline: none; border-color: var(--accent); }
.remove-card-btn { background: none; border: none; color: var(--text-muted); cursor: pointer; font-size: 16px; padding: 6px; }

.study-progress { text-align: center; font-size: 15px; color: var(--text-secondary); margin-bottom: 20px; }
.progress-bar { height: 3px; background: rgba(40, 40, 40, 0.5); border-radius: 2px; margin-top: 8px; overflow: hidden; }
.progress-fill { height: 100%; background: var(--accent); border-radius: 2px; transition: width 0.5s ease; box-shadow: 0 0 8px var(--accent-glow); }

.flashcard-flip-container { perspective: 1000px; cursor: pointer; margin-bottom: 20px; }
.flashcard-flip { width: 100%; min-height: 200px; position: relative; transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.flashcard-flip.flipped { transform: rotateY(180deg); }
.flashcard-front, .flashcard-back { position: absolute; inset: 0; backface-visibility: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 32px; border-radius: var(--radius); text-align: center; font-size: 17px; line-height: 1.5; }
.flashcard-front { background: rgba(255, 255, 255, 0.04); backdrop-filter: var(--blur); border: 1px solid var(--glass-border); }
.flashcard-back { background: rgba(122, 156, 131, 0.06); backdrop-filter: var(--blur); border: 1px solid rgba(122, 156, 131, 0.12); transform: rotateY(180deg); }
.flip-hint { position: absolute; bottom: 12px; font-size: 12px; color: var(--text-muted); }

.study-controls { display: flex; gap: 12px; justify-content: center; }
.study-btn { padding: 12px 24px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all var(--transition); background: var(--glass); backdrop-filter: var(--blur); color: var(--text); }
.study-btn-hard:hover { border-color: var(--red); background: rgba(190, 100, 100, 0.08); }
.study-btn-ok:hover { border-color: var(--accent-5); background: rgba(196, 164, 109, 0.08); }
.study-btn-easy:hover { border-color: var(--accent-4); background: rgba(122, 156, 131, 0.08); }
.study-btn:hover { transform: translateY(-2px); }

/* ========== ANALYTICS ========== */
.analytics-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.analytics-card { min-height: 300px; }
.chart-container { height: 240px; display: flex; align-items: flex-end; gap: 8px; padding: 16px 0; }
.chart-bar-group { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.chart-bar { width: 100%; max-width: 34px; border-radius: 6px 6px 2px 2px; transition: height 0.8s var(--bounce); min-height: 2px; }
.chart-bar:hover { filter: brightness(1.3); box-shadow: 0 0 12px var(--accent-glow); }
.chart-bar-label { font-size: 10px; color: var(--text-muted); font-weight: 600; }
.chart-bar-value { font-size: 10px; font-weight: 700; color: var(--accent); }

.subject-bars { display: flex; flex-direction: column; gap: 12px; padding: 16px 0; }
.subject-bar-item { display: flex; align-items: center; gap: 12px; }
.subject-bar-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; box-shadow: 0 0 6px currentColor; }
.subject-bar-name { width: 80px; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subject-bar-track { flex: 1; height: 6px; background: rgba(40, 40, 40, 0.5); border-radius: 3px; overflow: hidden; }
.subject-bar-fill { height: 100%; border-radius: 3px; transition: width 1s ease; }
.subject-bar-value { font-size: 12px; color: var(--text-muted); width: 50px; text-align: right; }

.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stats-item {
    padding: 16px;
    background: rgba(0, 0, 0, 0.3); backdrop-filter: var(--blur);
    border-radius: var(--radius-sm); text-align: center;
    border: 1px solid var(--glass-border); transition: all var(--transition);
}
.stats-item:hover { border-color: var(--glass-border-hover); transform: translateY(-2px); }
.stats-item-value { font-size: 22px; font-weight: 800; color: var(--accent); display: block; }
.stats-item-label { font-size: 10px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.5px; }

/* ========== HABITS ========== */
.habits-week-header { display: grid; grid-template-columns: 200px repeat(7, 1fr) auto; gap: 8px; padding: 12px 18px; font-size: 10px; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.5px; }
.habits-list { display: flex; flex-direction: column; gap: 4px; }
.habit-item {
    display: grid; grid-template-columns: 200px repeat(7, 1fr) auto; gap: 8px;
    padding: 14px 18px;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius-sm); border: 1px solid var(--glass-border);
    align-items: center; transition: all var(--transition);
}
.habit-item:hover { border-color: var(--glass-border-hover); }
.habit-name { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.habit-check {
    width: 32px; height: 32px; border: 1px solid var(--glass-border);
    border-radius: 8px; background: rgba(0, 0, 0, 0.3);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-size: 15px; transition: all var(--bounce); color: transparent; margin: 0 auto;
}
.habit-check:hover { border-color: var(--accent-4); background: rgba(122, 156, 131, 0.08); }
.habit-check.checked { background: var(--accent-4); border-color: var(--accent-4); color: var(--bg-deepest); box-shadow: 0 0 12px rgba(122, 156, 131, 0.2); }

/* ========== GOALS ========== */
.goals-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.goal-card {
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    border-radius: var(--radius); padding: 24px; border: 1px solid var(--glass-border);
    transition: all var(--transition);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.02);
}
.goal-card:hover { border-color: var(--glass-border-hover); }
.goal-card-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px; }
.goal-card-title { font-size: 16px; font-weight: 700; }
.goal-card-deadline { font-size: 10px; color: var(--text-muted); background: rgba(0, 0, 0, 0.3); padding: 3px 10px; border-radius: 999px; }
.goal-progress-ring { display: flex; align-items: center; gap: 20px; margin: 16px 0; }
.goal-ring { width: 80px; height: 80px; position: relative; }
.goal-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.goal-ring-bg { fill: none; stroke: rgba(40, 40, 40, 0.5); stroke-width: 6; }
.goal-ring-fill { fill: none; stroke-width: 6; stroke-linecap: round; transition: stroke-dashoffset 0.8s ease; filter: drop-shadow(0 0 6px currentColor); }
.goal-ring-text { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; }
.goal-details { flex: 1; }
.goal-details p { font-size: 14px; color: var(--text-secondary); line-height: 1.5; }
.goal-done { border-color: var(--accent-4) !important; }
.goal-card-footer { display: flex; gap: 8px; justify-content: space-between; align-items: center; margin-top: 12px; }
.goal-card-footer button { padding: 6px 14px; border: none; border-radius: var(--radius-xs); font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all var(--transition); }
.goal-log-btn { background: rgba(255, 255, 255, 0.07); color: var(--accent); }
.goal-log-btn:hover { background: rgba(255, 255, 255, 0.12); }
.goal-delete-btn { background: rgba(190, 100, 100, 0.08); color: var(--red); }
.goal-delete-btn:hover { background: rgba(190, 100, 100, 0.12); }

/* ========== SUBJECTS ========== */
.color-input { width: 44px; height: 44px; border: 1px solid var(--glass-border); border-radius: var(--radius-sm); cursor: pointer; padding: 2px; background: rgba(0, 0, 0, 0.4); }
.subjects-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.subject-card {
    border-radius: var(--radius); padding: 24px;
    background: var(--glass); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
    transition: all var(--bounce); position: relative; overflow: hidden;
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.02);
}
.subject-card:hover { transform: translateY(-5px) scale(1.02); box-shadow: var(--shadow-lg); border-color: var(--glass-border-hover); }
.subject-emoji { font-size: 30px; margin-bottom: 8px; display: block; }
.subject-card-name { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
.subject-card-stats { font-size: 13px; color: var(--text-muted); }
.subject-delete { position: absolute; top: 12px; right: 12px; opacity: 0; transition: opacity var(--transition); }
.subject-card:hover .subject-delete { opacity: 1; }

/* ========== LIBRARY / NCERT ========== */
.ncert-selector { margin-bottom: 24px; }

.ncert-class-tabs {
    display: flex; gap: 6px; flex-wrap: wrap;
}
.ncert-class-tab {
    padding: 10px 20px;
    background: var(--glass); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: 999px; font-size: 14px; font-weight: 600;
    cursor: pointer; transition: all var(--transition);
    font-family: var(--font); color: var(--text-muted);
}
.ncert-class-tab:hover { border-color: var(--accent); color: var(--text); }
.ncert-class-tab.active {
    background: var(--accent); color: var(--bg-deepest);
    border-color: var(--accent); box-shadow: 0 2px 16px var(--accent-glow);
}

.ncert-subjects {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.ncert-subject-card {
    background: var(--glass); backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius); padding: 22px;
    cursor: pointer; transition: all var(--bounce);
    box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,0.02);
    position: relative; overflow: hidden;
}
.ncert-subject-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--glass-border-hover);
    box-shadow: var(--shadow-lg);
}
.ncert-subject-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 3px;
    border-radius: var(--radius) var(--radius) 0 0;
}
.ncert-subject-icon { font-size: 28px; margin-bottom: 10px; display: block; }
.ncert-subject-name { font-size: 15px; font-weight: 700; margin-bottom: 2px; }
.ncert-subject-info { font-size: 13px; color: var(--text-muted); }
.ncert-subject-chapters { font-size: 12px; color: var(--text-muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; }

.ncert-chapters-header {
    display: flex; justify-content: space-between; align-items: flex-start;
    margin-bottom: 20px; flex-wrap: wrap; gap: 12px;
}
.ncert-chapters-header h3 { font-size: 16px !important; font-weight: 700; color: var(--text) !important; text-transform: none !important; letter-spacing: 0 !important; }
.ncert-book-meta { font-size: 13px; color: var(--text-muted); }

.ncert-chapter-list { display: flex; flex-direction: column; gap: 4px; }

.ncert-chapter-item {
    display: flex; align-items: center; gap: 14px;
    padding: 14px 16px;
    background: rgba(0, 0, 0, 0.25); backdrop-filter: var(--blur);
    border-radius: var(--radius-sm);
    border: 1px solid transparent;
    transition: all var(--transition);
}
.ncert-chapter-item:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: var(--glass-border);
    transform: translateX(4px);
}

.ncert-ch-num {
    width: 36px; height: 36px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px; font-weight: 700; color: var(--accent);
    flex-shrink: 0;
}

.ncert-ch-info { flex: 1; }
.ncert-ch-name { font-size: 15px; font-weight: 600; }
.ncert-ch-sub { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.ncert-ch-link {
    padding: 8px 16px;
    background: var(--accent);
    color: var(--bg-deepest);
    border: none; border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    text-decoration: none;
    transition: all var(--transition);
    white-space: nowrap;
    display: inline-flex; align-items: center; gap: 6px;
}
.ncert-ch-link:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-sm { padding: 7px 16px; font-size: 13px; }

/* ========== BUTTONS ========== */
.btn { padding: 10px 22px; border: none; border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; font-family: var(--font); transition: all var(--transition); }
.btn-primary { background: var(--accent); color: var(--bg-deepest); box-shadow: 0 2px 16px var(--accent-glow); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 28px var(--accent-glow); filter: brightness(1.1); }
.btn-secondary { background: var(--glass); backdrop-filter: var(--blur); color: var(--text-muted); border: 1px solid var(--glass-border); }
.btn-secondary:hover { border-color: var(--accent); color: var(--text); }

/* ========== EMPTY STATE ========== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 44px; margin-bottom: 12px; opacity: 0.2; }
.empty-state-text { font-size: 14px; line-height: 1.6; }

/* ========== TOAST ========== */
.toast-container { position: fixed; top: 24px; right: 24px; z-index: 10000; display: flex; flex-direction: column; gap: 8px; }
.toast {
    padding: 14px 20px;
    background: var(--glass-strong); backdrop-filter: var(--blur-strong); -webkit-backdrop-filter: var(--blur-strong);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm); color: var(--text); font-size: 15px; font-family: var(--font);
    box-shadow: var(--shadow-lg);
    animation: toastIn 0.4s var(--bounce) both;
    display: flex; align-items: center; gap: 10px; max-width: 360px;
}
.toast.success { border-left: 3px solid var(--accent-4); }
.toast.error { border-left: 3px solid var(--red); }
.toast.info { border-left: 3px solid var(--accent); }
@keyframes toastIn { from { opacity: 0; transform: translateX(40px) scale(0.9); } to { opacity: 1; transform: translateX(0) scale(1); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(40px) scale(0.9); } }

/* ========== STAGGERED ANIMATIONS ========== */
.stat-card:nth-child(1) { animation: slideUp 0.5s ease 0.1s both; }
.stat-card:nth-child(2) { animation: slideUp 0.5s ease 0.2s both; }
.stat-card:nth-child(3) { animation: slideUp 0.5s ease 0.3s both; }
.stat-card:nth-child(4) { animation: slideUp 0.5s ease 0.4s both; }
@keyframes slideUp { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }

/* ========== RESPONSIVE ========== */
@media (max-width: 1024px) {
    .timer-layout { grid-template-columns: 1fr; }
    .analytics-grid { grid-template-columns: 1fr; }
    .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
    .insights-row   { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* ── Sidebar ── */
    .sidebar { transform: translateX(-100%); transition: transform 0.28s ease; }
    .sidebar.open { transform: translateX(0); box-shadow: 4px 0 32px rgba(0,0,0,0.6); }
    .mobile-toggle { display: block; }
    .main-content { margin-left: 0; padding: 20px 14px; padding-top: 68px; }

    /* ── Dashboard ── */
    .dashboard-row  { grid-template-columns: 1fr; }
    .page-header    { flex-direction: column; align-items: flex-start; gap: 8px; }
    .header-quote   { text-align: left; }

    /* ── Focus timer ── */
    .timer-layout { grid-template-columns: 1fr; }
    .timer-circle { width: 200px; height: 200px; }
    .timer-time   { font-size: 40px; }
    .timer-sidebar { order: -1; }
    
    /* ── Notes ── */
    .notes-layout.editing { grid-template-columns: 1fr; }

    /* ── Tasks ── */
    .task-input-row { flex-direction: column; }
    .task-input-row input[type="text"],
    .task-input-row select,
    .task-input-row input[type="date"] { width: 100%; }

    /* ── Habits ── */
    .habit-item, .habits-week-header { grid-template-columns: 100px repeat(7, 1fr) auto; }

    /* ── NCERT / Library ── */
    .ncert-chapter-item { gap: 10px; }
    .ncert-ch-actions   { flex-direction: column; gap: 4px; align-items: flex-end; }
    .ncert-ch-link, .btn-sol { font-size: 12px; padding: 6px 10px; }

    /* ── Solutions overlay ── */
    .sol-overlay-header {
        padding: 10px 14px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .sol-overlay-title { order: 1; flex: 1; min-width: 160px; }
    .sol-back-btn      { order: 0; flex-shrink: 0; }
    .sol-overlay-progress { order: 3; width: 100%; justify-content: space-between; }
    .sol-overlay-tools { order: 2; gap: 4px; }
    .sol-tool { padding: 6px 8px; font-size: 12px; gap: 4px; }
    .sol-prog-bar { flex: 1; }
    .sol-overlay-body { padding: 16px 14px 40px; gap: 24px; }
    .sol-section-header { padding-bottom: 8px; }
    .sol-card-q    { gap: 10px; padding-left: 8px; }
    .sq-badge      { width: 24px; height: 24px; font-size: 9px; }
    .sq-text       { font-size: 13.5px; }
    .sol-card-a    { margin-left: 38px; font-size: 14px; }
    .sol-card-note { margin-left: 38px; }
    .sq-actions  { gap: 2px; }
    .sq-mark-btn, .sq-note-btn, .sq-hl-btn { width: 26px; height: 26px; }
}

@media (max-width: 480px) {
    .dashboard-grid { grid-template-columns: 1fr; }
    .greeting  { font-size: 26px !important; }
    .timer-circle { width: 180px; height: 180px; }
    .timer-time   { font-size: 36px; }

    /* Ambient grid 2-col on very small */
    
    /* Solutions overlay ── very narrow */
    .sol-overlay-header    { padding: 8px 12px; }
    .sol-overlay-name      { font-size: 14px; }
    .sol-overlay-meta      { font-size: 12px; }
    .sol-tool span + span, .sol-tool svg + span { display: none; } /* hide label text, keep icon */
    .sol-overlay-body      { padding: 12px 10px 32px; }
    .sol-card-q            { padding: 11px 10px 9px; }
    .sq-text               { font-size: 14px; }
    .sol-card-a            { font-size: 12.5px; line-height: 1.7; }

    /* NCERT chapters */
    .ncert-chapter-item    { flex-wrap: wrap; }
    .ncert-ch-actions      { width: 100%; flex-direction: row; }
}

/* ========== CUSTOM DROPDOWN ========== */
.custom-select {
    position: relative;
    display: inline-block;
    min-width: 160px;
}
.custom-select-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: var(--blur);
    -webkit-backdrop-filter: var(--blur);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    transition: all var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    user-select: none;
}
.custom-select-trigger:hover {
    border-color: var(--glass-border-hover);
    background: rgba(0, 0, 0, 0.6);
}
.custom-select-trigger.open {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.07);
}
.custom-select-trigger .cs-placeholder {
    color: var(--text-muted);
}
.custom-select-arrow {
    flex-shrink: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: transform var(--transition);
    font-size: 10px;
}
.custom-select-trigger.open .custom-select-arrow {
    transform: rotate(180deg);
}
.custom-select-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    min-width: 100%;
    max-height: 240px;
    overflow-y: auto;
    background: var(--glass-strong);
    backdrop-filter: var(--blur-strong);
    -webkit-backdrop-filter: var(--blur-strong);
    border: 1px solid var(--glass-border-hover);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg), 0 0 0 1px rgba(0,0,0,0.1);
    z-index: 400;
    padding: 4px;
    opacity: 0;
    transform: translateY(-8px) scale(0.97);
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.custom-select-menu.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}
.custom-select-option {
    padding: 9px 12px;
    font-size: 14px;
    color: var(--text-secondary);
    border-radius: var(--radius-xs);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.custom-select-option:hover {
    background: rgba(255, 255, 255, 0.07);
    color: var(--text);
}
.custom-select-option.selected {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text);
    font-weight: 600;
}
.custom-select-option.selected::after {
    content: '✓';
    margin-left: auto;
    font-size: 13px;
    color: var(--accent);
}
.custom-select-separator {
    height: 1px;
    background: var(--glass-border);
    margin: 4px 8px;
}

/* size variants */
.custom-select.cs-sm .custom-select-trigger { padding: 6px 10px; font-size: 13px; }
.custom-select.cs-sm .custom-select-option { padding: 7px 10px; font-size: 13px; }
.custom-select.cs-pill .custom-select-trigger { border-radius: 999px; }
.custom-select.cs-pill .custom-select-menu { border-radius: var(--radius-sm); }

/* inline in task row */
.task-input-row .custom-select { min-width: 130px; }
.notes-toolbar .custom-select .custom-select-trigger { border-radius: 999px; }
.filter-group .custom-select .custom-select-trigger { font-size: 13px; padding: 8px 12px; }

/* ========== NCERT CHAPTER ACTIONS (PDF + Solutions) ========== */
.ncert-ch-actions {
    display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.btn-sol {
    padding: 8px 14px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--accent);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--radius-xs);
    font-size: 13px; font-weight: 600;
    cursor: pointer; font-family: var(--font);
    transition: all var(--transition);
    white-space: nowrap;
}
.btn-sol:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: var(--accent);
    transform: translateY(-1px);
}

/* ========== SOLUTIONS FULL-PAGE OVERLAY — Light Reading Theme ========== */
@keyframes solSlideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* --sol-* custom props — warm parchment reading theme */
.sol-overlay {
    --sol-bg:       #f0ebe0;   /* warm parchment — easier than pure white */
    --sol-surface:  #f8f4ec;   /* slightly lighter parchment */
    --sol-border:   rgba(60,45,20,0.10);
    --sol-border2:  rgba(60,45,20,0.16);
    --sol-text:     #2a2218;   /* warm near-black, not pure black */
    --sol-text2:    #2a2218;   /* answers same brightness as questions */
    --sol-muted:    #8a7e70;   /* warm mid tone */
    --sol-accent:   #8a6028;   /* muted amber — not distracting */
    --sol-accent-l: #f0e8d8;
    --sol-accent-b: #cca868;
    --sol-green:    #3a6e48;   /* muted green */
    --sol-green-l:  #e4f0e8;
    --sol-green-b:  #88c4a0;
    --sol-amber:    #886020;   /* muted amber for review */
    --sol-amber-l:  #f5ead8;
    --sol-amber-b:  #d4a860;
    --sol-shadow:   0 1px 4px rgba(0,0,0,0.06);
    --sol-shadow2:  0 4px 16px rgba(0,0,0,0.08);

    position: fixed; inset: 0; z-index: 900;
    background: var(--sol-bg);
    display: flex; flex-direction: column;
    overflow: hidden;
    font-family: var(--font);
    color: var(--sol-text);
}

/* ── Header ─────────────────────────────────────────────────────────────── */
.sol-overlay-header {
    display: flex; align-items: center; gap: 12px;
    padding: 11px 24px 11px;
    background: var(--sol-surface);
    border-bottom: 1px solid var(--sol-border);
    flex-shrink: 0; position: relative; z-index: 1;
    overflow: hidden; /* stop anything from spilling out */
}

/* Full-width progress strip at very bottom of header */
.sol-prog-strip {
    position: absolute; bottom: 0; left: 0;
    height: 3px; width: 0%;
    background: var(--sol-accent);
    transition: width 0.5s ease;
}

.sol-back-btn {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 12px;
    background: var(--sol-accent-l);
    border: 1px solid var(--sol-accent-b);
    border-radius: 8px;
    color: var(--sol-accent); font-size: 13px; font-weight: 600;
    font-family: var(--font); cursor: pointer;
    transition: all 0.18s; white-space: nowrap; flex-shrink: 0;
}
.sol-back-btn:hover { background: var(--sol-accent-b); }

.sol-overlay-title { flex: 1; min-width: 0; }
.sol-overlay-name {
    font-size: 14px; font-weight: 700; color: var(--sol-text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sol-overlay-meta {
    font-size: 11px; color: var(--sol-muted); margin-top: 1px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Tools row — right side, never wraps */
.sol-overlay-tools {
    display: flex; gap: 6px; flex-shrink: 0; align-items: center;
}
.sol-tool {
    display: flex; align-items: center; gap: 5px;
    padding: 6px 11px;
    background: transparent;
    border: 1px solid var(--sol-border2);
    border-radius: 8px;
    color: var(--sol-muted); font-size: 12px; font-weight: 600;
    font-family: var(--font); cursor: pointer; transition: all 0.18s;
    white-space: nowrap;
}
.sol-tool:hover  { background: var(--sol-accent-l); color: var(--sol-accent); border-color: var(--sol-accent-b); }
.sol-tool.active { background: var(--sol-accent-l); border-color: var(--sol-accent); color: var(--sol-accent); }

/* Compact progress count inside tools row */
.sol-prog-count {
    font-size: 12px; font-weight: 700; color: var(--sol-accent);
    white-space: nowrap; padding: 6px 10px;
    background: var(--sol-accent-l); border-radius: 8px;
    border: 1px solid var(--sol-accent-b); flex-shrink: 0;
}

/* ── Scrollable body ─────────────────────────────────────────────────────── */
.sol-overlay-body {
    flex: 1; overflow-y: auto;
    padding: 0 32px 60px;   /* no top padding — sections handle their own */
    display: flex; flex-direction: column;
    box-sizing: border-box;
}
.sol-overlay-body::-webkit-scrollbar { width: 5px; }
.sol-overlay-body::-webkit-scrollbar-track { background: transparent; }
.sol-overlay-body::-webkit-scrollbar-thumb { background: var(--sol-border2); border-radius: 99px; }

/* ── Exercise section ───────────────────────────────────────────────────── */
.sol-section { display: flex; flex-direction: column; }
.sol-section-header {
    display: flex; align-items: center; gap: 10px;
    padding: 24px 0 14px;
    border-bottom: 1px solid var(--sol-border);
    margin-bottom: 0;
    position: sticky; top: 0;
    background: var(--sol-bg); z-index: 2;
}
.sol-section-name {
    font-size: 11px; font-weight: 800; color: var(--sol-accent);
    text-transform: uppercase; letter-spacing: 0.1em;
}
.sol-section-count {
    font-size: 11px; color: var(--sol-muted);
    background: var(--sol-accent-l); padding: 2px 8px;
    border-radius: 99px; font-weight: 600;
}

/* ── Q&A — open layout, no card boxes ────────────────────────────────────── */
.sol-card {
    padding: 24px 0;
    border-bottom: 1px solid var(--sol-border);
    transition: background 0.15s;
}
.sol-card:last-child { border-bottom: none; }

/* Mark state: left accent bar instead of border */
.sol-card { position: relative; padding-left: 4px; }
.sol-card::before {
    content: '';
    position: absolute; left: 0; top: 20px; bottom: 20px;
    width: 3px; border-radius: 2px;
    background: transparent; transition: background 0.18s;
}
.sol-card.got::before    { background: var(--sol-green); }
.sol-card.review::before { background: var(--sol-amber); }

.sol-card-q {
    display: flex; gap: 14px; align-items: flex-start;
    padding-left: 12px;
}

.sq-badge {
    width: 26px; height: 26px; flex-shrink: 0; margin-top: 2px;
    background: var(--sol-accent-l);
    border: 1.5px solid var(--sol-accent-b);
    border-radius: 7px;
    display: flex; align-items: center; justify-content: center;
    font-size: 10px; font-weight: 800; color: var(--sol-accent);
}

.sq-text {
    flex: 1;
    font-size: 15px; font-weight: 700; color: var(--sol-text);
    line-height: 1.65; white-space: pre-wrap; word-break: break-word;
}

.sq-actions { display: flex; gap: 3px; flex-shrink: 0; margin-top: 1px; }

/* Mark button */
.sq-mark-btn {
    width: 26px; height: 26px;
    border-radius: 7px; border: 1px solid var(--sol-border2);
    background: transparent; font-size: 13px; font-weight: 700;
    cursor: pointer; font-family: var(--font);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
}
.sq-mark-btn:hover   { background: var(--sol-accent-l); border-color: var(--sol-accent-b); }
.sq-mark-none        { color: var(--sol-muted); }
.sq-mark-got         { background: var(--sol-green-l); border-color: var(--sol-green-b); color: var(--sol-green); }
.sq-mark-review      { background: var(--sol-amber-l); border-color: var(--sol-amber-b); color: var(--sol-amber); }

/* Icon buttons */
.sq-note-btn, .sq-hl-btn {
    width: 26px; height: 26px;
    border-radius: 7px; border: 1px solid transparent;
    background: none; color: var(--sol-muted);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.18s;
}
.sq-note-btn:hover, .sq-hl-btn:hover { background: var(--sol-accent-l); color: var(--sol-accent); border-color: var(--sol-accent-b); }
.sq-note-btn.has-note, .sq-note-btn.open { color: var(--sol-accent); }
.sq-hl-btn.active { color: var(--sol-amber); }

/* ── Answer — full white, no inner box ──────────────────────────────────── */
.sol-card-a {
    margin: 14px 0 0 52px;   /* indent to align with q text */
    font-size: 14.5px; color: var(--sol-text);  /* same brightness as question */
    line-height: 1.85; white-space: pre-wrap; word-break: break-word;
}
.sol-card-a.hl {
    background: rgba(200,168,60,0.12);
    border-radius: 8px;
    padding: 10px 14px;
    margin-right: 0;
}
.sol-card-a sub, .sq-text sub { font-size: 0.75em; vertical-align: sub; }
.sol-card-a sup, .sq-text sup { font-size: 0.75em; vertical-align: super; }

/* Notes area */
.sol-card-note { margin: 10px 0 0 52px; }
.sq-note-area {
    width: 100%; min-height: 80px;
    background: var(--sol-accent-l);
    border: 1.5px solid var(--sol-accent-b);
    border-radius: 8px; padding: 10px 13px;
    color: var(--sol-text); font-family: var(--font); font-size: 13.5px;
    line-height: 1.65; resize: vertical; box-sizing: border-box;
    transition: border-color 0.18s, box-shadow 0.18s;
}
.sq-note-area:focus {
    outline: none; border-color: var(--sol-accent);
    box-shadow: 0 0 0 3px rgba(168,136,72,0.2);
}
.sq-note-area::placeholder { color: var(--sol-muted); }

/* ── Night mode — warm dark, reduced contrast ────────────────────────────── */
.sol-overlay.night {
    --sol-bg:       #151210;   /* dark walnut, not pitch black */
    --sol-surface:  #1c1914;
    --sol-border:   rgba(255,240,200,0.07);
    --sol-border2:  rgba(255,240,200,0.12);
    --sol-text:     #c8bfb0;   /* warm cream, not stark white */
    --sol-text2:    #c8bfb0;   /* same brightness for answers */
    --sol-muted:    #5a5248;
    --sol-accent:   #a88848;   /* muted warm amber */
    --sol-accent-l: rgba(168,136,72,0.12);
    --sol-accent-b: rgba(168,136,72,0.28);
    --sol-green:    #4a8060;
    --sol-green-l:  rgba(74,128,96,0.12);
    --sol-green-b:  rgba(74,128,96,0.3);
    --sol-amber:    #907040;
    --sol-amber-l:  rgba(144,112,64,0.12);
    --sol-amber-b:  rgba(144,112,64,0.3);
    --sol-shadow:   0 1px 4px rgba(0,0,0,0.5);
    --sol-shadow2:  0 4px 16px rgba(0,0,0,0.6);
}
/* Night mode overrides */
.sol-overlay.night .sol-section-header { background: var(--sol-bg); }
.sol-overlay.night .sq-mark-btn        { background: transparent; }
.sol-overlay.night .sq-mark-btn:hover  { background: rgba(255,255,255,0.08); }
.sol-overlay.night .sol-back-btn:hover { background: rgba(255,255,255,0.1); }
.sol-overlay.night .sol-card-a.hl      { background: rgba(200,168,60,0.1); }
.sol-overlay.night .sq-hl-btn.active   { color: #c8a840; }
.sol-overlay.night .sq-note-area       { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }
.sol-overlay.night .sq-note-area:focus { box-shadow: 0 0 0 3px rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.35); }
.sol-overlay.night .sq-note-area::placeholder { color: rgba(255,255,255,0.25); }
.sol-overlay.night .sol-overlay-body::-webkit-scrollbar-thumb { background: #333; }

/* Night tool button — slightly different style so it stands out */
.sol-tool-night { letter-spacing: 0.01em; }

/* Empty state */
.sol-empty-full {
    display: flex; flex-direction: column; align-items: center;
    gap: 12px; padding: 80px 20px; text-align: center;
}
.sol-empty-icon { font-size: 48px; }
.sol-empty-full p { color: var(--sol-muted); font-size: 15px; margin: 0; }
.sol-empty-full code {
    background: var(--sol-accent-l); padding: 4px 12px;
    border-radius: 6px; color: var(--sol-accent); font-size: 12px;
}
