/* ========================================================
   SOLUTION BUDDY - DEDICATED STYLESHEET
   Class 9 Hindi Lokbharti Textbook Exercise Solutions
   महाराष्ट्र राज्य पाठ्यपुस्तक निर्मिती व अभ्यासक्रम संशोधन मंडळ
   ======================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', 'Noto Sans Devanagari', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

body {
    background-color: #f8fafc;
    color: #0f172a;
    line-height: 1.65;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ========================================================
   TOP STICKY HEADER BAR
   ======================================================== */
.site-header {
    background: #0f172a;
    color: #ffffff;
    padding: 8px 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    position: sticky;
    top: 0;
    z-index: 1000;
    transition: background-color 0.25s ease;
}

.header-container {
    max-width: 860px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 40px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.header-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: #ffffff;
    text-decoration: none;
    font-size: 26px;
    font-weight: 700;
    line-height: 1;
    padding: 2px 6px;
    cursor: pointer;
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.header-back-btn:hover {
    color: #38bdf8;
    transform: translateX(-3px);
    background: transparent !important;
}

.header-title {
    font-size: 16px;
    font-weight: 700;
    color: #f8fafc;
    text-align: left;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
    flex: 1;
}

.unit-chap-short {
    color: #38bdf8;
    font-weight: 800;
    margin-right: 4px;
    white-space: nowrap;
}

.chap-name-full {
    color: #f1f5f9;
    font-weight: 600;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.header-icon-btn {
    background: transparent;
    border: 1px solid transparent;
    color: #f8fafc;
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    outline: none;
}

.header-icon-btn:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #38bdf8;
}

/* ========================================================
   PAGE CONTAINER & WORKBOOK PAGE BOXES
   ======================================================== */
.page-container {
    max-width: 860px;
    margin: 22px auto 40px auto;
    padding: 0 14px;
}

.workbook-page {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 26px 28px;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    position: relative;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.page-content {
    width: 100%;
}

/* CHAPTER HEADER IN FIRST BOX */
.page-header-box {
    border-bottom: 2px solid #0f172a;
    padding: 0 0 12px 0;
    text-align: center;
    margin-bottom: 20px;
    background: transparent;
}

.page-header-box h2 {
    font-size: 21px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 4px;
    letter-spacing: 0.5px;
}

.page-header-box h3 {
    font-size: 16.5px;
    font-weight: 700;
    color: #b45309;
    display: inline-block;
}

/* MAIN QUESTION TITLE (Q1, Q2, etc.) */
.main-q-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 16px;
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.main-q-num {
    background: #0284c7;
    color: #ffffff;
    padding: 2px 10px;
    border-radius: 6px;
    font-size: 14.5px;
    font-weight: 800;
    flex-shrink: 0;
    display: inline-block;
}

.main-q-text {
    flex: 1;
    line-height: 1.5;
}

/* SUB-QUESTION FIELD GROUPS */
.field-group {
    margin-bottom: 16px;
}

.field-group:last-child {
    margin-bottom: 0;
}

.field-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.5;
}

.field-answer {
    font-size: 14.5px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    line-height: 1.68;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
}

.ans-label {
    color: #1e3a8a;
    font-weight: 800;
    margin-right: 6px;
    display: inline-block;
}

.field-answer p {
    margin-bottom: 8px;
}

.field-answer p:last-child {
    margin-bottom: 0;
}

.field-title ul, .field-title ol,
.field-answer ul, .field-answer ol,
.prompt-box ul, .prompt-box ol,
.answer-box ul, .answer-box ol {
    padding-left: 22px;
    margin-left: 0;
    margin-top: 6px;
    margin-bottom: 8px;
    box-sizing: border-box;
}

.field-title li,
.field-answer li,
.prompt-box li,
.answer-box li {
    margin-bottom: 4px;
}

.prompt-box {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0 12px 0;
    font-size: 14px;
    color: #334155;
    line-height: 1.6;
    box-sizing: border-box;
}

/* TABLES */
.workbook-table, .data-table, .styled-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13.5px;
    background: #ffffff;
    border: 1.5px solid #0f172a;
}

