:root {
    --bg-main: #f5f7fb;
    --bg-soft: #eef3ff;
    --bg-card: rgba(255, 255, 255, 0.88);
    --text-main: #172033;
    --text-soft: #5a6478;

    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --accent: #7c3aed;

    --border-soft: rgba(37, 99, 235, 0.12);
    --shadow-soft: 0 10px 30px rgba(37, 99, 235, 0.08);
    --shadow-card: 0 12px 35px rgba(15, 23, 42, 0.08);

    --radius-lg: 22px;
    --radius-md: 16px;
    --radius-sm: 12px;
}
*{
    margin:0;
    padding:0;
    box-sizing:border-box;
}

body {
    margin: 0;
    font-family: Arial, sans-serif;
    color: var(--text-main);
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.10), transparent 28%),
        radial-gradient(circle at top right, rgba(124, 58, 237, 0.10), transparent 24%),
        linear-gradient(180deg, #f8fbff 0%, #eef4ff 100%);
    min-height: 100vh;
}

/* ===============================
   Header
================================ */

h1 {
    text-align: center;
    font-size: 42px;
    margin: 28px 0 20px;
    color: var(--text-main);
    font-weight: 800;
    letter-spacing: -0.5px;
}

/* ===============================
   Navigation
================================ */

.nav {
    max-width: 1100px;
    margin: 0 auto 24px;
    padding: 18px;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 14px;

    background: rgba(20, 31, 54, 0.92);
    border-radius: 24px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
    backdrop-filter: blur(10px);
}

.nav button {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    padding: 14px 20px;
    border-radius: 16px;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    min-width: 150px;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.28);
    transition: all 0.25s ease;
}

.nav button:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    box-shadow: 0 14px 25px rgba(37, 99, 235, 0.35);
}

.nav button:hover{
    background:#0d6efd;
    color:white;
    transform:translateY(-3px);
}

/* ===============================
   Main Container
================================ */

#planner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 40px;
}

.card,
.section-card,
.day-box,
.question-card,
.dashboard-stat,
.dash-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin: 18px 0;
    box-shadow: var(--shadow-card);
    backdrop-filter: blur(8px);
}

.day-box h2,
.card h2,
.section-card h2 {
    margin-top: 0;
    font-size: 32px;
    color: var(--text-main);
}

.card p,
.section-card p,
.day-box p,
.question-card p,
.dashboard-stat p,
.dash-card p,
li {
    color: var(--text-main);
    line-height: 1.6;
}

/* ===============================
   Cards
================================ */

.day-box{
    background:white;
    border-radius:18px;
    padding:25px;
    margin-bottom:30px;
    box-shadow:0 8px 24px rgba(0,0,0,.08);
}

.day-box h2{
    margin-bottom:20px;
    border-bottom:3px solid #0d6efd;
    padding-bottom:12px;
    color:#0d6efd;
}

.day-box h3{
    margin:15px 0 10px;
}

.day-box p{
    margin:8px 0;
    line-height:1.6;
}

.day-box ul{
    margin-left:25px;
    margin-top:10px;
}

.day-box li{
    margin-bottom:8px;
}

/* ===============================
   Study Task Cards
================================ */

.task {
    background: #f7faff;
    border-radius: 18px;
    padding: 20px;
    margin: 16px 0;
    border-left: 6px solid #3b82f6;
    box-shadow: var(--shadow-soft);
}

.task.physics {
    border-left-color: #3b82f6;
}

.task.chemistry {
    border-left-color: #10b981;
}

.task.maths {
    border-left-color: #f59e0b;
}

.task h3 {
    margin-top: 0;
    font-size: 30px;
}

.task h3{
    margin-bottom:10px;
}

.physics{
    background:#eaf3ff;
    border-color:#2196F3;
}

.chemistry{
    background:#eafaf1;
    border-color:#28a745;
}

.maths{
    background:#fff9e8;
    border-color:#ffc107;
}

/* ===============================
   Buttons
================================ */

button,
.complete-btn {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    border: none;
    border-radius: 14px;
    padding: 12px 18px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.20);
}

button:hover,
.complete-btn:hover {
    transform: translateY(-1px);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}

/* ===============================
   Progress Bars
================================ */

.progress{
    width:100%;
    height:14px;
    background:#ddd;
    border-radius:20px;
    overflow:hidden;
    margin-top:15px;
}

.progress-fill{
    width:0%;
    height:100%;
    background:#28a745;
    transition:.4s;
}

/* ===============================
   MCQ / PYQ / Formula Layout
================================ */

#options{
    display:grid;
    grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
    gap:12px;
    margin:20px 0;
}

#options .complete-btn{
    width:100%;
    margin:0;
    background:#0d6efd;
}

#options .complete-btn:hover{
    background:#0b5ed7;
}

.day-box > .complete-btn{
    min-width:180px;
}

/* ===============================
   Dashboard Style
================================ */

.dashboard-stat{
    background:#f8f9fa;
    border-radius:14px;
    padding:18px;
    margin:12px 0;
    border-left:6px solid #0d6efd;
}

.dashboard-stat strong{
    color:#0d6efd;
}

/* ===============================
   Mobile Responsive
================================ */

@media(max-width:768px){

    h1{
        font-size:26px;
        padding:20px 10px;
    }

    .nav{
        flex-direction:column;
        align-items:center;
    }

    .nav button{
        width:95%;
    }

    .day-box{
        padding:18px;
    }

    .complete-btn{
        width:100%;
        margin:8px 0;
    }

    .day-box > .complete-btn{
        width:100%;
    }

    #options{
        grid-template-columns:1fr;
    }
}

/* ===============================
   MCQ QUIZ UI FIX
================================ */

#planner {
    max-width: 1000px;
    margin: 30px auto;
    padding: 10px;
}

#planner .card {
    background: white;
    padding: 25px;
    border-radius: 18px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
    margin-bottom: 20px;
}

#planner h2 {
    margin-bottom: 10px;
    color: #111827;
}

#planner h3 {
    margin: 18px 0;
    color: #111827;
}

#planner p {
    font-size: 16px;
    margin: 8px 0;
}

#planner button {
    display: block;
    width: 100%;
    max-width: 450px;
    margin: 10px 0;
    padding: 13px 18px;
    border: none;
    border-radius: 12px;
    background: #0d6efd;
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    text-align: left;
}

#planner button:hover {
    background: #084fc7;
}

#planner hr {
    margin: 18px 0;
}

#planner table {
    background: white;
    margin-top: 15px;
}

#planner th {
    background: #0d6efd;
    color: white;
}

#planner td,
#planner th {
    padding: 10px;
}

/* ===============================
   DASHBOARD PROGRESS BAR
================================ */

.progress-box {
    width: 100%;
    max-width: 600px;
    background: #e5e7eb;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 12px;
}

.progress-fill {
    background: #0d6efd;
    color: white;
    padding: 10px;
    text-align: center;
    font-weight: bold;
    min-width: 40px;
}
/* ===============================
   DASHBOARD FINAL POLISH
================================ */

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 18px;
    margin-top: 20px;
}

.dashboard-mini-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 18px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    border-left: 6px solid #0d6efd;
}

.dashboard-mini-card h3 {
    margin-bottom: 8px;
    color: #111827;
}

.dashboard-mini-card p {
    font-size: 18px;
    font-weight: bold;
    color: #0d6efd;
}

#planner table {
    width: 100%;
    overflow-x: auto;
}

#planner table th {
    background: #0d6efd;
    color: white;
}

#planner table td,
#planner table th {
    padding: 10px;
    text-align: left;
}

@media (max-width: 600px) {
    #planner table {
        font-size: 13px;
    }

    #planner .card {
        padding: 16px;
    }

    #planner button {
        font-size: 14px;
    }
}

/* ===============================
   PLANNER WEEK NAVIGATION CLEANUP
================================ */

#planner select {
    width: 100%;
    max-width: 350px;
    padding: 12px;
    margin-top: 8px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    font-size: 16px;
}

.week-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.week-nav button {
    width: auto !important;
    text-align: center !important;
}

.week-nav button:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}

/* ===============================
   PLANNER DATE BUTTONS
================================ */

.date-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 12px;
}

.date-nav button {
    width: auto !important;
    padding: 10px 14px !important;
    text-align: center !important;
    border-radius: 999px !important;
}

.active-date {
    background: #111827 !important;
    color: white !important;
}

/* ===============================
   APP FOOTER
================================ */

.app-footer {
    margin-top: 30px;
    text-align: center;
    padding: 22px 14px;
    background: rgba(20, 31, 54, 0.92);
    color: #e5ecff;
    border-radius: 22px 22px 0 0;
    font-size: 14px;
}

/* ===============================
   SPLASH SCREEN
================================ */

#splash-screen {
    position: fixed;
    inset: 0;
    background: #f3f4f6;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#splash-screen.hide-splash {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.6s ease, visibility 0.6s ease;
}

#splash-screen img {
    width: 280px;
    height: 280px;
    border-radius: 42px;
    margin-bottom: 24px;
}

#splash-screen h2 {
    margin: 8px 0;
    font-size: 28px;
    color: #111827;
}

#splash-screen p {
    margin: 0;
    color: #6b7280;
    font-size: 15px;
}

/* ===============================
   VERSION 2.0 READABLE DARK MODE
================================ */

body.dark-mode {
    background: #111827;
    color: #f9fafb;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4,
body.dark-mode p,
body.dark-mode li,
body.dark-mode label,
body.dark-mode strong,
body.dark-mode b {
    color: #f9fafb;
}

body.dark-mode .card,
body.dark-mode .section-card,
body.dark-mode .day-box,
body.dark-mode .question-card,
body.dark-mode .dashboard-stat,
body.dark-mode .dash-card {
    background: #f8fafc;
    color: #111827;
    border: 1px solid #cbd5e1;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
}

body.dark-mode .card h1,
body.dark-mode .card h2,
body.dark-mode .card h3,
body.dark-mode .card h4,
body.dark-mode .card p,
body.dark-mode .card li,
body.dark-mode .card strong,
body.dark-mode .card b,
body.dark-mode .section-card h1,
body.dark-mode .section-card h2,
body.dark-mode .section-card h3,
body.dark-mode .section-card h4,
body.dark-mode .section-card p,
body.dark-mode .section-card li,
body.dark-mode .section-card strong,
body.dark-mode .section-card b,
body.dark-mode .day-box h1,
body.dark-mode .day-box h2,
body.dark-mode .day-box h3,
body.dark-mode .day-box h4,
body.dark-mode .day-box p,
body.dark-mode .day-box li,
body.dark-mode .day-box strong,
body.dark-mode .day-box b,
body.dark-mode .question-card h1,
body.dark-mode .question-card h2,
body.dark-mode .question-card h3,
body.dark-mode .question-card h4,
body.dark-mode .question-card p,
body.dark-mode .question-card li,
body.dark-mode .question-card strong,
body.dark-mode .question-card b,
body.dark-mode .dashboard-stat h1,
body.dark-mode .dashboard-stat h2,
body.dark-mode .dashboard-stat h3,
body.dark-mode .dashboard-stat h4,
body.dark-mode .dashboard-stat p,
body.dark-mode .dashboard-stat li,
body.dark-mode .dashboard-stat strong,
body.dark-mode .dashboard-stat b,
body.dark-mode .dash-card h1,
body.dark-mode .dash-card h2,
body.dark-mode .dash-card h3,
body.dark-mode .dash-card h4,
body.dark-mode .dash-card p,
body.dark-mode .dash-card li,
body.dark-mode .dash-card strong,
body.dark-mode .dash-card b {
    color: #111827;
}

body.dark-mode button,
body.dark-mode .complete-btn {
    background: #2563eb;
    color: #ffffff;
    border: 1px solid #1d4ed8;
}

body.dark-mode button:hover,
body.dark-mode .complete-btn:hover {
    background: #1d4ed8;
}

body.dark-mode input,
body.dark-mode select {
    background: #ffffff;
    color: #111827;
    border: 1px solid #94a3b8;
}

body.dark-mode input::placeholder {
    color: #64748b;
}

body.dark-mode .nav {
    background: #1f2937;
}

body.dark-mode .app-footer {
    background: #1f2937;
    color: #f9fafb;
}

body.dark-mode table {
    color: #111827;
    background: #ffffff;
    border-color: #94a3b8;
}

body.dark-mode th,
body.dark-mode td {
    color: #111827;
    border-color: #94a3b8;
}

body.dark-mode code {
    background: #e5e7eb;
    color: #111827;
}

/* ===============================
   VERSION 2.0 MOBILE UI POLISH
================================ */

@media (max-width: 768px) {

    body {
        padding: 10px;
        font-size: 15px;
    }

    h1 {
        font-size: 24px;
        text-align: center;
        margin: 15px 0;
    }

    h2 {
        font-size: 21px;
    }

    h3 {
        font-size: 18px;
    }

    .nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        padding: 10px;
        position: sticky;
        top: 0;
        z-index: 100;
        border-radius: 12px;
    }

    .nav button {
        width: 100%;
        font-size: 14px;
        padding: 10px 8px;
        border-radius: 10px;
        margin: 0;
    }

    #planner {
        width: 100%;
        padding: 0;
    }

    .card,
    .section-card,
    .day-box,
    .question-card,
    .dashboard-stat,
    .dash-card {
        width: 100%;
        box-sizing: border-box;
        padding: 15px;
        margin: 12px 0;
        border-radius: 14px;
    }

    .dashboard-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .button-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    button,
    .complete-btn {
        width: 100%;
        margin: 6px 0;
        padding: 12px;
        font-size: 15px;
        border-radius: 10px;
    }

    input,
    select {
        width: 100% !important;
        box-sizing: border-box;
        font-size: 15px;
        padding: 12px;
    }

    table {
        display: block;
        width: 100%;
        overflow-x: auto;
        font-size: 14px;
    }

    footer,
    .app-footer {
        font-size: 13px;
        padding: 12px;
        text-align: center;
    }

    #splash-screen img {
        width: 110px;
        height: 110px;
    }

    #splash-screen h2 {
        font-size: 22px;
    }

    #splash-screen p {
        font-size: 14px;
    }
}

/* Extra small phones */
@media (max-width: 420px) {

    h1 {
        font-size: 21px;
    }

    .nav {
        grid-template-columns: 1fr;
    }

    .nav button {
        font-size: 14px;
        padding: 11px;
    }

    .card,
    .section-card,
    .day-box,
    .question-card {
        padding: 13px;
    }

    button,
    .complete-btn {
        font-size: 14px;
    }
}

/* ===============================
   VERSION 2.0 GRAPHICS PHASE 2
   Dashboard + Splash + Visual Cards
================================ */

/* Dashboard layout polish */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
    margin: 22px 0;
}

.dash-card {
    position: relative;
    overflow: hidden;
    text-align: center;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(238,243,255,0.95));
    border: 1px solid rgba(37, 99, 235, 0.14);
}

.dash-card::before {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -30px;
    top: -30px;
    background: rgba(37, 99, 235, 0.10);
    border-radius: 50%;
}

.dash-card h3 {
    font-size: 34px;
    margin: 0 0 8px;
    color: #2563eb;
}

.dash-card p {
    margin: 0;
    font-weight: 700;
    color: #334155;
}

/* Section headings */
.section-card h2,
.day-box h2,
.card h2 {
    border-bottom: 3px solid rgba(37, 99, 235, 0.20);
    padding-bottom: 12px;
}

/* Better subject/task visual style */
.task {
    position: relative;
    overflow: hidden;
}

.task::after {
    content: "";
    position: absolute;
    right: -35px;
    bottom: -35px;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    background: rgba(37, 99, 235, 0.08);
}

.task.physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.task.chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.task.maths {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

/* Question cards */
.question-card {
    border-left: 5px solid #2563eb;
}

.question-card:hover,
.card:hover,
.day-box:hover,
.section-card:hover {
    transform: translateY(-1px);
    transition: 0.25s ease;
}

/* Input/search polish */
input,
select {
    outline: none;
    transition: 0.2s ease;
}

input:focus,
select:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

/* Splash screen polish */
#splash-screen {
    background:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 30%),
        radial-gradient(circle at bottom right, rgba(124, 58, 237, 0.18), transparent 30%),
        linear-gradient(135deg, #f8fbff, #eef4ff);
}

#splash-screen img {
    border-radius: 28px;
    box-shadow: 0 18px 45px rgba(37, 99, 235, 0.25);
}

#splash-screen h2 {
    color: #172033;
    font-size: 34px;
    margin-bottom: 8px;
}

#splash-screen p {
    color: #5a6478;
    font-weight: 600;
}

/* Footer polish */
.app-footer p {
    margin: 5px 0;
}

/* Dark mode compatibility for graphics */
body.dark-mode .dash-card {
    background: linear-gradient(135deg, #f8fafc, #eaf1ff);
}

body.dark-mode .dash-card h3 {
    color: #2563eb;
}

body.dark-mode .task.physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

body.dark-mode .task.chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

body.dark-mode .task.maths {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

/* ===============================
   VERSION 2.0 GRAPHICS PHASE 3
   Premium Background + Aesthetic Details
================================ */

/* Soft decorative background layer */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.16), transparent 22%),
        radial-gradient(circle at 85% 16%, rgba(124, 58, 237, 0.14), transparent 24%),
        radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.10), transparent 26%);
}

/* Main title glow */
h1 {
    position: relative;
}

h1::after {
    content: "";
    display: block;
    width: 120px;
    height: 5px;
    margin: 12px auto 0;
    border-radius: 999px;
    background: linear-gradient(90deg, #2563eb, #7c3aed, #10b981);
}

/* Better card entrance feel */
.card,
.section-card,
.day-box,
.question-card,
.dashboard-stat,
.dash-card {
    animation: softFadeUp 0.35s ease both;
}

@keyframes softFadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Premium button glow */
button:active,
.complete-btn:active {
    transform: scale(0.98);
}

/* Better chapter/section cards */
.button-grid button {
    min-height: 52px;
}

/* Subject color labels */
.physics,
.task.physics {
    border-left-color: #2563eb;
}

.chemistry,
.task.chemistry {
    border-left-color: #10b981;
}

.maths,
.task.maths {
    border-left-color: #f59e0b;
}

/* Better list spacing */
ul {
    padding-left: 24px;
}

li {
    margin: 7px 0;
}

/* Better table polish */
table {
    border-radius: 12px;
    overflow: hidden;
    background: white;
}

th {
    background: #eaf1ff;
    color: #172033;
}

td {
    background: #ffffff;
}

/* Small badge style if used anywhere */
.badge,
.exam-badge {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 999px;
    background: #eaf1ff;
    color: #2563eb;
    font-weight: 700;
    font-size: 13px;
}

/* Dark mode background polish */
body.dark-mode::before {
    background:
        radial-gradient(circle at 12% 18%, rgba(59, 130, 246, 0.18), transparent 22%),
        radial-gradient(circle at 85% 16%, rgba(124, 58, 237, 0.16), transparent 24%),
        radial-gradient(circle at 50% 90%, rgba(16, 185, 129, 0.12), transparent 26%);
}

body.dark-mode h1::after {
    background: linear-gradient(90deg, #60a5fa, #a78bfa, #34d399);
}

/* Mobile: reduce animations/glow slightly */
@media (max-width: 768px) {
    h1::after {
        width: 90px;
        height: 4px;
    }

    .card,
    .section-card,
    .day-box,
    .question-card,
    .dashboard-stat,
    .dash-card {
        animation: none;
    }
}

/* ===============================
   VERSION 2.0 LOGO / BRAND POLISH
================================ */

.brand-header {
    max-width: 1100px;
    margin: 28px auto 22px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(37, 99, 235, 0.12);
    border-radius: 28px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
}

.brand-icon {
    width: 78px;
    height: 78px;
    min-width: 78px;
    border-radius: 24px;

    display: flex;
    align-items: center;
    justify-content: center;

    background:
        linear-gradient(135deg, #2563eb, #7c3aed);
    color: white;

    font-size: 28px;
    font-weight: 900;
    letter-spacing: 1px;

    box-shadow: 0 16px 35px rgba(37, 99, 235, 0.28);
}

.brand-header h1 {
    margin: 0;
    text-align: left;
    font-size: 40px;
    line-height: 1.1;
}

.brand-header h1::after {
    margin-left: 0;
}

.brand-header p {
    margin: 10px 0 0;
    color: #5a6478;
    font-weight: 700;
    font-size: 16px;
}

/* Splash brand polish */
#splash-screen h2 {
    text-align: center;
    max-width: 90%;
}

/* Dark mode brand polish */
body.dark-mode .brand-header {
    background: rgba(248, 250, 252, 0.95);
    border: 1px solid rgba(203, 213, 225, 0.8);
}

body.dark-mode .brand-header h1 {
    color: #111827;
}

body.dark-mode .brand-header p {
    color: #334155;
}

/* Mobile brand header */
@media (max-width: 768px) {
    .brand-header {
        margin: 14px 10px 16px;
        padding: 18px;
        flex-direction: column;
        text-align: center;
        border-radius: 22px;
    }

    .brand-header h1 {
        font-size: 28px;
        text-align: center;
    }

    .brand-header h1::after {
        margin-left: auto;
        margin-right: auto;
    }

    .brand-header p {
        font-size: 14px;
    }

    .brand-icon {
        width: 68px;
        height: 68px;
        min-width: 68px;
        font-size: 24px;
        border-radius: 20px;
    }
}

/* ===============================
   VERSION 2.0 FINAL CSS CLEANUP
================================ */

/* Prevent horizontal scroll */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Make all boxes behave properly */
* {
    box-sizing: border-box;
}

/* Better image safety */
img {
    max-width: 100%;
    height: auto;
}

/* Prevent long text from breaking layout */
.card,
.section-card,
.day-box,
.question-card,
.dashboard-stat,
.dash-card,
.task {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Better spacing between multiple buttons */
.card button,
.section-card button,
.day-box button,
.question-card button,
.dashboard-stat button {
    margin: 6px;
}

/* Keep button text readable */
button,
.complete-btn {
    line-height: 1.25;
    white-space: normal;
}

/* Cleaner disabled-looking prevention */
button:focus,
.complete-btn:focus,
input:focus,
select:focus {
    outline: none;
}

/* Make labels work like buttons */
label.complete-btn {
    text-align: center;
}

/* Better question readability */
.question-card p {
    margin: 8px 0;
}

/* Better dashboard number readability */
.dash-card h3 {
    word-break: break-word;
}

/* Make search/filter areas cleaner */
input,
select {
    max-width: 100%;
}

/* Fix footer width */
.app-footer {
    width: 100%;
    box-sizing: border-box;
}

/* Dark mode final text safety */
body.dark-mode .card,
body.dark-mode .section-card,
body.dark-mode .day-box,
body.dark-mode .question-card,
body.dark-mode .dashboard-stat,
body.dark-mode .dash-card,
body.dark-mode .task {
    color: #111827;
}

body.dark-mode .card *,
body.dark-mode .section-card *,
body.dark-mode .day-box *,
body.dark-mode .question-card *,
body.dark-mode .dashboard-stat *,
body.dark-mode .dash-card *,
body.dark-mode .task * {
    color: inherit;
}

/* But keep buttons white text in dark mode */
body.dark-mode button,
body.dark-mode button *,
body.dark-mode .complete-btn,
body.dark-mode .complete-btn * {
    color: #ffffff;
}

/* Keep inputs readable in dark mode */
body.dark-mode input,
body.dark-mode select {
    color: #111827;
}

/* Smooth app feel */
button,
.card,
.section-card,
.day-box,
.question-card,
.dashboard-stat,
.dash-card,
.task {
    transition: 0.25s ease;
}

/* ===============================
   VERSION 2.0 PHASE 6A
   AESTHETIC BACKGROUND THEMES
================================ */

body.bg-aurora {
    background:
        radial-gradient(circle at 10% 15%, rgba(34, 211, 238, 0.28), transparent 25%),
        radial-gradient(circle at 80% 10%, rgba(168, 85, 247, 0.30), transparent 28%),
        radial-gradient(circle at 60% 80%, rgba(34, 197, 94, 0.18), transparent 24%),
        linear-gradient(135deg, #07111f 0%, #16213e 45%, #2e1065 100%);
}

body.bg-floral {
    background:
        radial-gradient(circle at 12% 20%, rgba(244, 114, 182, 0.28), transparent 25%),
        radial-gradient(circle at 85% 18%, rgba(251, 207, 232, 0.45), transparent 26%),
        radial-gradient(circle at 55% 85%, rgba(249, 168, 212, 0.25), transparent 28%),
        linear-gradient(135deg, #fff1f8 0%, #ffe4f0 45%, #fdf2f8 100%);
}

body.bg-bow {
    background:
        radial-gradient(circle at 15% 15%, rgba(244, 114, 182, 0.30), transparent 22%),
        radial-gradient(circle at 80% 20%, rgba(236, 72, 153, 0.22), transparent 24%),
        radial-gradient(circle at 50% 85%, rgba(251, 207, 232, 0.40), transparent 26%),
        linear-gradient(135deg, #fff7fb 0%, #ffe4ef 50%, #fce7f3 100%);
}

body.bg-lavender {
    background:
        radial-gradient(circle at 10% 18%, rgba(168, 85, 247, 0.22), transparent 24%),
        radial-gradient(circle at 85% 20%, rgba(196, 181, 253, 0.34), transparent 26%),
        radial-gradient(circle at 50% 90%, rgba(139, 92, 246, 0.18), transparent 28%),
        linear-gradient(135deg, #f5f3ff 0%, #ede9fe 45%, #faf5ff 100%);
}

body.bg-starry {
    background:
        radial-gradient(circle at 20% 15%, rgba(96, 165, 250, 0.22), transparent 24%),
        radial-gradient(circle at 85% 20%, rgba(147, 51, 234, 0.26), transparent 26%),
        radial-gradient(circle at 45% 80%, rgba(14, 165, 233, 0.16), transparent 26%),
        linear-gradient(135deg, #020617 0%, #0f172a 48%, #1e1b4b 100%);
}

body.bg-sunset {
    background:
        radial-gradient(circle at 15% 18%, rgba(251, 146, 60, 0.30), transparent 24%),
        radial-gradient(circle at 80% 18%, rgba(244, 114, 182, 0.26), transparent 24%),
        radial-gradient(circle at 50% 85%, rgba(253, 186, 116, 0.30), transparent 28%),
        linear-gradient(135deg, #fff7ed 0%, #fed7aa 45%, #fbcfe8 100%);
}

/* Make cards look glassy on aesthetic backgrounds */
body.bg-aurora .card,
body.bg-aurora .section-card,
body.bg-aurora .day-box,
body.bg-aurora .question-card,
body.bg-aurora .dashboard-stat,
body.bg-aurora .dash-card,
body.bg-starry .card,
body.bg-starry .section-card,
body.bg-starry .day-box,
body.bg-starry .question-card,
body.bg-starry .dashboard-stat,
body.bg-starry .dash-card {
    background: rgba(248, 250, 252, 0.92);
    border: 1px solid rgba(203, 213, 225, 0.55);
}

body.bg-aurora .brand-header,
body.bg-starry .brand-header {
    background: rgba(248, 250, 252, 0.90);
}

/* Decorative sparkle layer */
body.bg-aurora::after,
body.bg-starry::after,
body.bg-lavender::after,
body.bg-floral::after,
body.bg-bow::after,
body.bg-sunset::after {
    content: "✦ ✧ ✦";
    position: fixed;
    top: 18px;
    right: 28px;
    z-index: -1;
    pointer-events: none;
    font-size: 42px;
    letter-spacing: 18px;
    opacity: 0.35;
    color: #ffffff;
}

body.bg-floral::after,
body.bg-bow::after {
    content: "🌸 🎀 🌸";
    opacity: 0.22;
}

body.bg-lavender::after {
    content: "✦ 💜 ✦";
    opacity: 0.22;
}

body.bg-sunset::after {
    content: "☀️ ✦ 🌸";
    opacity: 0.22;
}

/* Background setting buttons spacing */
.dashboard-stat button {
    margin: 6px;
}

/* ===============================
   VERSION 2.0 PHASE 6B
   IMAGE-STYLE BACKGROUND + GLASS UI
================================ */

/* Full app background image-like effect */
body.bg-aurora,
body.bg-starry {
    color: #f8fafc;
    background:
        linear-gradient(rgba(5, 10, 25, 0.35), rgba(5, 10, 25, 0.55)),
        radial-gradient(circle at 15% 25%, rgba(59, 130, 246, 0.38), transparent 26%),
        radial-gradient(circle at 70% 12%, rgba(168, 85, 247, 0.38), transparent 28%),
        radial-gradient(circle at 85% 58%, rgba(16, 185, 129, 0.22), transparent 24%),
        radial-gradient(circle at 30% 85%, rgba(236, 72, 153, 0.18), transparent 28%),
        linear-gradient(135deg, #020617 0%, #111827 42%, #312e81 100%);
}

body.bg-floral,
body.bg-bow {
    background:
        linear-gradient(rgba(255, 240, 248, 0.35), rgba(255, 240, 248, 0.55)),
        radial-gradient(circle at 12% 18%, rgba(244, 114, 182, 0.35), transparent 24%),
        radial-gradient(circle at 80% 12%, rgba(251, 207, 232, 0.55), transparent 28%),
        radial-gradient(circle at 85% 78%, rgba(236, 72, 153, 0.25), transparent 26%),
        radial-gradient(circle at 25% 85%, rgba(253, 164, 175, 0.25), transparent 24%),
        linear-gradient(135deg, #fff1f8 0%, #ffe4ef 45%, #fdf2f8 100%);
}

body.bg-lavender {
    background:
        linear-gradient(rgba(245, 243, 255, 0.30), rgba(245, 243, 255, 0.50)),
        radial-gradient(circle at 15% 20%, rgba(168, 85, 247, 0.35), transparent 26%),
        radial-gradient(circle at 82% 18%, rgba(196, 181, 253, 0.48), transparent 28%),
        radial-gradient(circle at 50% 85%, rgba(139, 92, 246, 0.25), transparent 28%),
        linear-gradient(135deg, #f5f3ff 0%, #ede9fe 45%, #faf5ff 100%);
}

body.bg-sunset {
    background:
        linear-gradient(rgba(255, 247, 237, 0.35), rgba(255, 247, 237, 0.55)),
        radial-gradient(circle at 12% 18%, rgba(251, 146, 60, 0.42), transparent 25%),
        radial-gradient(circle at 80% 14%, rgba(244, 114, 182, 0.34), transparent 26%),
        radial-gradient(circle at 55% 85%, rgba(253, 186, 116, 0.38), transparent 28%),
        linear-gradient(135deg, #fff7ed 0%, #fed7aa 45%, #fbcfe8 100%);
}

/* Glass panels for main areas */
.nav,
.brand-header,
.card,
.section-card,
.day-box,
.question-card,
.dashboard-stat,
.dash-card,
.task {
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

/* Dark aesthetic themes: transparent glass cards */
body.bg-aurora .card,
body.bg-aurora .section-card,
body.bg-aurora .day-box,
body.bg-aurora .question-card,
body.bg-aurora .dashboard-stat,
body.bg-aurora .dash-card,
body.bg-aurora .task,
body.bg-starry .card,
body.bg-starry .section-card,
body.bg-starry .day-box,
body.bg-starry .question-card,
body.bg-starry .dashboard-stat,
body.bg-starry .dash-card,
body.bg-starry .task {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: #f8fafc;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.30);
}

body.bg-aurora .card *,
body.bg-aurora .section-card *,
body.bg-aurora .day-box *,
body.bg-aurora .question-card *,
body.bg-aurora .dashboard-stat *,
body.bg-aurora .dash-card *,
body.bg-aurora .task *,
body.bg-starry .card *,
body.bg-starry .section-card *,
body.bg-starry .day-box *,
body.bg-starry .question-card *,
body.bg-starry .dashboard-stat *,
body.bg-starry .dash-card *,
body.bg-starry .task * {
    color: #f8fafc;
}

/* Keep buttons readable on dark glass */
body.bg-aurora button,
body.bg-starry button,
body.bg-aurora .complete-btn,
body.bg-starry .complete-btn {
    color: #ffffff;
}

/* Inputs on dark themes */
body.bg-aurora input,
body.bg-aurora select,
body.bg-starry input,
body.bg-starry select {
    background: rgba(255, 255, 255, 0.92);
    color: #111827;
}

/* Brand header on dark aesthetic */
body.bg-aurora .brand-header,
body.bg-starry .brand-header {
    background: rgba(15, 23, 42, 0.70);
    border: 1px solid rgba(255, 255, 255, 0.20);
}

body.bg-aurora .brand-header h1,
body.bg-aurora .brand-header p,
body.bg-starry .brand-header h1,
body.bg-starry .brand-header p {
    color: #ffffff;
}

/* Nav more like reference */
.nav {
    border: 1px solid rgba(255,255,255,0.12);
}

body.bg-aurora .nav,
body.bg-starry .nav {
    background: rgba(8, 13, 30, 0.72);
}

body.bg-floral .nav,
body.bg-bow .nav,
body.bg-lavender .nav,
body.bg-sunset .nav {
    background: rgba(30, 41, 59, 0.88);
}

/* Decorative corner flowers / sparkle feel */
body.bg-floral::before,
body.bg-bow::before,
body.bg-lavender::before,
body.bg-sunset::before {
    content: "🌸";
    position: fixed;
    left: -20px;
    bottom: -10px;
    font-size: 170px;
    opacity: 0.13;
    pointer-events: none;
    z-index: -1;
}

body.bg-bow::before {
    content: "🎀";
    opacity: 0.16;
}

body.bg-lavender::before {
    content: "💜";
    opacity: 0.12;
}

body.bg-aurora::before,
body.bg-starry::before {
    content: "✦";
    position: fixed;
    left: 40px;
    bottom: 20px;
    font-size: 140px;
    opacity: 0.10;
    pointer-events: none;
    z-index: -1;
}

/* Subject cards glow on dark aesthetic */
body.bg-aurora .task.physics,
body.bg-starry .task.physics {
    border-left-color: #60a5fa;
}

body.bg-aurora .task.chemistry,
body.bg-starry .task.chemistry {
    border-left-color: #34d399;
}

body.bg-aurora .task.maths,
body.bg-starry .task.maths {
    border-left-color: #f472b6;
}

/* Softer hover glow */
.card:hover,
.section-card:hover,
.day-box:hover,
.question-card:hover,
.dashboard-stat:hover,
.dash-card:hover,
.task:hover {
    box-shadow: 0 20px 55px rgba(37, 99, 235, 0.16);
}

/* ===============================
   VERSION 2.0 PHASE 6C
   SIDEBAR APP LAYOUT
================================ */

.app-shell {
    max-width: 1400px;
    margin: 0 auto 40px;
    padding: 0 18px;
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 24px;
    align-items: start;
}

.sidebar {
    position: sticky;
    top: 18px;
    min-height: calc(100vh - 36px);
    padding: 20px;
    border-radius: 30px;

    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.18);
}

.brand-icon.small {
    width: 54px;
    height: 54px;
    min-width: 54px;
    border-radius: 18px;
    font-size: 20px;
}

.sidebar-brand h2 {
    margin: 0;
    color: #ffffff;
    font-size: 24px;
}

.sidebar-brand p {
    margin: 4px 0 0;
    color: #cbd5e1;
    font-size: 13px;
    font-weight: 700;
}

.sidebar .nav {
    max-width: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;

    background: transparent;
    border: none;
    box-shadow: none;
    border-radius: 0;
}

.sidebar .nav button {
    width: 100%;
    min-width: 0;
    justify-content: flex-start;
    text-align: left;
    padding: 13px 16px;
    border-radius: 16px;
    font-size: 16px;

    background: rgba(255, 255, 255, 0.10);
    color: #ffffff;
    border: 1px solid rgba(255,255,255,0.12);
    box-shadow: none;
}

.sidebar .nav button:hover {
    background: rgba(37, 99, 235, 0.85);
    transform: translateX(4px);
}

.main-content {
    min-width: 0;
}

.main-content #planner {
    max-width: none;
    margin: 0;
    padding: 0 0 40px;
}

/* Make top brand align with sidebar layout */
.brand-header {
    max-width: 1400px;
}

/* Light background themes sidebar */
body.bg-floral .sidebar,
body.bg-bow .sidebar,
body.bg-lavender .sidebar,
body.bg-sunset .sidebar {
    background: rgba(30, 41, 59, 0.82);
}

/* Dark mode compatibility */
body.dark-mode .sidebar {
    background: rgba(15, 23, 42, 0.82);
}

/* Mobile: return to top navigation */
@media (max-width: 900px) {
    .app-shell {
        display: block;
        padding: 0 10px;
    }

    .sidebar {
        position: static;
        min-height: auto;
        margin-bottom: 18px;
        padding: 14px;
        border-radius: 22px;
    }

    .sidebar-brand {
        justify-content: center;
        text-align: left;
    }

    .sidebar .nav {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .sidebar .nav button {
        text-align: center;
        justify-content: center;
        font-size: 14px;
        padding: 11px 8px;
    }
}

@media (max-width: 420px) {
    .sidebar .nav {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   VERSION 2.0 PHASE 6D
   AESTHETIC DASHBOARD REDESIGN
================================ */

.v2-dashboard {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hero-dashboard-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 30px;
    border-radius: 30px;
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.92), rgba(124, 58, 237, 0.88)),
        radial-gradient(circle at top right, rgba(255,255,255,0.28), transparent 30%);
    color: white;
    box-shadow: 0 22px 60px rgba(37, 99, 235, 0.28);
    overflow: hidden;
    position: relative;
}

.hero-dashboard-card::after {
    content: "✦";
    position: absolute;
    right: 22px;
    top: 14px;
    font-size: 70px;
    opacity: 0.18;
}

.hero-dashboard-card h2 {
    margin: 0;
    font-size: 38px;
    color: white;
    border-bottom: none;
}

.hero-dashboard-card p {
    color: rgba(255,255,255,0.90);
    font-weight: 700;
}

.hero-label {
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 13px;
    opacity: 0.9;
}

.hero-progress-circle {
    width: 128px;
    height: 128px;
    min-width: 128px;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(255,255,255,0.22) 58%, transparent 60%),
        conic-gradient(#ffffff 0deg, rgba(255,255,255,0.35) 360deg);
    border: 2px solid rgba(255,255,255,0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero-progress-circle span {
    font-size: 34px;
    font-weight: 900;
    color: white;
}

.hero-progress-circle small {
    color: rgba(255,255,255,0.9);
    font-weight: 800;
}

.dashboard-main-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 18px;
}

.today-focus-card,
.streak-card,
.motivation-card,
.subject-progress-card,
.recent-activity-card {
    padding: 24px;
    border-radius: 26px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(37, 99, 235, 0.12);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(16px);
}

.today-focus-card h3,
.streak-card h3,
.motivation-card h3,
.subject-progress-card h3,
.recent-activity-card h3 {
    margin-top: 0;
    color: #172033;
}

.quick-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.quick-actions button {
    flex: 1;
    min-width: 130px;
}

.streak-card {
    text-align: center;
    background:
        linear-gradient(135deg, #fff7ed, #ffedd5);
}

.big-number {
    font-size: 56px;
    font-weight: 900;
    color: #f97316;
    line-height: 1;
}

.motivation-card {
    background:
        linear-gradient(135deg, #f5f3ff, #ede9fe);
}

.aesthetic-grid .dash-card {
    min-height: 135px;
}

.mini-stat-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 0;
    border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.mini-stat-row:last-child {
    border-bottom: none;
}

.mini-stat-row span {
    font-weight: 700;
    color: #334155;
}

.mini-stat-row strong {
    font-size: 20px;
    color: #2563eb;
}

.activity-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 14px;
    margin: 10px 0;
    border-radius: 18px;
    background: rgba(37, 99, 235, 0.06);
}

.activity-item span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #2563eb;
    color: white;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}

.activity-item strong {
    color: #172033;
}

.activity-item p {
    margin: 4px 0 0;
    color: #64748b;
}

/* Dark/glass background compatibility */
body.bg-aurora .today-focus-card,
body.bg-aurora .streak-card,
body.bg-aurora .motivation-card,
body.bg-aurora .subject-progress-card,
body.bg-aurora .recent-activity-card,
body.bg-starry .today-focus-card,
body.bg-starry .streak-card,
body.bg-starry .motivation-card,
body.bg-starry .subject-progress-card,
body.bg-starry .recent-activity-card {
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(255,255,255,0.18);
}

body.bg-aurora .today-focus-card *,
body.bg-aurora .streak-card *,
body.bg-aurora .motivation-card *,
body.bg-aurora .subject-progress-card *,
body.bg-aurora .recent-activity-card *,
body.bg-starry .today-focus-card *,
body.bg-starry .streak-card *,
body.bg-starry .motivation-card *,
body.bg-starry .subject-progress-card *,
body.bg-starry .recent-activity-card * {
    color: #f8fafc;
}

body.bg-aurora .activity-item,
body.bg-starry .activity-item {
    background: rgba(255,255,255,0.10);
}

/* Mobile dashboard */
@media (max-width: 900px) {
    .hero-dashboard-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
    }

    .hero-dashboard-card h2 {
        font-size: 28px;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .hero-progress-circle {
        width: 110px;
        height: 110px;
        min-width: 110px;
    }
}

/* ===============================
   VERSION 2.0 PHASE 6E
   BACKGROUND SELECTOR THUMBNAILS
================================ */

.background-theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 16px;
}

.background-theme-card {
    min-height: 130px;
    border-radius: 22px;
    padding: 18px;
    cursor: pointer;
    position: relative;
    overflow: hidden;

    display: flex;
    flex-direction: column;
    justify-content: flex-end;

    border: 1px solid rgba(255, 255, 255, 0.35);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.14);
    transition: 0.25s ease;
}

.background-theme-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 20px 42px rgba(15, 23, 42, 0.22);
}

.background-theme-card span {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 34px;
    opacity: 0.92;
}

.background-theme-card h4 {
    margin: 0;
    color: #ffffff;
    font-size: 18px;
    font-weight: 900;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.aurora-card {
    background:
        radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.75), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(168, 85, 247, 0.75), transparent 36%),
        linear-gradient(135deg, #020617, #312e81);
}

.floral-card {
    background:
        radial-gradient(circle at 20% 20%, rgba(244, 114, 182, 0.85), transparent 34%),
        radial-gradient(circle at 80% 80%, rgba(251, 207, 232, 0.95), transparent 36%),
        linear-gradient(135deg, #f9a8d4, #fff1f8);
}

.bow-card {
    background:
        radial-gradient(circle at 18% 22%, rgba(236, 72, 153, 0.70), transparent 32%),
        radial-gradient(circle at 78% 78%, rgba(251, 207, 232, 0.95), transparent 38%),
        linear-gradient(135deg, #fff7fb, #f472b6);
}

.lavender-card {
    background:
        radial-gradient(circle at 18% 22%, rgba(168, 85, 247, 0.75), transparent 34%),
        radial-gradient(circle at 80% 80%, rgba(196, 181, 253, 0.95), transparent 36%),
        linear-gradient(135deg, #4c1d95, #ede9fe);
}

.starry-card {
    background:
        radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.75), transparent 32%),
        radial-gradient(circle at 80% 20%, rgba(147, 51, 234, 0.75), transparent 34%),
        linear-gradient(135deg, #020617, #1e1b4b);
}

.sunset-card {
    background:
        radial-gradient(circle at 20% 20%, rgba(251, 146, 60, 0.90), transparent 34%),
        radial-gradient(circle at 80% 80%, rgba(244, 114, 182, 0.75), transparent 36%),
        linear-gradient(135deg, #fb923c, #fbcfe8);
}

/* Active background card indicator */
body.bg-aurora .aurora-card,
body.bg-floral .floral-card,
body.bg-bow .bow-card,
body.bg-lavender .lavender-card,
body.bg-starry .starry-card,
body.bg-sunset .sunset-card {
    outline: 4px solid #2563eb;
    outline-offset: 3px;
}

/* Dark/glass compatibility */
body.bg-aurora .background-theme-card *,
body.bg-starry .background-theme-card *,
body.dark-mode .background-theme-card * {
    color: #ffffff;
}

/* Mobile theme cards */
@media (max-width: 600px) {
    .background-theme-grid {
        grid-template-columns: 1fr 1fr;
        gap: 10px;
    }

    .background-theme-card {
        min-height: 110px;
        padding: 14px;
        border-radius: 18px;
    }

    .background-theme-card h4 {
        font-size: 14px;
    }

    .background-theme-card span {
        font-size: 28px;
    }
}

/* ===============================
   PHASE 6E READABILITY FIX
   Aurora + Starry themes
================================ */

/* Make all main text readable on dark aesthetic themes */
body.bg-aurora,
body.bg-starry {
    color: #f8fafc;
}

body.bg-aurora h1,
body.bg-aurora h2,
body.bg-aurora h3,
body.bg-aurora h4,
body.bg-aurora p,
body.bg-aurora li,
body.bg-aurora label,
body.bg-aurora span,
body.bg-aurora strong,
body.bg-aurora b,
body.bg-starry h1,
body.bg-starry h2,
body.bg-starry h3,
body.bg-starry h4,
body.bg-starry p,
body.bg-starry li,
body.bg-starry label,
body.bg-starry span,
body.bg-starry strong,
body.bg-starry b {
    color: #f8fafc;
}

/* Keep text inside light boxes dark if any light cards appear */
body.bg-aurora .background-theme-card h4,
body.bg-starry .background-theme-card h4 {
    color: #ffffff;
}

/* Fix mini dashboard rows */
body.bg-aurora .mini-stat-row span,
body.bg-aurora .mini-stat-row strong,
body.bg-starry .mini-stat-row span,
body.bg-starry .mini-stat-row strong {
    color: #f8fafc;
}

/* Fix activity text */
body.bg-aurora .activity-item strong,
body.bg-aurora .activity-item p,
body.bg-starry .activity-item strong,
body.bg-starry .activity-item p {
    color: #f8fafc;
}

/* Fix dashboard cards */
body.bg-aurora .dash-card h3,
body.bg-aurora .dash-card p,
body.bg-starry .dash-card h3,
body.bg-starry .dash-card p {
    color: #f8fafc;
}

/* Keep buttons readable */
body.bg-aurora button,
body.bg-aurora .complete-btn,
body.bg-starry button,
body.bg-starry .complete-btn {
    color: #ffffff !important;
}

/* Keep input/search text readable */
body.bg-aurora input,
body.bg-aurora select,
body.bg-starry input,
body.bg-starry select {
    background: #ffffff;
    color: #111827 !important;
}

body.bg-aurora input::placeholder,
body.bg-starry input::placeholder {
    color: #64748b;
}

/* Fix import label button */
body.bg-aurora label.complete-btn,
body.bg-starry label.complete-btn {
    color: #ffffff !important;
}

/* Make glass cards slightly lighter for readability */
body.bg-aurora .card,
body.bg-aurora .section-card,
body.bg-aurora .day-box,
body.bg-aurora .question-card,
body.bg-aurora .dashboard-stat,
body.bg-aurora .dash-card,
body.bg-aurora .task,
body.bg-starry .card,
body.bg-starry .section-card,
body.bg-starry .day-box,
body.bg-starry .question-card,
body.bg-starry .dashboard-stat,
body.bg-starry .dash-card,
body.bg-starry .task {
    background: rgba(15, 23, 42, 0.82);
}

/* ===============================
   FINAL READABILITY FIX
   Aurora + Starry = dark background + light cards
================================ */

body.bg-aurora .card,
body.bg-aurora .section-card,
body.bg-aurora .day-box,
body.bg-aurora .question-card,
body.bg-aurora .dashboard-stat,
body.bg-aurora .dash-card,
body.bg-aurora .task,
body.bg-aurora .today-focus-card,
body.bg-aurora .streak-card,
body.bg-aurora .motivation-card,
body.bg-aurora .subject-progress-card,
body.bg-aurora .recent-activity-card,
body.bg-starry .card,
body.bg-starry .section-card,
body.bg-starry .day-box,
body.bg-starry .question-card,
body.bg-starry .dashboard-stat,
body.bg-starry .dash-card,
body.bg-starry .task,
body.bg-starry .today-focus-card,
body.bg-starry .streak-card,
body.bg-starry .motivation-card,
body.bg-starry .subject-progress-card,
body.bg-starry .recent-activity-card {
    background: rgba(255, 255, 255, 0.94) !important;
    color: #111827 !important;
    border: 1px solid rgba(203, 213, 225, 0.75) !important;
}

body.bg-aurora .card *,
body.bg-aurora .section-card *,
body.bg-aurora .day-box *,
body.bg-aurora .question-card *,
body.bg-aurora .dashboard-stat *,
body.bg-aurora .dash-card *,
body.bg-aurora .task *,
body.bg-aurora .today-focus-card *,
body.bg-aurora .streak-card *,
body.bg-aurora .motivation-card *,
body.bg-aurora .subject-progress-card *,
body.bg-aurora .recent-activity-card *,
body.bg-starry .card *,
body.bg-starry .section-card *,
body.bg-starry .day-box *,
body.bg-starry .question-card *,
body.bg-starry .dashboard-stat *,
body.bg-starry .dash-card *,
body.bg-starry .task *,
body.bg-starry .today-focus-card *,
body.bg-starry .streak-card *,
body.bg-starry .motivation-card *,
body.bg-starry .subject-progress-card *,
body.bg-starry .recent-activity-card * {
    color: #111827 !important;
}

/* Keep hero card attractive and readable */
body.bg-aurora .hero-dashboard-card,
body.bg-starry .hero-dashboard-card {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.95), rgba(124, 58, 237, 0.92)) !important;
    color: #ffffff !important;
}

body.bg-aurora .hero-dashboard-card *,
body.bg-starry .hero-dashboard-card * {
    color: #ffffff !important;
}

/* Keep sidebar dark and readable */
body.bg-aurora .sidebar,
body.bg-starry .sidebar {
    background: rgba(8, 13, 30, 0.86) !important;
}

body.bg-aurora .sidebar *,
body.bg-starry .sidebar * {
    color: #ffffff !important;
}

/* Keep nav buttons readable */
body.bg-aurora button,
body.bg-aurora .complete-btn,
body.bg-starry button,
body.bg-starry .complete-btn {
    color: #ffffff !important;
}

/* Keep input text dark on white */
body.bg-aurora input,
body.bg-aurora select,
body.bg-starry input,
body.bg-starry select {
    background: #ffffff !important;
    color: #111827 !important;
}

body.bg-aurora input *,
body.bg-aurora select *,
body.bg-starry input *,
body.bg-starry select * {
    color: #111827 !important;
}

/* Keep theme cards text white */
body.bg-aurora .background-theme-card,
body.bg-starry .background-theme-card {
    color: #ffffff !important;
}

body.bg-aurora .background-theme-card *,
body.bg-starry .background-theme-card * {
    color: #ffffff !important;
}

/* ===============================
   VERSION 2.0 PHASE 6F
   FINAL RESPONSIVE + REFERENCE STYLE POLISH
================================ */

/* Main app spacing refinement */
.app-shell {
    padding-bottom: 30px;
}

/* Make sidebar feel more premium */
.sidebar {
    overflow: hidden;
}

.sidebar::after {
    content: "";
    position: absolute;
    width: 160px;
    height: 160px;
    right: -70px;
    bottom: -70px;
    border-radius: 50%;
    background: rgba(59, 130, 246, 0.14);
    pointer-events: none;
}

/* Sidebar nav icons/buttons final polish */
.sidebar .nav button {
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: 0.1px;
}

/* Main content cards should not stretch too harshly */
.main-content {
    max-width: 100%;
}

/* Dashboard final spacing */
.v2-dashboard {
    padding-bottom: 20px;
}

.hero-dashboard-card {
    min-height: 190px;
}

/* Make progress/stat cards more balanced */
.aesthetic-grid {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.aesthetic-grid .dash-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

/* Better card hierarchy */
.today-focus-card,
.streak-card,
.motivation-card,
.subject-progress-card,
.recent-activity-card {
    min-height: 170px;
}

/* Reference-style quick action buttons */
.quick-actions button {
    border-radius: 999px;
    padding: 12px 18px;
}

/* Better activity list */
.activity-item {
    border: 1px solid rgba(37, 99, 235, 0.10);
}

/* Settings background cards should fit beautifully */
.background-theme-grid {
    align-items: stretch;
}

.background-theme-card {
    isolation: isolate;
}

.background-theme-card::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(0, 0, 0, 0.02),
        rgba(0, 0, 0, 0.35)
    );
    z-index: -1;
}

/* Make selected background card obvious */
body.bg-aurora .aurora-card,
body.bg-floral .floral-card,
body.bg-bow .bow-card,
body.bg-lavender .lavender-card,
body.bg-starry .starry-card,
body.bg-sunset .sunset-card {
    outline: 4px solid #ffffff;
    box-shadow:
        0 0 0 3px #2563eb,
        0 20px 45px rgba(37, 99, 235, 0.35);
}

/* Planner/card readability final polish */
.card h2,
.section-card h2,
.day-box h2 {
    line-height: 1.2;
}

.question-card,
.card,
.day-box,
.section-card {
    line-height: 1.55;
}

/* Better MCQ/PYQ option lists */
.question-card ul,
.card ul {
    background: rgba(37, 99, 235, 0.04);
    border-radius: 14px;
    padding: 14px 14px 14px 34px;
}

/* Inputs on all themes */
input,
select {
    min-height: 46px;
}

/* Footer final polish */
.app-footer {
    margin-top: 40px;
}

/* Tablet layout */
@media (max-width: 1100px) {
    .app-shell {
        grid-template-columns: 240px 1fr;
        gap: 18px;
    }

    .sidebar {
        padding: 16px;
    }

    .sidebar .nav button {
        font-size: 15px;
        padding: 12px 14px;
    }

    .hero-dashboard-card h2 {
        font-size: 32px;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr 1fr;
    }

    .today-focus-card {
        grid-column: 1 / -1;
    }
}

/* Mobile layout final */
@media (max-width: 900px) {
    .brand-header {
        margin-top: 12px;
    }

    .sidebar {
        border-radius: 24px;
    }

    .sidebar-brand {
        padding-bottom: 12px;
        margin-bottom: 12px;
    }

    .sidebar .nav {
        grid-template-columns: 1fr 1fr;
    }

    .sidebar .nav button {
        transform: none !important;
        text-align: center;
        justify-content: center;
    }

    .hero-dashboard-card {
        min-height: auto;
    }

    .dashboard-main-grid {
        grid-template-columns: 1fr;
    }

    .today-focus-card,
    .streak-card,
    .motivation-card,
    .subject-progress-card,
    .recent-activity-card {
        min-height: auto;
    }

    .quick-actions {
        flex-direction: column;
    }

    .quick-actions button {
        width: 100%;
    }

    .aesthetic-grid {
        grid-template-columns: 1fr 1fr;
    }
}

/* Small phone final */
@media (max-width: 520px) {
    body {
        padding: 6px;
    }

    .brand-header {
        margin: 10px 4px 14px;
        padding: 16px 12px;
    }

    .brand-header h1 {
        font-size: 24px;
    }

    .brand-header p {
        font-size: 13px;
    }

    .app-shell {
        padding: 0 4px;
    }

    .sidebar {
        padding: 12px;
        border-radius: 20px;
    }

    .sidebar .nav {
        grid-template-columns: 1fr;
    }

    .sidebar .nav button {
        font-size: 14px;
        padding: 12px;
    }

    .hero-dashboard-card {
        padding: 20px 14px;
        border-radius: 22px;
    }

    .hero-dashboard-card h2 {
        font-size: 23px;
    }

    .hero-progress-circle {
        width: 96px;
        height: 96px;
        min-width: 96px;
    }

    .hero-progress-circle span {
        font-size: 26px;
    }

    .aesthetic-grid {
        grid-template-columns: 1fr;
    }

    .dashboard-theme-grid,
    .background-theme-grid {
        grid-template-columns: 1fr;
    }

    .card,
    .section-card,
    .day-box,
    .question-card,
    .dashboard-stat,
    .dash-card,
    .task,
    .today-focus-card,
    .streak-card,
    .motivation-card,
    .subject-progress-card,
    .recent-activity-card {
        padding: 14px;
        border-radius: 18px;
    }

    .big-number {
        font-size: 42px;
    }

    table {
        font-size: 13px;
    }
}

/* Very small screen */
@media (max-width: 360px) {
    .brand-icon {
        width: 58px;
        height: 58px;
        min-width: 58px;
        font-size: 20px;
    }

    .brand-header h1 {
        font-size: 21px;
    }

    button,
    .complete-btn {
        font-size: 13px;
    }
}

/* ===============================
   DESIGN VERSION 3
   AESTHETIC HOME DASHBOARD
================================ */

.v3-home {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.v3-hero {
    position: relative;
    overflow: hidden;
    min-height: 290px;
    padding: 34px;
    border-radius: 34px;

    display: grid;
    grid-template-columns: 1.8fr 1fr;
    gap: 24px;
    align-items: center;

    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.88), rgba(255, 240, 248, 0.78)),
        radial-gradient(circle at 10% 20%, rgba(244, 114, 182, 0.30), transparent 25%),
        radial-gradient(circle at 82% 18%, rgba(124, 58, 237, 0.25), transparent 28%);
    border: 1px solid rgba(255, 255, 255, 0.55);
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.14);
    backdrop-filter: blur(18px);
}

.v3-hero::after {
    content: "🌸";
    position: absolute;
    right: 22px;
    bottom: -22px;
    font-size: 130px;
    opacity: 0.16;
}

.v3-pill {
    display: inline-block;
    padding: 8px 14px;
    border-radius: 999px;
    background: rgba(236, 72, 153, 0.12);
    color: #be185d;
    font-weight: 900;
    margin-bottom: 12px;
}

.v3-hero h2 {
    margin: 0;
    font-size: 46px;
    color: #111827;
    line-height: 1.05;
    border-bottom: none;
}

.v3-hero p {
    font-size: 18px;
    color: #475569;
    font-weight: 700;
}

.v3-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 22px;
}

.v3-date-card {
    position: relative;
    z-index: 1;
    padding: 26px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    text-align: center;
}

.v3-date-card span {
    font-size: 44px;
}

.v3-date-card h3 {
    font-size: 24px;
    color: #111827;
    margin: 12px 0 8px;
}

.v3-date-card p {
    color: #64748b;
}

.v3-stats-grid,
.v3-subject-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 18px;
}

.v3-stat-card,
.v3-subject-card,
.v3-mission-card,
.v3-motivation-card {
    position: relative;
    overflow: hidden;
    padding: 24px;
    border-radius: 28px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.58);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(16px);
}

.v3-stat-card span,
.v3-subject-card span {
    font-size: 34px;
}

.v3-stat-card h3 {
    margin: 10px 0 4px;
    font-size: 34px;
    color: #2563eb;
}

.v3-stat-card p,
.v3-subject-card p {
    color: #475569;
    font-weight: 700;
}

.v3-main-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    gap: 20px;
}

.v3-mission-card h3,
.v3-motivation-card h3,
.v3-subject-card h3 {
    margin-top: 0;
    color: #111827;
}

.v3-mission-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 16px;
    margin: 12px 0;
    border-radius: 20px;
    background: rgba(37, 99, 235, 0.06);
}

.v3-mission-item span {
    font-size: 30px;
}

.v3-mission-item h4 {
    margin: 0;
    color: #111827;
}

.v3-mission-item p {
    margin: 4px 0 0;
    color: #64748b;
    font-weight: 700;
}

.v3-mission-item.physics {
    background: #eff6ff;
}

.v3-mission-item.chemistry {
    background: #ecfdf5;
}

.v3-mission-item.maths {
    background: #fffbeb;
}

.v3-motivation-card {
    background:
        linear-gradient(135deg, rgba(255, 241, 248, 0.96), rgba(237, 233, 254, 0.92));
}

.v3-motivation-card p {
    font-size: 18px;
    color: #475569;
    font-weight: 800;
    line-height: 1.6;
}

.v3-subject-card.physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.v3-subject-card.chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.v3-subject-card.maths {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.v3-subject-card button {
    margin-top: 12px;
}

/* Dark/aesthetic background readable support */
body.bg-aurora .v3-hero,
body.bg-starry .v3-hero,
body.bg-aurora .v3-stat-card,
body.bg-starry .v3-stat-card,
body.bg-aurora .v3-subject-card,
body.bg-starry .v3-subject-card,
body.bg-aurora .v3-mission-card,
body.bg-starry .v3-mission-card,
body.bg-aurora .v3-motivation-card,
body.bg-starry .v3-motivation-card,
body.bg-aurora .v3-date-card,
body.bg-starry .v3-date-card {
    background: rgba(255, 255, 255, 0.94) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-hero *,
body.bg-starry .v3-hero *,
body.bg-aurora .v3-stat-card *,
body.bg-starry .v3-stat-card *,
body.bg-aurora .v3-subject-card *,
body.bg-starry .v3-subject-card *,
body.bg-aurora .v3-mission-card *,
body.bg-starry .v3-mission-card *,
body.bg-aurora .v3-motivation-card *,
body.bg-starry .v3-motivation-card *,
body.bg-aurora .v3-date-card *,
body.bg-starry .v3-date-card * {
    color: inherit;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-hero {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 26px 18px;
    }

    .v3-hero h2 {
        font-size: 34px;
    }

    .v3-hero-actions {
        justify-content: center;
    }

    .v3-main-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .v3-hero h2 {
        font-size: 28px;
    }

    .v3-hero p,
    .v3-motivation-card p {
        font-size: 15px;
    }

    .v3-stats-grid,
    .v3-subject-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   DESIGN VERSION 3 PHASE 2
   MINI CALENDAR CARD
================================ */

.v3-calendar-card {
    position: relative;
    z-index: 1;
    padding: 22px;
    border-radius: 28px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(16px);
}

.v3-calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.v3-calendar-header h3 {
    margin: 0;
    color: #111827;
    font-size: 22px;
}

.v3-calendar-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-calendar-weekdays,
.v3-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
}

.v3-calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 900;
}

.v3-calendar-days span {
    height: 34px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(37, 99, 235, 0.06);
    color: #111827;
    font-weight: 800;
    font-size: 13px;
}

.v3-calendar-days .empty-day {
    background: transparent;
}

.v3-calendar-days .today-day {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #ffffff;
    box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

/* Aurora / Starry readability */
body.bg-aurora .v3-calendar-card,
body.bg-starry .v3-calendar-card {
    background: rgba(255, 255, 255, 0.94) !important;
}

body.bg-aurora .v3-calendar-card *,
body.bg-starry .v3-calendar-card * {
    color: #111827 !important;
}

body.bg-aurora .v3-calendar-days .today-day,
body.bg-starry .v3-calendar-days .today-day {
    color: #ffffff !important;
}

/* Mobile calendar */
@media (max-width: 520px) {
    .v3-calendar-card {
        padding: 16px;
    }

    .v3-calendar-days span {
        height: 30px;
        font-size: 12px;
    }

    .v3-calendar-weekdays span {
        font-size: 10px;
    }
}

/* ===============================
   DESIGN VERSION 3
   CLICKABLE MINI CALENDAR
================================ */

.v3-calendar-header button {
    width: 42px;
    height: 42px;
    min-width: 42px;
    padding: 0;
    border-radius: 50%;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.v3-calendar-header > div {
    text-align: center;
}

/* ===============================
   DESIGN VERSION 3
   PREMIUM CLICKABLE CALENDAR
================================ */

.v3-calendar-card {
    position: relative;
    z-index: 1;
    padding: 22px;
    border-radius: 30px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 22px 50px rgba(15, 23, 42, 0.12);
    backdrop-filter: blur(18px);
}

.v3-calendar-header {
    display: grid;
    grid-template-columns: 44px 1fr 44px;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.v3-calendar-title {
    text-align: center;
}

.v3-calendar-title h3 {
    margin: 0;
    font-size: 23px;
    color: #111827;
    font-weight: 900;
}

.v3-calendar-title p {
    margin: 2px 0 0;
    color: #64748b;
    font-weight: 800;
}

.v3-calendar-arrow {
    width: 44px;
    height: 44px;
    border-radius: 18px;
    border: none;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 30px;
    line-height: 1;
    color: #7c3aed;
    background: linear-gradient(135deg, #ffffff, #f5f3ff);
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.18);
    cursor: pointer;
}

.v3-calendar-arrow:hover {
    transform: translateY(-2px) scale(1.04);
    background: linear-gradient(135deg, #fdf2f8, #ede9fe);
}

.v3-calendar-weekdays,
.v3-calendar-days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 7px;
}

.v3-calendar-weekdays span {
    text-align: center;
    font-size: 12px;
    color: #64748b;
    font-weight: 900;
}

.v3-calendar-day,
.v3-calendar-days .empty-day {
    height: 35px;
    border-radius: 13px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    padding: 0;
    background: rgba(124, 58, 237, 0.07);
    color: #111827;
    font-weight: 900;
    font-size: 13px;
    cursor: pointer;
}

.v3-calendar-day:hover {
    background: linear-gradient(135deg, #fdf2f8, #ede9fe);
    color: #7c3aed;
    transform: translateY(-1px);
}

.v3-calendar-days .empty-day {
    background: transparent;
    cursor: default;
}

.v3-calendar-day.today-day {
    background: linear-gradient(135deg, #ec4899, #7c3aed);
    color: #ffffff;
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.35);
}

.v3-today-button {
    width: 100%;
    margin-top: 16px;
    border-radius: 18px;
    background: linear-gradient(135deg, #fdf2f8, #ede9fe);
    color: #7c3aed;
    box-shadow: 0 10px 24px rgba(124, 58, 237, 0.16);
}

/* Dark background readability */
body.bg-aurora .v3-calendar-card,
body.bg-starry .v3-calendar-card {
    background: rgba(255, 255, 255, 0.95) !important;
}

body.bg-aurora .v3-calendar-title h3,
body.bg-starry .v3-calendar-title h3,
body.bg-aurora .v3-calendar-title p,
body.bg-starry .v3-calendar-title p,
body.bg-aurora .v3-calendar-weekdays span,
body.bg-starry .v3-calendar-weekdays span {
    color: #111827 !important;
}

body.bg-aurora .v3-calendar-day.today-day,
body.bg-starry .v3-calendar-day.today-day {
    color: #ffffff !important;
}

@media (max-width: 520px) {
    .v3-calendar-card {
        padding: 16px;
    }

    .v3-calendar-header {
        grid-template-columns: 38px 1fr 38px;
    }

    .v3-calendar-arrow {
        width: 38px;
        height: 38px;
        border-radius: 15px;
        font-size: 26px;
    }

    .v3-calendar-day,
    .v3-calendar-days .empty-day {
        height: 31px;
        font-size: 12px;
    }
}

/* ===============================
   V3 CALENDAR WIDTH FIX
================================ */

.v3-calendar-card {
    max-width: 360px;
    width: 100%;
    justify-self: center;
}

.v3-hero {
    grid-template-columns: 1.6fr 0.8fr;
}

@media (max-width: 900px) {
    .v3-calendar-card {
        max-width: 340px;
        margin: 0 auto;
    }

    .v3-hero {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .v3-calendar-card {
        max-width: 100%;
    }
}

/* ===============================
   V3 COMPACT CALENDAR FIX
================================ */

.v3-hero {
    grid-template-columns: 1.7fr 0.7fr !important;
    gap: 18px !important;
}

.v3-calendar-card {
    max-width: 320px !important;
    width: 320px !important;
    padding: 18px !important;
    justify-self: center !important;
}

.v3-calendar-header {
    grid-template-columns: 36px 1fr 36px !important;
    gap: 8px !important;
    margin-bottom: 14px !important;
}

.v3-calendar-arrow {
    width: 36px !important;
    height: 36px !important;
    border-radius: 14px !important;
    font-size: 24px !important;
}

.v3-calendar-title h3 {
    font-size: 26px !important;
}

.v3-calendar-title p {
    font-size: 19px !important;
}

.v3-calendar-weekdays,
.v3-calendar-days {
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
}

.v3-calendar-weekdays span {
    font-size: 12px !important;
}

.v3-calendar-day,
.v3-calendar-days .empty-day {
    height: 31px !important;
    min-width: 0 !important;
    border-radius: 11px !important;
    font-size: 13px !important;
}

.v3-today-button {
    margin-top: 14px !important;
    padding: 13px 12px !important;
    border-radius: 15px !important;
    font-size: 15px !important;
}

/* Make hero buttons less stretched */
.v3-hero-actions {
    max-width: 460px;
}

.v3-hero-actions button {
    width: 100%;
    max-width: 460px;
}

/* Mobile safe */
@media (max-width: 900px) {
    .v3-hero {
        grid-template-columns: 1fr !important;
    }

    .v3-calendar-card {
        width: 100% !important;
        max-width: 330px !important;
        margin: 0 auto !important;
    }
}

@media (max-width: 420px) {
    .v3-calendar-card {
        max-width: 300px !important;
        padding: 14px !important;
    }

    .v3-calendar-day,
    .v3-calendar-days .empty-day {
        height: 28px !important;
        font-size: 12px !important;
    }

    .v3-calendar-weekdays,
    .v3-calendar-days {
        gap: 4px !important;
    }
}

/* ===============================
   DESIGN VERSION 3
   TODAY FOCUS CARD
================================ */

.v3-focus-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.92), rgba(255,241,248,0.82)),
        radial-gradient(circle at 12% 20%, rgba(236, 72, 153, 0.18), transparent 28%),
        radial-gradient(circle at 88% 80%, rgba(124, 58, 237, 0.16), transparent 26%);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-focus-card::after {
    content: "🎀";
    position: absolute;
    right: 24px;
    bottom: -18px;
    font-size: 110px;
    opacity: 0.12;
    transform: rotate(-12deg);
}

.v3-focus-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 20px;
}

.v3-focus-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-focus-header p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
}

.v3-focus-header button {
    white-space: nowrap;
    border-radius: 18px;
    padding: 14px 22px;
}

.v3-focus-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.v3-focus-subject {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.65);
    box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.v3-focus-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.8);
}

.v3-focus-subject h4 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 18px;
}

.v3-focus-subject p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

.v3-focus-subject.physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.v3-focus-subject.chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.v3-focus-subject.maths {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

/* Dark background readability */
body.bg-aurora .v3-focus-card,
body.bg-starry .v3-focus-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-focus-card *,
body.bg-starry .v3-focus-card * {
    color: inherit;
}

body.bg-aurora .v3-focus-subject *,
body.bg-starry .v3-focus-subject * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-focus-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .v3-focus-grid {
        grid-template-columns: 1fr;
    }

    .v3-focus-header button {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .v3-focus-card {
        padding: 20px;
    }

    .v3-focus-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   STUDY STREAK + PROGRESS PANEL
================================ */

.v3-progress-panel {
    display: grid;
    grid-template-columns: 1.4fr 0.7fr;
    gap: 20px;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.93), rgba(239,246,255,0.82)),
        radial-gradient(circle at 10% 20%, rgba(59, 130, 246, 0.18), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.15), transparent 26%);
    border: 1px solid rgba(255,255,255,0.66);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-progress-left h3 {
    margin: 12px 0 6px;
    font-size: 30px;
    color: #111827;
}

.v3-progress-left p {
    margin: 0 0 18px;
    color: #64748b;
    font-weight: 700;
}

.v3-mini-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.v3-mini-stats div {
    padding: 16px;
    border-radius: 22px;
    background: rgba(255,255,255,0.8);
    border: 1px solid rgba(255,255,255,0.65);
    text-align: center;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.v3-mini-stats strong {
    display: block;
    font-size: 26px;
    color: #2563eb;
}

.v3-mini-stats span {
    color: #64748b;
    font-weight: 800;
    font-size: 13px;
}

.v3-progress-ring-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 18px;
    padding: 20px;
    border-radius: 28px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 16px 36px rgba(15, 23, 42, 0.08);
}

.v3-progress-ring {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    background:
        conic-gradient(#ec4899 calc(var(--progress) * 1%), #e5e7eb 0);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 14px 35px rgba(236, 72, 153, 0.22);
}

.v3-progress-ring > div {
    width: 112px;
    height: 112px;
    border-radius: 50%;
    background: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.v3-progress-ring strong {
    font-size: 30px;
    color: #111827;
}

.v3-progress-ring span {
    color: #64748b;
    font-weight: 800;
    font-size: 13px;
}

.v3-progress-ring-card button {
    width: 100%;
    border-radius: 18px;
}

/* Dark background readability */
body.bg-aurora .v3-progress-panel,
body.bg-starry .v3-progress-panel {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-progress-panel *,
body.bg-starry .v3-progress-panel * {
    color: inherit;
}

body.bg-aurora .v3-mini-stats *,
body.bg-starry .v3-mini-stats *,
body.bg-aurora .v3-progress-ring-card *,
body.bg-starry .v3-progress-ring-card * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-progress-panel {
        grid-template-columns: 1fr;
    }

    .v3-mini-stats {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 520px) {
    .v3-progress-panel {
        padding: 20px;
    }

    .v3-progress-left h3 {
        font-size: 24px;
    }

    .v3-mini-stats {
        grid-template-columns: 1fr;
    }

    .v3-progress-ring {
        width: 130px;
        height: 130px;
    }

    .v3-progress-ring > div {
        width: 96px;
        height: 96px;
    }
}

/* ===============================
   DESIGN VERSION 3
   DAILY MOTIVATION QUOTE CARD
================================ */

.v3-quote-card {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 22px;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(253,242,248,0.96), rgba(237,233,254,0.9)),
        radial-gradient(circle at 92% 18%, rgba(236,72,153,0.18), transparent 26%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-quote-card::after {
    content: "✦";
    position: absolute;
    right: 28px;
    top: 16px;
    font-size: 62px;
    opacity: 0.14;
    color: #7c3aed;
}

.v3-quote-icon {
    width: 76px;
    height: 76px;
    min-width: 76px;
    border-radius: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    background: rgba(255,255,255,0.78);
    box-shadow: 0 14px 32px rgba(124, 58, 237, 0.13);
}

.v3-quote-card h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-quote-card p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
    line-height: 1.6;
}

/* Dark background readability */
body.bg-aurora .v3-quote-card,
body.bg-starry .v3-quote-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-quote-card *,
body.bg-starry .v3-quote-card * {
    color: inherit;
}

@media (max-width: 620px) {
    .v3-quote-card {
        flex-direction: column;
        align-items: flex-start;
        padding: 22px;
    }

    .v3-quote-card h3 {
        font-size: 23px;
    }

    .v3-quote-icon {
        width: 62px;
        height: 62px;
        min-width: 62px;
        font-size: 32px;
        border-radius: 22px;
    }
}

/* ===============================
   DESIGN VERSION 3
   QUICK ACCESS PANEL
================================ */

.v3-quick-panel {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(240,249,255,0.84)),
        radial-gradient(circle at 8% 18%, rgba(14,165,233,0.14), transparent 28%),
        radial-gradient(circle at 92% 78%, rgba(236,72,153,0.15), transparent 28%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-quick-panel::after {
    content: "✧";
    position: absolute;
    right: 28px;
    top: 18px;
    font-size: 72px;
    opacity: 0.13;
    color: #0ea5e9;
}

.v3-quick-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.v3-quick-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-quick-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-quick-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.v3-quick-card {
    text-align: left;
    padding: 20px;
    border-radius: 24px;
    border: 1px solid rgba(255,255,255,0.7);
    background: rgba(255,255,255,0.78);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: 0.25s ease;
}

.v3-quick-card:hover {
    transform: translateY(-4px);
    background: linear-gradient(135deg, #ffffff, #fdf2f8);
    box-shadow: 0 20px 42px rgba(124, 58, 237, 0.14);
}

.v3-quick-card span {
    display: inline-flex;
    width: 46px;
    height: 46px;
    border-radius: 16px;
    align-items: center;
    justify-content: center;
    font-size: 25px;
    background: rgba(255,255,255,0.86);
    margin-bottom: 14px;
}

.v3-quick-card h4 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.v3-quick-card p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

/* Dark background readability */
body.bg-aurora .v3-quick-panel,
body.bg-starry .v3-quick-panel {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-quick-panel *,
body.bg-starry .v3-quick-panel * {
    color: inherit;
}

body.bg-aurora .v3-quick-card *,
body.bg-starry .v3-quick-card * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-quick-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .v3-quick-panel {
        padding: 20px;
    }

    .v3-quick-grid {
        grid-template-columns: 1fr;
    }

    .v3-quick-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   STUDY SNAPSHOT CARD
================================ */

.v3-snapshot-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(255,251,235,0.86)),
        radial-gradient(circle at 10% 20%, rgba(245,158,11,0.16), transparent 28%),
        radial-gradient(circle at 90% 80%, rgba(236,72,153,0.14), transparent 26%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-snapshot-card::after {
    content: "✦";
    position: absolute;
    right: 26px;
    top: 16px;
    font-size: 70px;
    color: #f59e0b;
    opacity: 0.12;
}

.v3-snapshot-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.v3-snapshot-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-snapshot-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-snapshot-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.v3-snapshot-item {
    display: flex;
    gap: 14px;
    align-items: center;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.v3-snapshot-item span {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.86);
}

.v3-snapshot-item h4 {
    margin: 0;
    color: #111827;
    font-size: 25px;
}

.v3-snapshot-item p {
    margin: 2px 0 0;
    color: #64748b;
    font-weight: 800;
    font-size: 13px;
}

/* Dark background readability */
body.bg-aurora .v3-snapshot-card,
body.bg-starry .v3-snapshot-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-snapshot-card *,
body.bg-starry .v3-snapshot-card * {
    color: inherit;
}

body.bg-aurora .v3-snapshot-item *,
body.bg-starry .v3-snapshot-item * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 1000px) {
    .v3-snapshot-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .v3-snapshot-card {
        padding: 20px;
    }

    .v3-snapshot-grid {
        grid-template-columns: 1fr;
    }

    .v3-snapshot-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   GOAL TRACKER CARD
================================ */

.v3-goal-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(236,253,245,0.86)),
        radial-gradient(circle at 10% 18%, rgba(16,185,129,0.16), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(124,58,237,0.14), transparent 26%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-goal-card::after {
    content: "🎯";
    position: absolute;
    right: 24px;
    bottom: -20px;
    font-size: 110px;
    opacity: 0.10;
}

.v3-goal-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
    margin-bottom: 20px;
}

.v3-goal-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-goal-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-goal-header button {
    white-space: nowrap;
    border-radius: 18px;
    padding: 14px 22px;
}

.v3-goal-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.v3-goal-item {
    display: flex;
    gap: 14px;
    align-items: flex-start;
    padding: 18px;
    border-radius: 24px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.v3-goal-item span {
    width: 46px;
    height: 46px;
    min-width: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: rgba(255,255,255,0.86);
}

.v3-goal-item h4 {
    margin: 0 0 6px;
    color: #111827;
    font-size: 18px;
}

.v3-goal-item p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

/* Dark background readability */
body.bg-aurora .v3-goal-card,
body.bg-starry .v3-goal-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-goal-card *,
body.bg-starry .v3-goal-card * {
    color: inherit;
}

body.bg-aurora .v3-goal-item *,
body.bg-starry .v3-goal-item * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-goal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .v3-goal-header button {
        width: 100%;
    }

    .v3-goal-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .v3-goal-card {
        padding: 20px;
    }

    .v3-goal-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   STUDY MODE CARDS
================================ */

.v3-mode-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(245,243,255,0.88)),
        radial-gradient(circle at 8% 20%, rgba(124,58,237,0.16), transparent 28%),
        radial-gradient(circle at 92% 78%, rgba(236,72,153,0.14), transparent 28%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-mode-card::after {
    content: "✦";
    position: absolute;
    right: 26px;
    top: 18px;
    font-size: 72px;
    color: #7c3aed;
    opacity: 0.12;
}

.v3-mode-header {
    position: relative;
    z-index: 1;
    margin-bottom: 20px;
}

.v3-mode-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-mode-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-mode-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.v3-mode-item {
    text-align: left;
    padding: 20px;
    border-radius: 26px;
    border: 1px solid rgba(255,255,255,0.72);
    background: rgba(255,255,255,0.78);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    cursor: pointer;
    transition: 0.25s ease;
}

.v3-mode-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 42px rgba(124, 58, 237, 0.14);
}

.v3-mode-item span {
    display: inline-flex;
    width: 48px;
    height: 48px;
    border-radius: 18px;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    background: rgba(255,255,255,0.9);
    margin-bottom: 14px;
}

.v3-mode-item h4 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 18px;
}

.v3-mode-item p {
    margin: 0;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

.v3-mode-item.learn {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.v3-mode-item.practice {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.v3-mode-item.revision {
    background: linear-gradient(135deg, #fdf2f8, #ffffff);
}

.v3-mode-item.exam {
    background: linear-gradient(135deg, #fff7ed, #ffffff);
}

/* Dark background readability */
body.bg-aurora .v3-mode-card,
body.bg-starry .v3-mode-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-mode-card *,
body.bg-starry .v3-mode-card * {
    color: inherit;
}

body.bg-aurora .v3-mode-item *,
body.bg-starry .v3-mode-item * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 1100px) {
    .v3-mode-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 560px) {
    .v3-mode-card {
        padding: 20px;
    }

    .v3-mode-grid {
        grid-template-columns: 1fr;
    }

    .v3-mode-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   UPCOMING PLANNER PREVIEW
================================ */

.v3-upcoming-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(240,253,250,0.88)),
        radial-gradient(circle at 8% 18%, rgba(20,184,166,0.15), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.13), transparent 28%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-upcoming-card::after {
    content: "☁";
    position: absolute;
    right: 26px;
    top: 14px;
    font-size: 82px;
    color: #14b8a6;
    opacity: 0.12;
}

.v3-upcoming-header {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 20px;
}

.v3-upcoming-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-upcoming-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-upcoming-header button {
    white-space: nowrap;
    border-radius: 18px;
    padding: 14px 22px;
}

.v3-upcoming-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.v3-upcoming-item {
    padding: 20px;
    border-radius: 26px;
    background: rgba(255,255,255,0.78);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
}

.v3-upcoming-item > span {
    display: inline-block;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(20,184,166,0.12);
    color: #0f766e;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 12px;
}

.v3-upcoming-item h4 {
    margin: 0 0 8px;
    color: #111827;
    font-size: 19px;
}

.v3-upcoming-item p {
    margin: 0 0 16px;
    color: #64748b;
    font-weight: 700;
    line-height: 1.45;
}

.v3-upcoming-item button {
    width: 100%;
    border-radius: 16px;
}

/* Dark background readability */
body.bg-aurora .v3-upcoming-card,
body.bg-starry .v3-upcoming-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-upcoming-card *,
body.bg-starry .v3-upcoming-card * {
    color: inherit;
}

body.bg-aurora .v3-upcoming-item *,
body.bg-starry .v3-upcoming-item * {
    color: #111827 !important;
}

/* Mobile */
@media (max-width: 900px) {
    .v3-upcoming-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .v3-upcoming-header button {
        width: 100%;
    }

    .v3-upcoming-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 520px) {
    .v3-upcoming-card {
        padding: 20px;
    }

    .v3-upcoming-header h3 {
        font-size: 23px;
    }
}

/* ===============================
   DESIGN VERSION 3
   STUDY JOURNAL CARD
================================ */

.v3-journal-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(255,247,237,0.88)),
        radial-gradient(circle at 8% 18%, rgba(251,146,60,0.16), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.13), transparent 28%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
}

.v3-journal-card::after {
    content: "✎";
    position: absolute;
    right: 28px;
    top: 16px;
    font-size: 76px;
    color: #fb923c;
    opacity: 0.13;
}

.v3-journal-header {
    position: relative;
    z-index: 1;
    margin-bottom: 18px;
}

.v3-journal-header h3 {
    margin: 12px 0 6px;
    color: #111827;
    font-size: 28px;
}

.v3-journal-header p {
    margin: 0;
    color: #64748b;
    font-weight: 800;
}

.v3-journal-textarea {
    position: relative;
    z-index: 1;
    width: 100%;
    min-height: 130px;
    resize: vertical;
    border: 1px solid rgba(255,255,255,0.75);
    outline: none;
    border-radius: 24px;
    padding: 18px;
    font-size: 16px;
    font-family: inherit;
    color: #111827;
    background: rgba(255,255,255,0.82);
    box-shadow: inset 0 2px 10px rgba(15,23,42,0.05);
}

.v3-journal-textarea:focus {
    border-color: rgba(236,72,153,0.45);
    box-shadow: 0 0 0 4px rgba(236,72,153,0.10);
}

.v3-journal-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.v3-journal-actions button {
    border-radius: 18px;
}

/* Dark background readability */
body.bg-aurora .v3-journal-card,
body.bg-starry .v3-journal-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .v3-journal-card *,
body.bg-starry .v3-journal-card * {
    color: inherit;
}

body.bg-aurora .v3-journal-textarea,
body.bg-starry .v3-journal-textarea {
    color: #111827 !important;
    background: rgba(255,255,255,0.9) !important;
}

@media (max-width: 520px) {
    .v3-journal-card {
        padding: 20px;
    }

    .v3-journal-header h3 {
        font-size: 23px;
    }

    .v3-journal-actions {
        flex-direction: column;
    }

    .v3-journal-actions button {
        width: 100%;
    }
}

/* ===============================
   DESIGN VERSION 3
   FINAL HOME PAGE POLISH
================================ */

.v3-home {
    max-width: 1180px;
    margin: 0 auto;
    padding-bottom: 30px;
}

/* Softer section spacing */
.v3-home > section {
    animation: v3FadeUp 0.45s ease both;
}

@keyframes v3FadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Make major headings consistent */
.v3-home h3 {
    letter-spacing: -0.02em;
}

/* Make all V3 buttons feel premium */
.v3-home button {
    transition: 0.25s ease;
}

.v3-home button:hover {
    transform: translateY(-2px);
}

/* Add soft divider feeling between big sections */
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card {
    margin-top: 2px;
}

/* Slightly reduce repeated lower old cards */
.v3-main-grid {
    margin-top: 4px;
}

.v3-mission-card,
.v3-motivation-card,
.v3-subject-card {
    border-radius: 30px;
}

/* Make old mission section blend better */
.v3-main-grid {
    grid-template-columns: 1.2fr 0.8fr;
}

/* Subject cards feel lighter */
.v3-subject-grid {
    margin-bottom: 10px;
}

.v3-subject-card {
    min-height: 190px;
}

/* Better desktop hero balance */
.v3-hero {
    min-height: 330px;
}

/* Keep calendar compact */
.v3-calendar-card {
    align-self: center;
}

/* Sidebar polish */
.sidebar {
    box-shadow: 18px 0 45px rgba(15, 23, 42, 0.08);
}

.sidebar .nav button {
    border-radius: 18px;
}

/* Main content breathing space */
.main-content {
    padding-top: 28px;
}

/* Mobile polish */
@media (max-width: 900px) {
    .v3-home {
        max-width: 100%;
    }

    .v3-main-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding-top: 18px;
    }
}

@media (max-width: 520px) {
    .v3-home {
        gap: 18px;
    }

    .v3-hero,
    .v3-focus-card,
    .v3-progress-panel,
    .v3-quote-card,
    .v3-quick-panel,
    .v3-snapshot-card,
    .v3-goal-card,
    .v3-mode-card,
    .v3-upcoming-card,
    .v3-journal-card {
        border-radius: 26px;
    }
}

/* ===============================
   DESIGN VERSION 3
   MOBILE + SIDEBAR POLISH
================================ */

/* Better app shell spacing */
.app-shell {
    min-height: calc(100vh - 120px);
}

/* Sidebar smoother look */
.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-brand {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.14);
    margin-bottom: 16px;
}

.sidebar .nav {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar .nav button {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
    font-size: 15px;
    padding: 13px 15px;
}

/* Home cards better on medium screens */
@media (max-width: 1100px) {
    .v3-home {
        max-width: 100%;
    }

    .v3-hero {
        grid-template-columns: 1fr !important;
    }

    .v3-calendar-card {
        max-width: 350px !important;
        width: 100% !important;
        margin: 0 auto !important;
    }

    .v3-progress-panel {
        grid-template-columns: 1fr !important;
    }
}

/* Tablet layout */
@media (max-width: 900px) {
    .app-shell {
        display: block;
    }

    .sidebar {
        position: relative;
        width: 100%;
        height: auto;
        border-radius: 0 0 28px 28px;
        padding: 18px;
    }

    .sidebar-brand {
        display: flex;
        align-items: center;
        justify-content: center;
        text-align: left;
        gap: 12px;
    }

    .sidebar .nav {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 10px;
    }

    .sidebar .nav button {
        justify-content: center;
        text-align: center;
        font-size: 14px;
        padding: 12px 10px;
        border-radius: 16px;
    }

    .main-content {
        padding: 18px;
    }

    .v3-hero {
        min-height: auto !important;
        padding: 26px 20px !important;
    }

    .v3-hero h2 {
        font-size: 34px !important;
    }

    .v3-hero p {
        font-size: 16px !important;
    }

    .v3-hero-actions {
        max-width: 100%;
    }

    .v3-hero-actions button {
        max-width: none;
    }
}

/* Phone layout */
@media (max-width: 620px) {
    body {
        overflow-x: hidden;
    }

    header,
    .brand-header {
        padding: 18px 14px;
    }

    .brand-header {
        align-items: center;
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 10px;
    }

    .brand-header h1 {
        font-size: 24px;
        line-height: 1.15;
    }

    .brand-header p {
        font-size: 13px;
    }

    .brand-icon {
        width: 58px;
        height: 58px;
        font-size: 18px;
    }

    .sidebar {
        padding: 14px;
        border-radius: 0 0 24px 24px;
    }

    .sidebar-brand {
        margin-bottom: 12px;
        padding-bottom: 12px;
    }

    .sidebar-brand h2 {
        font-size: 18px;
    }

    .sidebar-brand p {
        font-size: 12px;
    }

    .sidebar .nav {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }

    .sidebar .nav button {
        font-size: 13px;
        padding: 11px 8px;
        min-height: 44px;
    }

    .main-content {
        padding: 14px;
    }

    .v3-home {
        gap: 16px;
        padding-bottom: 18px;
    }

    .v3-hero {
        padding: 22px 16px !important;
        border-radius: 26px !important;
    }

    .v3-hero h2 {
        font-size: 28px !important;
    }

    .v3-pill {
        font-size: 12px;
        padding: 7px 11px;
    }

    .v3-hero-actions {
        display: grid;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .v3-hero-actions button {
        width: 100%;
    }

    .v3-calendar-card {
        max-width: 100% !important;
        width: 100% !important;
        padding: 15px !important;
    }

    .v3-calendar-header {
        grid-template-columns: 38px 1fr 38px !important;
    }

    .v3-calendar-title h3 {
        font-size: 22px !important;
    }

    .v3-calendar-title p {
        font-size: 15px !important;
    }

    .v3-calendar-day,
    .v3-calendar-days .empty-day {
        height: 30px !important;
        font-size: 12px !important;
    }

    .v3-calendar-weekdays,
    .v3-calendar-days {
        gap: 5px !important;
    }

    .v3-focus-card,
    .v3-progress-panel,
    .v3-quote-card,
    .v3-quick-panel,
    .v3-snapshot-card,
    .v3-goal-card,
    .v3-mode-card,
    .v3-upcoming-card,
    .v3-journal-card {
        padding: 18px !important;
        border-radius: 24px !important;
    }

    .v3-focus-header h3,
    .v3-progress-left h3,
    .v3-quote-card h3,
    .v3-quick-header h3,
    .v3-snapshot-header h3,
    .v3-goal-header h3,
    .v3-mode-header h3,
    .v3-upcoming-header h3,
    .v3-journal-header h3 {
        font-size: 22px !important;
    }

    .v3-mini-stats,
    .v3-snapshot-grid,
    .v3-goal-grid,
    .v3-mode-grid,
    .v3-upcoming-grid,
    .v3-quick-grid,
    .v3-focus-grid {
        grid-template-columns: 1fr !important;
    }

    .v3-progress-ring {
        width: 125px !important;
        height: 125px !important;
    }

    .v3-progress-ring > div {
        width: 92px !important;
        height: 92px !important;
    }

    .v3-progress-ring strong {
        font-size: 24px !important;
    }

    .v3-journal-textarea {
        min-height: 120px;
        font-size: 14px;
    }

    .app-footer {
        padding: 18px 12px;
        font-size: 12px;
    }
}

/* Extra small phones */
@media (max-width: 380px) {
    .sidebar .nav {
        grid-template-columns: 1fr;
    }

    .v3-calendar-day,
    .v3-calendar-days .empty-day {
        height: 28px !important;
    }

    .v3-calendar-weekdays,
    .v3-calendar-days {
        gap: 4px !important;
    }

    .brand-header h1 {
        font-size: 21px;
    }
}

/* ===============================
   DESIGN VERSION 3
   PLANNER PAGE PREMIUM DESIGN
================================ */

/* Main planner section cards */
.section-card {
    position: relative;
    overflow: hidden;
    padding: 28px;
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(245,243,255,0.86)),
        radial-gradient(circle at 10% 18%, rgba(124,58,237,0.13), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.12), transparent 28%);
    border: 1px solid rgba(255,255,255,0.68);
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10);
    backdrop-filter: blur(18px);
    animation: v3FadeUp 0.45s ease both;
}

.section-card h2 {
    font-size: 30px;
    color: #111827;
    margin-top: 0;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}

.section-card > p {
    color: #64748b;
    font-weight: 800;
    line-height: 1.6;
}

/* Month / week / chapter buttons inside planner */
.section-card button {
    border-radius: 18px;
    padding: 13px 18px;
    font-weight: 900;
    transition: 0.25s ease;
}

.section-card button:hover {
    transform: translateY(-2px);
}

/* Planner task cards */
.task {
    position: relative;
    overflow: hidden;
    padding: 22px;
    margin: 16px 0;
    border-radius: 26px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.7);
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.task::after {
    content: "";
    position: absolute;
    right: -30px;
    bottom: -30px;
    width: 95px;
    height: 95px;
    border-radius: 50%;
    opacity: 0.16;
}

.task h3 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #111827;
    font-size: 22px;
}

.task p {
    color: #475569;
    font-weight: 700;
    line-height: 1.55;
}

.task strong {
    color: #111827;
}

/* Subject-specific planner cards */
.task.physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.task.physics::after {
    background: #2563eb;
}

.task.chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff);
}

.task.chemistry::after {
    background: #10b981;
}

.task.maths {
    background: linear-gradient(135deg, #fffbeb, #ffffff);
}

.task.maths::after {
    background: #f59e0b;
}

/* Inputs / checkboxes if planner uses them */
.task input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #7c3aed;
    cursor: pointer;
}

/* Planner completed feeling */
.task.completed,
.task.done {
    opacity: 0.78;
    border-color: rgba(16,185,129,0.35);
}

.task.completed h3,
.task.done h3 {
    text-decoration: line-through;
}

/* Back buttons and navigation buttons */
.back-btn,
button.back-btn {
    background: linear-gradient(135deg, #f8fafc, #ede9fe);
    color: #7c3aed;
    box-shadow: 0 10px 24px rgba(124,58,237,0.14);
}

/* Dark background readability */
body.bg-aurora .section-card,
body.bg-starry .section-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora .section-card *,
body.bg-starry .section-card * {
    color: inherit;
}

body.bg-aurora .task *,
body.bg-starry .task * {
    color: #111827 !important;
}

/* Mobile planner design */
@media (max-width: 620px) {
    .section-card {
        padding: 20px !important;
        border-radius: 26px !important;
    }

    .section-card h2 {
        font-size: 24px;
    }

    .task {
        padding: 18px;
        border-radius: 22px;
    }

    .task h3 {
        font-size: 19px;
    }

    .section-card button {
        width: 100%;
        margin: 5px 0;
    }
}

/* ===============================
   V3 PLANNER STRONG VISUAL UPGRADE
   Works even if planner class names are different
================================ */

/* Planner page container spacing */
#planner {
    max-width: 1180px;
    margin: 0 auto;
}

/* Any direct planner content block */
#planner > div {
    animation: v3FadeUp 0.45s ease both;
}

/* Main planner cards / boxes */
#planner .card,
#planner .month-card,
#planner .week-card,
#planner .day-card,
#planner .planner-card,
#planner .chapter-card,
#planner .section-card {
    position: relative;
    overflow: hidden;
    padding: 26px !important;
    margin-bottom: 20px !important;
    border-radius: 32px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(245,243,255,0.88)),
        radial-gradient(circle at 10% 18%, rgba(124,58,237,0.14), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.12), transparent 28%) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 22px 55px rgba(15, 23, 42, 0.10) !important;
    backdrop-filter: blur(18px);
}

/* If planner uses plain divs inside section card */
#planner .section-card > div,
#planner .card > div {
    border-radius: 24px;
}

/* Planner headings */
#planner h2 {
    font-size: 32px !important;
    color: #111827 !important;
    letter-spacing: -0.03em;
    margin-bottom: 12px !important;
}

#planner h3 {
    font-size: 23px !important;
    color: #111827 !important;
    letter-spacing: -0.02em;
}

#planner p {
    color: #475569 !important;
    font-weight: 700;
    line-height: 1.6;
}

/* All planner buttons */
#planner button {
    border-radius: 18px !important;
    padding: 13px 18px !important;
    font-weight: 900 !important;
    border: none !important;
    background: linear-gradient(135deg, #ec4899, #7c3aed) !important;
    color: white !important;
    box-shadow: 0 12px 28px rgba(124, 58, 237, 0.22) !important;
    transition: 0.25s ease !important;
}

#planner button:hover {
    transform: translateY(-2px);
    box-shadow: 0 18px 38px rgba(124, 58, 237, 0.30) !important;
}

/* Month / week button grid feeling */
#planner .month-grid,
#planner .week-grid,
#planner .button-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
}

/* Task-like blocks */
#planner .task,
#planner .subject-task,
#planner .planner-task,
#planner .day-task,
#planner .study-task,
#planner li {
    position: relative;
    overflow: hidden;
    padding: 20px !important;
    margin: 14px 0 !important;
    border-radius: 26px !important;
    background: rgba(255,255,255,0.84) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08) !important;
}

/* Subject color cards */
#planner .physics,
#planner [class*="physics"] {
    background: linear-gradient(135deg, #eff6ff, #ffffff) !important;
    border-color: rgba(37,99,235,0.18) !important;
}

#planner .chemistry,
#planner [class*="chemistry"] {
    background: linear-gradient(135deg, #ecfdf5, #ffffff) !important;
    border-color: rgba(16,185,129,0.18) !important;
}

#planner .maths,
#planner .math,
#planner [class*="maths"],
#planner [class*="math"] {
    background: linear-gradient(135deg, #fffbeb, #ffffff) !important;
    border-color: rgba(245,158,11,0.20) !important;
}

/* Completed tasks */
#planner input[type="checkbox"] {
    width: 19px;
    height: 19px;
    accent-color: #7c3aed;
    cursor: pointer;
}

#planner label {
    font-weight: 800;
    color: #111827 !important;
}

/* Lists look like cards */
#planner ul,
#planner ol {
    padding-left: 0 !important;
    list-style: none !important;
}

/* Back / secondary buttons */
#planner button:nth-last-child(1),
#planner .back-btn {
    background: linear-gradient(135deg, #f8fafc, #ede9fe) !important;
    color: #7c3aed !important;
}

/* Dark background readability */
body.bg-aurora #planner .card,
body.bg-starry #planner .card,
body.bg-aurora #planner .section-card,
body.bg-starry #planner .section-card,
body.bg-aurora #planner .month-card,
body.bg-starry #planner .month-card,
body.bg-aurora #planner .week-card,
body.bg-starry #planner .week-card,
body.bg-aurora #planner .day-card,
body.bg-starry #planner .day-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora #planner *,
body.bg-starry #planner * {
    color: inherit;
}

/* Mobile planner */
@media (max-width: 620px) {
    #planner .card,
    #planner .section-card,
    #planner .month-card,
    #planner .week-card,
    #planner .day-card {
        padding: 20px !important;
        border-radius: 26px !important;
    }

    #planner h2 {
        font-size: 25px !important;
    }

    #planner h3 {
        font-size: 20px !important;
    }

    #planner button {
        width: 100%;
        margin: 5px 0;
    }
}

/* ===============================
   V3 PLANNER COMPACT FIX
   Less scrolling, cleaner spacing
================================ */

/* Reduce big planner card spacing */
#planner .card,
#planner .month-card,
#planner .week-card,
#planner .day-card,
#planner .planner-card,
#planner .chapter-card,
#planner .section-card {
    padding: 20px !important;
    margin-bottom: 14px !important;
    border-radius: 24px !important;
}

/* Smaller planner headings */
#planner h2 {
    font-size: 26px !important;
    margin-bottom: 8px !important;
}

#planner h3 {
    font-size: 20px !important;
    margin: 8px 0 !important;
}

#planner p {
    margin: 6px 0 !important;
    line-height: 1.45 !important;
}

/* Compact buttons */
#planner button {
    padding: 10px 14px !important;
    border-radius: 14px !important;
    font-size: 14px !important;
    margin: 4px !important;
}

/* Month/week buttons should appear in neat grid */
#planner .section-card > button,
#planner .card > button {
    min-width: 150px;
}

/* Compact task cards */
#planner .task,
#planner .subject-task,
#planner .planner-task,
#planner .day-task,
#planner .study-task,
#planner li {
    padding: 14px 16px !important;
    margin: 10px 0 !important;
    border-radius: 20px !important;
}

/* Make subject tasks tighter */
#planner .task h3,
#planner .subject-task h3,
#planner .planner-task h3,
#planner .day-task h3,
#planner .study-task h3 {
    font-size: 18px !important;
    margin-bottom: 6px !important;
}

/* Put small repeated details closer together */
#planner .task p,
#planner .subject-task p,
#planner .planner-task p,
#planner .day-task p,
#planner .study-task p {
    font-size: 14px !important;
    margin: 4px 0 !important;
}

/* If planner has many buttons, wrap them neatly */
#planner .section-card,
#planner .card {
    display: block;
}

#planner .section-card button,
#planner .card button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Make month/week selection less tall */
#planner .month-grid,
#planner .week-grid,
#planner .button-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)) !important;
    gap: 10px !important;
}

/* Reduce empty vertical gaps */
#planner br {
    display: none;
}

/* Compact checkbox rows */
#planner label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 4px 0 !important;
    font-size: 14px !important;
}

#planner input[type="checkbox"] {
    width: 16px;
    height: 16px;
}

/* Mobile compact planner */
@media (max-width: 620px) {
    #planner .card,
    #planner .section-card,
    #planner .month-card,
    #planner .week-card,
    #planner .day-card {
        padding: 16px !important;
        border-radius: 22px !important;
    }

    #planner h2 {
        font-size: 22px !important;
    }

    #planner h3 {
        font-size: 18px !important;
    }

    #planner button {
        width: auto !important;
        min-width: 120px;
        padding: 10px 12px !important;
    }

    #planner .task,
    #planner .subject-task,
    #planner .planner-task,
    #planner .day-task,
    #planner .study-task,
    #planner li {
        padding: 13px !important;
    }
}

/* ===============================
   V3 DAILY TASK CHECKBOX
================================ */

.daily-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.daily-task-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 900;
    color: #7c3aed !important;
    cursor: pointer;
    white-space: nowrap;
}

.daily-task-check input {
    width: 17px;
    height: 17px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.daily-task-done {
    opacity: 0.75;
    border-color: rgba(16,185,129,0.45) !important;
}

.daily-task-done h3 {
    text-decoration: line-through;
}

.daily-task-done::before {
    content: "✅ Completed";
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(16,185,129,0.12);
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

/* Mobile */
@media (max-width: 520px) {
    .daily-task-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .daily-task-check {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================
   V3 DAILY TASK CHECKBOX
================================ */

.daily-task-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.daily-task-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.75);
    font-size: 13px;
    font-weight: 900;
    color: #7c3aed !important;
    cursor: pointer;
    white-space: nowrap;
}

.daily-task-check input {
    width: 17px;
    height: 17px;
    accent-color: #7c3aed;
    cursor: pointer;
}

.daily-task-done {
    opacity: 0.75;
    border-color: rgba(16,185,129,0.45) !important;
}

.daily-task-done h3 {
    text-decoration: line-through;
}

.daily-task-done::before {
    content: "✅ Completed";
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(16,185,129,0.12);
    color: #047857;
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 520px) {
    .daily-task-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .daily-task-check {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================
   FULL PLANNER TASK CHECKBOX
================================ */

.planner-task-check-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.planner-task-check {
    display: inline-flex !important;
    align-items: center;
    gap: 8px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(255,255,255,0.86);
    border: 1px solid rgba(255,255,255,0.75);
    color: #7c3aed !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    cursor: pointer;
    white-space: nowrap;
}

.planner-task-check input {
    width: 17px !important;
    height: 17px !important;
    accent-color: #7c3aed;
    cursor: pointer;
}

.planner-task-done {
    opacity: 0.72;
    border-color: rgba(16,185,129,0.45) !important;
}

.planner-task-done h3,
.planner-task-done h4 {
    text-decoration: line-through;
}

.planner-task-done::before {
    content: "✅ Completed";
    display: inline-block;
    margin-bottom: 10px;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(16,185,129,0.12);
    color: #047857 !important;
    font-size: 12px;
    font-weight: 900;
}

@media (max-width: 520px) {
    .planner-task-check-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .planner-task-check {
        width: 100%;
        justify-content: center;
    }
}

/* ===============================
   V3 TOPIC LEVEL CHECKBOXES
================================ */

.topic-check-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 12px;
}

.topic-check-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;

    padding: 12px 14px;
    border-radius: 16px;

    background: rgba(255,255,255,0.82);
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);

    color: #111827 !important;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
}

.topic-check-row input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 2px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.topic-check-row span {
    color: #475569 !important;
}

.topic-check-row strong {
    color: #111827 !important;
}

.topic-check-row.topic-done {
    opacity: 0.7;
    background: rgba(16,185,129,0.10);
    border-color: rgba(16,185,129,0.35);
}

.topic-check-row.topic-done span {
    text-decoration: line-through;
}

.topic-check-row.topic-done::after {
    content: "Done";
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(16,185,129,0.14);
    color: #047857;
    font-size: 11px;
    font-weight: 900;
}

/* Mobile */
@media (max-width: 520px) {
    .topic-check-row {
        padding: 11px 12px;
        font-size: 14px;
    }

    .topic-check-row.topic-done::after {
        display: none;
    }
}

/* ===============================
   TOPIC LEVEL CHECKBOXES
================================ */

.topic-check-row {
    display: flex !important;
    align-items: flex-start;
    gap: 12px;

    padding: 11px 13px !important;
    margin: 8px 0 !important;
    border-radius: 16px;

    background: rgba(255,255,255,0.86) !important;
    border: 1px solid rgba(255,255,255,0.75);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.05);

    color: #111827 !important;
    font-weight: 700;
    line-height: 1.45;
    cursor: pointer;
}

.topic-check-row input {
    width: 18px !important;
    height: 18px !important;
    margin-top: 3px;
    accent-color: #7c3aed;
    cursor: pointer;
    flex-shrink: 0;
}

.topic-check-row span {
    color: #475569 !important;
}

.topic-check-row strong {
    color: #111827 !important;
}

.topic-check-row.topic-done {
    opacity: 0.72;
    background: rgba(16,185,129,0.11) !important;
    border-color: rgba(16,185,129,0.35) !important;
}

.topic-check-row.topic-done span {
    text-decoration: line-through;
}

.topic-check-row.topic-done::after {
    content: "Done";
    margin-left: auto;
    padding: 4px 8px;
    border-radius: 999px;
    background: rgba(16,185,129,0.14);
    color: #047857 !important;
    font-size: 11px;
    font-weight: 900;
}

@media (max-width: 520px) {
    .topic-check-row {
        font-size: 14px;
        padding: 10px 12px !important;
    }

    .topic-check-row.topic-done::after {
        display: none;
    }
}

/* ===============================
   DESIGN VERSION 3
   MCQ PAGE PREMIUM DESIGN
================================ */

/* MCQ main cards */
#planner .mcq-card,
#planner .question-card,
#planner .quiz-card,
#planner .mcq-question-card,
#planner .result-card {
    position: relative;
    overflow: hidden;
    padding: 22px !important;
    margin: 14px 0 !important;
    border-radius: 26px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(240,253,250,0.86)),
        radial-gradient(circle at 10% 18%, rgba(20,184,166,0.14), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(124,58,237,0.12), transparent 28%) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09) !important;
    backdrop-filter: blur(18px);
}

/* MCQ headings */
#planner .mcq-card h3,
#planner .question-card h3,
#planner .quiz-card h3,
#planner .mcq-question-card h3,
#planner .result-card h3 {
    color: #111827 !important;
    font-size: 22px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

/* MCQ question text */
#planner .question-card p,
#planner .mcq-card p,
#planner .quiz-card p {
    color: #475569 !important;
    font-weight: 700;
    line-height: 1.55;
}

/* MCQ option buttons */
#planner .option-btn,
#planner .answer-option,
#planner .mcq-option,
#planner .quiz-option {
    width: 100%;
    display: block;
    text-align: left;
    margin: 9px 0 !important;
    padding: 13px 16px !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,0.88) !important;
    color: #111827 !important;
    border: 1px solid rgba(255,255,255,0.75) !important;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06) !important;
    font-weight: 800 !important;
}

#planner .option-btn:hover,
#planner .answer-option:hover,
#planner .mcq-option:hover,
#planner .quiz-option:hover {
    background: linear-gradient(135deg, #ecfeff, #f5f3ff) !important;
    color: #7c3aed !important;
    transform: translateY(-2px);
}

/* Correct / wrong option styles */
#planner .correct,
#planner .correct-answer {
    background: rgba(16,185,129,0.16) !important;
    border-color: rgba(16,185,129,0.45) !important;
    color: #047857 !important;
}

#planner .wrong,
#planner .wrong-answer {
    background: rgba(239,68,68,0.14) !important;
    border-color: rgba(239,68,68,0.42) !important;
    color: #b91c1c !important;
}

/* MCQ selection buttons/cards */
#planner .exam-card,
#planner .subject-card,
#planner .chapter-card {
    padding: 18px !important;
    margin: 10px 0 !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,0.86) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08) !important;
}

/* Timer / score badges */
#planner .timer,
#planner .score,
#planner .mcq-timer,
#planner .mcq-score {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 13px;
    border-radius: 999px;
    background: rgba(124,58,237,0.10);
    color: #7c3aed !important;
    font-weight: 900;
    margin: 6px 6px 10px 0;
}

/* Search and select boxes in MCQ */
#planner input[type="text"],
#planner select {
    border-radius: 18px !important;
    padding: 13px 15px !important;
    border: 1px solid rgba(255,255,255,0.75) !important;
    background: rgba(255,255,255,0.88) !important;
    color: #111827 !important;
    font-weight: 700;
    outline: none;
    box-shadow: 0 8px 20px rgba(15,23,42,0.05);
}

#planner input[type="text"]:focus,
#planner select:focus {
    border-color: rgba(124,58,237,0.45) !important;
    box-shadow: 0 0 0 4px rgba(124,58,237,0.10);
}

/* Result screen */
#planner .result-card,
#planner .mcq-result {
    text-align: center;
}

#planner .result-card h2,
#planner .mcq-result h2 {
    font-size: 34px !important;
    color: #111827 !important;
}

/* Dark background readability */
body.bg-aurora #planner .mcq-card,
body.bg-starry #planner .mcq-card,
body.bg-aurora #planner .question-card,
body.bg-starry #planner .question-card,
body.bg-aurora #planner .quiz-card,
body.bg-starry #planner .quiz-card,
body.bg-aurora #planner .result-card,
body.bg-starry #planner .result-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora #planner .mcq-card *,
body.bg-starry #planner .mcq-card *,
body.bg-aurora #planner .question-card *,
body.bg-starry #planner .question-card *,
body.bg-aurora #planner .quiz-card *,
body.bg-starry #planner .quiz-card *,
body.bg-aurora #planner .result-card *,
body.bg-starry #planner .result-card * {
    color: inherit;
}

/* Mobile MCQ */
@media (max-width: 620px) {
    #planner .mcq-card,
    #planner .question-card,
    #planner .quiz-card,
    #planner .mcq-question-card,
    #planner .result-card {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    #planner .option-btn,
    #planner .answer-option,
    #planner .mcq-option,
    #planner .quiz-option {
        padding: 12px 13px !important;
        font-size: 14px !important;
    }
}

/* ===============================
   DESIGN VERSION 3
   PYQ PAGE PREMIUM DESIGN
================================ */

/* PYQ main cards */
#planner .pyq-card,
#planner .pyq-question-card,
#planner .pyq-result-card,
#planner .pyq-answer-card {
    position: relative;
    overflow: hidden;
    padding: 22px !important;
    margin: 14px 0 !important;
    border-radius: 26px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(253,242,248,0.86)),
        radial-gradient(circle at 10% 18%, rgba(236,72,153,0.14), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(124,58,237,0.12), transparent 28%) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09) !important;
    backdrop-filter: blur(18px);
}

/* PYQ headings */
#planner .pyq-card h3,
#planner .pyq-question-card h3,
#planner .pyq-answer-card h3,
#planner .question-card h3 {
    color: #111827 !important;
    font-size: 22px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

/* PYQ text */
#planner .pyq-card p,
#planner .pyq-question-card p,
#planner .pyq-answer-card p,
#planner .question-card p {
    color: #475569 !important;
    font-weight: 700;
    line-height: 1.55;
}

/* PYQ question cards */
#planner .question-card {
    border-radius: 26px !important;
    padding: 22px !important;
    margin: 14px 0 !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(245,243,255,0.86)) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.08) !important;
}

/* PYQ exam/subject/chapter buttons */
#planner .pyq-exam-card,
#planner .pyq-subject-card,
#planner .pyq-chapter-card,
#planner .exam-card,
#planner .subject-card,
#planner .chapter-card {
    padding: 18px !important;
    margin: 10px 0 !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,0.86) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08) !important;
}

/* PYQ buttons */
#planner .pyq-card button,
#planner .pyq-question-card button,
#planner .question-card button {
    border-radius: 16px !important;
    padding: 11px 15px !important;
    font-weight: 900 !important;
    margin: 5px !important;
}

/* Answer toggle / action buttons */
#planner button[onclick*="togglePYQAnswer"],
#planner button[onclick*="addBookmark"],
#planner button[onclick*="addWrongPYQ"],
#planner button[onclick*="markPYQProgress"] {
    background: linear-gradient(135deg, #fdf2f8, #ede9fe) !important;
    color: #7c3aed !important;
    box-shadow: 0 10px 24px rgba(124,58,237,0.14) !important;
}

/* PYQ answer box */
#planner [id^="pyq-answer"],
#planner .pyq-answer,
#planner .answer-box {
    padding: 16px !important;
    margin-top: 12px !important;
    border-radius: 20px !important;
    background: rgba(16,185,129,0.10) !important;
    border: 1px solid rgba(16,185,129,0.28) !important;
    color: #064e3b !important;
    font-weight: 800;
}

/* PYQ metadata badges */
#planner .pyq-badge,
#planner .exam-badge,
#planner .year-badge,
#planner .difficulty-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    margin: 4px 5px 8px 0;
    border-radius: 999px;
    background: rgba(124,58,237,0.10);
    color: #7c3aed !important;
    font-size: 12px;
    font-weight: 900;
}

/* Search/select area */
#planner input[type="search"],
#planner input[type="text"],
#planner select {
    border-radius: 18px !important;
    padding: 13px 15px !important;
    border: 1px solid rgba(255,255,255,0.75) !important;
    background: rgba(255,255,255,0.9) !important;
    color: #111827 !important;
    font-weight: 700;
    outline: none;
    box-shadow: 0 8px 20px rgba(15,23,42,0.05);
    margin: 6px 5px !important;
}

#planner input[type="search"]:focus,
#planner input[type="text"]:focus,
#planner select:focus {
    border-color: rgba(236,72,153,0.45) !important;
    box-shadow: 0 0 0 4px rgba(236,72,153,0.10);
}

/* PYQ page section look */
#planner .section-card h2 {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Dark background readability */
body.bg-aurora #planner .pyq-card,
body.bg-starry #planner .pyq-card,
body.bg-aurora #planner .pyq-question-card,
body.bg-starry #planner .pyq-question-card,
body.bg-aurora #planner .pyq-answer-card,
body.bg-starry #planner .pyq-answer-card,
body.bg-aurora #planner .question-card,
body.bg-starry #planner .question-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora #planner .pyq-card *,
body.bg-starry #planner .pyq-card *,
body.bg-aurora #planner .pyq-question-card *,
body.bg-starry #planner .pyq-question-card *,
body.bg-aurora #planner .question-card *,
body.bg-starry #planner .question-card * {
    color: inherit;
}

/* Mobile PYQ */
@media (max-width: 620px) {
    #planner .pyq-card,
    #planner .pyq-question-card,
    #planner .pyq-answer-card,
    #planner .question-card {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    #planner .pyq-card button,
    #planner .pyq-question-card button,
    #planner .question-card button {
        width: 100%;
        margin: 5px 0 !important;
    }

    #planner input[type="search"],
    #planner input[type="text"],
    #planner select {
        width: 100%;
        margin: 6px 0 !important;
    }
}

/* ===============================
   DESIGN VERSION 3
   SETTINGS PAGE PREMIUM DESIGN
================================ */

/* Settings main card */
#planner .settings-card,
#planner .settings-section,
#planner .theme-section,
#planner .backup-section,
#planner .reset-section {
    position: relative;
    overflow: hidden;
    padding: 24px !important;
    margin: 14px 0 !important;
    border-radius: 28px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(245,243,255,0.88)),
        radial-gradient(circle at 10% 18%, rgba(124,58,237,0.14), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.12), transparent 28%) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09) !important;
    backdrop-filter: blur(18px);
}

/* Settings headings */
#planner .settings-card h3,
#planner .settings-section h3,
#planner .theme-section h3,
#planner .backup-section h3,
#planner .reset-section h3 {
    color: #111827 !important;
    font-size: 23px !important;
    margin-top: 0 !important;
    margin-bottom: 10px !important;
}

#planner .settings-card p,
#planner .settings-section p,
#planner .theme-section p,
#planner .backup-section p,
#planner .reset-section p {
    color: #475569 !important;
    font-weight: 700;
    line-height: 1.55;
}

/* Settings buttons */
#planner .settings-card button,
#planner .settings-section button,
#planner .theme-section button,
#planner .backup-section button,
#planner .reset-section button,
#planner button[onclick*="setTheme"],
#planner button[onclick*="setBackgroundTheme"],
#planner button[onclick*="export"],
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    border-radius: 18px !important;
    padding: 12px 16px !important;
    margin: 6px !important;
    font-weight: 900 !important;
    background: linear-gradient(135deg, #ec4899, #7c3aed) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px rgba(124,58,237,0.20) !important;
}

/* Safer reset buttons */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    color: #991b1b !important;
    box-shadow: 0 12px 28px rgba(239,68,68,0.14) !important;
}

/* Backup buttons */
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
    color: #047857 !important;
    box-shadow: 0 12px 28px rgba(16,185,129,0.14) !important;
}

/* File input */
#planner input[type="file"] {
    display: block;
    width: 100%;
    padding: 14px;
    margin: 10px 0;
    border-radius: 18px;
    background: rgba(255,255,255,0.88);
    border: 1px solid rgba(255,255,255,0.75);
    color: #111827;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(15,23,42,0.05);
}

/* Background selector thumbnails */
#planner .background-options,
#planner .theme-options,
#planner .settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 14px;
}

#planner .background-option,
#planner .theme-option,
#planner .bg-option,
#planner .theme-card {
    position: relative;
    overflow: hidden;
    min-height: 120px;
    padding: 18px !important;
    border-radius: 24px !important;
    background: rgba(255,255,255,0.84) !important;
    border: 1px solid rgba(255,255,255,0.74) !important;
    box-shadow: 0 14px 32px rgba(15,23,42,0.08) !important;
    cursor: pointer;
    transition: 0.25s ease;
}

#planner .background-option:hover,
#planner .theme-option:hover,
#planner .bg-option:hover,
#planner .theme-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 42px rgba(124,58,237,0.15) !important;
}

/* Make all labels readable */
#planner label {
    color: #111827 !important;
    font-weight: 800;
}

/* Setting section title look */
#planner .section-card h2 {
    font-size: 31px !important;
    color: #111827 !important;
    margin-bottom: 12px !important;
}

/* Dark background readability */
body.bg-aurora #planner .settings-card,
body.bg-starry #planner .settings-card,
body.bg-aurora #planner .settings-section,
body.bg-starry #planner .settings-section,
body.bg-aurora #planner .theme-section,
body.bg-starry #planner .theme-section,
body.bg-aurora #planner .backup-section,
body.bg-starry #planner .backup-section,
body.bg-aurora #planner .reset-section,
body.bg-starry #planner .reset-section {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora #planner .settings-card *,
body.bg-starry #planner .settings-card *,
body.bg-aurora #planner .settings-section *,
body.bg-starry #planner .settings-section *,
body.bg-aurora #planner .theme-section *,
body.bg-starry #planner .theme-section *,
body.bg-aurora #planner .backup-section *,
body.bg-starry #planner .backup-section *,
body.bg-aurora #planner .reset-section *,
body.bg-starry #planner .reset-section * {
    color: inherit;
}

/* Mobile settings */
@media (max-width: 620px) {
    #planner .settings-card,
    #planner .settings-section,
    #planner .theme-section,
    #planner .backup-section,
    #planner .reset-section {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    #planner .settings-card button,
    #planner .settings-section button,
    #planner .theme-section button,
    #planner .backup-section button,
    #planner .reset-section button {
        width: 100%;
        margin: 5px 0 !important;
    }

    #planner .background-options,
    #planner .theme-options,
    #planner .settings-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   DESIGN VERSION 3
   DASHBOARD FINAL PREMIUM DESIGN
================================ */

/* Dashboard main cards */
#planner .dashboard-card,
#planner .dash-card,
#planner .stats-card,
#planner .progress-card,
#planner .analytics-card,
#planner .hero-dashboard-card,
#planner .today-focus-card,
#planner .streak-card,
#planner .motivation-card {
    position: relative;
    overflow: hidden;
    padding: 24px !important;
    margin: 14px 0 !important;
    border-radius: 28px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.95), rgba(239,246,255,0.86)),
        radial-gradient(circle at 10% 18%, rgba(37,99,235,0.14), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(236,72,153,0.12), transparent 28%) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.09) !important;
    backdrop-filter: blur(18px);
}

/* Dashboard grid */
#planner .dashboard-grid,
#planner .aesthetic-grid,
#planner .stats-grid,
#planner .analytics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px !important;
    margin: 18px 0 !important;
}

/* Hero dashboard card */
#planner .hero-dashboard-card {
    padding: 30px !important;
    border-radius: 34px !important;
    background:
        linear-gradient(135deg, rgba(255,255,255,0.94), rgba(253,242,248,0.88)),
        radial-gradient(circle at 8% 18%, rgba(236,72,153,0.16), transparent 28%),
        radial-gradient(circle at 92% 80%, rgba(124,58,237,0.14), transparent 28%) !important;
}

#planner .hero-dashboard-card::after {
    content: "📊";
    position: absolute;
    right: 26px;
    bottom: -18px;
    font-size: 110px;
    opacity: 0.10;
}

/* Dashboard headings */
#planner .dashboard-card h3,
#planner .dash-card h3,
#planner .stats-card h3,
#planner .progress-card h3,
#planner .analytics-card h3,
#planner .hero-dashboard-card h2,
#planner .hero-dashboard-card h3,
#planner .today-focus-card h3,
#planner .streak-card h3,
#planner .motivation-card h3 {
    color: #111827 !important;
    letter-spacing: -0.03em;
    margin-top: 0 !important;
}

#planner .hero-dashboard-card h2 {
    font-size: 36px !important;
    margin-bottom: 8px !important;
}

#planner .dashboard-card h3,
#planner .dash-card h3,
#planner .stats-card h3,
#planner .progress-card h3,
#planner .analytics-card h3 {
    font-size: 24px !important;
}

/* Dashboard text */
#planner .dashboard-card p,
#planner .dash-card p,
#planner .stats-card p,
#planner .progress-card p,
#planner .analytics-card p,
#planner .hero-dashboard-card p,
#planner .today-focus-card p,
#planner .streak-card p,
#planner .motivation-card p {
    color: #475569 !important;
    font-weight: 750;
    line-height: 1.55;
}

/* Dashboard numbers */
#planner .dash-card h3,
#planner .stats-card h3,
#planner .progress-card h3,
#planner .analytics-card h3 {
    font-size: 34px !important;
    color: #2563eb !important;
}

/* Small dashboard labels */
#planner .dashboard-label,
#planner .dash-label,
#planner .stat-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(124,58,237,0.10);
    color: #7c3aed !important;
    font-size: 12px;
    font-weight: 900;
    margin-bottom: 10px;
}

/* Progress bars */
#planner .progress-bar,
#planner .dashboard-progress-bar {
    width: 100%;
    height: 12px;
    border-radius: 999px;
    background: rgba(226,232,240,0.9);
    overflow: hidden;
    margin: 10px 0;
}

#planner .progress-fill,
#planner .dashboard-progress-fill {
    height: 100%;
    border-radius: 999px;
    background: linear-gradient(135deg, #ec4899, #7c3aed);
}

/* Dashboard buttons */
#planner .dashboard-card button,
#planner .dash-card button,
#planner .stats-card button,
#planner .progress-card button,
#planner .analytics-card button,
#planner .hero-dashboard-card button,
#planner .today-focus-card button,
#planner .streak-card button,
#planner .motivation-card button {
    border-radius: 18px !important;
    padding: 12px 16px !important;
    margin: 5px !important;
    font-weight: 900 !important;
}

/* Recent activity / list rows */
#planner .activity-card,
#planner .activity-item,
#planner .recent-card,
#planner .recent-item,
#planner .dashboard-list-item {
    padding: 16px !important;
    margin: 10px 0 !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,0.84) !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 10px 24px rgba(15,23,42,0.06) !important;
    color: #111827 !important;
}

/* Subject progress cards */
#planner .physics-progress,
#planner .dashboard-physics {
    background: linear-gradient(135deg, #eff6ff, #ffffff) !important;
}

#planner .chemistry-progress,
#planner .dashboard-chemistry {
    background: linear-gradient(135deg, #ecfdf5, #ffffff) !important;
}

#planner .maths-progress,
#planner .math-progress,
#planner .dashboard-maths,
#planner .dashboard-math {
    background: linear-gradient(135deg, #fffbeb, #ffffff) !important;
}

/* Dashboard section title */
#planner .section-card h2 {
    color: #111827 !important;
    font-size: 31px !important;
}

/* Dark background readability */
body.bg-aurora #planner .dashboard-card,
body.bg-starry #planner .dashboard-card,
body.bg-aurora #planner .dash-card,
body.bg-starry #planner .dash-card,
body.bg-aurora #planner .stats-card,
body.bg-starry #planner .stats-card,
body.bg-aurora #planner .progress-card,
body.bg-starry #planner .progress-card,
body.bg-aurora #planner .analytics-card,
body.bg-starry #planner .analytics-card,
body.bg-aurora #planner .hero-dashboard-card,
body.bg-starry #planner .hero-dashboard-card,
body.bg-aurora #planner .today-focus-card,
body.bg-starry #planner .today-focus-card,
body.bg-aurora #planner .streak-card,
body.bg-starry #planner .streak-card,
body.bg-aurora #planner .motivation-card,
body.bg-starry #planner .motivation-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

body.bg-aurora #planner .dashboard-card *,
body.bg-starry #planner .dashboard-card *,
body.bg-aurora #planner .dash-card *,
body.bg-starry #planner .dash-card *,
body.bg-aurora #planner .stats-card *,
body.bg-starry #planner .stats-card *,
body.bg-aurora #planner .progress-card *,
body.bg-starry #planner .progress-card *,
body.bg-aurora #planner .analytics-card *,
body.bg-starry #planner .analytics-card *,
body.bg-aurora #planner .hero-dashboard-card *,
body.bg-starry #planner .hero-dashboard-card * {
    color: inherit;
}

/* Mobile dashboard */
@media (max-width: 620px) {
    #planner .dashboard-card,
    #planner .dash-card,
    #planner .stats-card,
    #planner .progress-card,
    #planner .analytics-card,
    #planner .hero-dashboard-card,
    #planner .today-focus-card,
    #planner .streak-card,
    #planner .motivation-card {
        padding: 18px !important;
        border-radius: 22px !important;
    }

    #planner .hero-dashboard-card h2 {
        font-size: 26px !important;
    }

    #planner .dash-card h3,
    #planner .stats-card h3,
    #planner .progress-card h3,
    #planner .analytics-card h3 {
        font-size: 28px !important;
    }

    #planner .dashboard-grid,
    #planner .aesthetic-grid,
    #planner .stats-grid,
    #planner .analytics-grid {
        grid-template-columns: 1fr !important;
    }

    #planner .dashboard-card button,
    #planner .dash-card button,
    #planner .stats-card button,
    #planner .progress-card button,
    #planner .analytics-card button,
    #planner .hero-dashboard-card button {
        width: 100%;
        margin: 5px 0 !important;
    }
}

/* ===============================
   DESIGN VERSION 3.5
   PHOTO MATCH BACKGROUND POLISH
================================ */

/* Full app dreamy background layer */
body {
    position: relative;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 18%, rgba(236, 72, 153, 0.22), transparent 28%),
        radial-gradient(circle at 80% 12%, rgba(124, 58, 237, 0.24), transparent 30%),
        radial-gradient(circle at 50% 92%, rgba(14, 165, 233, 0.16), transparent 32%),
        linear-gradient(135deg, #fff7fb 0%, #f5f3ff 42%, #eef6ff 100%) !important;
    background-attachment: fixed;
}

/* Soft decorative blurred shapes like photo background */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background:
        radial-gradient(circle at 8% 70%, rgba(255, 182, 193, 0.34), transparent 24%),
        radial-gradient(circle at 92% 72%, rgba(167, 139, 250, 0.28), transparent 26%),
        radial-gradient(circle at 48% 35%, rgba(255, 255, 255, 0.36), transparent 22%);
    filter: blur(4px);
}

/* Very soft grain/glass overlay */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        linear-gradient(rgba(255,255,255,0.22), rgba(255,255,255,0.10));
    backdrop-filter: blur(0.5px);
}

/* Dark aurora should feel closer to photo but still readable */
body.bg-aurora {
    background:
        radial-gradient(circle at 18% 16%, rgba(34, 211, 238, 0.28), transparent 26%),
        radial-gradient(circle at 76% 22%, rgba(168, 85, 247, 0.32), transparent 30%),
        radial-gradient(circle at 50% 88%, rgba(236, 72, 153, 0.20), transparent 28%),
        linear-gradient(135deg, #07111f 0%, #172554 42%, #312e81 100%) !important;
}

body.bg-starry {
    background:
        radial-gradient(circle at 20% 20%, rgba(129, 140, 248, 0.26), transparent 26%),
        radial-gradient(circle at 82% 18%, rgba(236, 72, 153, 0.22), transparent 28%),
        radial-gradient(circle at 48% 86%, rgba(56, 189, 248, 0.18), transparent 28%),
        linear-gradient(135deg, #020617 0%, #111827 45%, #312e81 100%) !important;
}

/* Main app glass panel feeling */
.main-content {
    background: rgba(255, 255, 255, 0.18);
    backdrop-filter: blur(18px);
}

/* Make all main V3 cards more photo-like */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    border: 1px solid rgba(255, 255, 255, 0.72) !important;
    box-shadow:
        0 24px 65px rgba(15, 23, 42, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.75) !important;
    backdrop-filter: blur(22px) saturate(135%) !important;
}

/* Add premium shine line to big V3 cards */
.v3-hero::before,
.v3-focus-card::before,
.v3-progress-panel::before,
.v3-quote-card::before,
.v3-quick-panel::before,
.v3-snapshot-card::before,
.v3-goal-card::before,
.v3-mode-card::before,
.v3-upcoming-card::before,
.v3-journal-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background:
        linear-gradient(
            135deg,
            rgba(255,255,255,0.55),
            transparent 36%,
            rgba(255,255,255,0.14)
        );
    opacity: 0.7;
}

/* Keep card content above shine */
.v3-hero > *,
.v3-focus-card > *,
.v3-progress-panel > *,
.v3-quote-card > *,
.v3-quick-panel > *,
.v3-snapshot-card > *,
.v3-goal-card > *,
.v3-mode-card > *,
.v3-upcoming-card > *,
.v3-journal-card > * {
    position: relative;
    z-index: 1;
}

/* More elegant header */
.brand-header {
    background: rgba(255,255,255,0.22);
    backdrop-filter: blur(18px);
    border-bottom: 1px solid rgba(255,255,255,0.28);
}

/* Premium logo icon */
.brand-icon {
    background:
        linear-gradient(135deg, rgba(255,255,255,0.92), rgba(253,242,248,0.82)),
        linear-gradient(135deg, #ec4899, #7c3aed);
    color: #7c3aed;
    border: 1px solid rgba(255,255,255,0.72);
    box-shadow:
        0 18px 42px rgba(124, 58, 237, 0.22),
        inset 0 1px 0 rgba(255,255,255,0.9);
}

/* Make buttons less harsh, more photo-app like */
button,
.v3-home button,
#planner button {
    border-radius: 18px !important;
    box-shadow:
        0 12px 28px rgba(124, 58, 237, 0.18),
        inset 0 1px 0 rgba(255,255,255,0.36) !important;
}

/* Dark background readable glass */
body.bg-aurora .main-content,
body.bg-starry .main-content {
    background: rgba(255,255,255,0.06);
}

body.bg-aurora .brand-header,
body.bg-starry .brand-header {
    background: rgba(15, 23, 42, 0.36);
    border-bottom-color: rgba(255,255,255,0.12);
}

/* ===============================
   DESIGN VERSION 3.5
   REAL PHOTO BACKGROUND + THEME COLOR SYSTEM
================================ */

/* Default theme color variables */
:root {
    --theme-accent: #ec4899;
    --theme-accent-2: #7c3aed;
    --theme-soft: rgba(236, 72, 153, 0.12);
    --theme-shadow: rgba(124, 58, 237, 0.22);
}

/* Background-specific theme colors */
body.bg-aurora {
    --theme-accent: #22d3ee;
    --theme-accent-2: #8b5cf6;
    --theme-soft: rgba(34, 211, 238, 0.14);
    --theme-shadow: rgba(34, 211, 238, 0.22);
}

body.bg-floral {
    --theme-accent: #ec4899;
    --theme-accent-2: #f97316;
    --theme-soft: rgba(236, 72, 153, 0.13);
    --theme-shadow: rgba(236, 72, 153, 0.22);
}

body.bg-bow {
    --theme-accent: #db2777;
    --theme-accent-2: #9333ea;
    --theme-soft: rgba(219, 39, 119, 0.13);
    --theme-shadow: rgba(219, 39, 119, 0.22);
}

body.bg-lavender {
    --theme-accent: #8b5cf6;
    --theme-accent-2: #6366f1;
    --theme-soft: rgba(139, 92, 246, 0.13);
    --theme-shadow: rgba(139, 92, 246, 0.22);
}

body.bg-starry {
    --theme-accent: #60a5fa;
    --theme-accent-2: #a78bfa;
    --theme-soft: rgba(96, 165, 250, 0.14);
    --theme-shadow: rgba(96, 165, 250, 0.22);
}

body.bg-sunset {
    --theme-accent: #f97316;
    --theme-accent-2: #ec4899;
    --theme-soft: rgba(249, 115, 22, 0.13);
    --theme-shadow: rgba(249, 115, 22, 0.22);
}

/* Real photo-style background */
body {
    background:
        linear-gradient(
            135deg,
            rgba(255, 247, 251, 0.68),
            rgba(245, 243, 255, 0.58),
            rgba(238, 246, 255, 0.62)
        ),
       center / cover fixed no-repeat,
        radial-gradient(circle at 20% 20%, var(--theme-soft), transparent 30%),
        linear-gradient(135deg, #fff7fb, #f5f3ff, #eef6ff) !important;
}

/* If image is missing, this still keeps a beautiful fallback */
body::before {
    background:
        radial-gradient(circle at 12% 18%, var(--theme-soft), transparent 28%),
        radial-gradient(circle at 82% 14%, rgba(124, 58, 237, 0.18), transparent 30%),
        radial-gradient(circle at 50% 90%, rgba(14, 165, 233, 0.12), transparent 30%);
}

/* Dark themes with image feeling */
body.bg-aurora,
body.bg-starry {
    background:
        linear-gradient(
            135deg,
            rgba(2, 6, 23, 0.72),
            rgba(15, 23, 42, 0.62),
            rgba(49, 46, 129, 0.58)
        ),
        center / cover fixed no-repeat,
        radial-gradient(circle at 20% 16%, var(--theme-soft), transparent 28%),
        linear-gradient(135deg, #020617, #172554, #312e81) !important;
}

/* Change all pink/purple buttons with selected theme */
button,
.v3-home button,
#planner button,
.sidebar .nav button {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px var(--theme-shadow) !important;
}

/* Sidebar active/hover theme color */
.sidebar .nav button:hover,
.sidebar .nav button:focus {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
}

/* Pills change with theme */
.v3-pill,
#planner .dashboard-label,
#planner .dash-label,
#planner .stat-label,
#planner .pyq-badge,
#planner .exam-badge,
#planner .year-badge,
#planner .difficulty-badge {
    background: var(--theme-soft) !important;
    color: var(--theme-accent-2) !important;
}

/* Calendar selected day changes with theme */
.v3-calendar-day.today-day {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
    box-shadow: 0 8px 20px var(--theme-shadow) !important;
}

/* Progress ring changes with theme */
.v3-progress-ring {
    background:
        conic-gradient(
            var(--theme-accent) calc(var(--progress) * 1%),
            #e5e7eb 0
        ) !important;
    box-shadow: 0 14px 35px var(--theme-shadow) !important;
}

/* Logo icon changes with theme */
.brand-icon {
    color: var(--theme-accent-2) !important;
    box-shadow:
        0 18px 42px var(--theme-shadow),
        inset 0 1px 0 rgba(255,255,255,0.9) !important;
}

/* Checkbox color changes with theme */
input[type="checkbox"] {
    accent-color: var(--theme-accent-2) !important;
}

/* Topic checkbox labels use theme */
.topic-check-row input,
.daily-task-check input,
.planner-task-check input {
    accent-color: var(--theme-accent-2) !important;
}

/* Search focus color changes with theme */
#planner input[type="search"]:focus,
#planner input[type="text"]:focus,
#planner select:focus,
.v3-journal-textarea:focus {
    border-color: var(--theme-accent) !important;
    box-shadow: 0 0 0 4px var(--theme-soft) !important;
}

/* Soft card glow uses theme */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    box-shadow:
        0 24px 65px rgba(15, 23, 42, 0.12),
        0 0 42px var(--theme-soft),
        inset 0 1px 0 rgba(255,255,255,0.75) !important;
}

/* Make secondary/light buttons also theme-aware */
.v3-today-button,
button.back-btn,
.back-btn,
#planner button[onclick*="togglePYQAnswer"],
#planner button[onclick*="addBookmark"],
#planner button[onclick*="addWrongPYQ"],
#planner button[onclick*="markPYQProgress"] {
    background: linear-gradient(135deg, rgba(255,255,255,0.88), var(--theme-soft)) !important;
    color: var(--theme-accent-2) !important;
}

/* Reset buttons stay red for safety */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    color: #991b1b !important;
    box-shadow: 0 12px 28px rgba(239,68,68,0.14) !important;
}

/* Backup buttons stay green */
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
    color: #047857 !important;
    box-shadow: 0 12px 28px rgba(16,185,129,0.14) !important;
}

/* ===============================
   V3.5 CSS-ONLY AURORA PHOTO BACKGROUND
   No image file needed
================================ */

body {
    background:
        radial-gradient(circle at 18% 12%, rgba(34, 211, 238, 0.30), transparent 26%),
        radial-gradient(circle at 70% 10%, rgba(168, 85, 247, 0.34), transparent 30%),
        radial-gradient(circle at 52% 32%, rgba(236, 72, 153, 0.26), transparent 28%),
        radial-gradient(circle at 22% 86%, rgba(236, 72, 153, 0.24), transparent 24%),
        radial-gradient(circle at 88% 84%, rgba(244, 114, 182, 0.22), transparent 24%),
        linear-gradient(135deg, #050816 0%, #111827 38%, #312e81 70%, #4c1d95 100%) !important;
    background-attachment: fixed !important;
}

/* Aurora light beams */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -2;
    background:
        linear-gradient(115deg, transparent 8%, rgba(34, 211, 238, 0.20) 18%, transparent 30%),
        linear-gradient(78deg, transparent 18%, rgba(236, 72, 153, 0.24) 34%, transparent 48%),
        linear-gradient(100deg, transparent 42%, rgba(168, 85, 247, 0.26) 58%, transparent 72%),
        radial-gradient(circle at 50% 100%, rgba(15, 23, 42, 0.92), transparent 46%);
    filter: blur(10px);
    opacity: 0.95;
}

/* Stars + flower glow feeling */
body::after {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background:
        radial-gradient(circle at 12% 18%, rgba(255,255,255,0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 25% 44%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 52% 16%, rgba(255,255,255,0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 76% 32%, rgba(255,255,255,0.7) 0 1px, transparent 2px),
        radial-gradient(circle at 90% 58%, rgba(255,255,255,0.9) 0 1px, transparent 2px),
        radial-gradient(circle at 7% 84%, rgba(236,72,153,0.42), transparent 12%),
        radial-gradient(circle at 94% 92%, rgba(236,72,153,0.38), transparent 14%);
    opacity: 0.9;
}

/* Make page cards dark glass like the reference */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    background: rgba(8, 13, 34, 0.72) !important;
    border: 1px solid rgba(255, 255, 255, 0.18) !important;
    box-shadow:
        0 24px 65px rgba(0, 0, 0, 0.32),
        0 0 42px rgba(236, 72, 153, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.18) !important;
    backdrop-filter: blur(22px) saturate(135%) !important;
}

/* Text readable on dark glass */
.v3-home h2,
.v3-home h3,
.v3-home h4,
.section-card h2,
.section-card h3,
#planner h2,
#planner h3,
#planner h4 {
    color: #ffffff !important;
}

.v3-home p,
.section-card p,
#planner p {
    color: #dbeafe !important;
}

/* Sidebar like reference */
.sidebar {
    background: rgba(5, 10, 28, 0.82) !important;
    border-right: 1px solid rgba(255,255,255,0.16);
    box-shadow: 18px 0 55px rgba(0,0,0,0.28);
    backdrop-filter: blur(22px);
}

.sidebar h2,
.sidebar p,
.sidebar .nav button {
    color: #ffffff !important;
}

/* Theme accent still changes buttons */
body.bg-aurora {
    --theme-accent: #22d3ee;
    --theme-accent-2: #8b5cf6;
}

body.bg-floral {
    --theme-accent: #ec4899;
    --theme-accent-2: #f97316;
}

body.bg-bow {
    --theme-accent: #db2777;
    --theme-accent-2: #9333ea;
}

body.bg-lavender {
    --theme-accent: #8b5cf6;
    --theme-accent-2: #6366f1;
}

body.bg-starry {
    --theme-accent: #60a5fa;
    --theme-accent-2: #a78bfa;
}

body.bg-sunset {
    --theme-accent: #f97316;
    --theme-accent-2: #ec4899;
}

button,
.v3-home button,
#planner button,
.sidebar .nav button {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
}

/* Inner small cards stay readable */
.v3-calendar-card,
.v3-focus-subject,
.v3-mini-stats div,
.v3-progress-ring-card,
.v3-quick-card,
.v3-snapshot-item,
.v3-goal-item,
.v3-mode-item,
.v3-upcoming-item,
.task,
.question-card,
.formula-card {
    background: rgba(255,255,255,0.92) !important;
    color: #111827 !important;
}

.v3-calendar-card *,
.v3-focus-subject *,
.v3-mini-stats div *,
.v3-progress-ring-card *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.task *,
.question-card *,
.formula-card * {
    color: #111827 !important;
}

/* ===============================
   V3.5 FINAL READABLE AURORA DESIGN
   Better photo-match + readable text
================================ */

/* Main aurora background */
body {
    background:
        radial-gradient(ellipse at 50% 0%, rgba(34, 211, 238, 0.32), transparent 28%),
        radial-gradient(ellipse at 68% 8%, rgba(16, 185, 129, 0.24), transparent 26%),
        radial-gradient(ellipse at 35% 10%, rgba(236, 72, 153, 0.30), transparent 30%),
        radial-gradient(circle at 8% 78%, rgba(236, 72, 153, 0.28), transparent 18%),
        radial-gradient(circle at 96% 86%, rgba(244, 114, 182, 0.25), transparent 20%),
        linear-gradient(180deg, #061025 0%, #10183b 42%, #1f1647 72%, #070914 100%) !important;
    background-attachment: fixed !important;
    color: #f8fafc !important;
}

/* Aurora beams */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    pointer-events: none;
    background:
        linear-gradient(105deg, transparent 6%, rgba(34, 211, 238, 0.18) 18%, transparent 34%),
        linear-gradient(80deg, transparent 18%, rgba(236, 72, 153, 0.24) 34%, transparent 50%),
        linear-gradient(112deg, transparent 38%, rgba(168, 85, 247, 0.28) 57%, transparent 74%),
        linear-gradient(92deg, transparent 55%, rgba(16, 185, 129, 0.20) 70%, transparent 86%);
    filter: blur(12px);
    opacity: 0.9;
}

/* Stars + flower glow */
body::after {
    content: "✦   ✧       ✦        ✧      ✦";
    position: fixed;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    color: rgba(255, 255, 255, 0.75);
    font-size: 34px;
    letter-spacing: 80px;
    padding: 40px 20px;
    background:
        radial-gradient(circle at 9% 84%, rgba(236, 72, 153, 0.42), transparent 13%),
        radial-gradient(circle at 92% 88%, rgba(236, 72, 153, 0.36), transparent 15%),
        radial-gradient(circle at 16% 24%, rgba(255,255,255,0.8) 0 1px, transparent 2px),
        radial-gradient(circle at 42% 18%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 74% 28%, rgba(255,255,255,0.75) 0 1px, transparent 2px),
        radial-gradient(circle at 88% 55%, rgba(255,255,255,0.65) 0 1px, transparent 2px);
    opacity: 0.75;
}

/* Header readable */
.brand-header {
    background: rgba(5, 10, 28, 0.78) !important;
    border-bottom: 1px solid rgba(255,255,255,0.16) !important;
    backdrop-filter: blur(20px);
}

.brand-header h1,
.brand-header p {
    color: #ffffff !important;
}

/* Sidebar like the reference */
.sidebar {
    background: rgba(5, 10, 28, 0.88) !important;
    border-right: 1px solid rgba(255,255,255,0.16) !important;
    backdrop-filter: blur(22px);
}

.sidebar h2,
.sidebar p,
.sidebar .nav button {
    color: #ffffff !important;
}

/* Main content transparent over background */
.main-content {
    background: transparent !important;
}

/* Big cards: dark but readable */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    background: rgba(10, 18, 46, 0.78) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    box-shadow:
        0 24px 65px rgba(0, 0, 0, 0.34),
        0 0 36px rgba(236, 72, 153, 0.12),
        inset 0 1px 0 rgba(255,255,255,0.16) !important;
    backdrop-filter: blur(22px) saturate(130%) !important;
}

/* Force readable headings */
.v3-home h2,
.v3-home h3,
.v3-home h4,
.section-card h2,
.section-card h3,
.section-card h4,
#planner h2,
#planner h3,
#planner h4 {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.25);
}

/* Force readable paragraphs */
.v3-home p,
.section-card p,
#planner p {
    color: #dbeafe !important;
    font-weight: 700 !important;
}

/* Make small cards readable with light cards */
.v3-calendar-card,
.v3-focus-subject,
.v3-mini-stats div,
.v3-progress-ring-card,
.v3-quick-card,
.v3-snapshot-item,
.v3-goal-item,
.v3-mode-item,
.v3-upcoming-item,
.task,
.question-card,
.formula-card,
.pyq-card,
.mcq-card,
.dashboard-card,
.dash-card,
.settings-card {
    background: rgba(255,255,255,0.94) !important;
    color: #111827 !important;
    border: 1px solid rgba(255,255,255,0.72) !important;
    box-shadow: 0 16px 36px rgba(0,0,0,0.18) !important;
}

/* Text inside small cards */
.v3-calendar-card *,
.v3-focus-subject *,
.v3-mini-stats div *,
.v3-progress-ring-card *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.task *,
.question-card *,
.formula-card *,
.pyq-card *,
.mcq-card *,
.dashboard-card *,
.dash-card *,
.settings-card * {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Journal textarea readable */
.v3-journal-textarea {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

/* Theme color variables */
:root {
    --theme-accent: #ec4899;
    --theme-accent-2: #8b5cf6;
    --theme-soft: rgba(236, 72, 153, 0.14);
    --theme-shadow: rgba(236, 72, 153, 0.24);
}

body.bg-aurora {
    --theme-accent: #22d3ee;
    --theme-accent-2: #8b5cf6;
    --theme-soft: rgba(34, 211, 238, 0.14);
    --theme-shadow: rgba(34, 211, 238, 0.24);
}

body.bg-floral {
    --theme-accent: #ec4899;
    --theme-accent-2: #f97316;
    --theme-soft: rgba(236, 72, 153, 0.14);
    --theme-shadow: rgba(236, 72, 153, 0.24);
}

body.bg-bow {
    --theme-accent: #db2777;
    --theme-accent-2: #9333ea;
    --theme-soft: rgba(219, 39, 119, 0.14);
    --theme-shadow: rgba(219, 39, 119, 0.24);
}

body.bg-lavender {
    --theme-accent: #8b5cf6;
    --theme-accent-2: #6366f1;
    --theme-soft: rgba(139, 92, 246, 0.14);
    --theme-shadow: rgba(139, 92, 246, 0.24);
}

body.bg-starry {
    --theme-accent: #60a5fa;
    --theme-accent-2: #a78bfa;
    --theme-soft: rgba(96, 165, 250, 0.14);
    --theme-shadow: rgba(96, 165, 250, 0.24);
}

body.bg-sunset {
    --theme-accent: #f97316;
    --theme-accent-2: #ec4899;
    --theme-soft: rgba(249, 115, 22, 0.14);
    --theme-shadow: rgba(249, 115, 22, 0.24);
}

/* Theme-aware buttons */
button,
.v3-home button,
#planner button,
.sidebar .nav button {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
    box-shadow: 0 12px 28px var(--theme-shadow) !important;
}

/* Pills/theme tags */
.v3-pill,
#planner .dashboard-label,
#planner .dash-label,
#planner .stat-label,
#planner .pyq-badge,
#planner .exam-badge,
#planner .year-badge,
#planner .difficulty-badge {
    background: var(--theme-soft) !important;
    color: var(--theme-accent-2) !important;
}

/* Calendar selected day */
.v3-calendar-day.today-day {
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
}

/* Progress ring */
.v3-progress-ring {
    background:
        conic-gradient(
            var(--theme-accent) calc(var(--progress) * 1%),
            #e5e7eb 0
        ) !important;
}

/* Checkbox */
input[type="checkbox"] {
    accent-color: var(--theme-accent-2) !important;
}

/* Safety: reset buttons stay red */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    background: linear-gradient(135deg, #fee2e2, #fecaca) !important;
    color: #991b1b !important;
}

/* Backup buttons stay green */
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    background: linear-gradient(135deg, #ecfdf5, #d1fae5) !important;
    color: #047857 !important;
}

/* Mobile readability */
@media (max-width: 620px) {
    .v3-hero,
    .v3-focus-card,
    .v3-progress-panel,
    .v3-quote-card,
    .v3-quick-panel,
    .v3-snapshot-card,
    .v3-goal-card,
    .v3-mode-card,
    .v3-upcoming-card,
    .v3-journal-card,
    .section-card {
        background: rgba(10, 18, 46, 0.86) !important;
    }
}

/* ===============================
   V3.5 READABILITY FIX
   Fix white text on light cards
================================ */

.v3-calendar-card,
.v3-focus-subject,
.v3-mini-stats div,
.v3-progress-ring-card,
.v3-quick-card,
.v3-snapshot-item,
.v3-goal-item,
.v3-mode-item,
.v3-upcoming-item,
.v3-journal-textarea,
.task,
.question-card,
.formula-card,
.pyq-card,
.mcq-card,
.dashboard-card,
.dash-card,
.settings-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
}

.v3-calendar-card *,
.v3-focus-subject *,
.v3-mini-stats div *,
.v3-progress-ring-card *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.task *,
.question-card *,
.formula-card *,
.pyq-card *,
.mcq-card *,
.dashboard-card *,
.dash-card *,
.settings-card * {
    color: #111827 !important;
    text-shadow: none !important;
}

.v3-upcoming-item h4,
.v3-upcoming-item p,
.v3-quick-card h4,
.v3-quick-card p,
.v3-mode-item h4,
.v3-mode-item p,
.v3-goal-item h4,
.v3-goal-item p,
.v3-snapshot-item h4,
.v3-snapshot-item p {
    color: #111827 !important;
}

.v3-upcoming-item button,
.v3-quick-card button,
.v3-mode-item button {
    color: #ffffff !important;
}

/* Main dark cards readable */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    background: rgba(8, 13, 34, 0.76) !important;
}

.v3-hero h2,
.v3-hero h3,
.v3-focus-card h3,
.v3-progress-panel h3,
.v3-quote-card h3,
.v3-quick-panel h3,
.v3-snapshot-card h3,
.v3-goal-card h3,
.v3-mode-card h3,
.v3-upcoming-card h3,
.v3-journal-card h3 {
    color: #ffffff !important;
}

.v3-hero p,
.v3-focus-card > p,
.v3-progress-panel > p,
.v3-quote-card > p,
.v3-quick-panel > p,
.v3-snapshot-card > p,
.v3-goal-card > p,
.v3-mode-card > p,
.v3-upcoming-card > p,
.v3-journal-card > p {
    color: #dbeafe !important;
}

/* Background image */
body {
    background:
        linear-gradient(
            rgba(5, 10, 28, 0.35),
            rgba(5, 10, 28, 0.55)
        ),
        url("planner-bg.png") center / cover fixed no-repeat !important;
}

/* FINAL BACKGROUND IMAGE FIX */
html,
body {
    min-height: 100%;
}

body {
    background-image:
        linear-gradient(rgba(5, 10, 28, 0.25), rgba(5, 10, 28, 0.55)),
        url("./assets/backgrounds/planner-bg.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* FINAL SIMPLE IMAGE BACKGROUND FIX */
html,
body {
    min-height: 100%;
}

body {
    background-image:
        linear-gradient(rgba(5, 10, 28, 0.35), rgba(5, 10, 28, 0.62)),
        url("planner-bg.png") !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* ===============================
   FINAL FONT READABILITY FIX
   Fix invisible / low contrast text
================================ */

/* Main dark glass cards */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    color: #ffffff !important;
}

/* Headings on dark cards */
.v3-hero h1,
.v3-hero h2,
.v3-hero h3,
.v3-focus-card h1,
.v3-focus-card h2,
.v3-focus-card h3,
.v3-progress-panel h1,
.v3-progress-panel h2,
.v3-progress-panel h3,
.v3-quote-card h1,
.v3-quote-card h2,
.v3-quote-card h3,
.v3-quick-panel h1,
.v3-quick-panel h2,
.v3-quick-panel h3,
.v3-snapshot-card h1,
.v3-snapshot-card h2,
.v3-snapshot-card h3,
.v3-goal-card h1,
.v3-goal-card h2,
.v3-goal-card h3,
.v3-mode-card h1,
.v3-mode-card h2,
.v3-mode-card h3,
.v3-upcoming-card h1,
.v3-upcoming-card h2,
.v3-upcoming-card h3,
.v3-journal-card h1,
.v3-journal-card h2,
.v3-journal-card h3,
.section-card h1,
.section-card h2,
.section-card h3 {
    color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35) !important;
}

/* Paragraphs on dark cards */
.v3-hero p,
.v3-focus-card > p,
.v3-progress-panel > p,
.v3-quote-card > p,
.v3-quick-panel > p,
.v3-snapshot-card > p,
.v3-goal-card > p,
.v3-mode-card > p,
.v3-upcoming-card > p,
.v3-journal-card > p,
.section-card > p {
    color: #e0ecff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.28) !important;
}

/* Light inner cards must have dark readable text */
.v3-calendar-card,
.v3-focus-subject,
.v3-mini-stats div,
.v3-progress-ring-card,
.v3-quick-card,
.v3-snapshot-item,
.v3-goal-item,
.v3-mode-item,
.v3-upcoming-item,
.task,
.question-card,
.formula-card,
.pyq-card,
.mcq-card,
.dashboard-card,
.dash-card,
.settings-card,
.topic-check-row,
.planner-task-check,
.daily-task-check {
    background: rgba(255,255,255,0.94) !important;
    color: #111827 !important;
}

/* Everything inside light cards must be dark */
.v3-calendar-card *,
.v3-focus-subject *,
.v3-mini-stats div *,
.v3-progress-ring-card *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.task *,
.question-card *,
.formula-card *,
.pyq-card *,
.mcq-card *,
.dashboard-card *,
.dash-card *,
.settings-card *,
.topic-check-row *,
.planner-task-check *,
.daily-task-check * {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Fix pale text inside upcoming cards specifically */
.v3-upcoming-item h4,
.v3-upcoming-item p,
.v3-upcoming-item span,
.v3-quick-card h4,
.v3-quick-card p,
.v3-mode-item h4,
.v3-mode-item p,
.v3-goal-item h4,
.v3-goal-item p,
.v3-snapshot-item h4,
.v3-snapshot-item p,
.v3-focus-subject h4,
.v3-focus-subject p {
    color: #111827 !important;
}

/* Buttons should stay readable */
.v3-upcoming-item button,
.v3-quick-card button,
.v3-mode-item button,
.v3-goal-card button,
.v3-focus-card button,
.v3-hero button,
#planner button,
.sidebar .nav button {
    color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}

/* Light/secondary buttons with purple text */
.v3-today-button,
button.back-btn,
.back-btn,
#planner button[onclick*="togglePYQAnswer"],
#planner button[onclick*="addBookmark"],
#planner button[onclick*="addWrongPYQ"],
#planner button[onclick*="markPYQProgress"] {
    color: var(--theme-accent-2) !important;
}

/* Reset buttons readable */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    color: #991b1b !important;
}

/* Backup buttons readable */
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    color: #047857 !important;
}

/* Inputs and textarea readable */
input,
select,
textarea,
.v3-journal-textarea {
    color: #111827 !important;
    background: rgba(255,255,255,0.95) !important;
}

input::placeholder,
textarea::placeholder {
    color: #64748b !important;
}

/* Pills readable */
.v3-pill {
    color: var(--theme-accent-2) !important;
    text-shadow: none !important;
    font-weight: 900 !important;
}

/* Header and sidebar text */
.brand-header h1,
.brand-header p,
.sidebar h2,
.sidebar p {
    color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35) !important;
}

/* Calendar title fix */
.v3-calendar-title h3,
.v3-calendar-title p,
.v3-calendar-weekdays span,
.v3-calendar-day {
    color: #111827 !important;
    text-shadow: none !important;
}

.v3-calendar-day.today-day {
    color: #ffffff !important;
}

/* ===============================
   FINAL FIX: TEXT INSIDE LIGHT CARDS
   Especially Upcoming Plan cards
================================ */

/* Upcoming Plan small cards */
.v3-upcoming-card .v3-upcoming-item,
.v3-upcoming-card .v3-upcoming-item * {
    color: #111827 !important;
    text-shadow: none !important;
}

.v3-upcoming-card .v3-upcoming-item h4 {
    color: #111827 !important;
    font-weight: 900 !important;
}

.v3-upcoming-card .v3-upcoming-item p {
    color: #334155 !important;
    font-weight: 800 !important;
}

.v3-upcoming-card .v3-upcoming-item > span {
    color: #0f172a !important;
    background: rgba(209, 250, 229, 0.95) !important;
}

/* Buttons inside upcoming cards */
.v3-upcoming-card .v3-upcoming-item button {
    color: #7c3aed !important;
    background: rgba(245, 243, 255, 0.95) !important;
    text-shadow: none !important;
}

/* All light inner cards across home */
.v3-focus-subject *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.v3-calendar-card *,
.v3-progress-ring-card * {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Paragraphs inside light inner cards */
.v3-focus-subject p,
.v3-quick-card p,
.v3-snapshot-item p,
.v3-goal-item p,
.v3-mode-item p,
.v3-upcoming-item p {
    color: #334155 !important;
    font-weight: 800 !important;
}

/* Headings inside light inner cards */
.v3-focus-subject h4,
.v3-quick-card h4,
.v3-snapshot-item h4,
.v3-goal-item h4,
.v3-mode-item h4,
.v3-upcoming-item h4 {
    color: #111827 !important;
    font-weight: 900 !important;
}

/* Do not let global dark-card rules override light card text */
.v3-home .v3-upcoming-item h4,
.v3-home .v3-upcoming-item p,
.v3-home .v3-quick-card h4,
.v3-home .v3-quick-card p,
.v3-home .v3-mode-item h4,
.v3-home .v3-mode-item p,
.v3-home .v3-goal-item h4,
.v3-home .v3-goal-item p,
.v3-home .v3-snapshot-item h4,
.v3-home .v3-snapshot-item p,
.v3-home .v3-focus-subject h4,
.v3-home .v3-focus-subject p {
    color: #111827 !important;
    text-shadow: none !important;
}

/* Keep main section headings white */
.v3-upcoming-card > .v3-upcoming-header h3,
.v3-upcoming-card > .v3-upcoming-header p {
    color: #ffffff !important;
}

/* ===============================
   EMERGENCY TEXT VISIBILITY FIX
================================ */

.v3-upcoming-item,
.v3-upcoming-item * {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
}

.v3-upcoming-item h4,
.v3-upcoming-item p,
.v3-upcoming-item span {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
}

.v3-upcoming-item button,
.v3-upcoming-item button * {
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
    background: #f5f3ff !important;
}

.v3-upcoming-header h3 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.v3-upcoming-header p {
    color: #e0ecff !important;
    -webkit-text-fill-color: #e0ecff !important;
}

/* ===============================
   FINAL GLOBAL FONT VISIBILITY FIX
   Whole website readability
================================ */

/* Dark main glass cards: white text */
.v3-hero,
.v3-focus-card,
.v3-progress-panel,
.v3-quote-card,
.v3-quick-panel,
.v3-snapshot-card,
.v3-goal-card,
.v3-mode-card,
.v3-upcoming-card,
.v3-journal-card,
.section-card {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Headings inside dark cards */
.v3-hero h1,
.v3-hero h2,
.v3-hero h3,
.v3-focus-card h1,
.v3-focus-card h2,
.v3-focus-card h3,
.v3-progress-panel h1,
.v3-progress-panel h2,
.v3-progress-panel h3,
.v3-quote-card h1,
.v3-quote-card h2,
.v3-quote-card h3,
.v3-quick-panel h1,
.v3-quick-panel h2,
.v3-quick-panel h3,
.v3-snapshot-card h1,
.v3-snapshot-card h2,
.v3-snapshot-card h3,
.v3-goal-card h1,
.v3-goal-card h2,
.v3-goal-card h3,
.v3-mode-card h1,
.v3-mode-card h2,
.v3-mode-card h3,
.v3-upcoming-card h1,
.v3-upcoming-card h2,
.v3-upcoming-card h3,
.v3-journal-card h1,
.v3-journal-card h2,
.v3-journal-card h3,
.section-card h1,
.section-card h2,
.section-card h3,
#planner > .section-card h1,
#planner > .section-card h2,
#planner > .section-card h3 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 2px 12px rgba(0,0,0,0.35) !important;
}

/* Paragraphs directly on dark cards */
.v3-hero > p,
.v3-focus-card > p,
.v3-progress-panel > p,
.v3-quote-card > p,
.v3-quick-panel > p,
.v3-snapshot-card > p,
.v3-goal-card > p,
.v3-mode-card > p,
.v3-upcoming-card > p,
.v3-journal-card > p,
.section-card > p {
    color: #e0ecff !important;
    -webkit-text-fill-color: #e0ecff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.28) !important;
}

/* Light cards everywhere: dark text */
.v3-calendar-card,
.v3-focus-subject,
.v3-mini-stats div,
.v3-progress-ring-card,
.v3-quick-card,
.v3-snapshot-item,
.v3-goal-item,
.v3-mode-item,
.v3-upcoming-item,
.v3-journal-textarea,
.task,
.question-card,
.formula-card,
.pyq-card,
.mcq-card,
.dashboard-card,
.dash-card,
.settings-card,
.topic-check-row,
.planner-task-check,
.daily-task-check,
#planner .card,
#planner .exam-card,
#planner .subject-card,
#planner .chapter-card,
#planner .formula-section,
#planner .formula-subject-card,
#planner .formula-chapter-card,
#planner .pyq-question-card,
#planner .mcq-question-card,
#planner .result-card {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
}

/* Everything inside light cards must stay dark */
.v3-calendar-card *,
.v3-focus-subject *,
.v3-mini-stats div *,
.v3-progress-ring-card *,
.v3-quick-card *,
.v3-snapshot-item *,
.v3-goal-item *,
.v3-mode-item *,
.v3-upcoming-item *,
.task *,
.question-card *,
.formula-card *,
.pyq-card *,
.mcq-card *,
.dashboard-card *,
.dash-card *,
.settings-card *,
.topic-check-row *,
.planner-task-check *,
.daily-task-check *,
#planner .card *,
#planner .exam-card *,
#planner .subject-card *,
#planner .chapter-card *,
#planner .formula-section *,
#planner .formula-subject-card *,
#planner .formula-chapter-card *,
#planner .pyq-question-card *,
#planner .mcq-question-card *,
#planner .result-card * {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
}

/* Light card paragraphs softer but readable */
.v3-focus-subject p,
.v3-quick-card p,
.v3-snapshot-item p,
.v3-goal-item p,
.v3-mode-item p,
.v3-upcoming-item p,
.task p,
.question-card p,
.formula-card p,
.pyq-card p,
.mcq-card p,
.dashboard-card p,
.dash-card p,
.settings-card p,
#planner .card p,
#planner .exam-card p,
#planner .subject-card p,
#planner .chapter-card p {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    font-weight: 800 !important;
}

/* Buttons must stay readable */
button,
.v3-home button,
#planner button,
.sidebar .nav button {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: none !important;
}

/* Secondary purple buttons */
.v3-today-button,
button.back-btn,
.back-btn,
#planner button[onclick*="togglePYQAnswer"],
#planner button[onclick*="addBookmark"],
#planner button[onclick*="addWrongPYQ"],
#planner button[onclick*="markPYQProgress"] {
    color: var(--theme-accent-2) !important;
    -webkit-text-fill-color: var(--theme-accent-2) !important;
    background: rgba(245,243,255,0.96) !important;
}

/* Reset buttons readable */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"] {
    color: #991b1b !important;
    -webkit-text-fill-color: #991b1b !important;
}

/* Backup buttons readable */
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    color: #047857 !important;
    -webkit-text-fill-color: #047857 !important;
}

/* Inputs readable */
input,
select,
textarea,
.v3-journal-textarea {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    background: rgba(255,255,255,0.96) !important;
    text-shadow: none !important;
}

/* Placeholder readable */
input::placeholder,
textarea::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* Pills readable */
.v3-pill {
    color: var(--theme-accent-2) !important;
    -webkit-text-fill-color: var(--theme-accent-2) !important;
    text-shadow: none !important;
    font-weight: 900 !important;
}

/* Header + sidebar readable */
.brand-header h1,
.brand-header p,
.sidebar h2,
.sidebar p,
.sidebar-brand h2,
.sidebar-brand p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 2px 10px rgba(0,0,0,0.35) !important;
}

/* Sidebar buttons readable */
.sidebar .nav button,
.sidebar .nav button * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Calendar readable */
.v3-calendar-title h3,
.v3-calendar-title p,
.v3-calendar-weekdays span,
.v3-calendar-day {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    text-shadow: none !important;
}

.v3-calendar-day.today-day {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* ===============================
   DESIGN VERSION 3.6 FIXED
   Photo-style dashboard correction
================================ */

.v36-home {
    max-width: 1180px;
    margin: 0 auto;
    padding: 8px 0 40px;
}

/* Top greeting bar */
.v36-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 18px;
    margin-bottom: 18px;
    padding: 22px 26px;
    border-radius: 30px;
    background: rgba(8, 13, 32, 0.72);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow: 0 20px 55px rgba(0,0,0,0.32);
    backdrop-filter: blur(22px);
}

.v36-topbar span,
.v36-label {
    display: inline-flex;
    width: fit-content;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(236,72,153,0.18);
    color: #f9a8d4 !important;
    -webkit-text-fill-color: #f9a8d4 !important;
    font-size: 12px;
    font-weight: 900;
}

.v36-topbar h2 {
    margin: 9px 0 4px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 32px;
    line-height: 1.05;
}

.v36-topbar p {
    margin: 0;
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
    font-weight: 800;
}

/* Correct photo-like grid */
.v36-dashboard-grid {
    display: grid;
    grid-template-columns: 1.45fr 0.9fr;
    gap: 18px;
    align-items: stretch;
}

/* Base card style */
.v36-hero-box,
.v36-calendar-box,
.v36-progress-box,
.v36-streak-box,
.v36-focus-box,
.v36-stats-box,
.v36-quote-box,
.v36-tools-box,
.v36-journal-box {
    border-radius: 30px;
    padding: 22px;
    background: rgba(8, 13, 32, 0.72);
    border: 1px solid rgba(255,255,255,0.16);
    box-shadow:
        0 20px 55px rgba(0,0,0,0.30),
        inset 0 1px 0 rgba(255,255,255,0.14);
    backdrop-filter: blur(22px);
    overflow: hidden;
}

/* Main large card */
.v36-hero-box {
    min-height: 300px;
    grid-column: 1 / 2;
    grid-row: 1 / span 2;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at 12% 10%, rgba(34,211,238,0.28), transparent 28%),
        radial-gradient(circle at 88% 86%, rgba(236,72,153,0.26), transparent 32%),
        rgba(8, 13, 32, 0.76);
}

.v36-hero-content {
    position: relative;
    z-index: 2;
    max-width: 620px;
}

.v36-hero-box h1 {
    margin: 14px 0 12px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 44px;
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.v36-hero-box p {
    color: #e0ecff !important;
    -webkit-text-fill-color: #e0ecff !important;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.6;
}

.v36-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 20px;
}

.v36-flower-art {
    position: absolute;
    right: 26px;
    bottom: -18px;
    font-size: 120px;
    opacity: 0.18;
}

/* Right calendar card */
.v36-calendar-box {
    grid-column: 2 / 3;
    grid-row: 1 / span 2;
    padding: 16px;
}

.v36-calendar-box .v3-calendar-card {
    width: 100% !important;
    max-width: none !important;
    background: rgba(255,255,255,0.96) !important;
    border-radius: 24px !important;
    box-shadow: none !important;
}

/* Progress and streak below */
.v36-progress-box,
.v36-streak-box {
    min-height: 170px;
}

.v36-progress-box {
    grid-column: 1 / 2;
}

.v36-streak-box {
    grid-column: 2 / 3;
}

/* Ring */
.v36-progress-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.v36-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    margin: 16px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background:
        conic-gradient(var(--theme-accent) calc(var(--progress) * 1%), rgba(255,255,255,0.18) 0);
}

.v36-ring > div {
    width: 84px;
    height: 84px;
    border-radius: 50%;
    background: rgba(255,255,255,0.96);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.v36-ring strong {
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-size: 25px;
}

.v36-ring span {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    font-weight: 900;
}

.v36-progress-box p {
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
    font-weight: 800;
}

/* Streak and quote */
.v36-streak-box h3,
.v36-quote-box h3 {
    margin: 14px 0 8px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 28px;
}

.v36-streak-box p,
.v36-quote-box p {
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
    font-weight: 800;
}

/* Subject cards */
.v36-focus-box {
    background: rgba(255,255,255,0.94) !important;
    min-height: 170px;
}

.v36-focus-box span {
    font-size: 32px;
}

.v36-focus-box h3 {
    margin: 10px 0 5px;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-size: 23px;
}

.v36-focus-box p {
    color: #334155 !important;
    -webkit-text-fill-color: #334155 !important;
    font-weight: 800;
}

.v36-focus-box.physics {
    background: linear-gradient(135deg, rgba(239,246,255,0.96), rgba(255,255,255,0.94)) !important;
}

.v36-focus-box.chemistry {
    background: linear-gradient(135deg, rgba(236,253,245,0.96), rgba(255,255,255,0.94)) !important;
}

.v36-focus-box.maths {
    background: linear-gradient(135deg, rgba(255,251,235,0.96), rgba(255,255,255,0.94)) !important;
}

/* Stats */
.v36-stats-box,
.v36-tools-box,
.v36-journal-box,
.v36-quote-box {
    min-height: 190px;
}

.v36-stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255,255,255,0.14);
}

.v36-stat-row span {
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
    font-weight: 800;
}

.v36-stat-row strong {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 24px;
}

/* Tool grid */
.v36-tool-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 9px;
    margin-top: 16px;
}

.v36-tool-grid button {
    width: 100%;
    padding: 12px 9px !important;
}

/* Journal */
.v36-journal-box textarea {
    width: 100%;
    min-height: 105px;
    margin: 14px 0 12px;
    padding: 15px;
    border-radius: 20px;
    border: none;
    outline: none;
    resize: vertical;
    background: rgba(255,255,255,0.96) !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    font-weight: 800;
}

/* Buttons */
.v36-home button {
    border: none !important;
    border-radius: 17px !important;
    padding: 12px 16px !important;
    background: linear-gradient(135deg, var(--theme-accent), var(--theme-accent-2)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
    box-shadow: 0 12px 28px var(--theme-shadow) !important;
}

/* Prevent old hidden rule damage */
.v3-home {
    display: block;
}

/* Mobile */
@media (max-width: 900px) {
    .v36-dashboard-grid {
        grid-template-columns: 1fr;
    }

    .v36-hero-box,
    .v36-calendar-box,
    .v36-progress-box,
    .v36-streak-box {
        grid-column: auto;
        grid-row: auto;
    }

    .v36-hero-box h1 {
        font-size: 34px;
    }

    .v36-topbar {
        flex-direction: column;
        align-items: flex-start;
    }

    .v36-tool-grid {
        grid-template-columns: 1fr;
    }
}

/* ===============================
   V3.6 PHOTO STYLE REPAIR PATCH
   Fix size, spacing, sidebar, calendar
================================ */

/* Main app spacing */
.container,
.main-content,
#planner {
    max-width: none !important;
}

/* Reduce sidebar heaviness */
.sidebar {
    width: 280px !important;
    min-width: 280px !important;
    padding: 18px 16px !important;
    background: rgba(8, 13, 32, 0.78) !important;
    border-right: 1px solid rgba(255,255,255,0.16) !important;
    backdrop-filter: blur(22px) !important;
}

.sidebar .nav button,
.sidebar button {
    width: 100% !important;
    min-height: 54px !important;
    margin-bottom: 12px !important;
    padding: 14px 18px !important;
    border-radius: 20px !important;
    font-size: 16px !important;
    justify-content: flex-start !important;
}

/* Home wrapper should fit inside screen */
.v36-home {
    max-width: 1000px !important;
    margin: 0 auto !important;
    padding: 0 16px 40px !important;
}

/* Hide topbar if it is making the page too tall */
.v36-topbar {
    padding: 18px 22px !important;
    margin-bottom: 16px !important;
    border-radius: 26px !important;
}

.v36-topbar h2 {
    font-size: 26px !important;
}

/* Better two column layout like the reference */
.v36-dashboard-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.9fr) !important;
    gap: 18px !important;
    align-items: start !important;
}

/* Main hero card smaller and cleaner */
.v36-hero-box {
    min-height: 500px !important;
    padding: 26px !important;
    border-radius: 30px !important;
    grid-column: 1 / 2 !important;
    grid-row: 1 / 3 !important;
    align-items: center !important;
}

.v36-hero-box h1 {
    font-size: 48px !important;
    line-height: 1.05 !important;
    text-align: center !important;
    max-width: 560px !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.v36-hero-box p {
    font-size: 17px !important;
    line-height: 1.55 !important;
    text-align: left !important;
}

/* Hero buttons should look like clean wide pills */
.v36-hero-actions {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 18px !important;
    margin-top: 26px !important;
}

.v36-hero-actions button {
    width: 100% !important;
    min-height: 44px !important;
    border-radius: 18px !important;
    padding: 12px 18px !important;
    text-align: left !important;
    font-size: 16px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Fix invisible Revise PYQs button */
.v36-hero-actions button:nth-child(3),
.v36-hero-actions button:nth-child(3) * {
    background: rgba(245,243,255,0.96) !important;
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
    opacity: 1 !important;
}

/* Calendar panel should not overflow */
.v36-calendar-box {
    grid-column: 2 / 3 !important;
    grid-row: 1 / 3 !important;
    width: 100% !important;
    max-width: 360px !important;
    padding: 16px !important;
    border-radius: 30px !important;
    overflow: hidden !important;
}

.v36-calendar-box .v3-calendar-card {
    width: 100% !important;
    max-width: 100% !important;
    padding: 18px !important;
    border-radius: 26px !important;
    overflow: hidden !important;
}

/* Calendar numbers smaller so they fit */
.v36-calendar-box .v3-calendar-grid,
.v36-calendar-box .v3-calendar-days {
    gap: 8px !important;
}

.v36-calendar-box .v3-calendar-day {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    font-size: 14px !important;
    border-radius: 50% !important;
}

.v36-calendar-box .v3-calendar-weekdays span {
    font-size: 13px !important;
}

/* Calendar title */
.v36-calendar-box .v3-calendar-title h3 {
    font-size: 24px !important;
}

.v36-calendar-box .v3-calendar-title p {
    font-size: 18px !important;
}

/* Calendar nav buttons */
.v36-calendar-box .v3-calendar-nav button,
.v36-calendar-box button {
    min-height: 40px !important;
    padding: 9px 13px !important;
    border-radius: 18px !important;
}

/* Cards below should align better */
.v36-progress-box,
.v36-streak-box,
.v36-focus-box,
.v36-stats-box,
.v36-quote-box,
.v36-tools-box,
.v36-journal-box {
    border-radius: 28px !important;
    padding: 20px !important;
}

/* Stop flower from covering content */
.v36-flower-art {
    right: 20px !important;
    bottom: -24px !important;
    font-size: 100px !important;
    opacity: 0.14 !important;
    pointer-events: none !important;
}

/* Make page fit better on laptop screen */
@media (max-width: 1250px) {
    .v36-home {
        max-width: 940px !important;
    }

    .v36-hero-box h1 {
        font-size: 42px !important;
    }

    .v36-calendar-box {
        max-width: 340px !important;
    }

    .v36-calendar-box .v3-calendar-day {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        font-size: 13px !important;
    }
}

/* Mobile repair */
@media (max-width: 900px) {
    .sidebar {
        width: 100% !important;
        min-width: 0 !important;
    }

    .v36-dashboard-grid {
        grid-template-columns: 1fr !important;
    }

    .v36-hero-box,
    .v36-calendar-box {
        grid-column: auto !important;
        grid-row: auto !important;
        max-width: 100% !important;
    }

    .v36-hero-box {
        min-height: auto !important;
    }

    .v36-hero-box h1 {
        font-size: 34px !important;
    }
}

/* ===============================
   VERSION 3.7 STUDYMASTER PHOTO MATCH
================================ */

.study-master-home {
    max-width: 1260px;
    margin: 0 auto;
    padding: 0 18px 40px;
}

/* Header like reference */
.sm-header {
    text-align: center;
    padding: 18px 20px 24px;
}

.sm-header h1 {
    margin: 0;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 76px;
    font-style: italic;
    font-weight: 400;
    line-height: 1;
    text-shadow: 0 8px 28px rgba(0,0,0,0.45);
}

.sm-header p {
    margin: 8px 0;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 18px;
}

.sm-header h3 {
    margin: 16px 0 10px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 24px;
    font-weight: 500;
}

.sm-header em {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-size: 18px;
}

/* Layout */
.sm-main-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 28px;
    align-items: start;
}

.sm-center {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sm-mission-card,
.sm-small-card,
.sm-background-card,
.sm-bottom-note,
.sm-right-card {
    background: rgba(8, 15, 42, 0.78) !important;
    border: 1px solid rgba(255,255,255,0.18);
    box-shadow:
        0 20px 48px rgba(0,0,0,0.36),
        inset 0 1px 0 rgba(255,255,255,0.14);
    backdrop-filter: blur(20px) saturate(130%);
    border-radius: 14px;
}

/* Mission */
.sm-mission-card {
    padding: 12px;
}

.sm-mission-card h2 {
    text-align: center;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 18px;
    margin: 4px 0 14px;
    letter-spacing: 0.04em;
}

.sm-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
}

.sm-subject-card {
    min-height: 170px;
    padding: 14px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 86px 1fr;
    gap: 14px;
    border: 1px solid rgba(255,255,255,0.18);
    background: rgba(255,255,255,0.06);
}

.sm-subject-card .sm-icon {
    width: 76px;
    height: 76px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 42px;
    border: 1px solid currentColor;
}

.sm-subject-card h3 {
    margin: 0 0 6px;
    font-size: 20px;
    font-weight: 900;
}

.sm-subject-card p {
    margin: 4px 0 8px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px;
    line-height: 1.35;
}

.sm-subject-card span {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 8px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px;
}

.sm-subject-card.physics {
    color: #4db9ff;
    background: linear-gradient(135deg, rgba(15,74,128,0.58), rgba(6,20,55,0.72));
}

.sm-subject-card.physics span {
    background: rgba(59,130,246,0.45);
}

.sm-subject-card.chemistry {
    color: #6ee56e;
    background: linear-gradient(135deg, rgba(22,101,52,0.45), rgba(6,35,30,0.72));
}

.sm-subject-card.chemistry span {
    background: rgba(34,197,94,0.38);
}

.sm-subject-card.maths {
    color: #ff63b7;
    background: linear-gradient(135deg, rgba(157,23,77,0.48), rgba(50,15,55,0.72));
}

.sm-subject-card.maths span {
    background: rgba(236,72,153,0.42);
}

/* Lower cards */
.sm-lower-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.sm-small-card {
    padding: 14px;
}

.sm-small-card h3 {
    margin: 0 0 12px;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 16px;
}

.sm-small-card p {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px;
}

.sm-small-card button {
    width: 100%;
    margin: 7px 0;
    padding: 12px 14px !important;
    border-radius: 9px !important;
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-align: left;
    box-shadow: none !important;
}

.sm-small-card button span {
    display: block;
    margin-top: 3px;
    font-size: 12px;
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
}

/* Background chooser */
.sm-background-card {
    padding: 14px;
}

.sm-background-card h3 {
    margin: 0 0 10px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 16px;
}

.sm-bg-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.sm-bg-row button {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 10px !important;
}

.sm-bg-row button span {
    display: block;
    margin-top: 6px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px;
    font-weight: 500;
}

.sm-bg-thumb {
    height: 84px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.25);
    background-size: cover;
    background-position: center;
}

.sm-bg-thumb.aurora {
    background-image: linear-gradient(135deg, #09122d, #10b981, #8b5cf6);
}

.sm-bg-thumb.floral {
    background-image: linear-gradient(135deg, #fbcfe8, #fb7185);
}

.sm-bg-thumb.bow {
    background-image: linear-gradient(135deg, #f9a8d4, #ec4899);
}

.sm-bg-thumb.lavender {
    background-image: linear-gradient(135deg, #312e81, #a78bfa);
}

.sm-bg-thumb.cherry {
    background-image: linear-gradient(135deg, #bae6fd, #f9a8d4);
}

.sm-bg-thumb.sunset {
    background-image: linear-gradient(135deg, #fb7185, #f97316, #fde68a);
}

.sm-bg-thumb.starry {
    background-image: linear-gradient(135deg, #020617, #1e40af);
}

.sm-bg-thumb.galaxy {
    background-image: linear-gradient(135deg, #1e1b4b, #7e22ce, #ec4899);
}

.sm-bottom-note {
    padding: 10px 18px;
    text-align: center;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
    font-size: 14px;
}

/* Right panel */
.sm-right-panel {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.sm-right-card {
    padding: 18px;
}

.sm-right-card h3 {
    margin: 0 0 12px;
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
    font-size: 16px;
}

.streak-card h2,
.progress-card h2 {
    margin: 8px 0;
    color: #ff5fac !important;
    -webkit-text-fill-color: #ff5fac !important;
    font-size: 42px;
}

.streak-card p,
.progress-card p,
.motivation-card p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.motivation-card {
    text-align: center;
    background:
        radial-gradient(circle at 85% 80%, rgba(236,72,153,0.28), transparent 30%),
        rgba(8, 15, 42, 0.78) !important;
}

.motivation-card p {
    font-style: italic;
    line-height: 1.5;
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
}

.motivation-card span {
    color: #ff80bd !important;
    -webkit-text-fill-color: #ff80bd !important;
}

.sm-progress-line {
    height: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.18);
    overflow: hidden;
}

.sm-progress-line span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a855f7, #ec4899);
}

/* Calendar inside right panel */
.calendar-card .v3-calendar-card {
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.calendar-card .v3-calendar-card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.calendar-card .v3-calendar-day {
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
}

.calendar-card .v3-calendar-day.today-day {
    background: #22c55e !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.calendar-card .v3-calendar-day.has-plan {
    background: #ec4899 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Sidebar closer to reference */
.sidebar {
    width: 235px !important;
    min-width: 235px !important;
    background: rgba(4, 9, 28, 0.82) !important;
    border-right: 1px solid rgba(255,255,255,0.15) !important;
    backdrop-filter: blur(24px) !important;
}

.sidebar .nav button,
.sidebar button {
    min-height: 46px !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px !important;
    justify-content: flex-start !important;
}

.sidebar .nav button:hover,
.sidebar .nav button.active,
.sidebar button:hover {
    background: linear-gradient(135deg, rgba(236,72,153,0.92), rgba(251,113,133,0.72)) !important;
}

/* Responsive */
@media (max-width: 1150px) {
    .sm-main-layout {
        grid-template-columns: 1fr;
    }

    .sm-right-panel {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
    }

    .sm-bg-row {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 850px) {
    .sm-header h1 {
        font-size: 48px;
    }

    .sm-subject-grid,
    .sm-lower-grid,
    .sm-right-panel {
        grid-template-columns: 1fr;
    }

    .sm-bg-row {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ===============================
   V3.7 STUDYMASTER CLEANUP PATCH
   Fix messy white boxes + layout
================================ */

/* Stop page overflow */
html,
body {
    overflow-x: hidden !important;
}

#planner {
    padding: 0 18px 40px !important;
    overflow-x: hidden !important;
}

/* Main StudyMaster page size */
.study-master-home {
    width: 100% !important;
    max-width: 1160px !important;
    margin: 0 auto !important;
    padding: 0 12px 40px !important;
}

/* Header closer to reference */
.study-master-home .sm-header {
    text-align: center !important;
    padding: 16px 10px 22px !important;
}

.study-master-home .sm-header h1 {
    font-size: 64px !important;
    line-height: 0.95 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-style: italic !important;
    font-weight: 400 !important;
    text-shadow: 0 8px 28px rgba(0,0,0,0.55) !important;
}

.study-master-home .sm-header p,
.study-master-home .sm-header h3 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.study-master-home .sm-header em {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
}

/* Exact main layout */
.study-master-home .sm-main-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 310px !important;
    gap: 22px !important;
    align-items: start !important;
}

.study-master-home .sm-center {
    min-width: 0 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
}

/* Force all StudyMaster glass boxes dark */
.study-master-home .sm-mission-card,
.study-master-home .sm-small-card,
.study-master-home .sm-background-card,
.study-master-home .sm-bottom-note,
.study-master-home .sm-right-card {
    background: rgba(7, 13, 36, 0.82) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    box-shadow:
        0 18px 45px rgba(0,0,0,0.36),
        inset 0 1px 0 rgba(255,255,255,0.14) !important;
    backdrop-filter: blur(20px) saturate(130%) !important;
    border-radius: 14px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Stop old global light-card CSS from turning these white */
.study-master-home .sm-right-card,
.study-master-home .streak-card,
.study-master-home .progress-card,
.study-master-home .motivation-card,
.study-master-home .calendar-card {
    background: rgba(7, 13, 36, 0.84) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Mission card */
.study-master-home .sm-mission-card {
    padding: 12px !important;
}

.study-master-home .sm-mission-card h2 {
    margin: 4px 0 14px !important;
    text-align: center !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 17px !important;
    letter-spacing: 0.04em !important;
}

/* 3 subject cards */
.study-master-home .sm-subject-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.study-master-home .sm-subject-card {
    min-width: 0 !important;
    min-height: 165px !important;
    padding: 13px !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: 70px minmax(0, 1fr) !important;
    gap: 12px !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.study-master-home .sm-subject-card .sm-icon {
    width: 62px !important;
    height: 62px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    font-size: 34px !important;
    border: 1px solid currentColor !important;
}

.study-master-home .sm-subject-card h3 {
    margin: 0 0 5px !important;
    font-size: 18px !important;
    font-weight: 900 !important;
}

.study-master-home .sm-subject-card p {
    margin: 4px 0 8px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.study-master-home .sm-subject-card span {
    display: inline-flex !important;
    padding: 6px 10px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Subject colors */
.study-master-home .sm-subject-card.physics {
    color: #4db9ff !important;
    background: linear-gradient(135deg, rgba(15,74,128,0.62), rgba(6,20,55,0.76)) !important;
}

.study-master-home .sm-subject-card.chemistry {
    color: #6ee56e !important;
    background: linear-gradient(135deg, rgba(22,101,52,0.50), rgba(6,35,30,0.76)) !important;
}

.study-master-home .sm-subject-card.maths {
    color: #ff63b7 !important;
    background: linear-gradient(135deg, rgba(157,23,77,0.52), rgba(50,15,55,0.76)) !important;
}

/* Lower cards */
.study-master-home .sm-lower-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.study-master-home .sm-small-card {
    min-width: 0 !important;
    padding: 14px !important;
}

.study-master-home .sm-small-card h3 {
    margin: 0 0 12px !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 15px !important;
}

.study-master-home .sm-small-card p {
    margin: 10px 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
    line-height: 1.35 !important;
}

.study-master-home .sm-small-card b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Buttons inside home */
.study-master-home button {
    border: none !important;
    outline: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
}

.study-master-home .sm-small-card button {
    width: 100% !important;
    min-height: 48px !important;
    margin: 7px 0 !important;
    padding: 10px 12px !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.08) !important;
    box-shadow: none !important;
    text-align: left !important;
}

.study-master-home .sm-small-card button span {
    display: block !important;
    margin-top: 3px !important;
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
    font-size: 12px !important;
}

/* Right panel */
.study-master-home .sm-right-panel {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.study-master-home .sm-right-card {
    width: 100% !important;
    padding: 16px !important;
    overflow: hidden !important;
}

.study-master-home .sm-right-card h3 {
    margin: 0 0 12px !important;
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
    font-size: 15px !important;
}

.study-master-home .streak-card h2,
.study-master-home .progress-card h2 {
    margin: 6px 0 !important;
    color: #ff5fac !important;
    -webkit-text-fill-color: #ff5fac !important;
    font-size: 38px !important;
}

.study-master-home .streak-card p,
.study-master-home .progress-card p,
.study-master-home .motivation-card p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Calendar must stay dark, not white */
.study-master-home .calendar-card .v3-calendar-card,
.study-master-home .calendar-card .v3-calendar-card * {
    background: transparent !important;
    box-shadow: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.study-master-home .calendar-card .v3-calendar-card {
    padding: 0 !important;
    border: none !important;
}

.study-master-home .calendar-card .v3-calendar-day {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    font-size: 13px !important;
    border-radius: 50% !important;
    background: transparent !important;
}

.study-master-home .calendar-card .v3-calendar-day.today-day {
    background: #22c55e !important;
}

.study-master-home .calendar-card .v3-calendar-day.has-plan {
    background: #ec4899 !important;
}

/* Progress line */
.study-master-home .sm-progress-line {
    height: 13px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.18) !important;
    overflow: hidden !important;
}

.study-master-home .sm-progress-line span {
    display: block !important;
    height: 100% !important;
    border-radius: inherit !important;
    background: linear-gradient(90deg, #a855f7, #ec4899) !important;
}

/* Motivation */
.study-master-home .motivation-card {
    text-align: center !important;
    background:
        radial-gradient(circle at 88% 82%, rgba(236,72,153,0.30), transparent 34%),
        rgba(7, 13, 36, 0.84) !important;
}

.study-master-home .motivation-card p {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-style: italic !important;
    line-height: 1.5 !important;
}

/* Background chooser */
.study-master-home .sm-background-card {
    padding: 14px !important;
}

.study-master-home .sm-background-card h3 {
    margin: 0 0 10px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px !important;
}

.study-master-home .sm-bg-row {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.study-master-home .sm-bg-row button {
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    border-radius: 10px !important;
}

.study-master-home .sm-bg-row button span {
    display: block !important;
    margin-top: 6px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 600 !important;
}

.study-master-home .sm-bg-thumb {
    height: 78px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
}

/* Bottom note */
.study-master-home .sm-bottom-note {
    padding: 10px 16px !important;
    text-align: center !important;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
    font-size: 14px !important;
}

/* Sidebar like photo but not huge */
.sidebar {
    width: 235px !important;
    min-width: 235px !important;
}

.sidebar .nav button,
.sidebar button {
    min-height: 46px !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
}

/* Responsive */
@media (max-width: 1180px) {
    .study-master-home {
        max-width: 1000px !important;
    }

    .study-master-home .sm-main-layout {
        grid-template-columns: 1fr !important;
    }

    .study-master-home .sm-right-panel {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .study-master-home .sm-bg-row {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 850px) {
    .study-master-home .sm-header h1 {
        font-size: 46px !important;
    }

    .study-master-home .sm-subject-grid,
    .study-master-home .sm-lower-grid,
    .study-master-home .sm-right-panel {
        grid-template-columns: 1fr !important;
    }

    .study-master-home .sm-bg-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =========================================================
   CLEAN ISOLATED HOME DESIGN
   Uses only .photo-* classes so old CSS does not fight
========================================================= */

.photo-home,
.photo-home * {
    box-sizing: border-box;
}

.photo-home {
    max-width: 1280px;
    margin: 0 auto;
    padding: 10px 18px 40px;
    color: #ffffff;
}

.photo-header {
    text-align: center;
    margin-bottom: 20px;
}

.photo-header h1 {
    margin: 0;
    font-size: 78px;
    line-height: 1;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: Georgia, "Times New Roman", serif;
    font-style: italic;
    font-weight: 400;
    text-shadow: 0 10px 30px rgba(0,0,0,0.45);
}

.photo-header p {
    margin: 8px 0 6px;
    font-size: 20px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-header h3 {
    margin: 10px 0 8px;
    font-size: 22px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 500;
}

.photo-tagline {
    color: #ffd0e6 !important;
    -webkit-text-fill-color: #ffd0e6 !important;
    font-size: 18px;
    font-style: italic;
}

.photo-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 310px;
    gap: 24px;
    align-items: start;
}

.photo-main {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.photo-right {
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-width: 0;
}

.photo-card {
    background: rgba(8, 14, 40, 0.78);
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 18px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.35);
    backdrop-filter: blur(16px);
}

/* Mission */
.photo-mission {
    padding: 14px;
}

.photo-mission h2 {
    text-align: center;
    margin: 4px 0 16px;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 20px;
    letter-spacing: 0.04em;
}

.photo-subject-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.photo-subject {
    min-width: 0;
    min-height: 188px;
    padding: 16px;
    border-radius: 14px;
    border: 1px solid rgba(255,255,255,0.16);
    display: grid;
    grid-template-columns: 88px minmax(0,1fr);
    gap: 14px;
    color: #ffffff;
}

.photo-subject-icon {
    width: 74px;
    height: 74px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    font-size: 40px;
    border: 1px solid currentColor;
}

.photo-subject h3 {
    margin: 0 0 8px;
    font-size: 18px;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-weight: 900;
}

.photo-subject p {
    margin: 4px 0 8px;
    font-size: 14px;
    line-height: 1.35;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-subject span {
    display: inline-flex;
    padding: 7px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
    font-size: 13px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-target {
    opacity: 0.96;
}

.photo-subject.physics {
    color: #57b8ff;
    background: linear-gradient(135deg, rgba(13,66,115,0.72), rgba(10,20,48,0.88));
}
.photo-subject.physics span { background: rgba(59,130,246,0.38); }

.photo-subject.chemistry {
    color: #70ef77;
    background: linear-gradient(135deg, rgba(18,91,48,0.68), rgba(8,28,24,0.88));
}
.photo-subject.chemistry span { background: rgba(34,197,94,0.35); }

.photo-subject.maths {
    color: #ff65b8;
    background: linear-gradient(135deg, rgba(134,24,76,0.70), rgba(42,12,45,0.88));
}
.photo-subject.maths span { background: rgba(236,72,153,0.35); }

/* Lower grid */
.photo-lower-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
}

.photo-mini-card {
    padding: 16px;
    min-width: 0;
}

.photo-mini-card h3 {
    margin: 0 0 14px;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 18px;
}

.photo-list-item {
    padding: 12px 14px;
    margin-bottom: 10px;
    border-radius: 12px;
    background: rgba(255,255,255,0.06);
}

.photo-list-item span {
    display: block;
    font-size: 15px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 700;
}

.photo-list-item small {
    display: block;
    margin-top: 4px;
    color: #cfe4ff !important;
    -webkit-text-fill-color: #cfe4ff !important;
    font-size: 13px;
}

.photo-goal-row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(255,255,255,0.10);
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-goal-row b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-focus-line {
    padding: 9px 0;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px;
}

/* Background chooser */
.photo-backgrounds {
    padding: 16px;
}

.photo-backgrounds h3 {
    margin: 0 0 12px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 18px;
}

.photo-bg-grid {
    display: grid;
    grid-template-columns: repeat(8, minmax(0,1fr));
    gap: 10px;
}

.photo-bg-grid button {
    border: none;
    background: transparent;
    padding: 0;
    cursor: pointer;
}

.photo-bg-grid span {
    display: block;
    margin-top: 7px;
    text-align: center;
    font-size: 12px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-bg-thumb {
    height: 92px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.20);
    background-size: cover;
    background-position: center;
}

.photo-bg-thumb.aurora {
    background-image: url("./planner-bg.png");
}
.photo-bg-thumb.floral {
    background: linear-gradient(135deg, #fbcfe8, #fb7185);
}
.photo-bg-thumb.bow {
    background: linear-gradient(135deg, #f9a8d4, #ec4899);
}
.photo-bg-thumb.lavender {
    background: linear-gradient(135deg, #312e81, #a78bfa);
}
.photo-bg-thumb.cherry {
    background: linear-gradient(135deg, #bae6fd, #f9a8d4);
}
.photo-bg-thumb.sunset {
    background: linear-gradient(135deg, #fb7185, #f97316, #fde68a);
}
.photo-bg-thumb.starry {
    background: linear-gradient(135deg, #020617, #1e40af);
}
.photo-bg-thumb.galaxy {
    background: linear-gradient(135deg, #1e1b4b, #7e22ce, #ec4899);
}

.photo-bottom-note {
    padding: 12px 18px;
    text-align: center;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
    font-size: 14px;
}

/* Right panel */
.photo-calendar-card,
.photo-side-card {
    padding: 18px;
}

.photo-side-card h3 {
    margin: 0 0 12px;
    color: #ffb2d8 !important;
    -webkit-text-fill-color: #ffb2d8 !important;
    font-size: 18px;
}

.photo-big-number {
    font-size: 42px;
    font-weight: 900;
    color: #ff63b7 !important;
    -webkit-text-fill-color: #ff63b7 !important;
    margin-bottom: 8px;
}

.photo-side-card p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-progress-bar {
    height: 14px;
    background: rgba(255,255,255,0.16);
    border-radius: 999px;
    overflow: hidden;
    margin: 12px 0;
}

.photo-progress-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #a855f7, #ec4899);
}

.photo-motivation {
    text-align: center;
}

.photo-motivation p {
    color: #ffd1e8 !important;
    -webkit-text-fill-color: #ffd1e8 !important;
    font-style: italic;
    line-height: 1.55;
}

.photo-heart {
    margin-top: 8px;
    color: #ff8ac4 !important;
    -webkit-text-fill-color: #ff8ac4 !important;
    font-size: 22px;
}

/* Calendar styling */
.photo-calendar-card .v3-calendar-card {
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

.photo-calendar-card .v3-calendar-card *,
.photo-calendar-card .v3-calendar-title,
.photo-calendar-card .v3-calendar-title h3,
.photo-calendar-card .v3-calendar-title p,
.photo-calendar-card .v3-calendar-weekdays span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-calendar-card .v3-calendar-grid,
.photo-calendar-card .v3-calendar-days {
    gap: 10px !important;
}

.photo-calendar-card .v3-calendar-day {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.photo-calendar-card .v3-calendar-day.today-day {
    background: #22c55e !important;
}

.photo-calendar-card .v3-calendar-day.has-plan {
    background: #ec4899 !important;
}

.photo-calendar-card .v3-calendar-nav button,
.photo-calendar-card button {
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
    box-shadow: none !important;
}

/* Background themes */
body.photo-theme-aurora {
    background:
        linear-gradient(rgba(8,8,26,0.28), rgba(26,8,42,0.42)),
        url("./planner-bg.png") center/cover fixed no-repeat;
}

body.photo-theme-floral {
    background: linear-gradient(135deg, #34113f, #7c2d72, #f472b6) fixed;
}

body.photo-theme-bow {
    background: linear-gradient(135deg, #4c1d3d, #be185d, #f9a8d4) fixed;
}

body.photo-theme-lavender {
    background: linear-gradient(135deg, #120a35, #4338ca, #a78bfa) fixed;
}

body.photo-theme-cherry {
    background: linear-gradient(135deg, #172554, #db2777, #fbcfe8) fixed;
}

body.photo-theme-sunset {
    background: linear-gradient(135deg, #4a044e, #ea580c, #fcd34d) fixed;
}

body.photo-theme-starry {
    background: linear-gradient(135deg, #020617, #1e3a8a, #312e81) fixed;
}

body.photo-theme-galaxy {
    background: linear-gradient(135deg, #0f172a, #581c87, #db2777) fixed;
}

/* Responsive */
@media (max-width: 1200px) {
    .photo-layout {
        grid-template-columns: 1fr;
    }

    .photo-right {
        display: grid;
        grid-template-columns: repeat(2, minmax(0,1fr));
    }

    .photo-bg-grid {
        grid-template-columns: repeat(4, minmax(0,1fr));
    }
}

@media (max-width: 900px) {
    .photo-header h1 {
        font-size: 50px;
    }

    .photo-subject-grid,
    .photo-lower-grid,
    .photo-right {
        grid-template-columns: 1fr;
    }

    .photo-bg-grid {
        grid-template-columns: repeat(2, minmax(0,1fr));
    }
}

/* =====================================================
   FINAL STRIP FIX FOR PHOTO HOME
   Fix ALL tall broken cards, not only subject cards
===================================================== */

/* Stop horizontal squeeze from old layout */
html,
body {
    overflow-x: hidden !important;
}

#planner {
    width: 100% !important;
    max-width: none !important;
    padding: 0 18px 40px !important;
    overflow-x: hidden !important;
}

/* Home gets full available app space */
.photo-home {
    width: 100% !important;
    max-width: 1150px !important;
    margin: 0 auto !important;
    padding: 8px 12px 40px !important;
}

/* Header */
.photo-header {
    width: 100% !important;
    text-align: center !important;
    padding: 8px 0 18px !important;
    margin: 0 0 10px !important;
}

.photo-header h1 {
    font-size: 58px !important;
    line-height: 1 !important;
}

.photo-header p {
    font-size: 17px !important;
}

.photo-header h3 {
    font-size: 20px !important;
}

/* IMPORTANT: remove side-by-side squeeze */
.photo-layout {
    display: grid !important;
    grid-template-columns: 1fr !important;
    width: 100% !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Main and right must use full width */
.photo-main,
.photo-right {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Base card reset for ALL photo cards */
.photo-card,
.photo-mission,
.photo-mini-card,
.photo-backgrounds,
.photo-bottom-note,
.photo-calendar-card,
.photo-side-card {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: auto !important;
    height: auto !important;
    overflow: hidden !important;
    background: rgba(8, 14, 40, 0.84) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.34) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Mission card */
.photo-mission {
    padding: 16px !important;
}

.photo-mission h2 {
    margin: 4px 0 16px !important;
    text-align: center !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 22px !important;
    letter-spacing: 0.04em !important;
}

/* Subject grid must not squeeze into strips */
.photo-subject-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
}

/* Subject cards proper shape */
.photo-subject {
    width: 100% !important;
    min-width: 0 !important;
    min-height: 210px !important;
    height: auto !important;
    padding: 16px !important;
    border-radius: 16px !important;
    display: grid !important;
    grid-template-columns: 72px minmax(0, 1fr) !important;
    gap: 12px !important;
    overflow: hidden !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Subject card dark backgrounds */
.photo-subject.physics {
    background: linear-gradient(135deg, rgba(13,66,115,0.78), rgba(7,15,42,0.92)) !important;
    border: 1px solid rgba(87,184,255,0.45) !important;
    color: #57b8ff !important;
}

.photo-subject.chemistry {
    background: linear-gradient(135deg, rgba(18,91,48,0.72), rgba(7,28,24,0.92)) !important;
    border: 1px solid rgba(112,239,119,0.42) !important;
    color: #70ef77 !important;
}

.photo-subject.maths {
    background: linear-gradient(135deg, rgba(134,24,76,0.76), rgba(42,12,45,0.92)) !important;
    border: 1px solid rgba(255,101,184,0.45) !important;
    color: #ff65b8 !important;
}

/* Subject icon */
.photo-subject-icon {
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    font-size: 34px !important;
    border: 1px solid currentColor !important;
    flex-shrink: 0 !important;
}

/* Subject text */
.photo-subject h3 {
    margin: 0 0 7px !important;
    font-size: 18px !important;
    line-height: 1.15 !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    text-shadow: none !important;
    white-space: normal !important;
    word-break: normal !important;
}

.photo-subject p {
    margin: 5px 0 8px !important;
    font-size: 13px !important;
    line-height: 1.35 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: none !important;
    white-space: normal !important;
    word-break: normal !important;
}

.photo-subject span {
    display: inline-flex !important;
    width: fit-content !important;
    max-width: 100% !important;
    padding: 6px 9px !important;
    border-radius: 9px !important;
    margin: 4px 0 8px !important;
    font-size: 12px !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    white-space: normal !important;
}

.photo-subject.physics span {
    background: rgba(59,130,246,0.42) !important;
}

.photo-subject.chemistry span {
    background: rgba(34,197,94,0.38) !important;
}

.photo-subject.maths span {
    background: rgba(236,72,153,0.40) !important;
}

/* Lower card grid must not become strips */
.photo-lower-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(260px, 1fr)) !important;
    gap: 14px !important;
    width: 100% !important;
}

.photo-mini-card {
    padding: 16px !important;
    min-height: 210px !important;
}

.photo-mini-card h3 {
    margin: 0 0 14px !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 18px !important;
}

/* List items inside cards */
.photo-list-item,
.photo-goal-row,
.photo-focus-line {
    width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    word-break: normal !important;
}

.photo-list-item {
    padding: 12px 14px !important;
    margin-bottom: 10px !important;
    border-radius: 12px !important;
    background: rgba(255,255,255,0.08) !important;
}

.photo-list-item span {
    display: block !important;
    font-size: 15px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-list-item small {
    display: block !important;
    margin-top: 4px !important;
    color: #cfe4ff !important;
    -webkit-text-fill-color: #cfe4ff !important;
}

.photo-goal-row {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 10px 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-focus-line {
    padding: 9px 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Right cards should move below in proper row */
.photo-right {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(220px, 1fr)) !important;
    gap: 14px !important;
}

/* Calendar card wider so calendar does not cut */
.photo-calendar-card {
    grid-column: span 2 !important;
    padding: 18px !important;
}

.photo-calendar-card .v3-calendar-card {
    width: 100% !important;
    max-width: none !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
}

.photo-calendar-card .v3-calendar-grid,
.photo-calendar-card .v3-calendar-days {
    gap: 8px !important;
}

.photo-calendar-card .v3-calendar-day {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    font-size: 13px !important;
}

/* Side cards */
.photo-side-card {
    padding: 18px !important;
    min-height: 150px !important;
}

.photo-side-card h3 {
    margin: 0 0 12px !important;
    color: #ffb2d8 !important;
    -webkit-text-fill-color: #ffb2d8 !important;
    font-size: 17px !important;
}

.photo-big-number {
    font-size: 38px !important;
    color: #ff63b7 !important;
    -webkit-text-fill-color: #ff63b7 !important;
}

.photo-side-card p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Background chooser */
.photo-backgrounds {
    padding: 16px !important;
}

.photo-backgrounds h3 {
    margin: 0 0 12px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.photo-bg-grid {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(90px, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
}

.photo-bg-grid button {
    width: 100% !important;
    min-width: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
}

.photo-bg-thumb {
    width: 100% !important;
    height: 82px !important;
    border-radius: 12px !important;
}

.photo-bg-grid span {
    display: block !important;
    margin-top: 6px !important;
    font-size: 12px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Bottom note */
.photo-bottom-note {
    padding: 12px 18px !important;
    text-align: center !important;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
}

/* Button cleanup */
.photo-home button {
    cursor: pointer !important;
    white-space: normal !important;
}

/* Very important: prevent old v36/study-master layout from interfering */
.v36-home,
.study-master-home {
    display: none !important;
}

/* Medium screens */
@media (max-width: 1150px) {
    .photo-subject-grid,
    .photo-lower-grid {
        grid-template-columns: 1fr !important;
    }

    .photo-subject {
        min-height: auto !important;
    }

    .photo-right {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .photo-calendar-card {
        grid-column: span 2 !important;
    }

    .photo-bg-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* Small screens */
@media (max-width: 700px) {
    .photo-header h1 {
        font-size: 42px !important;
    }

    .photo-subject {
        grid-template-columns: 64px minmax(0, 1fr) !important;
    }

    .photo-right {
        grid-template-columns: 1fr !important;
    }

    .photo-calendar-card {
        grid-column: auto !important;
    }

    .photo-bg-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   STUDYMASTER EXACT HOME - LOCKED VERSION
   This block overrides old messy patches
===================================================== */

/* Hide old failed home layouts completely */
.v36-home,
.study-master-home,
.photo-home {
    display: none !important;
}

/* Main page control */
#planner {
    width: 100% !important;
    max-width: none !important;
    padding: 0 16px 30px !important;
    overflow-x: hidden !important;
}

/* Full reset inside new Home only */
.smx-home,
.smx-home * {
    box-sizing: border-box !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    text-shadow: none !important;
}

/* Main wrapper */
.smx-home {
    width: 100% !important;
    max-width: 1230px !important;
    margin: 0 auto !important;
    padding: 4px 0 28px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: initial !important;
}

/* Header */
.smx-title {
    text-align: center !important;
    padding: 10px 0 22px !important;
}

.smx-title h1 {
    margin: 0 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-size: 72px !important;
    line-height: 0.95 !important;
    font-weight: 400 !important;
    font-style: italic !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 8px 28px rgba(0,0,0,0.55) !important;
}

.smx-title p {
    margin: 8px 0 8px !important;
    font-size: 18px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smx-title h3 {
    margin: 12px 0 8px !important;
    font-size: 22px !important;
    font-weight: 500 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smx-title em {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-size: 17px !important;
}

/* Main exact layout */
.smx-grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 315px !important;
    gap: 24px !important;
    align-items: start !important;
    width: 100% !important;
}

.smx-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-width: 0 !important;
}

.smx-side {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    min-width: 0 !important;
}

/* Glass cards */
.smx-card,
.smx-note {
    background: rgba(7, 13, 36, 0.82) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.35) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
    overflow: hidden !important;
}

/* Mission */
.smx-mission {
    padding: 12px !important;
}

.smx-mission h2 {
    margin: 4px 0 14px !important;
    text-align: center !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: 0.04em !important;
}

/* Subject cards */
.smx-subjects {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.smx-subject {
    min-width: 0 !important;
    min-height: 178px !important;
    padding: 14px !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: 74px minmax(0, 1fr) !important;
    gap: 12px !important;
    overflow: hidden !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
}

.smx-circle {
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    font-size: 34px !important;
    border: 1px solid currentColor !important;
    flex-shrink: 0 !important;
}

.smx-info {
    min-width: 0 !important;
}

.smx-subject h3 {
    margin: 0 0 6px !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    white-space: normal !important;
}

.smx-subject p {
    margin: 4px 0 8px !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    white-space: normal !important;
    word-break: normal !important;
}

.smx-subject span {
    display: inline-block !important;
    width: fit-content !important;
    max-width: 100% !important;
    padding: 6px 9px !important;
    margin: 2px 0 6px !important;
    border-radius: 8px !important;
    font-size: 12px !important;
    line-height: 1.1 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smx-target {
    opacity: 0.96 !important;
}

.smx-target b {
    color: inherit !important;
    -webkit-text-fill-color: inherit !important;
}

.smx-physics {
    color: #4db9ff !important;
    background: linear-gradient(135deg, rgba(15,74,128,0.68), rgba(6,20,55,0.90)) !important;
}

.smx-physics span {
    background: rgba(59,130,246,0.42) !important;
}

.smx-chemistry {
    color: #6ee56e !important;
    background: linear-gradient(135deg, rgba(22,101,52,0.52), rgba(6,35,30,0.90)) !important;
}

.smx-chemistry span {
    background: rgba(34,197,94,0.38) !important;
}

.smx-maths {
    color: #ff63b7 !important;
    background: linear-gradient(135deg, rgba(157,23,77,0.55), rgba(50,15,55,0.90)) !important;
}

.smx-maths span {
    background: rgba(236,72,153,0.42) !important;
}

/* Lower three cards */
.smx-bottom-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.smx-mini {
    padding: 14px !important;
    min-height: 188px !important;
}

.smx-mini h3 {
    margin: 0 0 12px !important;
    font-size: 16px !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-weight: 900 !important;
}

.smx-mini button {
    width: 100% !important;
    min-height: 46px !important;
    margin: 6px 0 !important;
    padding: 10px 12px !important;
    border: none !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.07) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
    text-align: left !important;
    cursor: pointer !important;
}

.smx-mini button b {
    display: block !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.smx-mini button span {
    display: block !important;
    margin-top: 3px !important;
    color: #cfe4ff !important;
    -webkit-text-fill-color: #cfe4ff !important;
    font-size: 12px !important;
}

.smx-row {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 9px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.10) !important;
}

.smx-row span,
.smx-row b,
.smx-focus {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.smx-focus {
    padding: 7px 0 !important;
}

/* Background selector */
.smx-background-box {
    padding: 14px !important;
}

.smx-background-box h3 {
    margin: 0 0 10px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 16px !important;
}

.smx-bg-list {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.smx-bg-list button {
    border: none !important;
    background: transparent !important;
    padding: 0 !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.smx-bg {
    height: 76px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    background-size: cover !important;
    background-position: center !important;
}

.smx-bg-list span {
    display: block !important;
    margin-top: 6px !important;
    text-align: center !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 11px !important;
}

.smx-bg.aurora {
    background-image: url("./planner-bg.png") !important;
}
.smx-bg.floral {
    background: linear-gradient(135deg, #fbcfe8, #fb7185) !important;
}
.smx-bg.bow {
    background: linear-gradient(135deg, #f9a8d4, #ec4899) !important;
}
.smx-bg.lavender {
    background: linear-gradient(135deg, #312e81, #a78bfa) !important;
}
.smx-bg.cherry {
    background: linear-gradient(135deg, #bae6fd, #f9a8d4) !important;
}
.smx-bg.sunset {
    background: linear-gradient(135deg, #fb7185, #f97316, #fde68a) !important;
}
.smx-bg.starry {
    background: linear-gradient(135deg, #020617, #1e40af) !important;
}
.smx-bg.galaxy {
    background: linear-gradient(135deg, #1e1b4b, #7e22ce, #ec4899) !important;
}

.smx-note {
    padding: 10px 16px !important;
    text-align: center !important;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
    font-size: 14px !important;
}

/* Right side */
.smx-side .smx-card {
    padding: 16px !important;
}

.smx-side h3 {
    margin: 0 0 10px !important;
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.smx-streak h2,
.smx-progress h2 {
    margin: 6px 0 !important;
    color: #ff5fac !important;
    -webkit-text-fill-color: #ff5fac !important;
    font-size: 38px !important;
    font-weight: 900 !important;
}

.smx-streak p,
.smx-progress p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.smx-progress-bar {
    height: 14px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.18) !important;
    overflow: hidden !important;
    margin: 10px 0 !important;
}

.smx-progress-bar span {
    display: block !important;
    height: 100% !important;
    width: 62% !important;
    background: linear-gradient(90deg, #a855f7, #ec4899) !important;
}

.smx-motivation {
    text-align: center !important;
}

.smx-motivation p {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-style: italic !important;
    line-height: 1.5 !important;
    font-size: 15px !important;
}

.smx-motivation span {
    color: #ff80bd !important;
    -webkit-text-fill-color: #ff80bd !important;
    font-size: 22px !important;
}

/* Calendar exact dark style */
.smx-calendar {
    padding: 16px !important;
}

.smx-calendar .v3-calendar-card {
    width: 100% !important;
    max-width: none !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
}

.smx-calendar .v3-calendar-card *,
.smx-calendar .v3-calendar-title h3,
.smx-calendar .v3-calendar-title p,
.smx-calendar .v3-calendar-weekdays span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smx-calendar .v3-calendar-grid,
.smx-calendar .v3-calendar-days {
    gap: 7px !important;
}

.smx-calendar .v3-calendar-day {
    width: 31px !important;
    height: 31px !important;
    min-width: 31px !important;
    min-height: 31px !important;
    border-radius: 50% !important;
    font-size: 13px !important;
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.smx-calendar .v3-calendar-day.today-day {
    background: #22c55e !important;
}

.smx-calendar .v3-calendar-day.has-plan {
    background: #ec4899 !important;
}

.smx-calendar .v3-calendar-nav button,
.smx-calendar button {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Body themes */
body.smx-theme-aurora {
    background:
        linear-gradient(rgba(8,8,26,0.25), rgba(26,8,42,0.45)),
        url("./planner-bg.png") center/cover fixed no-repeat !important;
}

body.smx-theme-floral {
    background: linear-gradient(135deg, #34113f, #7c2d72, #f472b6) fixed !important;
}

body.smx-theme-bow {
    background: linear-gradient(135deg, #4c1d3d, #be185d, #f9a8d4) fixed !important;
}

body.smx-theme-lavender {
    background: linear-gradient(135deg, #120a35, #4338ca, #a78bfa) fixed !important;
}

body.smx-theme-cherry {
    background: linear-gradient(135deg, #172554, #db2777, #fbcfe8) fixed !important;
}

body.smx-theme-sunset {
    background: linear-gradient(135deg, #4a044e, #ea580c, #fcd34d) fixed !important;
}

body.smx-theme-starry {
    background: linear-gradient(135deg, #020617, #1e3a8a, #312e81) fixed !important;
}

body.smx-theme-galaxy {
    background: linear-gradient(135deg, #0f172a, #581c87, #db2777) fixed !important;
}

/* Sidebar closer to reference */
.sidebar {
    width: 235px !important;
    min-width: 235px !important;
}

.sidebar .nav button,
.sidebar button {
    min-height: 46px !important;
    margin-bottom: 8px !important;
    border-radius: 10px !important;
    font-size: 15px !important;
}

/* Laptop fit */
@media (max-width: 1220px) {
    .smx-home {
        max-width: 1050px !important;
    }

    .smx-grid {
        grid-template-columns: 1fr !important;
    }

    .smx-side {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .smx-calendar {
        grid-column: span 2 !important;
    }
}

/* Tablet */
@media (max-width: 900px) {
    .smx-title h1 {
        font-size: 46px !important;
    }

    .smx-subjects,
    .smx-bottom-grid {
        grid-template-columns: 1fr !important;
    }

    .smx-subject {
        min-height: auto !important;
    }

    .smx-bg-list {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

/* Phone */
@media (max-width: 650px) {
    .smx-side {
        grid-template-columns: 1fr !important;
    }

    .smx-calendar {
        grid-column: auto !important;
    }

    .smx-bg-list {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   FINAL LOCKED STUDYMASTER HOME
   New classes only. Old broken layouts hidden.
===================================================== */

.v36-home,
.study-master-home,
.photo-home,
.smx-home {
    display: none !important;
}

#planner {
    width: 100% !important;
    max-width: none !important;
    padding: 0 14px 28px !important;
    overflow-x: hidden !important;
}

.final-study-home,
.final-study-home * {
    box-sizing: border-box !important;
    font-family: "Segoe UI", Arial, sans-serif !important;
    text-shadow: none !important;
}

.final-study-home {
    max-width: 1240px !important;
    margin: 0 auto !important;
    color: #ffffff !important;
    -webkit-text-fill-color: initial !important;
}

.final-study-header {
    text-align: center !important;
    padding: 12px 0 24px !important;
}

.final-study-header h1 {
    margin: 0 !important;
    font-family: Georgia, "Times New Roman", serif !important;
    font-style: italic !important;
    font-weight: 400 !important;
    font-size: 74px !important;
    line-height: 0.95 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 8px 30px rgba(0,0,0,0.55) !important;
}

.final-study-header p {
    margin: 8px 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 18px !important;
}

.final-study-header h3 {
    margin: 12px 0 8px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 500 !important;
}

.final-study-header em {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-size: 17px !important;
}

.final-study-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 320px !important;
    gap: 24px !important;
    align-items: start !important;
}

.final-study-main {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    min-width: 0 !important;
}

.final-study-side {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    min-width: 0 !important;
}

.final-card,
.final-note {
    background: rgba(7, 13, 36, 0.82) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 14px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.35) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
    overflow: hidden !important;
}

/* mission */
.final-mission {
    padding: 12px !important;
}

.final-mission h2 {
    margin: 4px 0 14px !important;
    text-align: center !important;
    color: #ff9fd1 !important;
    -webkit-text-fill-color: #ff9fd1 !important;
    font-size: 20px !important;
    letter-spacing: 0.04em !important;
    font-weight: 900 !important;
}

.final-subject-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 14px !important;
}

.final-subject {
    min-height: 180px !important;
    padding: 14px !important;
    border-radius: 12px !important;
    display: grid !important;
    grid-template-columns: 74px minmax(0, 1fr) !important;
    gap: 12px !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
}

.final-subject-icon {
    width: 66px !important;
    height: 66px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    border: 1px solid currentColor !important;
    font-size: 34px !important;
}

.final-subject-text {
    min-width: 0 !important;
}

.final-subject h3 {
    margin: 0 0 6px !important;
    color: currentColor !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: 18px !important;
    line-height: 1.1 !important;
    font-weight: 900 !important;
}

.final-subject p {
    margin: 4px 0 8px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
    line-height: 1.3 !important;
    word-break: normal !important;
    white-space: normal !important;
}

.final-subject span {
    display: inline-block !important;
    width: fit-content !important;
    padding: 6px 9px !important;
    margin: 2px 0 6px !important;
    border-radius: 8px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
}

.final-subject b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.final-physics {
    color: #4db9ff !important;
    background: linear-gradient(135deg, rgba(15,74,128,0.68), rgba(6,20,55,0.9)) !important;
}

.final-physics span {
    background: rgba(59,130,246,0.42) !important;
}

.final-chemistry {
    color: #6ee56e !important;
    background: linear-gradient(135deg, rgba(22,101,52,0.52), rgba(6,35,30,0.9)) !important;
}

.final-chemistry span {
    background: rgba(34,197,94,0.38) !important;
}

.final-maths {
    color: #ff63b7 !important;
    background: linear-gradient(135deg, rgba(157,23,77,0.55), rgba(50,15,55,0.9)) !important;
}

.final-maths span {
    background: rgba(236,72,153,0.42) !important;
}

/* lower row */
.final-bottom-row {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 12px !important;
}

.final-small {
    min-height: 190px !important;
    padding: 14px !important;
}

.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3 {
    margin: 0 0 12px !important;
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
    font-size: 16px !important;
    font-weight: 900 !important;
}

.final-small button {
    width: 100% !important;
    min-height: 46px !important;
    margin: 6px 0 !important;
    padding: 10px 12px !important;
    border: none !important;
    border-radius: 10px !important;
    background: rgba(255,255,255,0.07) !important;
    box-shadow: none !important;
    text-align: left !important;
    cursor: pointer !important;
}

.final-small button b {
    display: block !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.final-small button span {
    display: block !important;
    margin-top: 3px !important;
    color: #cfe4ff !important;
    -webkit-text-fill-color: #cfe4ff !important;
    font-size: 12px !important;
}

.final-small p,
.final-goal,
.final-goal span,
.final-goal b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.final-small p {
    margin: 10px 0 !important;
}

.final-goal {
    display: flex !important;
    justify-content: space-between !important;
    gap: 10px !important;
    padding: 9px 0 !important;
    border-bottom: 1px solid rgba(255,255,255,0.1) !important;
}

/* backgrounds */
.final-backgrounds {
    padding: 14px !important;
}

.final-bg-row {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0,1fr)) !important;
    gap: 10px !important;
}

.final-bg-row button {
    border: none !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 0 !important;
    cursor: pointer !important;
}

.final-bg {
    height: 76px !important;
    border-radius: 10px !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    background-size: cover !important;
    background-position: center !important;
}

.final-bg-row span {
    display: block !important;
    margin-top: 6px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 11px !important;
    text-align: center !important;
}

.bg1 { background-image: url("./planner-bg.png") !important; }
.bg2 { background: linear-gradient(135deg, #fbcfe8, #fb7185) !important; }
.bg3 { background: linear-gradient(135deg, #f9a8d4, #ec4899) !important; }
.bg4 { background: linear-gradient(135deg, #312e81, #a78bfa) !important; }
.bg5 { background: linear-gradient(135deg, #bae6fd, #f9a8d4) !important; }
.bg6 { background: linear-gradient(135deg, #fb7185, #f97316, #fde68a) !important; }
.bg7 { background: linear-gradient(135deg, #020617, #1e40af) !important; }
.bg8 { background: linear-gradient(135deg, #1e1b4b, #7e22ce, #ec4899) !important; }

.final-note {
    padding: 10px 16px !important;
    text-align: center !important;
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
    font-size: 14px !important;
}

/* side */
.final-calendar,
.final-side-card,
.final-motivation {
    padding: 16px !important;
}

.final-side-card h2 {
    margin: 6px 0 !important;
    color: #ff5fac !important;
    -webkit-text-fill-color: #ff5fac !important;
    font-size: 38px !important;
    font-weight: 900 !important;
}

.final-side-card p,
.final-motivation p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 14px !important;
}

.final-progress {
    height: 14px !important;
    border-radius: 999px !important;
    background: rgba(255,255,255,0.18) !important;
    overflow: hidden !important;
    margin: 10px 0 !important;
}

.final-progress span {
    display: block !important;
    width: 62% !important;
    height: 100% !important;
    background: linear-gradient(90deg, #a855f7, #ec4899) !important;
}

.final-motivation {
    text-align: center !important;
}

.final-motivation p {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
    font-style: italic !important;
    line-height: 1.5 !important;
}

.final-motivation span {
    color: #ff80bd !important;
    -webkit-text-fill-color: #ff80bd !important;
    font-size: 22px !important;
}

/* custom calendar */
.final-calendar-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 14px !important;
}

.final-calendar-head h3 {
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 17px !important;
}

.final-calendar-head button {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    border-radius: 50% !important;
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 24px !important;
}

.final-week,
.final-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 7px !important;
    text-align: center !important;
}

.final-week span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
}

.final-days {
    margin-top: 12px !important;
}

.final-days span {
    min-height: 30px !important;
    border-radius: 50% !important;
    display: grid !important;
    place-items: center !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
}

.final-days span.pink {
    background: #ec4899 !important;
}

.final-days span.green {
    background: #22c55e !important;
}

.final-legend {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    margin-top: 12px !important;
}

.final-legend small {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 10px !important;
}

.dot {
    display: inline-block !important;
    width: 9px !important;
    height: 9px !important;
    border-radius: 50% !important;
    margin-right: 4px !important;
}

.pink-dot { background: #ec4899 !important; }
.green-dot { background: #22c55e !important; }
.purple-dot { background: #a855f7 !important; }

/* body themes */
body.final-theme-aurora {
    background:
        linear-gradient(rgba(8,8,26,0.25), rgba(26,8,42,0.45)),
        url("./planner-bg.png") center/cover fixed no-repeat !important;
}

body.final-theme-floral {
    background: linear-gradient(135deg, #34113f, #7c2d72, #f472b6) fixed !important;
}

body.final-theme-bow {
    background: linear-gradient(135deg, #4c1d3d, #be185d, #f9a8d4) fixed !important;
}

body.final-theme-lavender {
    background: linear-gradient(135deg, #120a35, #4338ca, #a78bfa) fixed !important;
}

body.final-theme-cherry {
    background: linear-gradient(135deg, #172554, #db2777, #fbcfe8) fixed !important;
}

body.final-theme-sunset {
    background: linear-gradient(135deg, #4a044e, #ea580c, #fcd34d) fixed !important;
}

body.final-theme-starry {
    background: linear-gradient(135deg, #020617, #1e3a8a, #312e81) fixed !important;
}

body.final-theme-galaxy {
    background: linear-gradient(135deg, #0f172a, #581c87, #db2777) fixed !important;
}

/* fit smaller laptops */
@media (max-width: 1260px) {
    .final-study-home {
        max-width: 1040px !important;
    }

    .final-study-layout {
        grid-template-columns: 1fr !important;
    }

    .final-study-side {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .final-calendar {
        grid-column: span 2 !important;
    }
}

@media (max-width: 900px) {
    .final-study-header h1 {
        font-size: 46px !important;
    }

    .final-subject-row,
    .final-bottom-row {
        grid-template-columns: 1fr !important;
    }

    .final-bg-row {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 650px) {
    .final-study-side {
        grid-template-columns: 1fr !important;
    }

    .final-calendar {
        grid-column: auto !important;
    }

    .final-bg-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   FINAL SCREEN-FIT FIX
   Compact calendar + keep all cards visible like photo
===================================================== */

/* Make the full app use screen space better */
#planner {
    padding: 0 10px 20px !important;
}

/* Reduce overall size so everything fits like reference */
.final-study-home {
    max-width: 1120px !important;
    margin: 0 auto !important;
}

/* Header smaller so cards appear on screen */
.final-study-header {
    padding: 6px 0 14px !important;
}

.final-study-header h1 {
    font-size: 58px !important;
}

.final-study-header p {
    font-size: 15px !important;
    margin: 5px 0 !important;
}

.final-study-header h3 {
    font-size: 17px !important;
    margin: 6px 0 !important;
}

.final-study-header em {
    font-size: 14px !important;
}

/* IMPORTANT: keep right panel on the side */
.final-study-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 300px !important;
    gap: 16px !important;
    align-items: start !important;
}

/* Do not let old media query push right panel below */
.final-study-side {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
}

/* Make cards more compact */
.final-card,
.final-note {
    border-radius: 13px !important;
}

.final-mission {
    padding: 10px !important;
}

.final-mission h2 {
    font-size: 18px !important;
    margin-bottom: 10px !important;
}

/* Subject cards compact like reference */
.final-subject-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.final-subject {
    min-height: 150px !important;
    padding: 10px !important;
    grid-template-columns: 58px minmax(0, 1fr) !important;
    gap: 9px !important;
}

.final-subject-icon {
    width: 52px !important;
    height: 52px !important;
    font-size: 28px !important;
}

.final-subject h3 {
    font-size: 15px !important;
    margin-bottom: 4px !important;
}

.final-subject p {
    font-size: 11px !important;
    line-height: 1.25 !important;
    margin: 3px 0 5px !important;
}

.final-subject span {
    font-size: 10px !important;
    padding: 5px 7px !important;
    margin: 1px 0 5px !important;
}

/* Lower cards compact */
.final-bottom-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.final-small {
    min-height: 150px !important;
    padding: 10px !important;
}

.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3 {
    font-size: 14px !important;
    margin-bottom: 8px !important;
}

.final-small button {
    min-height: 36px !important;
    padding: 7px 9px !important;
    margin: 5px 0 !important;
}

.final-small button b {
    font-size: 12px !important;
}

.final-small button span {
    font-size: 10px !important;
}

.final-small p,
.final-goal,
.final-goal span,
.final-goal b {
    font-size: 12px !important;
}

.final-goal {
    padding: 6px 0 !important;
}

/* Background chooser smaller */
.final-backgrounds {
    padding: 10px !important;
}

.final-bg-row {
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 8px !important;
}

.final-bg {
    height: 58px !important;
}

.final-bg-row span {
    font-size: 10px !important;
}

/* Bottom note compact */
.final-note {
    padding: 8px 12px !important;
    font-size: 12px !important;
}

/* ===============================
   FIX CALENDAR SHAPE
================================ */

.final-calendar {
    padding: 14px !important;
    width: 300px !important;
    max-width: 300px !important;
}

/* Calendar header */
.final-calendar-head {
    margin-bottom: 10px !important;
}

.final-calendar-head h3 {
    font-size: 16px !important;
}

.final-calendar-head button {
    width: 30px !important;
    height: 30px !important;
}

/* Calendar grid must not stretch circles */
.final-week,
.final-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 6px !important;
}

.final-week span {
    font-size: 11px !important;
    text-align: center !important;
}

.final-days span {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    border-radius: 50% !important;
    justify-self: center !important;
    align-self: center !important;
    display: grid !important;
    place-items: center !important;
    font-size: 12px !important;
    padding: 0 !important;
}

/* Empty date cells should stay invisible */
.final-days span:empty {
    background: transparent !important;
}

/* Legend smaller */
.final-legend {
    gap: 5px !important;
    margin-top: 10px !important;
}

.final-legend small {
    font-size: 9px !important;
}

/* Side cards compact */
.final-side-card,
.final-motivation {
    padding: 14px !important;
}

.final-side-card h2 {
    font-size: 32px !important;
}

.final-side-card p,
.final-motivation p {
    font-size: 12px !important;
}

.final-progress {
    height: 11px !important;
}

/* Keep this layout until tablet size only */
@media (max-width: 1050px) {
    .final-study-layout {
        grid-template-columns: 1fr !important;
    }

    .final-study-side {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .final-calendar {
        width: 100% !important;
        max-width: 100% !important;
        grid-column: span 2 !important;
    }
}

@media (max-width: 760px) {
    .final-subject-row,
    .final-bottom-row,
    .final-study-side {
        grid-template-columns: 1fr !important;
    }

    .final-calendar {
        grid-column: auto !important;
    }

    .final-bg-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   FINAL CALENDAR + TEXT VISIBILITY FIX
   No test circles. Clickable dates. Visible card text.
===================================================== */

/* Fix invisible text inside subject cards */
.final-study-home .final-subject,
.final-study-home .final-subject * {
    text-shadow: none !important;
}

.final-study-home .final-subject h3 {
    font-weight: 900 !important;
    opacity: 1 !important;
}

.final-study-home .final-subject p,
.final-study-home .final-subject b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 700 !important;
}

.final-study-home .final-subject span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    font-weight: 800 !important;
}

/* Force subject cards dark, not pale */
.final-study-home .final-physics {
    background: linear-gradient(135deg, rgba(10, 75, 130, 0.9), rgba(5, 12, 35, 0.96)) !important;
    color: #55c2ff !important;
}

.final-study-home .final-chemistry {
    background: linear-gradient(135deg, rgba(18, 105, 55, 0.88), rgba(5, 28, 24, 0.96)) !important;
    color: #74f27f !important;
}

.final-study-home .final-maths {
    background: linear-gradient(135deg, rgba(150, 28, 90, 0.9), rgba(45, 10, 48, 0.96)) !important;
    color: #ff70bd !important;
}

.final-study-home .final-physics h3 {
    color: #55c2ff !important;
    -webkit-text-fill-color: #55c2ff !important;
}

.final-study-home .final-chemistry h3 {
    color: #74f27f !important;
    -webkit-text-fill-color: #74f27f !important;
}

.final-study-home .final-maths h3 {
    color: #ff70bd !important;
    -webkit-text-fill-color: #ff70bd !important;
}

/* Calendar clean layout */
.final-calendar {
    padding: 16px !important;
}

.final-calendar-head {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 14px !important;
}

.final-calendar-head h3 {
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 17px !important;
    font-weight: 900 !important;
    text-align: center !important;
}

.final-calendar-head button {
    width: 32px !important;
    height: 32px !important;
    border: none !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    display: grid !important;
    place-items: center !important;
    box-shadow: none !important;
}

.final-week,
.final-days {
    display: grid !important;
    grid-template-columns: repeat(7, 1fr) !important;
    gap: 7px !important;
}

.final-week span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 800 !important;
    text-align: center !important;
}

.final-days {
    margin-top: 12px !important;
}

.final-empty-day {
    width: 30px !important;
    height: 30px !important;
}

.final-date-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 50% !important;
    border: none !important;
    justify-self: center !important;
    align-self: center !important;
    display: grid !important;
    place-items: center !important;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

.final-date-btn:hover {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.final-today-btn {
    width: 100% !important;
    margin-top: 14px !important;
    padding: 11px 14px !important;
    border-radius: 999px !important;
    border: none !important;
    background: rgba(245, 243, 255, 0.96) !important;
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
    font-weight: 900 !important;
    box-shadow: none !important;
    cursor: pointer !important;
}

/* Remove old legend/test dots if any old CSS still shows them */
.final-legend,
.final-days .pink,
.final-days .green,
.final-days .purple {
    background: transparent !important;
}

/* =====================================================
   ABSOLUTE FINAL TEXT VISIBILITY FIX
   Fix invisible/pale text in StudyMaster home
===================================================== */

/* Force all Final Home text visible by default */
.final-study-home,
.final-study-home * {
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Dark cards text must be white */
.final-study-home .final-card,
.final-study-home .final-card *,
.final-study-home .final-note,
.final-study-home .final-note * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Pink headings */
.final-study-home .final-mission h2,
.final-study-home .final-small h3,
.final-study-home .final-backgrounds h3,
.final-study-home .final-side-card h3,
.final-study-home .final-motivation h3 {
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
    font-weight: 900 !important;
}

/* Subject headings keep their subject color */
.final-study-home .final-physics h3,
.final-study-home .final-physics .final-subject-icon {
    color: #55c2ff !important;
    -webkit-text-fill-color: #55c2ff !important;
}

.final-study-home .final-chemistry h3,
.final-study-home .final-chemistry .final-subject-icon {
    color: #74f27f !important;
    -webkit-text-fill-color: #74f27f !important;
}

.final-study-home .final-maths h3,
.final-study-home .final-maths .final-subject-icon {
    color: #ff70bd !important;
    -webkit-text-fill-color: #ff70bd !important;
}

/* Make subject cards darker so white text is readable */
.final-study-home .final-physics {
    background: linear-gradient(135deg, rgba(7, 69, 125, 0.96), rgba(3, 9, 30, 0.98)) !important;
}

.final-study-home .final-chemistry {
    background: linear-gradient(135deg, rgba(13, 95, 50, 0.96), rgba(3, 25, 20, 0.98)) !important;
}

.final-study-home .final-maths {
    background: linear-gradient(135deg, rgba(143, 22, 82, 0.96), rgba(35, 8, 42, 0.98)) !important;
}

/* Subject body text */
.final-study-home .final-subject p,
.final-study-home .final-subject p *,
.final-study-home .final-subject b {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
}

/* Unit badges */
.final-study-home .final-subject span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
}

/* Revision buttons text */
.final-study-home .final-small button,
.final-study-home .final-small button *,
.final-study-home .final-small button b,
.final-study-home .final-small button span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Softer subtext inside revision buttons */
.final-study-home .final-small button span {
    color: #dbeafe !important;
    -webkit-text-fill-color: #dbeafe !important;
}

/* MCQ goal and focus text */
.final-study-home .final-goal,
.final-study-home .final-goal *,
.final-study-home .final-small p,
.final-study-home .final-small p * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
}

/* Calendar text */
.final-study-home .final-calendar,
.final-study-home .final-calendar *,
.final-study-home .final-week span,
.final-study-home .final-date-btn,
.final-study-home .final-today-btn {
    opacity: 1 !important;
}

/* Calendar date button text */
.final-study-home .final-date-btn {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Today button purple text */
.final-study-home .final-today-btn {
    color: #7c3aed !important;
    -webkit-text-fill-color: #7c3aed !important;
}

/* Side cards */
.final-study-home .final-side-card h2 {
    color: #ff5fac !important;
    -webkit-text-fill-color: #ff5fac !important;
}

.final-study-home .final-side-card p,
.final-study-home .final-motivation p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Motivation pink text */
.final-study-home .final-motivation p {
    color: #ffc4e2 !important;
    -webkit-text-fill-color: #ffc4e2 !important;
}

/* Background labels */
.final-study-home .final-bg-row span {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Bottom note */
.final-study-home .final-note {
    color: #f0abfc !important;
    -webkit-text-fill-color: #f0abfc !important;
}

/* =====================================================
   FINAL BUTTON + PLANNER TAB POLISH
   Remove white buttons and make sidebar premium
===================================================== */

/* Remove white-looking buttons inside final home */
.final-study-home .final-small button,
.final-study-home .final-today-btn {
    background: linear-gradient(135deg, #38bdf8, #8b5cf6) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    box-shadow: 0 10px 24px rgba(56,189,248,0.22) !important;
}

/* Text inside those buttons */
.final-study-home .final-small button *,
.final-study-home .final-today-btn * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Revision buttons individual colors */
.final-study-home .final-small button:nth-of-type(1) {
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
}

.final-study-home .final-small button:nth-of-type(2) {
    background: linear-gradient(135deg, #22d3ee, #8b5cf6) !important;
}

.final-study-home .final-small button:nth-of-type(3) {
    background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
}

/* Start MCQ button */
.final-study-home .final-small button[onclick*="loadMCQ"] {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Open Today's Plan button */
.final-study-home .final-today-btn {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Make sidebar / planner tab look premium */
.sidebar {
    background: rgba(5, 10, 30, 0.86) !important;
    border-right: 1px solid rgba(255,255,255,0.18) !important;
    box-shadow: 12px 0 40px rgba(0,0,0,0.32) !important;
    backdrop-filter: blur(22px) saturate(130%) !important;
}

/* All sidebar buttons */
.sidebar .nav button,
.sidebar button {
    background: rgba(255,255,255,0.04) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 800 !important;
    letter-spacing: 0.01em !important;
    box-shadow: none !important;
    transition: 0.25s ease !important;
}

/* Hover sidebar buttons */
.sidebar .nav button:hover,
.sidebar button:hover {
    background: linear-gradient(135deg, rgba(236,72,153,0.95), rgba(251,107,47,0.92)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    transform: translateX(4px) !important;
    box-shadow: 0 12px 24px rgba(236,72,153,0.24) !important;
}

/* Active / Home / selected looking button */
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 14px 28px rgba(236,72,153,0.28) !important;
}

/* Sidebar title/brand */
.sidebar h1,
.sidebar h2,
.sidebar h3,
.sidebar p {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Make Planner area background feel less plain */
.final-study-home {
    padding-top: 4px !important;
}

.final-card,
.final-note {
    background:
        linear-gradient(135deg, rgba(10,18,48,0.86), rgba(18,10,45,0.82)) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
}

/* =====================================================
   ABSOLUTE LAST BUTTON FIX
   Must stay at the very bottom of style.css
===================================================== */

/* All buttons in final StudyMaster home */
.final-study-home button,
.final-study-home button *,
.final-study-home .final-small button,
.final-study-home .final-small button *,
.final-study-home .final-today-btn,
.final-study-home .final-today-btn * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Remove white button backgrounds */
.final-study-home .final-small button,
.final-study-home .final-today-btn {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    box-shadow: 0 10px 22px rgba(236,72,153,0.25) !important;
}

/* Today revision buttons */
.final-study-home .final-small:first-child button:nth-of-type(1) {
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
}

.final-study-home .final-small:first-child button:nth-of-type(2) {
    background: linear-gradient(135deg, #22d3ee, #8b5cf6) !important;
}

.final-study-home .final-small:first-child button:nth-of-type(3) {
    background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
}

/* MCQ start button */
.final-study-home .final-small:nth-child(2) button {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
}

/* Open today's plan button */
.final-study-home .final-today-btn {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
}

/* Make disabled-looking pale button readable if browser keeps pale style */
.final-study-home button[disabled],
.final-study-home button:disabled {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Planner/sidebar premium tab */
.sidebar .nav button,
.sidebar button {
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.12) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: 12px !important;
    font-weight: 900 !important;
}

.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 12px 26px rgba(236,72,153,0.28) !important;
}

/* =====================================================
   FINAL CALENDAR VISUAL POLISH
   Fix odd spacing, overflow, and date alignment
===================================================== */

.final-calendar {
    width: 300px !important;
    max-width: 300px !important;
    padding: 18px 16px !important;
    overflow: hidden !important;
}

/* Calendar title row */
.final-calendar-head {
    display: grid !important;
    grid-template-columns: 34px 1fr 34px !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
}

.final-calendar-head h3 {
    text-align: center !important;
    font-size: 20px !important;
    letter-spacing: 0.02em !important;
}

.final-calendar-head button {
    width: 34px !important;
    height: 34px !important;
    min-width: 34px !important;
    min-height: 34px !important;
    border-radius: 50% !important;
    padding: 0 !important;
}

/* Week row */
.final-week {
    display: grid !important;
    grid-template-columns: repeat(7, 30px) !important;
    justify-content: center !important;
    gap: 6px !important;
    margin-bottom: 12px !important;
}

.final-week span {
    width: 30px !important;
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 900 !important;
}

/* Date grid */
.final-days {
    display: grid !important;
    grid-template-columns: repeat(7, 30px) !important;
    justify-content: center !important;
    gap: 8px 6px !important;
    margin-top: 0 !important;
}

/* Empty spaces before first date */
.final-empty-day {
    width: 30px !important;
    height: 30px !important;
    display: block !important;
}

/* Date buttons */
.final-date-btn {
    width: 30px !important;
    height: 30px !important;
    min-width: 30px !important;
    min-height: 30px !important;
    max-width: 30px !important;
    max-height: 30px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;
    display: grid !important;
    place-items: center !important;
    font-size: 12px !important;
    font-weight: 900 !important;
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: none !important;
}

/* Hover/click feel */
.final-date-btn:hover {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    transform: scale(1.05) !important;
}

/* Today button */
.final-today-btn {
    width: 100% !important;
    margin-top: 18px !important;
    min-height: 40px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
}

/* Make right side card clean */
.final-study-side {
    gap: 12px !important;
}

.final-calendar + .final-side-card {
    margin-top: 0 !important;
}

/* On smaller layout, allow calendar to fit full width */
@media (max-width: 1050px) {
    .final-calendar {
        width: 100% !important;
        max-width: 360px !important;
        margin: 0 auto !important;
    }
}

/* =====================================================
   FINAL 100% SCREEN BALANCE FIX
   Keep fonts readable + stop cards becoming too tall
===================================================== */

/* Keep page comfortable at 100% zoom */
.final-study-home {
    max-width: 1180px !important;
}

/* Reduce vertical height without making text tiny */
.final-study-header {
    padding: 6px 0 12px !important;
}

.final-study-header h1 {
    font-size: 52px !important;
}

.final-study-header p {
    font-size: 15px !important;
    margin: 4px 0 !important;
}

.final-study-header h3 {
    font-size: 16px !important;
    margin: 5px 0 !important;
}

.final-study-header em {
    font-size: 14px !important;
}

/* Main layout: keep right side, but reduce gaps */
.final-study-layout {
    grid-template-columns: minmax(0, 1fr) 295px !important;
    gap: 14px !important;
}

/* Reduce card padding/height */
.final-mission {
    padding: 9px !important;
}

.final-mission h2 {
    font-size: 18px !important;
    margin: 2px 0 9px !important;
}

/* Subject cards: readable but shorter */
.final-subject-row {
    gap: 9px !important;
}

.final-subject {
    min-height: 138px !important;
    padding: 9px !important;
    grid-template-columns: 54px minmax(0, 1fr) !important;
    gap: 8px !important;
}

.final-subject-icon {
    width: 48px !important;
    height: 48px !important;
    font-size: 25px !important;
}

.final-subject h3 {
    font-size: 15px !important;
    margin-bottom: 3px !important;
}

.final-subject p {
    font-size: 11.5px !important;
    line-height: 1.25 !important;
    margin: 2px 0 4px !important;
}

.final-subject span {
    font-size: 10.5px !important;
    padding: 4px 7px !important;
    margin: 1px 0 4px !important;
}

/* Lower cards shorter but text still visible */
.final-bottom-row {
    gap: 9px !important;
}

.final-small {
    min-height: 145px !important;
    padding: 10px !important;
}

.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3 {
    font-size: 15px !important;
    margin-bottom: 8px !important;
}

.final-small button {
    min-height: 34px !important;
    margin: 4px 0 !important;
    padding: 7px 10px !important;
}

.final-small button b {
    font-size: 12px !important;
}

.final-small button span {
    font-size: 10.5px !important;
}

.final-small p,
.final-goal,
.final-goal span,
.final-goal b {
    font-size: 12px !important;
}

.final-goal {
    padding: 6px 0 !important;
}

/* Background selector more compact */
.final-backgrounds {
    padding: 10px !important;
}

.final-bg {
    height: 54px !important;
}

.final-bg-row span {
    font-size: 10px !important;
}

/* Bottom note compact */
.final-note {
    padding: 7px 12px !important;
    font-size: 12px !important;
}

/* Right side compact */
.final-study-side {
    gap: 10px !important;
}

.final-calendar {
    width: 295px !important;
    max-width: 295px !important;
    padding: 14px !important;
}

.final-calendar-head {
    margin-bottom: 12px !important;
}

.final-calendar-head h3 {
    font-size: 17px !important;
}

.final-week,
.final-days {
    grid-template-columns: repeat(7, 28px) !important;
    gap: 6px !important;
}

.final-week span {
    width: 28px !important;
    font-size: 10.5px !important;
}

.final-empty-day,
.final-date-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
    font-size: 11.5px !important;
}

.final-today-btn {
    min-height: 36px !important;
    margin-top: 14px !important;
    font-size: 12px !important;
}

.final-side-card,
.final-motivation {
    padding: 13px !important;
}

.final-side-card h2 {
    font-size: 30px !important;
}

.final-side-card p,
.final-motivation p {
    font-size: 12px !important;
}

/* Better fit for your current laptop width */
@media (max-width: 1180px) {
    .final-study-home {
        max-width: 1080px !important;
    }

    .final-study-layout {
        grid-template-columns: minmax(0, 1fr) 285px !important;
        gap: 12px !important;
    }

    .final-calendar {
        width: 285px !important;
        max-width: 285px !important;
    }

    .final-week,
    .final-days {
        grid-template-columns: repeat(7, 27px) !important;
        gap: 5px !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 27px !important;
        height: 27px !important;
        min-width: 27px !important;
        min-height: 27px !important;
    }
}

/* =====================================================
   FINAL WIDTH BALANCE FIX
   Wider mission cards + narrower right panel at 100%
===================================================== */

/* Use more of the screen width */
.final-study-home {
    max-width: 1240px !important;
}

/* Give more width to the mission section */
.final-study-layout {
    grid-template-columns: minmax(0, 1fr) 270px !important;
    gap: 14px !important;
}

/* Right calendar smaller */
.final-calendar {
    width: 270px !important;
    max-width: 270px !important;
    padding: 13px !important;
}

.final-calendar-head h3 {
    font-size: 16px !important;
}

.final-week,
.final-days {
    grid-template-columns: repeat(7, 25px) !important;
    gap: 5px !important;
}

.final-week span {
    width: 25px !important;
    font-size: 10px !important;
}

.final-empty-day,
.final-date-btn {
    width: 25px !important;
    height: 25px !important;
    min-width: 25px !important;
    min-height: 25px !important;
    max-width: 25px !important;
    max-height: 25px !important;
    font-size: 11px !important;
}

/* Subject cards wider and less tall */
.final-subject-row {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

.final-subject {
    min-height: 125px !important;
    padding: 10px !important;
    grid-template-columns: 48px minmax(0, 1fr) !important;
    gap: 8px !important;
}

.final-subject-icon {
    width: 42px !important;
    height: 42px !important;
    font-size: 23px !important;
}

.final-subject h3 {
    font-size: 14px !important;
}

.final-subject p {
    font-size: 10.5px !important;
    line-height: 1.18 !important;
}

.final-subject span {
    font-size: 9.5px !important;
    padding: 4px 6px !important;
}

/* Lower cards slightly shorter */
.final-small {
    min-height: 132px !important;
    padding: 9px !important;
}

.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3 {
    font-size: 14px !important;
}

.final-small button {
    min-height: 32px !important;
    padding: 6px 9px !important;
}

.final-goal {
    padding: 5px 0 !important;
}

/* Keep right panel beside content until smaller width */
@media (max-width: 1040px) {
    .final-study-layout {
        grid-template-columns: 1fr !important;
    }

    .final-study-side {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }

    .final-calendar {
        grid-column: span 2 !important;
        width: 100% !important;
        max-width: 360px !important;
        margin: 0 auto !important;
    }
}

/* =====================================================
   FINAL FONT SIZE POLISH
   Slightly bigger text without increasing card height too much
===================================================== */

/* Subject card readable text */
.final-subject h3 {
    font-size: 15.5px !important;
    letter-spacing: 0.01em !important;
}

.final-subject p {
    font-size: 11.3px !important;
    line-height: 1.22 !important;
}

.final-subject span {
    font-size: 10.2px !important;
    font-weight: 900 !important;
}

/* Mission title */
.final-mission h2 {
    font-size: 19px !important;
}

/* Lower card headings */
.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3 {
    font-size: 15.5px !important;
}

/* Lower card body text */
.final-small p,
.final-goal,
.final-goal span,
.final-goal b,
.final-small button b {
    font-size: 12.6px !important;
}

.final-small button span {
    font-size: 11px !important;
}

/* Today's focus text */
.final-small p {
    line-height: 1.35 !important;
}

/* Calendar font */
.final-calendar-head h3 {
    font-size: 17px !important;
}

.final-week span {
    font-size: 10.8px !important;
}

.final-date-btn {
    font-size: 11.5px !important;
}

/* Side cards */
.final-side-card h2 {
    font-size: 32px !important;
}

.final-side-card p,
.final-motivation p {
    font-size: 12.8px !important;
    line-height: 1.35 !important;
}

/* Background labels */
.final-bg-row span {
    font-size: 10.6px !important;
}

/* Bottom quote */
.final-note {
    font-size: 12.5px !important;
}

/* Keep subject cards from becoming tall again */
.final-subject {
    min-height: 128px !important;
}

.final-note-top {
    margin: 8px 0 16px !important;
    text-align: center !important;
    border-radius: 16px !important;
    background: linear-gradient(135deg, rgba(20,15,55,0.88), rgba(45,20,70,0.82)) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    color: #f9b7df !important;
    font-size: 13px !important;
    padding: 10px 16px !important;
    box-shadow: 0 8px 20px rgba(0,0,0,0.18) !important;
}

/* =========================================
   SIDEBAR PHOTO-MATCH POLISH
========================================= */

.sidebar {
    position: relative !important;
    background: linear-gradient(180deg, rgba(5,10,35,0.96), rgba(8,12,45,0.92)) !important;
    border: 1px solid rgba(255,255,255,0.10) !important;
    border-radius: 24px !important;
    padding: 20px 16px 18px !important;
    box-shadow: 0 18px 40px rgba(0,0,0,0.32) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
    overflow: visible !important;
}

.sidebar .nav,
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    margin-top: 16px !important;
}

.sidebar button,
.sidebar .nav button {
    width: 100% !important;
    text-align: left !important;
    border: none !important;
    border-radius: 18px !important;
    padding: 14px 16px !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    color: #ffffff !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.08) !important;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.06) !important;
    transition: 0.25s ease !important;
}

.sidebar button:hover,
.sidebar .nav button:hover {
    transform: translateX(4px) !important;
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    box-shadow: 0 10px 24px rgba(236,72,153,0.26) !important;
}

.sidebar button.active,
.sidebar .nav button.active {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    box-shadow: 0 12px 28px rgba(236,72,153,0.30) !important;
}

.sidebar h2,
.sidebar h3,
.sidebar p {
    color: #ffffff !important;
}

.sidebar-bow {
    position: absolute !important;
    top: -52px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
   width: 170px !important;
    height: auto !important;
    z-index: 20 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 12px 20px rgba(0,0,0,0.25)) !important;
}

.top-brand-wrap {
    display: flex !important;
    align-items: center !important;
    gap: 18px !important;
}

.top-brand-logo {
    width: 110px !important;
    height: 110px !important;
    object-fit: contain !important;
    border-radius: 22px !important;
    background: rgba(255,255,255,0.10) !important;
    padding: 10px !important;
    box-shadow: 0 12px 26px rgba(0,0,0,0.22) !important;
}

.top-brand-text h1 {
    margin: 0 !important;
}

.top-brand-text p {
    margin: 6px 0 0 !important;
}

/* =====================================================
   FIX MESSED LOGO/BOW PLACEMENT
===================================================== */

/* Hide old/floating logo boxes that caused the top-right mess */
.brand-badge,
.top-brand-logo,
.top-logo-box,
.logo-badge,
.app-logo-badge {
    position: static !important;
}

/* Sidebar should allow bow to go outside */
.sidebar {
    position: relative !important;
    overflow: visible !important;
    padding-top: 78px !important;
}

/* Bow like reference: above sidebar, not covering text */
.sidebar-bow {
    position: absolute !important;
    top: -38px !important;
    left: 92px !important;
    width: 165px !important;
    height: auto !important;
    z-index: 20 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35)) !important;
}

/* Clean sidebar logo/brand */
.sidebar-brand-fixed {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;
    padding: 12px 12px 18px !important;
    margin-bottom: 14px !important;
    border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}

/* Logo small, no huge bubble */
.sidebar-logo-fixed {
    width: 52px !important;
    height: 52px !important;
    min-width: 52px !important;
    min-height: 52px !important;
    object-fit: cover !important;
    border-radius: 14px !important;
    padding: 4px !important;
    background: rgba(255,255,255,0.92) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.28) !important;
}

/* Sidebar brand text */
.sidebar-brand-fixed h2 {
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
}

.sidebar-brand-fixed p {
    margin: 3px 0 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

/* Remove extra huge logo styling if image is inside old wrappers */
.sidebar img:not(.sidebar-bow):not(.sidebar-logo-fixed) {
    max-width: 52px !important;
    max-height: 52px !important;
}

/* Keep menu below clean */
.sidebar .nav,
.sidebar-nav {
    margin-top: 8px !important;
}

/* Hide old top floating logo/header */
.brand-badge,
.top-brand-logo,
.top-brand-wrap,
.top-brand-text,
.logo-badge,
.app-logo-badge,
.brand-header,
.header-logo,
.main-header {
    display: none !important;
}

/* =====================================================
   FINAL SIDEBAR POSITION LIKE REFERENCE IMAGE
   Sidebar starts from top, not below header
===================================================== */

/* Whole app layout */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Sidebar fixed to the left from top */
.sidebar {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    width: 230px !important;
    height: calc(100vh - 24px) !important;
    min-width: 230px !important;

    background: rgba(5, 10, 30, 0.88) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    border-radius: 22px !important;
    box-shadow: 0 22px 55px rgba(0,0,0,0.38) !important;
    backdrop-filter: blur(22px) saturate(135%) !important;

    padding: 96px 16px 18px !important;
    overflow-y: auto !important;
    overflow-x: visible !important;
    z-index: 50 !important;
}

/* Make main content move beside fixed sidebar */
.main,
.main-content,
.content,
.app-content,
#planner {
    margin-left: 258px !important;
}

/* If your wrapper uses flex, stop it from pushing sidebar down */
.container,
.app,
.layout {
    display: block !important;
}

/* =====================================================
   BOW POSITION LIKE REFERENCE
===================================================== */

.sidebar-bow {
    position: absolute !important;
    top: -42px !important;
    left: 118px !important;
    width: 185px !important;
    height: auto !important;
    z-index: 80 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 16px 22px rgba(0,0,0,0.38)) !important;
}

/* Sidebar brand should sit under bow */
.sidebar-brand-fixed {
    display: flex !important;
    align-items: center !important;
    gap: 12px !important;

    padding: 12px 10px 16px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}

/* Logo inside sidebar only */
.sidebar-logo-fixed {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    object-fit: cover !important;
    border-radius: 14px !important;
    padding: 4px !important;
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.28) !important;
}

.sidebar-brand-fixed h2 {
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 21px !important;
    font-weight: 900 !important;
    line-height: 1.1 !important;
}

.sidebar-brand-fixed p {
    margin: 3px 0 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

/* =====================================================
   SIDEBAR MENU LIKE REFERENCE
===================================================== */

.sidebar .nav,
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 9px !important;
    margin-top: 10px !important;
}

.sidebar .nav button,
.sidebar button {
    width: 100% !important;
    min-height: 46px !important;
    padding: 12px 14px !important;
    border-radius: 12px !important;
    border: none !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;

    background: transparent !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-size: 15px !important;
    font-weight: 800 !important;
    text-align: left !important;

    box-shadow: none !important;
    transition: 0.25s ease !important;
}

.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    box-shadow: 0 12px 26px rgba(236,72,153,0.28) !important;
    transform: translateX(3px) !important;
}

/* =====================================================
   EMERGENCY LAYOUT REPAIR
   Sidebar beside header + main content full width
===================================================== */

/* Remove the broken full-width top header space */
.brand-header,
.header,
.main-header,
.top-header,
.top-brand-wrap,
.top-brand-logo,
.brand-badge {
    display: none !important;
}

/* Main page layout beside sidebar */
body {
    margin: 0 !important;
    padding: 0 !important;
    overflow-x: hidden !important;
}

/* Sidebar fixed like reference */
.sidebar {
    position: fixed !important;
    top: 12px !important;
    left: 12px !important;
    width: 235px !important;
    min-width: 235px !important;
    height: calc(100vh - 24px) !important;
    z-index: 100 !important;

    padding: 86px 14px 18px !important;
    border-radius: 22px !important;
    background: rgba(5, 10, 30, 0.88) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    box-shadow: 0 22px 55px rgba(0,0,0,0.38) !important;
    backdrop-filter: blur(22px) saturate(135%) !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* IMPORTANT: give main content full remaining width */
#planner {
    margin-left: 270px !important;
    width: calc(100vw - 292px) !important;
    max-width: calc(100vw - 292px) !important;
    min-width: 0 !important;
    padding: 0 14px 28px !important;
    overflow-x: hidden !important;
}

/* Stop wrapper from squeezing content */
.container,
.app,
.layout,
.main,
.main-content,
.content,
.app-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Home should use available width */
.final-study-home {
    width: 100% !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
}

/* Keep StudyMaster title normal, not vertical */
.final-study-header {
    width: 100% !important;
    text-align: center !important;
    white-space: normal !important;
}

.final-study-header h1,
.final-study-header p,
.final-study-header h3,
.final-study-header em {
    white-space: normal !important;
    word-break: normal !important;
}

/* Keep main dashboard beside right cards */
.final-study-layout {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 270px !important;
    gap: 14px !important;
    align-items: start !important;
}

.final-study-main,
.final-study-side {
    min-width: 0 !important;
}

/* Sidebar bow like reference */
.sidebar-bow {
    position: absolute !important;
    top: -18px !important;
    left: 80px !important;
    width: 150px !important;
    height: auto !important;
    z-index: 150 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35)) !important;
}

/* Sidebar brand below bow */
.sidebar-brand-fixed {
    display: flex !important;
    align-items: center !important;
    gap: 11px !important;
    padding: 10px 8px 16px !important;
    margin-bottom: 12px !important;
    border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}

.sidebar-logo-fixed {
    width: 48px !important;
    height: 48px !important;
    min-width: 48px !important;
    min-height: 48px !important;
    object-fit: cover !important;
    border-radius: 14px !important;
    padding: 4px !important;
    background: rgba(255,255,255,0.95) !important;
    box-shadow: 0 10px 22px rgba(0,0,0,0.28) !important;
}

.sidebar-brand-fixed h2 {
    margin: 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 900 !important;
}

.sidebar-brand-fixed p {
    margin: 2px 0 0 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 800 !important;
}

/* Sidebar menu like reference */
.sidebar .nav,
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-top: 10px !important;
}

.sidebar .nav button,
.sidebar button {
    width: 100% !important;
    min-height: 44px !important;
    padding: 11px 13px !important;
    border-radius: 12px !important;
    border: none !important;
    background: transparent !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-align: left !important;

    box-shadow: none !important;
}

.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    box-shadow: 0 12px 26px rgba(236,72,153,0.28) !important;
}

/* Mobile: sidebar should not break screen */
@media (max-width: 900px) {
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 10px !important;
    }

    #planner {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }

    .final-study-layout {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   FINAL SIDEBAR GAP + MENU SPACING FIX
===================================================== */

/* Reduce empty space between sidebar and main content */
#planner {
    margin-left: 250px !important;
    width: calc(100vw - 265px) !important;
    max-width: calc(100vw - 265px) !important;
    padding-left: 8px !important;
    padding-right: 10px !important;
}

/* Let home content start closer to sidebar */
.final-study-home {
    max-width: 1120px !important;
    margin-left: 0 !important;
    margin-right: auto !important;
}

/* Make sidebar slightly slimmer */
.sidebar {
    width: 220px !important;
    min-width: 220px !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
}

/* Reduce menu spacing */
.sidebar .nav,
.sidebar-nav {
    gap: 5px !important;
    margin-top: 6px !important;
}

/* Make menu buttons less tall */
.sidebar .nav button,
.sidebar button {
    min-height: 38px !important;
    padding: 9px 12px !important;
    margin-bottom: 4px !important;
    border-radius: 11px !important;
    font-size: 14px !important;
    line-height: 1.1 !important;
}

/* Reduce brand area height */
.sidebar-brand-fixed {
    padding: 8px 8px 12px !important;
    margin-bottom: 8px !important;
}

/* Reduce divider spacing if present */
.sidebar hr,
.sidebar .divider {
    margin: 8px 0 !important;
}

/* Bow slightly smaller so it does not consume sidebar space */
.sidebar-bow {
    width: 135px !important;
    top: -14px !important;
    left: 74px !important;
}

/* Reduce top empty area in sidebar */
.sidebar {
    padding-top: 74px !important;
}

/* Make sidebar scroll feel cleaner */
.sidebar::-webkit-scrollbar {
    width: 6px !important;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.35) !important;
    border-radius: 999px !important;
}

/* Smaller screen safety */
@media (max-width: 900px) {
    #planner {
        margin-left: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =====================================================
   FINAL MAIN CONTENT LEFT ALIGN FIX
   Remove big purple gap after sidebar
===================================================== */

/* Sidebar exact width */
.sidebar {
    left: 10px !important;
    width: 220px !important;
    min-width: 220px !important;
}

/* Pull main planner content closer to sidebar */
#planner {
    margin-left: 238px !important;
    width: calc(100vw - 248px) !important;
    max-width: calc(100vw - 248px) !important;
    padding-left: 0 !important;
    padding-right: 10px !important;
}

/* Do not center the home too far right */
.final-study-home {
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: 1110px !important;
}

/* Make header and cards begin near sidebar */
.final-study-header,
.final-study-layout,
.final-note {
    margin-left: 0 !important;
}

/* Slightly reduce right panel so everything fits */
.final-study-layout {
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 12px !important;
}

.final-calendar {
    width: 260px !important;
    max-width: 260px !important;
}

/* Calendar circles still fit */
.final-week,
.final-days {
    grid-template-columns: repeat(7, 24px) !important;
    gap: 5px !important;
}

.final-week span {
    width: 24px !important;
}

.final-empty-day,
.final-date-btn {
    width: 24px !important;
    height: 24px !important;
    min-width: 24px !important;
    min-height: 24px !important;
    max-width: 24px !important;
    max-height: 24px !important;
}

/* Make background image visible behind, no purple block illusion */
body::before,
body::after {
    pointer-events: none !important;
}

/* =====================================================
   HARD FIX: MAIN CONTENT TOO FAR RIGHT
   Force dashboard to start beside sidebar
===================================================== */

/* Sidebar locked on left */
.sidebar {
    position: fixed !important;
    top: 8px !important;
    left: 10px !important;
    width: 220px !important;
    min-width: 220px !important;
    height: calc(100vh - 16px) !important;
    z-index: 100 !important;
}

/* Force planner area to start immediately after sidebar */
#planner {
    position: absolute !important;
    top: 0 !important;
    left: 242px !important;
    right: 10px !important;

    margin-left: 0 !important;
    margin-right: 0 !important;

    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;

    padding: 0 10px 30px !important;
    overflow-x: hidden !important;
}

/* Remove extra spacing from wrappers */
.container,
.app,
.layout,
.main,
.main-content,
.content,
.app-content {
    margin-left: 0 !important;
    padding-left: 0 !important;
    width: 100% !important;
    max-width: none !important;
}

/* Home should fill the available area */
.final-study-home {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Dashboard layout inside available width */
.final-study-layout {
    width: 100% !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 12px !important;
}

/* Header should not drift right */
.final-study-header {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Quote should align with main cards */
.final-note {
    margin-left: 0 !important;
    margin-right: 0 !important;
}

/* Right calendar width */
.final-calendar {
    width: 260px !important;
    max-width: 260px !important;
}

/* =====================================================
   FINAL REPAIR: FIX VERTICAL/SQUEEZED MAIN CONTENT
   Sidebar fixed + planner gets full remaining screen
===================================================== */

/* Hide old top/floating header/logo/footer that is disturbing layout */
.brand-header,
.header,
.main-header,
.top-header,
.top-brand-wrap,
.top-brand-logo,
.brand-badge,
.footer,
.app-footer,
footer {
    display: none !important;
}

/* Page reset */
html,
body {
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    min-height: 100% !important;
    overflow-x: hidden !important;
}

/* Sidebar fixed on left like reference */
.sidebar {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    width: 230px !important;
    min-width: 230px !important;
    height: calc(100vh - 20px) !important;
    z-index: 1000 !important;

    padding: 74px 14px 18px !important;
    border-radius: 22px !important;
    background: rgba(5, 10, 30, 0.90) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    box-shadow: 0 22px 55px rgba(0,0,0,0.38) !important;
    backdrop-filter: blur(22px) saturate(135%) !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Main planner becomes full screen area beside sidebar */
#planner {
    position: fixed !important;
    top: 0 !important;
    left: 252px !important;
    right: 0 !important;
    bottom: 0 !important;

    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;

    margin: 0 !important;
    padding: 0 14px 30px !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;
}

/* Stop any wrapper from squeezing the planner */
.container,
.app,
.layout,
.main,
.main-content,
.content,
.app-content {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Home must use full planner width */
.final-study-home {
    width: 100% !important;
    max-width: 1080px !important;
    min-width: 0 !important;
    margin: 0 auto !important;
    padding: 0 0 28px !important;
}

/* Prevent title/subtitle from becoming vertical */
.final-study-header,
.final-study-header * {
    width: auto !important;
    max-width: none !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
}

.final-study-header {
    display: block !important;
    text-align: center !important;
    padding: 8px 0 12px !important;
}

.final-study-header h1 {
    display: block !important;
    white-space: nowrap !important;
    font-size: 52px !important;
    line-height: 1 !important;
}

/* Dashboard layout */
.final-study-layout {
    width: 100% !important;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 12px !important;
    align-items: start !important;
}

.final-study-main,
.final-study-side {
    min-width: 0 !important;
}

/* Calendar compact */
.final-calendar {
    width: 260px !important;
    max-width: 260px !important;
}

/* Bow placement */
.sidebar-bow {
    position: absolute !important;
    top: -18px !important;
    left: 74px !important;
    width: 142px !important;
    height: auto !important;
    z-index: 1200 !important;
    pointer-events: none !important;
    filter: drop-shadow(0 14px 18px rgba(0,0,0,0.35)) !important;
}

/* Sidebar brand */
.sidebar-brand-fixed {
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    padding: 8px 8px 14px !important;
    margin-bottom: 8px !important;
    border-bottom: 1px solid rgba(255,255,255,0.14) !important;
}

.sidebar-logo-fixed {
    width: 46px !important;
    height: 46px !important;
    min-width: 46px !important;
    min-height: 46px !important;
    object-fit: cover !important;
    border-radius: 13px !important;
    padding: 4px !important;
    background: rgba(255,255,255,0.95) !important;
}

.sidebar-brand-fixed h2 {
    margin: 0 !important;
    font-size: 22px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.sidebar-brand-fixed p {
    margin: 2px 0 0 !important;
    font-size: 13px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Compact sidebar menu */
.sidebar .nav,
.sidebar-nav {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    margin-top: 8px !important;
}

.sidebar .nav button,
.sidebar button {
    width: 100% !important;
    min-height: 38px !important;
    padding: 9px 12px !important;
    margin: 0 0 4px !important;
    border-radius: 11px !important;

    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 10px !important;

    background: transparent !important;
    border: none !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-size: 14px !important;
    font-weight: 900 !important;
    text-align: left !important;
    box-shadow: none !important;
}

.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    box-shadow: 0 12px 26px rgba(236,72,153,0.28) !important;
}

/* Mobile safety */
@media (max-width: 900px) {
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: calc(100% - 20px) !important;
        min-width: 0 !important;
        height: auto !important;
        margin: 10px !important;
    }

    #planner {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: 100% !important;
        padding: 0 10px 30px !important;
    }

    .final-study-layout {
        grid-template-columns: 1fr !important;
    }

    .final-study-header h1 {
        white-space: normal !important;
    }
}

/* =====================================================
   SHOW MAIN HOME CONTENT AGAIN
   Sidebar fixed + planner visible beside it
===================================================== */

/* Keep sidebar on left */
.sidebar {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    width: 230px !important;
    height: calc(100vh - 20px) !important;
    z-index: 20 !important;
}

/* Show planner beside sidebar */
#planner {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;

    margin-left: 260px !important;
    width: calc(100vw - 270px) !important;
    max-width: calc(100vw - 270px) !important;

    padding: 0 12px 30px !important;
    overflow: visible !important;
}

/* Show final home */
.final-study-home {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;

    width: 100% !important;
    max-width: 1080px !important;
    margin: 0 auto !important;
}

/* Make sure inner layout appears */
.final-study-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 12px !important;
}

/* Make sure the header appears */
.final-study-header {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Undo accidental hiding of final home */
.final-study-home,
.final-study-home * {
    visibility: visible !important;
}

/* Hide only old layouts */
.v36-home,
.study-master-home,
.photo-home,
.smx-home {
    display: none !important;
}

/* =====================================================
   FINAL INNER PAGES THEME POLISH
   Planner / Dashboard / MCQ / PYQ / Formula / Settings
===================================================== */

/* Main content area for all tabs */
#planner {
    color: #ffffff !important;
}

/* Page titles */
#planner h1,
#planner h2,
#planner h3 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.35) !important;
}

/* Section/page wrapper cards */
.section-card,
.page-card,
.dashboard-card,
.dash-card,
.settings-card,
.formula-section,
.formula-card,
.question-card,
.mcq-card,
.pyq-card,
.task,
.card,
.result-card,
.subject-card,
.chapter-card,
.exam-card,
.pyq-question-card,
.mcq-question-card {
    background:
        linear-gradient(135deg, rgba(8, 14, 40, 0.86), rgba(18, 10, 45, 0.82)) !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    border-radius: 18px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.32) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Text inside dark cards */
.section-card *,
.page-card *,
.dashboard-card *,
.dash-card *,
.settings-card *,
.formula-section *,
.formula-card *,
.question-card *,
.mcq-card *,
.pyq-card *,
.task *,
.card *,
.result-card *,
.subject-card *,
.chapter-card *,
.exam-card *,
.pyq-question-card *,
.mcq-question-card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Softer paragraph text */
#planner p,
#planner li,
#planner span {
    color: #e8efff !important;
    -webkit-text-fill-color: #e8efff !important;
}

/* Important labels / badges */
.badge,
.exam-tag,
.subject-tag,
.chapter-tag,
.status-badge,
.progress-badge,
.topic-badge {
    background: linear-gradient(135deg, #ec4899, #8b5cf6) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-radius: 999px !important;
    padding: 6px 12px !important;
    font-weight: 900 !important;
}

/* All normal buttons inside tabs */
#planner button {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    padding: 10px 15px !important;
    font-weight: 900 !important;
    box-shadow: 0 10px 24px rgba(236,72,153,0.25) !important;
    cursor: pointer !important;
}

/* Button hover */
#planner button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 14px 28px rgba(236,72,153,0.35) !important;
}

/* Back buttons */
#planner .back-btn,
#planner button.back-btn,
#planner button[onclick*="back"],
#planner button[onclick*="Back"] {
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
}

/* Reset / clear buttons */
#planner button[onclick*="reset"],
#planner button[onclick*="clear"],
#planner button[onclick*="Clear"] {
    background: linear-gradient(135deg, #ef4444, #fb7185) !important;
}

/* Save / export / import buttons */
#planner button[onclick*="save"],
#planner button[onclick*="Save"],
#planner button[onclick*="export"],
#planner button[onclick*="import"] {
    background: linear-gradient(135deg, #10b981, #22d3ee) !important;
}

/* Inputs, selects, textareas */
#planner input,
#planner select,
#planner textarea {
    background: rgba(255,255,255,0.94) !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border: 1px solid rgba(255,255,255,0.30) !important;
    border-radius: 14px !important;
    padding: 10px 12px !important;
    font-weight: 800 !important;
    outline: none !important;
}

/* Placeholder */
#planner input::placeholder,
#planner textarea::placeholder {
    color: #64748b !important;
    -webkit-text-fill-color: #64748b !important;
}

/* Tables if any */
#planner table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: rgba(8,14,40,0.82) !important;
    border-radius: 16px !important;
    overflow: hidden !important;
}

#planner th {
    background: rgba(236,72,153,0.25) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

#planner td {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border-bottom: 1px solid rgba(255,255,255,0.10) !important;
}

/* Checkboxes */
#planner input[type="checkbox"] {
    accent-color: #ec4899 !important;
}

/* Planner task cards */
.task,
.planner-task,
.topic-check-row,
.planner-task-check,
.daily-task-check {
    background:
        linear-gradient(135deg, rgba(9, 20, 52, 0.90), rgba(42, 12, 55, 0.84)) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
}

/* Completed task feel */
.task.completed,
.completed,
.done {
    opacity: 0.72 !important;
    background:
        linear-gradient(135deg, rgba(16,185,129,0.24), rgba(34,211,238,0.18)) !important;
}

/* MCQ / PYQ options */
.option,
.mcq-option,
.pyq-option,
.answer-option {
    background: rgba(255,255,255,0.08) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    border-radius: 14px !important;
    padding: 10px 12px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Correct / wrong answer colors */
.correct {
    background: rgba(34,197,94,0.26) !important;
    border-color: rgba(34,197,94,0.55) !important;
}

.wrong,
.incorrect {
    background: rgba(239,68,68,0.26) !important;
    border-color: rgba(239,68,68,0.55) !important;
}

/* Formula cards special glow */
.formula-card,
.formula-section {
    background:
        radial-gradient(circle at top left, rgba(56,189,248,0.18), transparent 35%),
        linear-gradient(135deg, rgba(8,14,40,0.88), rgba(18,10,45,0.82)) !important;
}

/* Dashboard cards */
.dashboard-card,
.dash-card {
    background:
        radial-gradient(circle at top right, rgba(236,72,153,0.18), transparent 34%),
        linear-gradient(135deg, rgba(8,14,40,0.88), rgba(18,10,45,0.82)) !important;
}

/* Settings cards */
.settings-card {
    background:
        radial-gradient(circle at top right, rgba(139,92,246,0.20), transparent 34%),
        linear-gradient(135deg, rgba(8,14,40,0.88), rgba(18,10,45,0.82)) !important;
}

/* Scrollbar inside planner */
#planner::-webkit-scrollbar {
    width: 8px !important;
}

#planner::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #ec4899, #8b5cf6) !important;
    border-radius: 999px !important;
}

/* =====================================================
   DASHBOARD READABILITY FIX
   Make white dashboard cards dark + readable
===================================================== */

/* Dashboard/stat cards must be dark glass */
#planner .dashboard-card,
#planner .dash-card,
#planner .stat-card,
#planner .stats-card,
#planner .summary-card,
#planner .progress-card,
#planner .mcq-dashboard-card,
#planner .v2-dashboard-card,
#planner .v2-stat-card,
#planner .card {
    background:
        radial-gradient(circle at top right, rgba(236,72,153,0.22), transparent 32%),
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(25,10,50,0.88)) !important;

    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.36) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Everything inside dashboard/stat cards readable */
#planner .dashboard-card *,
#planner .dash-card *,
#planner .stat-card *,
#planner .stats-card *,
#planner .summary-card *,
#planner .progress-card *,
#planner .mcq-dashboard-card *,
#planner .v2-dashboard-card *,
#planner .v2-stat-card *,
#planner .card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Big numbers */
#planner .dashboard-card h1,
#planner .dashboard-card h2,
#planner .dash-card h1,
#planner .dash-card h2,
#planner .stat-card h1,
#planner .stat-card h2,
#planner .stats-card h1,
#planner .stats-card h2,
#planner .summary-card h1,
#planner .summary-card h2,
#planner .card h1,
#planner .card h2 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.35) !important;
}

/* Labels under numbers */
#planner .dashboard-card p,
#planner .dash-card p,
#planner .stat-card p,
#planner .stats-card p,
#planner .summary-card p,
#planner .progress-card p,
#planner .card p,
#planner .dashboard-card span,
#planner .dash-card span,
#planner .stat-card span,
#planner .stats-card span,
#planner .summary-card span,
#planner .progress-card span,
#planner .card span {
    color: #e8efff !important;
    -webkit-text-fill-color: #e8efff !important;
    font-weight: 800 !important;
}

/* Dashboard page title */
#planner > h1,
#planner > h2,
#planner .page-title,
#planner .dashboard-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.4) !important;
}

/* Remove pale circle effect if it makes cards unreadable */
#planner .dashboard-card::before,
#planner .dash-card::before,
#planner .stat-card::before,
#planner .stats-card::before,
#planner .summary-card::before,
#planner .card::before {
    opacity: 0.18 !important;
}

/* =====================================================
   DASHBOARD READABILITY FIX
   Make white dashboard cards dark + readable
===================================================== */

/* Dashboard/stat cards must be dark glass */
#planner .dashboard-card,
#planner .dash-card,
#planner .stat-card,
#planner .stats-card,
#planner .summary-card,
#planner .progress-card,
#planner .mcq-dashboard-card,
#planner .v2-dashboard-card,
#planner .v2-stat-card,
#planner .card {
    background:
        radial-gradient(circle at top right, rgba(236,72,153,0.22), transparent 32%),
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(25,10,50,0.88)) !important;

    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 24px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.36) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Everything inside dashboard/stat cards readable */
#planner .dashboard-card *,
#planner .dash-card *,
#planner .stat-card *,
#planner .stats-card *,
#planner .summary-card *,
#planner .progress-card *,
#planner .mcq-dashboard-card *,
#planner .v2-dashboard-card *,
#planner .v2-stat-card *,
#planner .card * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Big numbers */
#planner .dashboard-card h1,
#planner .dashboard-card h2,
#planner .dash-card h1,
#planner .dash-card h2,
#planner .stat-card h1,
#planner .stat-card h2,
#planner .stats-card h1,
#planner .stats-card h2,
#planner .summary-card h1,
#planner .summary-card h2,
#planner .card h1,
#planner .card h2 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.35) !important;
}

/* Labels under numbers */
#planner .dashboard-card p,
#planner .dash-card p,
#planner .stat-card p,
#planner .stats-card p,
#planner .summary-card p,
#planner .progress-card p,
#planner .card p,
#planner .dashboard-card span,
#planner .dash-card span,
#planner .stat-card span,
#planner .stats-card span,
#planner .summary-card span,
#planner .progress-card span,
#planner .card span {
    color: #e8efff !important;
    -webkit-text-fill-color: #e8efff !important;
    font-weight: 800 !important;
}

/* Dashboard page title */
#planner > h1,
#planner > h2,
#planner .page-title,
#planner .dashboard-title {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.4) !important;
}

/* Remove pale circle effect if it makes cards unreadable */
#planner .dashboard-card::before,
#planner .dash-card::before,
#planner .stat-card::before,
#planner .stats-card::before,
#planner .summary-card::before,
#planner .card::before {
    opacity: 0.18 !important;
}

/* =====================================================
   NUCLEAR INNER TAB DARK THEME FIX
   Fix white cards on Planner / Dashboard / MCQ / PYQ / Formula / Settings
===================================================== */

/* Main tab area */
#planner {
    color: #ffffff !important;
    -webkit-text-fill-color: initial !important;
}

/* Make all main content cards dark */
#planner .card,
#planner .task,
#planner .section-card,
#planner .page-card,
#planner .dashboard-card,
#planner .dash-card,
#planner .stat-card,
#planner .stats-card,
#planner .summary-card,
#planner .settings-card,
#planner .formula-card,
#planner .formula-section,
#planner .question-card,
#planner .mcq-card,
#planner .pyq-card,
#planner .result-card,
#planner .subject-card,
#planner .chapter-card,
#planner .exam-card,
#planner .option-card,
#planner .saved-card,
#planner .wrong-card,
#planner .review-card,
#planner .progress-card,
#planner .pyq-question-card,
#planner .mcq-question-card,
#planner [class*="card"],
#planner [class*="Card"],
#planner [class*="box"],
#planner [class*="Box"],
#planner [class*="item"],
#planner [class*="Item"] {
    background:
        radial-gradient(circle at top right, rgba(236,72,153,0.20), transparent 32%),
        linear-gradient(135deg, rgba(8,14,40,0.94), rgba(24,10,50,0.90)) !important;

    border: 1px solid rgba(255,255,255,0.22) !important;
    border-radius: 20px !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.34) !important;
    backdrop-filter: blur(18px) saturate(130%) !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Everything inside those cards readable */
#planner .card *,
#planner .task *,
#planner .section-card *,
#planner .page-card *,
#planner .dashboard-card *,
#planner .dash-card *,
#planner .stat-card *,
#planner .stats-card *,
#planner .summary-card *,
#planner .settings-card *,
#planner .formula-card *,
#planner .formula-section *,
#planner .question-card *,
#planner .mcq-card *,
#planner .pyq-card *,
#planner .result-card *,
#planner .subject-card *,
#planner .chapter-card *,
#planner .exam-card *,
#planner .option-card *,
#planner .saved-card *,
#planner .wrong-card *,
#planner .review-card *,
#planner .progress-card *,
#planner .pyq-question-card *,
#planner .mcq-question-card *,
#planner [class*="card"] *,
#planner [class*="Card"] *,
#planner [class*="box"] *,
#planner [class*="Box"] *,
#planner [class*="item"] *,
#planner [class*="Item"] * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
    text-shadow: none !important;
}

/* Page headings */
#planner h1,
#planner h2,
#planner h3,
#planner h4 {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-weight: 900 !important;
    text-shadow: 0 4px 18px rgba(0,0,0,0.35) !important;
}

/* Normal text */
#planner p,
#planner span,
#planner li,
#planner label,
#planner small,
#planner strong,
#planner b {
    color: #e8efff !important;
    -webkit-text-fill-color: #e8efff !important;
    opacity: 1 !important;
}

/* Important values/numbers */
#planner h1,
#planner h2,
#planner .number,
#planner .score,
#planner .percent,
#planner .count {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Buttons */
#planner button {
    background: linear-gradient(135deg, #ec4899, #fb6b2f) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: none !important;
    border-radius: 14px !important;
    font-weight: 900 !important;
    box-shadow: 0 10px 24px rgba(236,72,153,0.25) !important;
}

/* Back buttons */
#planner .back-btn,
#planner button[onclick*="back"],
#planner button[onclick*="Back"] {
    background: linear-gradient(135deg, #38bdf8, #6366f1) !important;
}

/* Inputs should stay light and readable */
#planner input,
#planner select,
#planner textarea {
    background: rgba(255,255,255,0.95) !important;
    color: #111827 !important;
    -webkit-text-fill-color: #111827 !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,255,255,0.35) !important;
    font-weight: 800 !important;
}

/* Options / answers */
#planner .option,
#planner .mcq-option,
#planner .pyq-option,
#planner .answer-option {
    background: rgba(255,255,255,0.08) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
}

/* Correct / wrong */
#planner .correct {
    background: rgba(34,197,94,0.28) !important;
    border-color: rgba(34,197,94,0.55) !important;
}

#planner .wrong,
#planner .incorrect {
    background: rgba(239,68,68,0.28) !important;
    border-color: rgba(239,68,68,0.55) !important;
}

/* Kill old pale white overlays */
#planner .card::before,
#planner .card::after,
#planner [class*="card"]::before,
#planner [class*="card"]::after,
#planner [class*="Card"]::before,
#planner [class*="Card"]::after {
    opacity: 0.08 !important;
}

/* Extra: force direct white-looking blocks dark */
#planner > div,
#planner > section,
#planner > article {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* =====================================================
   TOPIC ROW DARK FIX
   Fix gray topic rows inside Planner
===================================================== */

#planner .topic-check-row,
#planner .topic-check-row *,
#planner .planner-topic,
#planner .planner-topic *,
#planner .topic-row,
#planner .topic-row *,
#planner .topic-item,
#planner .topic-item *,
#planner label,
#planner label * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Topic row background */
#planner .topic-check-row,
#planner .planner-topic,
#planner .topic-row,
#planner .topic-item,
#planner label.topic-check-row {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.26) !important;
}

/* If topic rows are simple labels without class */
#planner label {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
    padding: 12px 16px !important;
    margin: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Checkbox should stay visible */
#planner label input[type="checkbox"],
#planner input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #ec4899 !important;
}

/* Completed topic row */
#planner .topic-check-row.completed,
#planner label.completed,
#planner .planner-topic.completed,
#planner .topic-row.completed {
    background:
        linear-gradient(135deg, rgba(16,185,129,0.26), rgba(34,211,238,0.18)) !important;
    opacity: 0.82 !important;
}

/* Kill pale gray backgrounds on planner text rows */
#planner [style*="background: rgb(229"],
#planner [style*="background:rgb(229"],
#planner [style*="background-color: rgb(229"],
#planner [style*="background-color:rgb(229"],
#planner [style*="background: #e5"],
#planner [style*="background-color: #e5"] {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* =====================================================
   TOPIC ROW DARK FIX
   Fix gray topic rows inside Planner
===================================================== */

#planner .topic-check-row,
#planner .topic-check-row *,
#planner .planner-topic,
#planner .planner-topic *,
#planner .topic-row,
#planner .topic-row *,
#planner .topic-item,
#planner .topic-item *,
#planner label,
#planner label * {
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    opacity: 1 !important;
}

/* Topic row background */
#planner .topic-check-row,
#planner .planner-topic,
#planner .topic-row,
#planner .topic-item,
#planner label.topic-check-row {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 28px rgba(0,0,0,0.26) !important;
}

/* If topic rows are simple labels without class */
#planner label {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    border: 1px solid rgba(255,255,255,0.18) !important;
    border-radius: 16px !important;
    padding: 12px 16px !important;
    margin: 8px 0 !important;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
}

/* Checkbox should stay visible */
#planner label input[type="checkbox"],
#planner input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    accent-color: #ec4899 !important;
}

/* Completed topic row */
#planner .topic-check-row.completed,
#planner label.completed,
#planner .planner-topic.completed,
#planner .topic-row.completed {
    background:
        linear-gradient(135deg, rgba(16,185,129,0.26), rgba(34,211,238,0.18)) !important;
    opacity: 0.82 !important;
}

/* Kill pale gray backgrounds on planner text rows */
#planner [style*="background: rgb(229"],
#planner [style*="background:rgb(229"],
#planner [style*="background-color: rgb(229"],
#planner [style*="background-color:rgb(229"],
#planner [style*="background: #e5"],
#planner [style*="background-color: #e5"] {
    background:
        linear-gradient(135deg, rgba(8,14,40,0.92), rgba(24,10,50,0.88)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* =====================================================
   FINAL THEME OPTIONS LIKE REFERENCE
   Background thumbnails + selected border + theme color change
===================================================== */

/* Theme variables */
body.final-theme-aurora {
    --theme-main: #22d3ee;
    --theme-second: #8b5cf6;
    --theme-third: #ec4899;
    --theme-glow: rgba(34,211,238,0.30);
}

body.final-theme-floral {
    --theme-main: #ec4899;
    --theme-second: #fb7185;
    --theme-third: #f9a8d4;
    --theme-glow: rgba(236,72,153,0.34);
}

body.final-theme-bow {
    --theme-main: #f472b6;
    --theme-second: #ec4899;
    --theme-third: #fb6b2f;
    --theme-glow: rgba(244,114,182,0.36);
}

body.final-theme-lavender {
    --theme-main: #a78bfa;
    --theme-second: #6366f1;
    --theme-third: #c084fc;
    --theme-glow: rgba(167,139,250,0.34);
}

body.final-theme-cherry {
    --theme-main: #fb7185;
    --theme-second: #f9a8d4;
    --theme-third: #38bdf8;
    --theme-glow: rgba(251,113,133,0.34);
}

body.final-theme-sunset {
    --theme-main: #fb6b2f;
    --theme-second: #f97316;
    --theme-third: #ec4899;
    --theme-glow: rgba(251,107,47,0.35);
}

body.final-theme-starry {
    --theme-main: #60a5fa;
    --theme-second: #2563eb;
    --theme-third: #a78bfa;
    --theme-glow: rgba(96,165,250,0.34);
}

body.final-theme-galaxy {
    --theme-main: #a855f7;
    --theme-second: #ec4899;
    --theme-third: #22d3ee;
    --theme-glow: rgba(168,85,247,0.36);
}

/* Background images/colors */
body.final-theme-aurora {
    background:
        linear-gradient(rgba(8,8,26,0.22), rgba(26,8,42,0.38)),
        url("./planner-bg.png") center/cover fixed no-repeat !important;
}

body.final-theme-floral {
    background:
        radial-gradient(circle at top right, rgba(249,168,212,0.35), transparent 28%),
        linear-gradient(135deg, #2a0f35, #831843, #f472b6) fixed !important;
}

body.final-theme-bow {
    background:
        radial-gradient(circle at top left, rgba(255,255,255,0.20), transparent 22%),
        linear-gradient(135deg, #3b1235, #be185d, #f9a8d4) fixed !important;
}

body.final-theme-lavender {
    background:
        radial-gradient(circle at top right, rgba(196,181,253,0.34), transparent 28%),
        linear-gradient(135deg, #100b2e, #312e81, #8b5cf6) fixed !important;
}

body.final-theme-cherry {
    background:
        radial-gradient(circle at top right, rgba(251,207,232,0.40), transparent 28%),
        linear-gradient(135deg, #172554, #be185d, #fbcfe8) fixed !important;
}

body.final-theme-sunset {
    background:
        radial-gradient(circle at bottom right, rgba(253,186,116,0.40), transparent 30%),
        linear-gradient(135deg, #3b0764, #ea580c, #f97316) fixed !important;
}

body.final-theme-starry {
    background:
        radial-gradient(circle at top, rgba(96,165,250,0.28), transparent 28%),
        linear-gradient(135deg, #020617, #172554, #312e81) fixed !important;
}

body.final-theme-galaxy {
    background:
        radial-gradient(circle at top right, rgba(236,72,153,0.30), transparent 30%),
        linear-gradient(135deg, #020617, #581c87, #db2777) fixed !important;
}

/* Theme chooser container */
.final-backgrounds {
    border-color: rgba(255,255,255,0.20) !important;
}

.final-bg-row {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 10px !important;
}

/* Theme option card */
.theme-option {
    position: relative !important;
    background: rgba(255,255,255,0.05) !important;
    border: 1px solid rgba(255,255,255,0.14) !important;
    border-radius: 14px !important;
    padding: 7px !important;
    box-shadow: none !important;
    cursor: pointer !important;
    transition: 0.25s ease !important;
}

.theme-option:hover {
    transform: translateY(-3px) !important;
    border-color: var(--theme-main) !important;
    box-shadow: 0 12px 26px var(--theme-glow) !important;
}

/* Active selected theme like reference */
.theme-option.active-theme {
    border: 2px solid var(--theme-main) !important;
    box-shadow:
        0 0 0 3px rgba(255,255,255,0.10),
        0 14px 30px var(--theme-glow) !important;
}

.theme-option.active-theme::before {
    content: "✓";
    position: absolute;
    top: 8px;
    left: 8px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: linear-gradient(135deg, var(--theme-main), var(--theme-second));
    color: #ffffff;
    font-size: 14px;
    font-weight: 900;
    z-index: 3;
}

/* Thumbnail images */
.final-bg {
    height: 62px !important;
    border-radius: 11px !important;
    border: 1px solid rgba(255,255,255,0.20) !important;
    background-size: cover !important;
    background-position: center !important;
}

.bg1 {
    background-image: url("./planner-bg.png") !important;
}

.bg2 {
    background:
        radial-gradient(circle at top right, #fbcfe8, transparent 35%),
        linear-gradient(135deg, #fb7185, #be185d) !important;
}

.bg3 {
    background:
        radial-gradient(circle at center, #fce7f3, transparent 30%),
        linear-gradient(135deg, #f9a8d4, #ec4899) !important;
}

.bg4 {
    background:
        linear-gradient(135deg, #312e81, #8b5cf6, #c4b5fd) !important;
}

.bg5 {
    background:
        linear-gradient(135deg, #bae6fd, #f9a8d4, #fb7185) !important;
}

.bg6 {
    background:
        linear-gradient(135deg, #fb7185, #fb6b2f, #fde68a) !important;
}

.bg7 {
    background:
        radial-gradient(circle at 70% 20%, #fef3c7, transparent 8%),
        linear-gradient(135deg, #020617, #172554, #2563eb) !important;
}

.bg8 {
    background:
        radial-gradient(circle at 70% 40%, #ec4899, transparent 20%),
        linear-gradient(135deg, #1e1b4b, #581c87, #020617) !important;
}

/* Theme labels */
.theme-option span {
    display: block !important;
    margin-top: 6px !important;
    text-align: center !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 10.8px !important;
    font-weight: 800 !important;
}

/* Sidebar active tab color changes with theme */
.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, var(--theme-main), var(--theme-second)) !important;
    box-shadow: 0 12px 28px var(--theme-glow) !important;
}

/* All planner buttons change with theme */
#planner button,
.final-study-home button {
    background: linear-gradient(135deg, var(--theme-main), var(--theme-second)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    box-shadow: 0 10px 24px var(--theme-glow) !important;
}

/* Keep special cards accented by selected theme */
.final-card,
.final-note,
#planner [class*="card"],
#planner [class*="Card"],
#planner [class*="box"],
#planner [class*="Box"] {
    border-color: color-mix(in srgb, var(--theme-main) 38%, rgba(255,255,255,0.18)) !important;
}

/* Dashboard/inner card glow also changes */
#planner [class*="card"],
#planner [class*="Card"],
#planner [class*="item"],
#planner [class*="Item"] {
    box-shadow: 0 16px 38px color-mix(in srgb, var(--theme-main) 20%, rgba(0,0,0,0.35)) !important;
}

/* Headings accent color */
.final-mission h2,
.final-small h3,
.final-backgrounds h3,
.final-side-card h3,
.final-motivation h3,
#planner h2,
#planner h3 {
    color: #ffb4d8 !important;
    -webkit-text-fill-color: #ffb4d8 !important;
}

/* Use theme color for important accents */
.final-side-card h2,
.photo-big-number,
#planner .score,
#planner .percent,
#planner .count {
    color: var(--theme-main) !important;
    -webkit-text-fill-color: var(--theme-main) !important;
}

/* Progress bar follows theme */
.final-progress span,
#planner .progress-bar span,
#planner .progress-fill {
    background: linear-gradient(90deg, var(--theme-main), var(--theme-second)) !important;
}

/* Mobile theme grid */
@media (max-width: 900px) {
    .final-bg-row {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 650px) {
    .final-bg-row {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

/* =====================================================
   EXACT BOTTOM THEME OPTIONS LIKE REFERENCE IMAGE
===================================================== */

.final-backgrounds {
    padding: 14px 18px 12px !important;
    border-radius: 16px !important;
    background:
        linear-gradient(135deg, rgba(7,13,36,0.88), rgba(16,10,45,0.84)) !important;
    border: 1px solid rgba(255,255,255,0.22) !important;
    box-shadow: 0 18px 45px rgba(0,0,0,0.35) !important;
}

.final-backgrounds h3 {
    margin: 0 0 12px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 16px !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
}

/* Horizontal theme row like reference */
.final-bg-row {
    display: grid !important;
    grid-template-columns: repeat(8, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
}

/* Theme card itself */
.theme-option {
    position: relative !important;
    padding: 0 !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    cursor: pointer !important;
    border-radius: 12px !important;
    overflow: visible !important;
}

/* Thumbnail size like picture */
.theme-option .final-bg {
    width: 100% !important;
    height: 86px !important;
    border-radius: 12px !important;
    border: 1px solid rgba(255,255,255,0.28) !important;
    background-size: cover !important;
    background-position: center !important;
    box-shadow: 0 12px 26px rgba(0,0,0,0.22) !important;
    transition: 0.25s ease !important;
}

/* Theme name below image */
.theme-option span {
    display: block !important;
    margin-top: 7px !important;
    text-align: center !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.15 !important;
}

/* Hover effect */
.theme-option:hover .final-bg {
    transform: translateY(-3px) !important;
    border-color: var(--theme-main, #ec4899) !important;
    box-shadow: 0 14px 30px var(--theme-glow, rgba(236,72,153,0.32)) !important;
}

/* Selected theme border like reference */
.theme-option.active-theme .final-bg {
    border: 2px solid #a855f7 !important;
    box-shadow:
        0 0 0 2px rgba(255,255,255,0.12),
        0 14px 34px rgba(168,85,247,0.38) !important;
}

/* Selected checkmark circle */
.theme-option.active-theme::before {
    content: "✓";
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    width: 26px !important;
    height: 26px !important;
    border-radius: 50% !important;
    background: linear-gradient(135deg, #a855f7, #ec4899) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    display: grid !important;
    place-items: center !important;
    font-size: 15px !important;
    font-weight: 900 !important;
    z-index: 5 !important;
    box-shadow: 0 8px 18px rgba(0,0,0,0.30) !important;
}

/* Thumbnail visuals */
.bg1 {
    background-image: url("./planner-bg.png") !important;
}

.bg2 {
    background:
        radial-gradient(circle at 40% 35%, rgba(255,255,255,0.42), transparent 18%),
        radial-gradient(circle at 70% 65%, #fb7185, transparent 28%),
        linear-gradient(135deg, #fbcfe8, #ec4899) !important;
}

.bg3 {
    background:
        radial-gradient(circle at center, rgba(255,255,255,0.42), transparent 22%),
        linear-gradient(135deg, #f9a8d4, #ec4899, #be185d) !important;
}

.bg4 {
    background:
        linear-gradient(135deg, #312e81, #7c3aed, #c4b5fd) !important;
}

.bg5 {
    background:
        radial-gradient(circle at 70% 25%, #ffffff, transparent 10%),
        linear-gradient(135deg, #bae6fd, #f9a8d4, #fb7185) !important;
}

.bg6 {
    background:
        linear-gradient(135deg, #fb7185, #fb6b2f, #fde68a) !important;
}

.bg7 {
    background:
        radial-gradient(circle at 70% 22%, #fef3c7, transparent 8%),
        linear-gradient(135deg, #020617, #172554, #2563eb) !important;
}

.bg8 {
    background:
        radial-gradient(circle at 65% 40%, #ec4899, transparent 18%),
        linear-gradient(135deg, #1e1b4b, #581c87, #020617) !important;
}

/* Theme color variables */
body.final-theme-aurora {
    --theme-main: #22d3ee;
    --theme-second: #8b5cf6;
    --theme-glow: rgba(34,211,238,0.34);
}

body.final-theme-floral {
    --theme-main: #ec4899;
    --theme-second: #fb7185;
    --theme-glow: rgba(236,72,153,0.36);
}

body.final-theme-bow {
    --theme-main: #f472b6;
    --theme-second: #ec4899;
    --theme-glow: rgba(244,114,182,0.36);
}

body.final-theme-lavender {
    --theme-main: #a78bfa;
    --theme-second: #6366f1;
    --theme-glow: rgba(167,139,250,0.36);
}

body.final-theme-cherry {
    --theme-main: #fb7185;
    --theme-second: #f9a8d4;
    --theme-glow: rgba(251,113,133,0.36);
}

body.final-theme-sunset {
    --theme-main: #fb6b2f;
    --theme-second: #f97316;
    --theme-glow: rgba(251,107,47,0.36);
}

body.final-theme-starry {
    --theme-main: #60a5fa;
    --theme-second: #2563eb;
    --theme-glow: rgba(96,165,250,0.36);
}

body.final-theme-galaxy {
    --theme-main: #a855f7;
    --theme-second: #ec4899;
    --theme-glow: rgba(168,85,247,0.36);
}

/* Sidebar active tab changes with selected theme */
.sidebar .nav button:hover,
.sidebar button:hover,
.sidebar .nav button.active,
.sidebar button.active,
.sidebar .nav button:first-child {
    background: linear-gradient(135deg, var(--theme-main), var(--theme-second)) !important;
    box-shadow: 0 12px 28px var(--theme-glow) !important;
}

/* Main buttons change with selected theme */
#planner button,
.final-study-home button {
    background: linear-gradient(135deg, var(--theme-main), var(--theme-second)) !important;
    box-shadow: 0 10px 24px var(--theme-glow) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Do not ruin theme-option cards */
.theme-option {
    background: transparent !important;
    box-shadow: none !important;
}

/* =====================================================
   REAL PHOTO BACKGROUNDS FOR THEME OPTIONS
===================================================== */

/* Main page background changes with selected theme */
body.final-theme-aurora {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/aurora.png") center/cover fixed no-repeat !important;
}

body.final-theme-floral {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/floral.png") center/cover fixed no-repeat !important;
}

body.final-theme-bow {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/bow2.png") center/cover fixed no-repeat !important;
}

body.final-theme-lavender {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/lavender.png") center/cover fixed no-repeat !important;
}

body.final-theme-cherry {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/cherry.png") center/cover fixed no-repeat !important;
}

body.final-theme-sunset {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/sunset.png") center/cover fixed no-repeat !important;
}

body.final-theme-starry {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/starry.png") center/cover fixed no-repeat !important;
}

body.final-theme-galaxy {
    background:
        linear-gradient(rgba(8,8,26,0.24), rgba(26,8,42,0.38)),
        url("./assets/backgrounds/galaxy.png") center/cover fixed no-repeat !important;
}

/* Theme option thumbnails also show real photos */
.bg1 {
    background-image: url("./assets/backgrounds/aurora.png") !important;
}

.bg2 {
    background-image: url("./assets/backgrounds/floral.png") !important;
}

.bg3 {
    background-image: url("./assets/backgrounds/bow2.png") !important;
}

.bg4 {
    background-image: url("./assets/backgrounds/lavender.png") !important;
}

.bg5 {
    background-image: url("./assets/backgrounds/cherry.png") !important;
}

.bg6 {
    background-image: url("./assets/backgrounds/sunset.png") !important;
}

.bg7 {
    background-image: url("./assets/backgrounds/starry.png") !important;
}

.bg8 {
    background-image: url("./assets/backgrounds/galaxy.png") !important;
}

/* =====================================================
   REMOVE BLUR/GAP BETWEEN SIDEBAR AND MAIN PLANNER
===================================================== */

/* Remove purple/blur empty strip between menu and content */
#planner {
    margin-left: 245px !important;
    width: calc(100vw - 255px) !important;
    max-width: calc(100vw - 255px) !important;
    padding-left: 0 !important;
}

/* Sidebar exact left position */
.sidebar {
    left: 10px !important;
    width: 225px !important;
    min-width: 225px !important;
}

/* Make main content start closer */
.final-study-home {
    margin-left: 0 !important;
    margin-right: auto !important;
    max-width: 1120px !important;
}

/* Remove any leftover glass/blur block from wrappers */
.container,
.app,
.layout,
.main,
.main-content,
.content,
.app-content {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

/* Remove accidental purple panel/overlay */
body::before,
body::after,
#planner::before,
#planner::after {
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

/* Keep only actual cards blurred, not the empty page area */
.final-card,
.final-note,
.sidebar {
    backdrop-filter: blur(18px) saturate(130%) !important;
}

/* =====================================================
   FINAL GAP REMOVAL FIX
   Remove purple space between sidebar and planner
===================================================== */

/* Sidebar final fixed width */
html body .sidebar {
    position: fixed !important;
    top: 10px !important;
    left: 10px !important;
    width: 230px !important;
    min-width: 230px !important;
    max-width: 230px !important;
}

/* Planner must start immediately after sidebar */
html body #planner {
    position: fixed !important;
    top: 0 !important;
    left: 250px !important;
    right: 0 !important;
    bottom: 0 !important;

    margin: 0 !important;
    padding: 0 10px 30px !important;

    width: auto !important;
    max-width: none !important;
    min-width: 0 !important;

    overflow-y: auto !important;
    overflow-x: hidden !important;

    background: transparent !important;
    backdrop-filter: none !important;
}

/* Stop the Home from centering to the right */
html body #planner .final-study-home {
    width: 100% !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    padding-left: 0 !important;
}

/* Main content should begin from left edge of planner */
html body #planner .final-study-header,
html body #planner .final-note,
html body #planner .final-study-layout {
    margin-left: 0 !important;
    margin-right: 0 !important;
    transform: none !important;
}

/* Keep dashboard layout fitting */
html body #planner .final-study-layout {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) 260px !important;
    gap: 12px !important;
}

/* Remove purple/blur panels from wrappers */
html body .container,
html body .app,
html body .layout,
html body .main,
html body .main-content,
html body .content,
html body .app-content {
    margin: 0 !important;
    padding: 0 !important;
    background: transparent !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
}

/* Remove pseudo overlay strips */
html body .container::before,
html body .container::after,
html body .app::before,
html body .app::after,
html body .layout::before,
html body .layout::after,
html body .main::before,
html body .main::after,
html body .main-content::before,
html body .main-content::after,
html body #planner::before,
html body #planner::after {
    display: none !important;
    content: none !important;
}

/* =====================================================
   TEMP FONT PREVIEW
===================================================== */

#fontPreviewBox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(5, 8, 30, 0.72);
    backdrop-filter: blur(14px);
}

.font-preview-card {
    width: min(520px, 90vw);
    padding: 42px 28px;
    border-radius: 28px;
    text-align: center;
    background:
        linear-gradient(rgba(8,8,26,0.20), rgba(26,8,42,0.42)),
        url("./assets/backgrounds/aurora.png") center/cover no-repeat;
    border: 1px solid rgba(255,255,255,0.22);
    box-shadow: 0 24px 60px rgba(0,0,0,0.45);
}

.font-preview-text {
    margin: 0 0 28px;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    font-family: "Olivia", "Great Vibes", "Brush Script MT", cursive;
    font-size: 44px;
    line-height: 1.25;
    font-weight: 400;
    text-shadow: 0 8px 24px rgba(0,0,0,0.45);
}

.font-preview-card button {
    padding: 11px 24px;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #ec4899, #fb6b2f);
    color: #ffffff;
    font-weight: 900;
}

/* =====================================================
   OLIVIA FONT FOR SPLASH GREETING
===================================================== */

@font-face {
    font-family: "Olivia";
    src: url("./assets/fonts/Olivia.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.splash-welcome {
    font-family: "Olivia", "Great Vibes", "Parisienne", "Brush Script MT", cursive !important;
    font-size: 42px !important;
    line-height: 1.18 !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 8px 26px rgba(0,0,0,0.55) !important;
}

/* =====================================================
   FINAL APP OPENING SPLASH SCREEN
===================================================== */

#splashScreen {
    position: fixed !important;
    inset: 0 !important;
    z-index: 999999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    background:
        linear-gradient(rgba(8, 8, 26, 0.28), rgba(26, 8, 42, 0.48)),
        url("./assets/backgrounds/aurora.png") center/cover no-repeat !important;

    transition: opacity 0.45s ease !important;
}

.splash-content {
    text-align: center !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
}

.splash-logo {
    width: 150px !important;
    height: 150px !important;
    object-fit: contain !important;
    border-radius: 30px !important;
    padding: 12px !important;
    background: rgba(255,255,255,0.14) !important;
    border: 1px solid rgba(255,255,255,0.25) !important;
    box-shadow: 0 22px 50px rgba(0,0,0,0.42) !important;
}

.splash-welcome {
    margin-top: 24px !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-family: "Olivia", "Great Vibes", "Brush Script MT", cursive !important;
    font-size: 36px !important;
    line-height: 1.25 !important;
    font-weight: 400 !important;

    text-shadow: 0 8px 24px rgba(0,0,0,0.50) !important;
}

/* =====================================================
   FREEBOOTER SCRIPT FONT FOR SPLASH
===================================================== */

@font-face {
    font-family: "Freebooter Script";
    src: url("./assets/fonts/FreebooterScript.ttf") format("truetype");
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

.splash-welcome,
.font-preview-text {
    font-family: "Freebooter Script", "Great Vibes", "Parisienne", "Brush Script MT", cursive !important;
    font-size: 52px !important;
    line-height: 1.05 !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 8px 26px rgba(0,0,0,0.55) !important;
}

/* =====================================================
   SPLASH GREETING FONT - NO FONT FILE NEEDED
===================================================== */

.splash-welcome,
.font-preview-text {
    font-family: "Great Vibes", "Brush Script MT", cursive !important;
    font-size: 56px !important;
    line-height: 1.05 !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
    text-shadow: 0 8px 26px rgba(0,0,0,0.55) !important;
}

/* =====================================================
   FINAL FIX: SPLASH MUST OPEN FULL SCREEN
===================================================== */

html body #splashScreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;

    z-index: 9999999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 !important;
    padding: 0 !important;

    background:
        linear-gradient(rgba(8, 8, 26, 0.22), rgba(26, 8, 42, 0.50)),
        url("./assets/backgrounds/aurora.png") center/cover no-repeat !important;

    overflow: hidden !important;
    opacity: 1 !important;
    visibility: visible !important;

    transition: opacity 0.45s ease !important;
}

html body #splashScreen .splash-content {
    position: relative !important;
    z-index: 10000000 !important;

    width: auto !important;
    max-width: 90vw !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
}

html body #splashScreen .splash-logo {
    width: 155px !important;
    height: 155px !important;
    object-fit: contain !important;

    border-radius: 32px !important;
    padding: 12px !important;

    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42) !important;
}

html body #splashScreen .splash-welcome {
    margin-top: 22px !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-family: "Great Vibes", "Brush Script MT", cursive !important;
    font-size: 56px !important;
    line-height: 1.05 !important;
    font-weight: 400 !important;
    letter-spacing: 0.02em !important;

    text-align: center !important;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.55) !important;
}

/* remove temporary preview completely */
#fontPreviewBox {
    display: none !important;
}

/* =====================================================
   FINAL CALENDAR CLEAN FIX
   Proper spacing, circles, and alignment
===================================================== */

.final-calendar {
    width: 260px !important;
    max-width: 260px !important;
    padding: 18px 14px 20px !important;
    overflow: hidden !important;
}

/* Header row */
.final-calendar-head {
    display: grid !important;
    grid-template-columns: 38px 1fr 38px !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 18px !important;
}

.final-calendar-head h3 {
    margin: 0 !important;
    text-align: center !important;
    font-size: 20px !important;
    font-weight: 900 !important;
    letter-spacing: 0.02em !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

.final-calendar-head button {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
}

/* Week row */
.final-week {
    display: grid !important;
    grid-template-columns: repeat(7, 26px) !important;
    justify-content: center !important;
    column-gap: 7px !important;
    margin-bottom: 12px !important;
}

.final-week span {
    width: 26px !important;
    text-align: center !important;
    font-size: 11px !important;
    font-weight: 900 !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;
}

/* Days grid */
.final-days {
    display: grid !important;
    grid-template-columns: repeat(7, 26px) !important;
    justify-content: center !important;
    column-gap: 7px !important;
    row-gap: 9px !important;
    margin: 0 !important;
}

/* Empty date spaces */
.final-empty-day {
    width: 26px !important;
    height: 26px !important;
    display: block !important;
}

/* Date buttons as real circles */
.final-date-btn {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    max-width: 26px !important;
    max-height: 26px !important;

    border-radius: 50% !important;
    padding: 0 !important;
    margin: 0 !important;

    display: grid !important;
    place-items: center !important;
    justify-self: center !important;
    align-self: center !important;

    font-size: 11.5px !important;
    font-weight: 900 !important;
    line-height: 1 !important;

    background: linear-gradient(135deg, var(--theme-main, #ec4899), var(--theme-second, #fb6b2f)) !important;
    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    border: none !important;
    box-shadow: 0 6px 14px rgba(0,0,0,0.18) !important;
}

/* Hover */
.final-date-btn:hover {
    transform: scale(1.08) !important;
    box-shadow: 0 8px 18px var(--theme-glow, rgba(236,72,153,0.35)) !important;
}

/* Today button */
.final-today-btn {
    width: 100% !important;
    margin-top: 18px !important;
    min-height: 42px !important;
    border-radius: 999px !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    text-align: center !important;
}

/* Prevent any old oval calendar CSS */
.final-days span,
.final-days button {
    aspect-ratio: 1 / 1 !important;
}

/* =====================================================
   FINAL SPLASH CLEANUP
   Removes old white preview card and keeps only real splash
===================================================== */

/* Kill old temporary preview completely */
#fontPreviewBox,
.font-preview-card,
.font-preview-text {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Final real splash screen */
html body #splashScreen {
    position: fixed !important;
    inset: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    z-index: 9999999 !important;

    display: flex !important;
    align-items: center !important;
    justify-content: center !important;

    margin: 0 !important;
    padding: 0 !important;

    background:
        linear-gradient(rgba(8, 8, 26, 0.22), rgba(26, 8, 42, 0.50)),
        url("./assets/backgrounds/aurora.png") center/cover no-repeat !important;

    overflow: hidden !important;
    transition: opacity 0.45s ease !important;
}

/* Center splash content only */
html body #splashScreen .splash-content {
    width: auto !important;
    max-width: 90vw !important;

    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;

    text-align: center !important;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* Splash logo */
html body #splashScreen .splash-logo {
    width: 155px !important;
    height: 155px !important;
    object-fit: contain !important;

    border-radius: 32px !important;
    padding: 12px !important;

    background: rgba(255, 255, 255, 0.14) !important;
    border: 1px solid rgba(255, 255, 255, 0.25) !important;
    box-shadow: 0 22px 50px rgba(0, 0, 0, 0.42) !important;
}

/* Splash greeting */
html body #splashScreen .splash-welcome {
    margin-top: 22px !important;

    color: #ffffff !important;
    -webkit-text-fill-color: #ffffff !important;

    font-family: "Great Vibes", "Brush Script MT", cursive !important;
    font-size: 56px !important;
    line-height: 1.05 !important;
    font-weight: 400 !important;

    text-align: center !important;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.55) !important;

    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
}

/* =====================================================
   FINAL MOBILE RESPONSIVE FIX
   Phone layout should stack cleanly, not squeeze
===================================================== */

@media (max-width: 768px) {

    html,
    body {
        width: 100% !important;
        overflow-x: hidden !important;
    }

    /* Sidebar becomes top horizontal/compact panel */
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;

        width: calc(100% - 20px) !important;
        max-width: calc(100% - 20px) !important;
        min-width: 0 !important;
        height: auto !important;

        margin: 10px auto !important;
        padding: 58px 12px 14px !important;

        border-radius: 18px !important;
        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    .sidebar-bow {
        width: 95px !important;
        top: -12px !important;
        left: 28px !important;
    }

    .sidebar-brand-fixed {
        padding: 8px 6px 12px !important;
        margin-bottom: 10px !important;
    }

    .sidebar-logo-fixed {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
    }

    .sidebar-brand-fixed h2 {
        font-size: 18px !important;
    }

    .sidebar-brand-fixed p {
        font-size: 11px !important;
    }

    /* Menu buttons become smaller */
    .sidebar .nav,
    .sidebar-nav {
        gap: 5px !important;
    }

    .sidebar .nav button,
    .sidebar button {
        min-height: 34px !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        border-radius: 10px !important;
    }

    /* Main content below sidebar */
    #planner {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;

        padding: 0 10px 28px !important;
        overflow-x: hidden !important;
    }

    .final-study-home {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 auto !important;
    }

    /* Header smaller */
    .final-study-header {
        padding: 6px 0 12px !important;
        text-align: center !important;
    }

    .final-study-header h1 {
        font-size: 38px !important;
        white-space: normal !important;
        line-height: 1 !important;
    }

    .final-study-header p {
        font-size: 15px !important;
        line-height: 1.25 !important;
    }

    .final-study-header h3 {
        font-size: 18px !important;
        line-height: 1.25 !important;
    }

    .final-study-header em {
        font-size: 14px !important;
        line-height: 1.3 !important;
    }

    .final-note {
        font-size: 13px !important;
        padding: 10px 12px !important;
        margin: 8px 0 !important;
        line-height: 1.35 !important;
    }

    /* Main grid stacks */
    .final-study-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .final-study-main,
    .final-study-side {
        width: 100% !important;
        min-width: 0 !important;
    }

    .final-study-side {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Mission subject cards stack vertically */
    .final-subject-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .final-subject {
        width: 100% !important;
        min-height: auto !important;
        grid-template-columns: 52px minmax(0, 1fr) !important;
        padding: 12px !important;
    }

    .final-subject-icon {
        width: 44px !important;
        height: 44px !important;
        font-size: 24px !important;
    }

    .final-subject h3 {
        font-size: 20px !important;
    }

    .final-subject p {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .final-subject span {
        font-size: 11px !important;
    }

    /* Bottom cards stack */
    .final-bottom-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .final-small {
        width: 100% !important;
        min-height: auto !important;
    }

    .final-small h3,
    .final-backgrounds h3,
    .final-side-card h3,
    .final-motivation h3 {
        font-size: 18px !important;
    }

    .final-small p,
    .final-goal,
    .final-goal span,
    .final-goal b {
        font-size: 13px !important;
    }

    /* Calendar full width and centered */
    .final-calendar {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 12px 18px !important;
    }

    .final-calendar-head {
        grid-template-columns: 36px 1fr 36px !important;
    }

    .final-calendar-head h3 {
        font-size: 18px !important;
    }

    .final-week,
    .final-days {
        grid-template-columns: repeat(7, 32px) !important;
        justify-content: center !important;
        column-gap: 7px !important;
        row-gap: 9px !important;
    }

    .final-week span {
        width: 32px !important;
        font-size: 10px !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        font-size: 12px !important;
    }

    /* Theme options become 2 columns */
    .final-bg-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 10px !important;
    }

    .theme-option .final-bg {
        height: 92px !important;
    }

    .theme-option span {
        font-size: 12px !important;
    }

    /* Side cards readable */
    .final-side-card,
    .final-motivation {
        width: 100% !important;
    }

    .final-side-card h2 {
        font-size: 34px !important;
    }

    .final-side-card p,
    .final-motivation p {
        font-size: 13px !important;
    }
}

/* =====================================================
   FINAL MOBILE CLEAN LAYOUT
   Simple phone layout, no congestion
===================================================== */

@media (max-width: 768px) {

    html,
    body {
        width: 100% !important;
        overflow-x: hidden !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    body {
        background-attachment: scroll !important;
    }

    /* Main app should not stay desktop-positioned */
    #planner {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 12px 26px !important;

        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    /* Sidebar becomes compact top menu */
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;

        width: calc(100% - 24px) !important;
        min-width: 0 !important;
        max-width: none !important;
        height: auto !important;

        margin: 12px auto !important;
        padding: 48px 12px 14px !important;

        border-radius: 20px !important;
        overflow: visible !important;
    }

    .sidebar-bow {
        width: 92px !important;
        top: -18px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
    }

    .sidebar-brand-fixed {
        justify-content: center !important;
        text-align: left !important;
        padding: 8px 8px 12px !important;
        margin-bottom: 10px !important;
    }

    .sidebar-logo-fixed {
        width: 42px !important;
        height: 42px !important;
        min-width: 42px !important;
        min-height: 42px !important;
    }

    .sidebar-brand-fixed h2 {
        font-size: 20px !important;
    }

    .sidebar-brand-fixed p {
        font-size: 12px !important;
    }

    /* Menu becomes 2-column grid */
    .sidebar .nav,
    .sidebar-nav {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
        margin-top: 10px !important;
    }

    .sidebar .nav button,
    .sidebar button {
        min-height: 38px !important;
        width: 100% !important;
        padding: 8px 10px !important;
        font-size: 12px !important;
        border-radius: 12px !important;
        justify-content: flex-start !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
    }

    /* Hide decorative bottom sidebar quote on mobile */
    .sidebar .sidebar-quote,
    .sidebar-quote,
    .sidebar > p:last-child {
        display: none !important;
    }

    /* Home content */
    .final-study-home {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 0 24px !important;
    }

    .final-study-header {
        padding: 8px 0 12px !important;
        text-align: center !important;
    }

    .final-study-header h1 {
        font-size: 42px !important;
        line-height: 0.95 !important;
        white-space: normal !important;
    }

    .final-study-header p {
        font-size: 15px !important;
        line-height: 1.3 !important;
        margin: 8px 0 !important;
    }

    .final-study-header h3 {
        font-size: 18px !important;
        line-height: 1.25 !important;
        margin: 8px 0 !important;
    }

    .final-study-header em {
        display: block !important;
        font-size: 14px !important;
        line-height: 1.35 !important;
        padding: 0 8px !important;
    }

    .final-note {
        font-size: 13px !important;
        line-height: 1.4 !important;
        padding: 10px 12px !important;
        margin: 8px 0 12px !important;
    }

    /* Main layout becomes one column */
    .final-study-layout {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
        width: 100% !important;
    }

    .final-study-main,
    .final-study-side {
        width: 100% !important;
        min-width: 0 !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 12px !important;
    }

    /* Mission card */
    .final-mission {
        padding: 12px !important;
        border-radius: 18px !important;
    }

    .final-mission h2 {
        font-size: 20px !important;
        line-height: 1.2 !important;
        margin-bottom: 12px !important;
    }

    .final-subject-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .final-subject {
        width: 100% !important;
        min-height: auto !important;
        padding: 14px !important;
        grid-template-columns: 54px minmax(0, 1fr) !important;
        gap: 12px !important;
        border-radius: 16px !important;
    }

    .final-subject-icon {
        width: 46px !important;
        height: 46px !important;
        font-size: 24px !important;
    }

    .final-subject h3 {
        font-size: 20px !important;
        line-height: 1.1 !important;
        margin-bottom: 6px !important;
    }

    .final-subject p {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin: 5px 0 !important;
    }

    .final-subject span {
        font-size: 11px !important;
        padding: 5px 8px !important;
    }

    /* Lower cards stack */
    .final-bottom-row {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .final-small {
        width: 100% !important;
        min-height: auto !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .final-small h3,
    .final-backgrounds h3,
    .final-side-card h3,
    .final-motivation h3 {
        font-size: 19px !important;
        line-height: 1.2 !important;
    }

    .final-small button {
        min-height: 42px !important;
        padding: 10px 12px !important;
    }

    .final-small button b,
    .final-small p,
    .final-goal,
    .final-goal span,
    .final-goal b {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .final-small button span {
        font-size: 11.5px !important;
    }

    /* Calendar full width */
    .final-calendar {
        width: 100% !important;
        max-width: 100% !important;
        padding: 16px 12px 18px !important;
        border-radius: 18px !important;
    }

    .final-calendar-head {
        grid-template-columns: 38px 1fr 38px !important;
        margin-bottom: 16px !important;
    }

    .final-calendar-head h3 {
        font-size: 19px !important;
    }

    .final-week,
    .final-days {
        grid-template-columns: repeat(7, 34px) !important;
        justify-content: center !important;
        column-gap: 5px !important;
        row-gap: 8px !important;
    }

    .final-week span {
        width: 34px !important;
        font-size: 10px !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 34px !important;
        height: 34px !important;
        min-width: 34px !important;
        min-height: 34px !important;
        max-width: 34px !important;
        max-height: 34px !important;
        font-size: 12px !important;
    }

    .final-today-btn {
        min-height: 44px !important;
        font-size: 13px !important;
        margin-top: 16px !important;
    }

    /* Side cards */
    .final-side-card,
    .final-motivation {
        width: 100% !important;
        padding: 16px !important;
        border-radius: 18px !important;
    }

    .final-side-card h2 {
        font-size: 34px !important;
    }

    .final-side-card p,
    .final-motivation p {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    /* Theme picker: 2 columns, readable */
    .final-backgrounds {
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .final-bg-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .theme-option .final-bg {
        height: 95px !important;
        border-radius: 14px !important;
    }

    .theme-option span {
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    /* Inner pages mobile */
    #planner .card,
    #planner .task,
    #planner [class*="card"],
    #planner [class*="Card"],
    #planner [class*="item"],
    #planner [class*="Item"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media (max-width: 420px) {
    .final-week,
    .final-days {
        grid-template-columns: repeat(7, 30px) !important;
        column-gap: 4px !important;
    }

    .final-week span {
        width: 30px !important;
        font-size: 9px !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px !important;
        min-height: 30px !important;
        max-width: 30px !important;
        max-height: 30px !important;
    }

    .final-study-header h1 {
        font-size: 36px !important;
    }

    .sidebar .nav,
    .sidebar-nav {
        grid-template-columns: 1fr !important;
    }
}

/* =====================================================
   TRUE FINAL MOBILE APP LAYOUT
   Separate mobile design, not squeezed desktop
===================================================== */

@media screen and (max-width: 900px) {

    html,
    body {
        width: 100% !important;
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow-x: hidden !important;
        background-attachment: scroll !important;
    }

    /* Remove desktop fixed layout completely */
    #planner {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;

        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;

        margin: 0 !important;
        padding: 0 12px 28px !important;

        overflow-x: hidden !important;
        overflow-y: visible !important;
    }

    /* Sidebar becomes clean top menu */
    .sidebar {
        position: relative !important;
        top: auto !important;
        left: auto !important;

        width: calc(100% - 24px) !important;
        min-width: 0 !important;
        max-width: calc(100% - 24px) !important;
        height: auto !important;

        margin: 12px auto 10px !important;
        padding: 14px 12px !important;

        border-radius: 20px !important;
        overflow: hidden !important;
        z-index: 10 !important;
    }

    /* Hide bow on phone because it eats space */
    .sidebar-bow {
        display: none !important;
    }

    /* Compact logo row */
    .sidebar-brand-fixed {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 10px !important;

        padding: 8px 0 12px !important;
        margin: 0 0 10px !important;
        border-bottom: 1px solid rgba(255,255,255,0.12) !important;
    }

    .sidebar-logo-fixed {
        width: 38px !important;
        height: 38px !important;
        min-width: 38px !important;
        min-height: 38px !important;
        border-radius: 12px !important;
    }

    .sidebar-brand-fixed h2 {
        font-size: 18px !important;
        line-height: 1 !important;
        margin: 0 !important;
    }

    .sidebar-brand-fixed p {
        font-size: 11px !important;
        margin: 2px 0 0 !important;
    }

    /* Menu becomes horizontal scroll */
    .sidebar .nav,
    .sidebar-nav {
        display: flex !important;
        flex-direction: row !important;
        gap: 8px !important;

        overflow-x: auto !important;
        overflow-y: hidden !important;

        padding: 4px 0 8px !important;
        margin: 0 !important;

        scrollbar-width: none !important;
    }

    .sidebar .nav::-webkit-scrollbar,
    .sidebar-nav::-webkit-scrollbar {
        display: none !important;
    }

    .sidebar .nav button,
    .sidebar button {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: auto !important;
        max-width: none !important;

        min-height: 34px !important;
        height: 34px !important;

        padding: 7px 12px !important;
        margin: 0 !important;

        border-radius: 999px !important;
        font-size: 12px !important;
        line-height: 1 !important;
        white-space: nowrap !important;

        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 5px !important;
    }

    /* Hide extra sidebar quote/decorations on mobile */
    .sidebar-quote,
    .sidebar .quote,
    .sidebar p:last-child {
        display: none !important;
    }

    /* Home full width */
    .final-study-home {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 0 0 24px !important;
    }

    /* Header compact */
    .final-study-header {
        width: 100% !important;
        padding: 8px 4px 12px !important;
        text-align: center !important;
    }

    .final-study-header h1 {
        font-size: 38px !important;
        line-height: 0.95 !important;
        white-space: normal !important;
        margin: 0 0 8px !important;
    }

    .final-study-header p {
        font-size: 14px !important;
        line-height: 1.25 !important;
        margin: 6px 0 !important;
    }

    .final-study-header h3 {
        font-size: 17px !important;
        line-height: 1.25 !important;
        margin: 8px 0 !important;
    }

    .final-study-header em {
        display: block !important;
        font-size: 13px !important;
        line-height: 1.3 !important;
        padding: 0 8px !important;
    }

    .final-note {
        width: 100% !important;
        font-size: 12.5px !important;
        line-height: 1.35 !important;
        padding: 9px 12px !important;
        margin: 8px 0 12px !important;
        border-radius: 14px !important;
    }

    /* Everything becomes one column */
    .final-study-layout {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 12px !important;
    }

    .final-study-main,
    .final-study-side {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        min-width: 0 !important;
        gap: 12px !important;
    }

    /* Mission */
    .final-mission {
        width: 100% !important;
        padding: 12px !important;
        border-radius: 18px !important;
    }

    .final-mission h2 {
        font-size: 19px !important;
        line-height: 1.2 !important;
        margin: 0 0 12px !important;
        text-align: center !important;
    }

    .final-subject-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .final-subject {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;

        display: grid !important;
        grid-template-columns: 52px 1fr !important;
        gap: 12px !important;

        padding: 14px !important;
        border-radius: 16px !important;
    }

    .final-subject-icon {
        width: 46px !important;
        height: 46px !important;
        font-size: 24px !important;
    }

    .final-subject h3 {
        font-size: 19px !important;
        line-height: 1.1 !important;
        margin: 0 0 5px !important;
    }

    .final-subject p {
        font-size: 13px !important;
        line-height: 1.35 !important;
        margin: 4px 0 !important;
    }

    .final-subject span {
        font-size: 11px !important;
        padding: 5px 8px !important;
        margin: 4px 0 !important;
    }

    /* Lower cards */
    .final-bottom-row {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
        gap: 10px !important;
    }

    .final-small,
    .final-side-card,
    .final-motivation,
    .final-backgrounds,
    .final-calendar {
        width: 100% !important;
        max-width: 100% !important;
        min-height: auto !important;
        padding: 14px !important;
        border-radius: 18px !important;
    }

    .final-small h3,
    .final-backgrounds h3,
    .final-side-card h3,
    .final-motivation h3 {
        font-size: 18px !important;
        line-height: 1.2 !important;
        margin-bottom: 10px !important;
    }

    .final-small button {
        min-height: 42px !important;
        padding: 10px 12px !important;
    }

    .final-small p,
    .final-goal,
    .final-goal span,
    .final-goal b,
    .final-small button b {
        font-size: 13px !important;
        line-height: 1.35 !important;
    }

    .final-small button span {
        font-size: 11.5px !important;
    }

    /* Calendar clean full width */
    .final-calendar-head {
        display: grid !important;
        grid-template-columns: 38px 1fr 38px !important;
        gap: 8px !important;
        margin-bottom: 14px !important;
    }

    .final-calendar-head h3 {
        font-size: 18px !important;
        text-align: center !important;
    }

    .final-calendar-head button {
        width: 36px !important;
        height: 36px !important;
        min-width: 36px !important;
        min-height: 36px !important;
    }

    .final-week,
    .final-days {
        display: grid !important;
        grid-template-columns: repeat(7, 1fr) !important;
        gap: 7px !important;
        width: 100% !important;
    }

    .final-week span {
        width: auto !important;
        font-size: 10px !important;
        text-align: center !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        max-width: 32px !important;
        max-height: 32px !important;
        justify-self: center !important;
        font-size: 12px !important;
    }

    .final-today-btn {
        width: 100% !important;
        min-height: 44px !important;
        margin-top: 16px !important;
        font-size: 13px !important;
    }

    /* Side card values */
    .final-side-card h2 {
        font-size: 32px !important;
    }

    .final-side-card p,
    .final-motivation p {
        font-size: 13px !important;
        line-height: 1.45 !important;
    }

    /* Theme options 2 per row */
    .final-bg-row {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 12px !important;
    }

    .theme-option {
        width: 100% !important;
    }

    .theme-option .final-bg {
        height: 96px !important;
        border-radius: 14px !important;
    }

    .theme-option span {
        font-size: 12px !important;
        line-height: 1.2 !important;
    }

    /* Inner tabs/cards mobile */
    #planner .card,
    #planner .task,
    #planner [class*="card"],
    #planner [class*="Card"],
    #planner [class*="item"],
    #planner [class*="Item"],
    #planner [class*="box"],
    #planner [class*="Box"] {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

@media screen and (max-width: 430px) {

    #planner {
        padding-left: 10px !important;
        padding-right: 10px !important;
    }

    .final-study-header h1 {
        font-size: 34px !important;
    }

    .final-study-header p {
        font-size: 13px !important;
    }

    .final-study-header h3 {
        font-size: 16px !important;
    }

    .final-subject {
        grid-template-columns: 46px 1fr !important;
        padding: 12px !important;
    }

    .final-subject-icon {
        width: 40px !important;
        height: 40px !important;
        font-size: 21px !important;
    }

    .final-subject h3 {
        font-size: 17px !important;
    }

    .final-subject p {
        font-size: 12px !important;
    }

    .final-week,
    .final-days {
        gap: 5px !important;
    }

    .final-empty-day,
    .final-date-btn {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
        min-height: 28px !important;
        max-width: 28px !important;
        max-height: 28px !important;
        font-size: 11px !important;
    }
}