.workbook-table th, .workbook-table td,
.data-table th, .data-table td,
.styled-table th, .styled-table td {
    border: 1.5px solid #0f172a;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.workbook-table th, .data-table th, .styled-table th {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    text-align: center;
}

/* NUMERICAL STEP BOX */
.step-box {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    margin: 8px 0;
    font-size: 14px;
    line-height: 1.6;
}

.step-line {
    margin-bottom: 5px;
}

.step-result {
    font-weight: 700;
    color: #1e3a8a;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px dashed #cbd5e1;
}

/* CHEMICAL FORMULA / CODE HIGHLIGHT */
.chem-eqn {
    background: #f1f5f9;
    border-left: 3px solid #0284c7;
    padding: 8px 12px;
    margin: 8px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    border-radius: 0 6px 6px 0;
    overflow-x: auto;
}

.chem-structure-card {
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 14px;
    margin: 8px 0;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 13.5px;
    font-weight: 600;
    color: #0f172a;
    white-space: pre-wrap;
    line-height: 1.45;
}

/* SVG DIAGRAM CARDS */
.image-box-wrapper, .svg-diagram-card {
    border: 1.5px dashed #94a3b8;
    border-radius: 6px;
    padding: 14px;
    margin: 14px 0;
    background: #f8fafc;
    text-align: center;
}

.image-box-wrapper svg, .svg-diagram-card svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto 8px auto;
    border-radius: 4px;
    background: #ffffff;
}

.image-box-title, .diagram-caption {
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
    margin-top: 6px;
}

/* BOTTOM BACK BUTTON & CHAPTER NAVIGATION BAR */
.bottom-nav-container {
    text-align: center;
    margin: 28px 0 20px 0;
}

.bottom-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 24px;
    background-color: #1e293b;
    color: #ffffff;
    border-radius: 6px;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.bottom-back-btn:hover {
    background-color: #334155;
    transform: translateY(-1px);
}

/* 3-WAY SEQUENTIAL CHAPTER NAVIGATION */
.chapter-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 26px 0 22px 0;
    width: 100%;
    box-sizing: border-box;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 11px 14px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 14.5px;
    font-weight: 600;
    transition: all 0.22s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    flex: 1;
    min-width: 0;
    text-align: center;
    box-sizing: border-box;
    white-space: nowrap;
}

.nav-btn-prev {
    background-color: #ffffff;
    color: #1e293b;
    border: 1.5px solid #cbd5e1;
}

.nav-btn-prev:hover {
    background-color: #f1f5f9;
    border-color: #94a3b8;
    transform: translateY(-1px);
}

.nav-btn-home {
    background-color: #1e293b;
    color: #ffffff;
    border: 1.5px solid #1e293b;
}

.nav-btn-home:hover {
    background-color: #334155;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 41, 59, 0.2);
}

.nav-btn-next {
    background-color: #dc2626;
    color: #ffffff;
    border: 1.5px solid #dc2626;
}

.nav-btn-next:hover {
    background-color: #b91c1c;
    border-color: #b91c1c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.25);
}

@media (max-width: 480px) {
    .chapter-nav-bar {
        gap: 6px;
    }
    .nav-btn {
        padding: 10px 6px;
        font-size: 13.5px;
    }
}

/* Dark mode support for navigation */
body.dark-mode .nav-btn-prev {
    background-color: #1e293b;
    color: #f8fafc;
    border-color: #334155;
}
body.dark-mode .nav-btn-prev:hover {
    background-color: #334155;
    border-color: #475569;
}
body.dark-mode .nav-btn-home {
    background-color: #334155;
    color: #f8fafc;
    border-color: #475569;
}
body.dark-mode .nav-btn-home:hover {
    background-color: #475569;
}
body.dark-mode .nav-btn-next {
    background-color: #dc2626;
    color: #ffffff;
    border-color: #dc2626;
}
body.dark-mode .nav-btn-next:hover {
    background-color: #ef4444;
}

/* SEO CONTENT & FAQ SECTION */
.seo-section {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px 28px;
    margin-top: 24px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1.5px solid #cbd5e1;
    text-align: left;
    line-height: 1.7;
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.seo-section h3 {
    color: #4B3D00;
    border-left: 4px solid #f59e0b;
    padding-left: 10px;
    font-size: 18px;
    font-weight: 700;
    margin-top: 22px;
    margin-bottom: 10px;
}

.seo-section h3:first-of-type {
    margin-top: 0;
}

.seo-section p {
    color: #334155;
    font-size: 14px;
    margin-bottom: 12px;
}

.seo-section ul {
    padding-left: 20px;
    color: #334155;
    font-size: 14px;
    margin-bottom: 14px;
}

.seo-section ul li {
    margin-bottom: 5px;
}

.faq-item {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 10px;
}

.faq-item:last-child {
    margin-bottom: 0;
}

.faq-item h4 {
    margin: 0 0 5px 0;
    color: #0f172a;
    font-size: 14.5px;
    font-weight: 700;
}

.faq-item p {
    margin: 0;
    color: #475569;
    font-size: 13.5px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.tag-pill {
    background: #f1f5f9;
    color: #1e293b;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 20px;
    text-decoration: none;
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.tag-pill:hover {
    background: #fde68a;
    border-color: #f59e0b;
}

/* TOAST NOTIFICATION */
.toast-popup {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: #0f172a;
    color: #ffffff;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-align: center;
    max-width: 90%;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.toast-popup.toast-show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
    pointer-events: auto;
}

/* ========================================================
   ADDITIONAL COMPONENT STYLES (CONCEPT MAPS, FLOWCHARTS, TABLES)
   ======================================================== */
.question-block {
    margin-bottom: 8px;
}

.question-desc {
    font-size: 15px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 12px;
    line-height: 1.5;
}

.table-container {
    overflow-x: auto;
    margin: 14px 0;
}

.solution-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13.5px;
    background: #ffffff;
    border: 1.5px solid #0f172a;
}

.solution-table th, .solution-table td {
    border: 1.5px solid #0f172a;
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}

.solution-table th {
    background-color: #f1f5f9;
    color: #0f172a;
    font-weight: 700;
    text-align: center;
}

.concept-map {
    background: #f8fafc;
    border: 1.5px dashed #94a3b8;
    border-radius: 8px;
    padding: 16px;
    margin: 16px auto;
    text-align: center;
}

.concept-center {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 8px;
    font-weight: 700;
    background: #e0f2fe;
    border: 1.5px solid #0284c7;
    color: #0369a1;
    margin-bottom: 12px;
}

.solution-box {
    padding: 10px 14px;
    border-radius: 8px;
    font-weight: 600;
    background: #f0fdf4;
    border: 1.5px solid #22c55e;
    color: #15803d;
}

.flow-steps {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin: 12px 0;
}

.flow-step {
    padding: 10px 14px;
    border-radius: 6px;
    background: #f8fafc;
    border: 1px solid #cbd5e1;
    font-weight: 600;
    color: #0f172a;
}

.flow-arrow {
    text-align: center;
    color: #64748b;
    font-size: 18px;
    font-weight: bold;
}

.faq-question {
    font-weight: 700;
    color: #0f172a;
    font-size: 14.5px;
    margin-bottom: 4px;
}

.faq-answer {
    color: #475569;
    font-size: 13.5px;
    line-height: 1.5;
}

/* Fallback aliases */
.question-title {
    font-size: 17px;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 14px;
    line-height: 1.5;
}

.sub-q-block {
    margin-bottom: 16px;
}

.sub-q-text {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 6px;
    line-height: 1.5;
}

.answer-box {
    font-size: 14.5px;
    color: #0f172a;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    padding: 10px 14px;
    border-radius: 6px;
    line-height: 1.68;
    text-align: left;
    overflow-wrap: break-word;
    word-wrap: break-word;
    box-sizing: border-box;
    max-width: 100%;
    overflow-x: auto;
}

.answer-box strong {
    color: #1e3a8a;
    font-weight: 800;
}

/* ========================================================
   MAHARASHTRA BOARD SANJAL (CONCEPT WEB) COMPONENT
   Matches Balbharti textbook / workbook diagram pattern
   ======================================================== */
.sanjal-web-container {
    max-width: 620px;
    margin: 18px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    width: 100%;
}

.sanjal-top-row, .sanjal-bottom-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    width: 100%;
}

.sanjal-box {
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 8px;
    padding: 12px 14px;
    font-size: 14px;
    font-weight: 600;
    color: #0f172a;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    box-sizing: border-box;
    line-height: 1.5;
}

.sanjal-center-wrap {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    margin: 4px 0;
}

.sanjal-arrows-top, .sanjal-arrows-bottom {
    display: flex;
    justify-content: space-around;
    width: 75%;
    font-size: 22px;
    font-weight: 800;
    color: #0284c7;
    line-height: 1.2;
}

.sanjal-center-box {
    background: #e0f2fe;
    border: 2px solid #0284c7;
    border-radius: 8px;
    padding: 10px 18px;
    font-size: 14.5px;
    font-weight: 700;
    color: #0369a1;
    text-align: center;
    max-width: 95%;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.15);
    box-sizing: border-box;
}

/* ========================================================
   WORD FORMATION DIAGRAM (PREFIX - ROOT - SUFFIX)
   Matches Balbharti textbook / workbook diagram pattern
   ======================================================== */
.word-formation-card {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 16px 14px;
    margin: 14px 0;
    box-sizing: border-box;
}

.word-formation-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: 8px 0;
    flex-wrap: wrap;
}

.affix-box {
    border: 2px solid #0f172a;
    background: #f8fafc;
    color: #0f172a;
    padding: 6px 16px;
    font-weight: 800;
    font-size: 17px;
    border-radius: 6px;
    min-width: 48px;
    text-align: center;
    box-sizing: border-box;
}

.root-box {
    border: 2px solid #0284c7;
    background: #e0f2fe;
    color: #0369a1;
    padding: 8px 20px;
    font-weight: 800;
    font-size: 17px;
    border-radius: 8px;
    text-align: center;
    box-sizing: border-box;
}

.arrow-symbol {
    font-size: 22px;
    font-weight: 800;
    color: #475569;
}

.word-results-row {
    display: flex;
    justify-content: space-around;
    gap: 12px;
    margin-top: 10px;
    font-size: 14px;
    flex-wrap: wrap;
    color: #334155;
}

.word-results-row strong {
    color: #1e3a8a;
}

/* ========================================================
   FLOW CHART (प्रवाह तालिका)
   ======================================================== */
.flow-diagram-container {
    max-width: 520px;
    margin: 16px auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 100%;
    box-sizing: border-box;
}

.flow-card-step {
    width: 100%;
    background: #ffffff;
    border: 2px solid #0f172a;
    border-radius: 8px;
    padding: 10px 16px;
    font-weight: 600;
    font-size: 14px;
    color: #0f172a;
    text-align: center;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    box-sizing: border-box;
    line-height: 1.5;
}

.flow-connector-arrow {
    font-size: 20px;
    color: #0284c7;
    font-weight: 800;
    line-height: 1;
}

/* ========================================================
   DARK MODE STYLES
   ======================================================== */
body.dark-mode {
    background-color: #0b1120;
    color: #e2e8f0;
}

body.dark-mode .site-header {
    background: #020617;
    border-bottom: 1px solid #1e293b;
}

body.dark-mode .header-back-btn {
    color: #ffffff;
}

body.dark-mode .header-back-btn:hover {
    color: #38bdf8;
}

body.dark-mode .header-title {
    color: #f8fafc;
}

body.dark-mode .unit-chap-short {
    color: #38bdf8;
}

body.dark-mode .chap-name-full {
    color: #cbd5e1;
}

body.dark-mode .workbook-page {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .page-header-box {
    border-bottom-color: #475569;
}

body.dark-mode .page-header-box h2 {
    color: #f8fafc;
}

body.dark-mode .page-header-box h3 {
    color: #fbbf24;
}

body.dark-mode .main-q-title {
    color: #f8fafc;
}

body.dark-mode .field-title {
    color: #f8fafc;
}

body.dark-mode .field-answer {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .ans-label {
    color: #60a5fa;
}

body.dark-mode .workbook-table,
body.dark-mode .data-table,
body.dark-mode .styled-table {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .workbook-table th,
body.dark-mode .data-table th,
body.dark-mode .styled-table th {
    background-color: #0f172a;
    color: #f8fafc;
    border-color: #475569;
}

body.dark-mode .workbook-table td,
body.dark-mode .data-table td,
body.dark-mode .styled-table td {
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .step-box {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .step-result {
    color: #38bdf8;
    border-top-color: #334155;
}

body.dark-mode .chem-eqn,
body.dark-mode .chem-structure-card {
    background: #0f172a;
    border-color: #334155;
    color: #38bdf8;
}

body.dark-mode .image-box-wrapper,
body.dark-mode .svg-diagram-card {
    background: #0f172a;
    border-color: #475569;
}

body.dark-mode .image-box-wrapper svg,
body.dark-mode .svg-diagram-card svg {
    background: #1e293b;
}

body.dark-mode .image-box-title,
body.dark-mode .diagram-caption {
    color: #f8fafc;
}

body.dark-mode .bottom-back-btn {
    background-color: #334155;
    color: #f8fafc;
}

body.dark-mode .bottom-back-btn:hover {
    background-color: #475569;
}

body.dark-mode .seo-section {
    background: #1e293b;
    border-color: #334155;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

body.dark-mode .seo-section h3 {
    color: #fbbf24;
    border-left-color: #f59e0b;
}

body.dark-mode .seo-section p,
body.dark-mode .seo-section ul,
body.dark-mode .seo-section ul li {
    color: #cbd5e1;
}

body.dark-mode .faq-item {
    background: #0f172a;
    border-color: #334155;
}

body.dark-mode .faq-item h4 {
    color: #f8fafc;
}

body.dark-mode .faq-item p {
    color: #94a3b8;
}

body.dark-mode .tag-pill {
    background: #0f172a;
    color: #cbd5e1;
    border-color: #334155;
}

body.dark-mode .tag-pill:hover {
    background: #f59e0b;
    color: #0f172a;
    border-color: #f59e0b;
}

body.dark-mode .question-desc {
    color: #cbd5e1;
}

body.dark-mode .solution-table {
    background: #1e293b;
    color: #e2e8f0;
    border-color: #475569;
}

body.dark-mode .solution-table th {
    background-color: #0f172a;
    color: #f8fafc;
    border-color: #475569;
}

body.dark-mode .solution-table td {
    border-color: #475569;
    color: #e2e8f0;
}

body.dark-mode .concept-map {
    background: #0f172a;
    border-color: #475569;
}

body.dark-mode .concept-center {
    background: #082f49;
    border-color: #0284c7;
    color: #38bdf8;
}

body.dark-mode .solution-box {
    background: #052e16;
    border-color: #16a34a;
    color: #4ade80;
}

body.dark-mode .flow-step {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .flow-arrow {
    color: #94a3b8;
}

body.dark-mode .faq-question {
    color: #f8fafc;
}

body.dark-mode .faq-answer {
    color: #94a3b8;
}

body.dark-mode .question-title {
    color: #f8fafc;
}

body.dark-mode .sub-q-text {
    color: #f8fafc;
}

body.dark-mode .answer-box {
    background: #0f172a;
    border-color: #334155;
    color: #e2e8f0;
}

body.dark-mode .answer-box strong {
    color: #60a5fa;
}

body.dark-mode .prompt-box {
    background: #0f172a;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .sanjal-box {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-mode .sanjal-center-box {
    background: #082f49;
    border-color: #0284c7;
    color: #38bdf8;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.3);
}

body.dark-mode .sanjal-arrows-top,
body.dark-mode .sanjal-arrows-bottom {
    color: #38bdf8;
}

body.dark-mode .word-formation-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .affix-box {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-mode .root-box {
    background: #082f49;
    border-color: #0284c7;
    color: #38bdf8;
}

body.dark-mode .arrow-symbol {
    color: #94a3b8;
}

body.dark-mode .word-results-row {
    color: #cbd5e1;
}

body.dark-mode .word-results-row strong {
    color: #60a5fa;
}

body.dark-mode .flow-card-step {
    background: #0f172a;
    border-color: #475569;
    color: #f8fafc;
}

body.dark-mode .flow-connector-arrow {
    color: #38bdf8;
}

/* ========================================================
   RESPONSIVE (MOBILE OPTIMIZED)
   ======================================================== */
@media (max-width: 600px) {
    .site-header {
        padding: 6px 12px;
    }

    .header-title {
        font-size: 14.5px;
    }

    .page-container {
        margin: 14px auto 28px auto;
        padding: 0 8px;
    }

    .workbook-page {
        padding: 18px 16px;
        margin-bottom: 16px;
    }

    .page-header-box h2 {
        font-size: 18px;
    }

    .page-header-box h3 {
        font-size: 15px;
    }

    .main-q-title {
        font-size: 15.5px;
    }

    .field-title {
        font-size: 14px;
    }

    .field-answer {
        padding: 8px 10px;
        font-size: 13.5px;
    }

    .workbook-table, .data-table, .styled-table, .solution-table {
        font-size: 12px;
    }

    .workbook-table th, .workbook-table td,
    .data-table th, .data-table td,
    .styled-table th, .styled-table td,
    .solution-table th, .solution-table td {
        padding: 6px 8px;
    }

    .question-desc {
        font-size: 14px;
    }

    .question-title {
        font-size: 15.5px;
    }

    .sub-q-text {
        font-size: 14px;
    }

    .answer-box {
        padding: 8px 10px;
        font-size: 13.5px;
    }

    .concept-map {
        padding: 12px 10px;
    }

    .concept-center {
        font-size: 13.5px;
        padding: 8px 12px;
    }

    .solution-box {
        font-size: 13px;
        padding: 8px 10px;
    }

    .seo-section {
        padding: 18px 16px;
    }

    /* Diagrams Responsive */
    .sanjal-web-container {
        margin: 12px auto;
        gap: 6px;
    }

    .sanjal-top-row, .sanjal-bottom-row {
        gap: 8px;
    }

    .sanjal-box {
        padding: 8px 10px;
        font-size: 12.5px;
        min-height: 48px;
        border-width: 1.5px;
    }

    .sanjal-center-box {
        padding: 8px 12px;
        font-size: 13px;
        border-width: 1.5px;
    }

    .sanjal-arrows-top, .sanjal-arrows-bottom {
        font-size: 18px;
        line-height: 1.1;
    }

    .word-formation-card {
        padding: 12px 10px;
    }

    .word-formation-diagram {
        gap: 8px;
    }

    .affix-box, .root-box {
        font-size: 14.5px;
        padding: 6px 12px;
        min-width: 40px;
    }

    .arrow-symbol {
        font-size: 18px;
    }

    .flow-diagram-container {
        gap: 4px;
        margin: 12px auto;
    }

    .flow-card-step {
        padding: 8px 12px;
        font-size: 13px;
        border-width: 1.5px;
    }

    .flow-connector-arrow {
        font-size: 18px;
    }
}


/* ========================================================
   SANJAL GRID & ITEM EXTENSION
   ======================================================== */
.sanjal-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 14px;
    width: 100%;
    margin-top: 14px;
}

.sanjal-item {
    background: #ffffff;
    border: 2px solid #cbd5e1;
    border-radius: 10px;
    padding: 12px 14px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1.5;
    transition: all 0.2s ease;
}

body.dark-mode .sanjal-item {
    background: #1e293b;
    border-color: #475569;
    color: #f1f5f9;
}

@media (max-width: 600px) {
    .sanjal-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    .sanjal-item {
        padding: 10px 12px;
        font-size: 14px;
    }
}


/* ========================================================
   DIAGRAM EXTENSIONS: STAGGERED LIST, TREE BRANCH & FLOW
   ======================================================== */
.staggered-box-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px auto;
    max-width: 680px;
    width: 100%;
}

.staggered-box {
    display: flex;
    align-items: center;
    background: #ffffff;
    border: 2px solid #86efac;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.04);
    gap: 14px;
    font-weight: 600;
    color: #166534;
    line-height: 1.5;
    transition: transform 0.15s ease;
}

.staggered-box:hover {
    transform: translateX(4px);
}

.staggered-box .box-num {
    background: #16a34a;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.staggered-box .box-content {
    flex: 1;
}

body.dark-mode .staggered-box {
    background: #0f172a;
    border-color: #22c55e;
    color: #86efac;
}

/* TREE BRANCH DIAGRAM (ROOT -> LEAVES) */
.tree-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.tree-branch-card {
    display: flex;
    align-items: center;
    background: #f8fafc;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    gap: 14px;
    box-shadow: 0 2px 6px rgba(0,0,0,0.03);
}

.tree-root-node {
    background: #fef3c7;
    border: 2px solid #f59e0b;
    color: #92400e;
    font-weight: 700;
    font-size: 16px;
    padding: 12px 18px;
    border-radius: 50px;
    text-align: center;
    min-width: 90px;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.15);
}

.tree-connector-arrow {
    font-size: 22px;
    font-weight: 800;
    color: #f59e0b;
    line-height: 1;
}

.tree-leaves-col {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.tree-leaf-box {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 8px;
    padding: 8px 12px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    font-size: 14px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

body.dark-mode .tree-branch-card {
    background: #1e293b;
    border-color: #334155;
}

body.dark-mode .tree-root-node {
    background: #78350f;
    border-color: #f59e0b;
    color: #fef3c7;
}

body.dark-mode .tree-leaf-box {
    background: #0f172a;
    border-color: #475569;
    color: #f1f5f9;
}

/* FLOW SEQUENCE DIAGRAM (FLOWCHART) */
.flow-sequence-container {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-width: 650px;
    margin: 18px auto;
}

.flow-step-box {
    background: #eff6ff;
    border: 2px solid #3b82f6;
    border-radius: 10px;
    padding: 14px 18px;
    font-weight: 600;
    color: #1e40af;
    text-align: center;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.08);
}

.flow-arrow-down {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    color: #3b82f6;
    line-height: 1;
}

body.dark-mode .flow-step-box {
    background: #172554;
    border-color: #60a5fa;
    color: #dbeafe;
}

body.dark-mode .flow-arrow-down {
    color: #60a5fa;
}

/* ========================================================
   PRINT STYLESHEET (@media print)
   ======================================================== */
@media print {
    body {
        background: #ffffff !important;
        color: #000000 !important;
        font-size: 12pt;
    }

    .top-header,
    .menu-toggle,
    .share-button,
    .header-icons,
    .sidebar,
    .bottom-nav-container,
    .chapter-nav-bar,
    .toast-popup,
    ins.adsbygoogle {
        display: none !important;
    }

    .page-container {
        max-width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    .workbook-page {
        border: 1px solid #94a3b8 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
        padding: 16px !important;
    }

    .sanjal-web-container,
    .word-formation-card,
    .flow-diagram-container {
        page-break-inside: avoid;
    }

    .seo-section {
        border: 1px solid #cbd5e1 !important;
        box-shadow: none !important;
        page-break-inside: avoid;
    }

    a {
        text-decoration: none !important;
        color: #000000 !important;
    }
}


