/* BPG Academy — Module 02: Class Workspaces, Theory Reader, Calendar & Dock */
    font-size: 0.8rem;
    color: var(--text-tertiary);
    margin-bottom: 8px;
}

.portal-main-title {
    font-size: 2.15rem;
    margin-bottom: 4px;
    font-weight: 600;
}

.portal-main-sub {
    color: var(--text-secondary);
    font-size: 0.92rem;
}

.portal-quick-actions {
    display: flex;
    gap: 10px;
}

/* 5-Tab Sub-Taskbar Strip */
.understated-tab-strip {
    display: flex;
    gap: 10px;
    background: var(--bg-cream-subtle);
    padding: 6px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-soft);
    margin-bottom: 36px;
    overflow-x: auto;
}

.strip-tab-btn {
    padding: 10px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-secondary);
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.strip-tab-btn:hover {
    color: var(--text-primary);
}

.strip-tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-navy);
    box-shadow: var(--shadow-sm);
}

.portal-tab-pane,
.class-tab-pane {
    display: none;
}

.portal-tab-pane.active,
.class-tab-pane.active {
    display: block;
    animation: fadeInView 0.22s ease;
}

/* Syllabus Table */
.syllabus-card-wrap {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 36px;
    box-shadow: var(--shadow-sm);
}

.syllabus-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    margin-top: 18px;
}

.syllabus-table th {
    text-align: left;
    padding: 12px 16px;
    font-weight: 600;
    color: var(--text-tertiary);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    border-bottom: 1px solid var(--border-strong);
}

.syllabus-table td {
    padding: 16px;
    border-bottom: 1px solid var(--border-soft);
    color: var(--text-secondary);
}

/* Master-Detail Textbook Theory Reader */
.deep-reader-layout {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 32px;
    align-items: start;
}

.reader-sidebar {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    overflow: hidden;
    position: sticky;
    top: 96px;
    max-height: calc(100vh - 130px);
    overflow-y: auto;
}

.sidebar-search-wrap {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-soft);
    display: flex;
    align-items: center;
    gap: 9px;
    background: var(--bg-cream-subtle);
}

.sidebar-search-wrap i {
    color: var(--text-tertiary);
    font-size: 0.85rem;
}

.sidebar-search-wrap input {
    width: 100%;
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.86rem;
}

.unit-tree-group {
    border-bottom: 1px solid var(--border-soft);
}

.unit-tree-header {
    width: 100%;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    font-weight: 600;
    font-size: 0.86rem;
    color: var(--text-primary);
}

.unit-tree-code {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--accent-navy);
    margin-right: 6px;
}

.unit-subtopics-list {
    display: none;
    padding: 4px 8px 10px;
}

.unit-tree-group.open .unit-subtopics-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.subtopic-item-btn {
    width: 100%;
    text-align: left;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    transition: background 0.15s ease;
}

.subtopic-item-btn:hover {
    background: var(--bg-cream-subtle);
}

.subtopic-item-btn.active {
    background: var(--accent-navy-soft);
    color: var(--accent-navy);
}

.subtopic-item-title {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.subtopic-item-meta {
    font-size: 0.72rem;
    color: var(--text-tertiary);
    display: flex;
    justify-content: space-between;
}

/* Right Textbook Canvas */
.reader-canvas {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 48px 54px;
    box-shadow: var(--shadow-sm);
    font-size: var(--reader-font-size);
}

.reader-top-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding-bottom: 18px;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-soft);
}

.font-scale-controls {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--bg-cream-subtle);
    padding: 4px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-soft);
}

.btn-font-scale {
    padding: 4px 10px;
    font-size: 0.78rem;
    font-weight: 700;
    border-radius: 5px;
    color: var(--text-secondary);
}

.btn-font-scale:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.reader-article-title {
    font-size: 1.95rem;
    line-height: 1.25;
    margin-bottom: 24px;
    font-weight: 600;
}

.textbook-prose {
    font-family: 'Newsreader', Georgia, serif;
    font-size: 1.12em;
    line-height: 1.8;
    color: var(--text-primary);
}

.reader-section-block {
    margin-bottom: 32px;
}

.reader-section-block h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.02rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent-navy);
    margin-bottom: 12px;
}

.math-theorem-box {
    font-family: 'Newsreader', Georgia, serif;
    background: var(--bg-cream);
    border-left: 3px solid var(--accent-navy);
    padding: 20px 24px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 16px 0;
    overflow-x: auto;
}

.collapsible-proof-box {
    background: var(--bg-cream-subtle);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    margin: 18px 0;
    overflow: hidden;
}

.collapsible-proof-box summary {
    font-family: 'Inter', sans-serif;
    padding: 14px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
}

.collapsible-proof-box summary::-webkit-details-marker {
    display: none;
}

.collapsible-proof-body {
    padding: 18px 22px;
    border-top: 1px solid var(--border-soft);
    background: var(--bg-card);
    line-height: 1.75;
}

.red-pen-alert {
    background: var(--accent-crimson-soft);
    border-left: 3px solid var(--accent-crimson);
    padding: 18px 22px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin-top: 24px;
}

.red-pen-alert h4 {
    color: var(--accent-crimson);
    font-size: 0.95rem;
    margin-bottom: 6px;
}

/* Live Schedule, Notes & Plans */
.live-classroom-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 36px;
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 36px;
}

.zoom-credentials-box {
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 16px 20px;
    margin: 20px 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.zoom-cred-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.9rem;
}

.zoom-cred-val {
    font-weight: 600;
}

.btn-copy-cred {
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    padding: 3px 10px;
    border-radius: 5px;
    font-size: 0.75rem;
    font-weight: 600;
}

.weekly-routine-box {
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 24px;
}

.weekly-routine-list {
    list-style: none;
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.weekly-routine-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    font-size: 0.86rem;
    padding-bottom: 10px;
    border-bottom: 1px dashed var(--border-soft);
}

.notes-vault-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.note-pdf-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.note-pdf-left {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.pdf-icon-box {
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: var(--accent-crimson-soft);
    color: var(--accent-crimson);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.15rem;
    flex-shrink: 0;
}

.note-badge-pill {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 999px;
    margin-bottom: 4px;
}

.note-badge-pill.free {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
}

.note-badge-pill.paid,
.note-badge-pill.distinction {
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
}

.note-badge-pill.diamond {
    background: var(--accent-navy-soft);
    color: var(--accent-navy);
}

/* In-App PDF Viewer Box */
.pdf-preview-body {
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-sm);
    padding: 24px;
    max-height: 55vh;
    overflow-y: auto;
    font-family: 'Newsreader', Georgia, serif;
    line-height: 1.75;
}

.courses-tier-grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.tier-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 32px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tier-card.gold {
    border-color: var(--accent-amber);
}

.tier-card.diamond {
    border: 2px solid var(--accent-navy);
}

.tier-badge {
    align-self: flex-start;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    background: var(--bg-cream-subtle);
}

.tier-price {
    font-size: 1.9rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
}

.tier-features-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 8px 0 18px;
}

.tier-features-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.88rem;
    color: var(--text-secondary);
}

.tier-features-list i {
    color: var(--accent-emerald);
    margin-top: 4px;
}

/* ==========================================================================
   4. CONSOLIDATED FLOATING UTILITY DOCK & SCIENTIFIC CALCULATOR
   ========================================================================== */
.utility-hub-container {
    position: fixed;
    bottom: 26px;
    right: 26px;
    z-index: 900;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 10px;
}

.utility-hub-menu {
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.2s ease;
}

.utility-hub-container.open .utility-hub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.utility-menu-item {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-strong);
    padding: 10px 16px;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-md);
    transition: transform 0.15s ease;
}

.utility-menu-item:hover {
    transform: translateX(-3px);
    border-color: var(--accent-navy);
}

.utility-menu-item.whatsapp i {
    color: #25D366;
    font-size: 1.05rem;
}

.utility-hub-fab {
    background: var(--accent-navy);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-lg);
}

/* Draggable Calculator */
.draggable-calc-widget {
    position: fixed;
    bottom: 90px;
    right: 26px;
    width: 325px;
    background: var(--bg-card);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 950;
    display: none;
    user-select: none;
    overflow: hidden;
}

.draggable-calc-widget.open {
    display: block;
}

.calc-drag-handle {
    background: var(--accent-navy);
    color: #fff;
    padding: 10px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
}

.drag-title-group {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.84rem;
    font-weight: 600;
}

.calc-widget-controls {
    display: flex;
    gap: 6px;
}

.calc-widget-btn {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    padding: 3px 8px;
    border-radius: 5px;
    font-size: 0.72rem;
    font-weight: 700;
}

.calc-history-drawer {
    display: none;
    background: var(--bg-cream-subtle);
    border-bottom: 1px solid var(--border-soft);
    max-height: 155px;
    overflow-y: auto;
    padding: 10px 12px;
}

.calc-history-drawer.open {
    display: block;
}

.calc-history-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-tertiary);
    margin-bottom: 6px;
}

.calc-history-head button {
    color: var(--accent-crimson);
    font-size: 0.72rem;
    font-weight: 600;
}

.calc-history-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 8px;
    border-radius: 5px;
    font-family: 'Fira Code', monospace;
    font-size: 0.76rem;
    cursor: pointer;
    border-bottom: 1px dashed var(--border-soft);
}

.calc-history-item:hover {
    background: var(--bg-card);
}

.calc-history-empty {
    font-size: 0.75rem;
    color: var(--text-tertiary);
    padding: 6px 0;
}

.calc-widget-body {
    padding: 14px;
    background: var(--bg-cream);
}

.calc-lcd-screen {
    background: #0F172A;
    color: #F8FAFC;
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: right;
    margin-bottom: 10px;
}

.calc-expr-line {
    font-size: 0.72rem;
    color: #94A3B8;
    min-height: 18px;
}

.calc-val-line {
    font-size: 1.3rem;
    font-weight: 700;
}

.calc-keypad-matrix {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 6px;
}

.cw-btn {
    padding: 9px 0;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.84rem;
}

.cw-btn.btn-op {
    background: var(--bg-cream-subtle);
    color: var(--accent-navy);
}

.cw-btn.btn-del {
    background: var(--accent-crimson-soft);
    color: var(--accent-crimson);
}

.cw-btn.btn-eval {
    background: var(--accent-navy);
    color: #fff;
}

.syllabus-tfoot-row td {
    background: var(--bg-cream-subtle);
    font-weight: 700;
    color: var(--text-primary);
    border-top: 2px solid var(--border-strong);
}

/* ==========================================================================
   5. AUTHENTICATION MODAL, GOOGLE PILL, FOOTER & TOASTS
   ========================================================================== */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.62);
    backdrop-filter: blur(4px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-backdrop.open {
    display: flex;
}

.modal-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 450px;
    padding: 30px;
    position: relative;
    box-shadow: var(--shadow-lg);
    max-height: 90vh;
    overflow-y: auto;
}

.modal-card.lg {
    max-width: 720px;
}

.modal-icon-badge {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--accent-navy-soft);
    color: var(--accent-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin: 0 auto 12px;
}

.btn-modal-dismiss {
    position: absolute;
    top: 18px;
    right: 18px;
    font-size: 1.05rem;
    color: var(--text-tertiary);
    padding: 6px;
}

.btn-modal-dismiss.static {
    position: static;
}

.btn-google-oauth-pill {
    width: 100%;
    padding: 11px 16px;
    background: var(--bg-cream);
    border: 1px solid var(--border-strong);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.88rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
}

.btn-google-oauth-pill:hover {
    border-color: var(--accent-navy);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 16px 0;
    color: var(--text-tertiary);
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
}

.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    border-bottom: 1px solid var(--border-soft);
}

.auth-divider span {
    padding: 0 10px;
}

.auth-tabs-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--bg-cream-subtle);
    padding: 4px;
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.auth-tab-btn {
    padding: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    border-radius: 6px;
    color: var(--text-secondary);
}

.auth-tab-btn.active {
    background: var(--bg-card);
    color: var(--accent-navy);
    box-shadow: var(--shadow-sm);
}

.bio-drawer-header {
    margin-bottom: 16px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border-soft);
}

.form-group-field {
    margin-bottom: 14px;
}

.form-group-field label {
    display: block;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 5px;
}

.form-group-field input,
.form-group-field select,
.form-group-field textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.88rem;
    background: var(--bg-card);
    color: var(--text-primary);
}

.btn-primary-block {
    width: 100%;
    padding: 12px;
    background: var(--accent-navy);
    color: #fff;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background 0.15s ease;
}

.btn-primary-block:hover {
    background: var(--accent-navy-hover);
}

.btn-primary-block:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* 3-Card & 4-Card Academic Pathways Grid (Class 10, 11, 12 & After 12 Entrance) */
.calm-three-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.calm-four-cards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.calm-portal-card.entrance-highlight {
    border-color: var(--accent-amber);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-cream) 100%);
}

/* ==========================================================================
   6. BPG CONCEPT SOLVER — AUTOMATED AI ACADEMIC COMPANION (HOMEPAGE)
   ========================================================================== */
.ai-solver-section {
    margin-bottom: 76px;
}

.ai-solver-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 36px 40px;
    box-shadow: var(--shadow-md);
    position: relative;
    overflow: hidden;
}

.ai-solver-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-navy), var(--accent-amber), var(--accent-emerald));
}

.ai-solver-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.ai-solver-title-group {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ai-solver-avatar {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: var(--accent-navy);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    box-shadow: 0 8px 20px rgba(30, 58, 138, 0.22);
    flex-shrink: 0;
}

.ai-status-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
    font-size: 0.75rem;
    font-weight: 700;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-emerald);
    animation: pulseEmerald 2s infinite;
}

@keyframes pulseEmerald {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.5;
        transform: scale(1.25);
    }
}

.ai-chips-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-prompt-chips-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    margin-bottom: 18px;
    scrollbar-width: thin;
}

.ai-prompt-chip {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 999px;
    background: var(--bg-cream);
    border: 1px solid var(--border-strong);
    color: var(--text-primary);
    font-size: 0.83rem;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.18s ease;
    white-space: nowrap;
}

.ai-prompt-chip:hover,
.ai-prompt-chip.active {
    background: var(--accent-navy);
    color: #FFFFFF;
    border-color: var(--accent-navy);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

.ai-chat-viewport {
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 24px;
    min-height: 230px;
    max-height: 460px;
    overflow-y: auto;
    margin-bottom: 16px;
}

.ai-msg-bubble {
    margin-bottom: 18px;
    animation: fadeInView 0.28s ease;
}

.ai-msg-bubble:last-child {
    margin-bottom: 0;
}

.ai-msg-user {
    display: flex;
    justify-content: flex-end;
}

.ai-msg-user-inner {
    background: var(--accent-navy);
    color: #FFFFFF;
    padding: 10px 18px;
    border-radius: 16px 16px 2px 16px;
    font-size: 0.9rem;
    font-weight: 600;
    max-width: 82%;
}

.ai-msg-bot-card {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 22px 26px;
    box-shadow: var(--shadow-sm);
}

.ai-msg-bot-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.ai-msg-bot-head strong {
    font-size: 0.95rem;
    color: var(--accent-navy);
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-concept-tip-box {
    margin-top: 14px;
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--accent-amber-soft);
    border-left: 4px solid var(--accent-amber);
    font-size: 0.87rem;
    color: var(--text-primary);
}

.ai-typing-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 12px 18px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: 999px;
    font-size: 0.82rem;
    color: var(--text-secondary);
}

.ai-typing-dots span {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent-navy);
    margin: 0 2px;
    animation: bounceDot 1.2s infinite;
}

.ai-typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.ai-typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes bounceDot {

    0%,
    80%,
    100% {
        transform: translateY(0);
        opacity: 0.4;
    }

    40% {
        transform: translateY(-5px);
        opacity: 1;
    }
}

.ai-input-bar {
    display: flex;
    gap: 10px;
}

.ai-input-bar input {
    flex: 1;
    padding: 12px 18px;
    border-radius: 999px;
    border: 1px solid var(--border-strong);
    background: var(--bg-cream);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: inherit;
}

.ai-input-bar input:focus {
    outline: none;
    border-color: var(--accent-navy);
    background: var(--bg-card);
}

/* ==========================================================================
   7. INLINE THEORY IMAGES, DIAGRAMS & CALLOUT BLOCKS
   ========================================================================== */
.inline-math-figure {
    margin: 20px auto;
    padding: 14px;
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    text-align: center;
    max-width: 100%;
}

.inline-math-figure.align-left {
    float: left;
    max-width: 48%;
    margin: 8px 20px 14px 0;
}

.inline-math-figure.align-right {
    float: right;
    max-width: 48%;
    margin: 8px 0 14px 20px;
}

.inline-math-figure.align-center {
    margin-left: auto;
    margin-right: auto;
    max-width: 640px;
    clear: both;
}

.inline-math-figure img,
.inline-math-figure svg {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
}

.inline-math-figure figcaption {
    margin-top: 10px;
    font-family: 'Inter', sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
}

.inline-trap-callout {
    margin: 14px 0;
    padding: 14px 18px;
    background: var(--accent-crimson-soft);
    border-left: 4px solid var(--accent-crimson);
    border-radius: 0 8px 8px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    clear: both;
}

.inline-tip-callout {
    margin: 14px 0;
    padding: 14px 18px;
    background: var(--accent-amber-soft);
    border-left: 4px solid var(--accent-amber);
    border-radius: 0 8px 8px 0;
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    color: var(--text-primary);
    clear: both;
}

/* ==========================================================================
   8. INTERACTIVE LIVE CLASS CALENDAR ENGINE (MONTH & WEEKLY AGENDA)
   ========================================================================== */
.calendar-engine-shell {
    background: var(--bg-card);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: var(--shadow-sm);
}

.calendar-top-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    padding-bottom: 20px;
    margin-bottom: 22px;
    border-bottom: 1px solid var(--border-soft);
}

.calendar-filter-pills,
.calendar-mode-toggle {
    display: inline-flex;
    background: var(--bg-cream-subtle);
    padding: 4px;
    border-radius: 999px;
    border: 1px solid var(--border-soft);
    gap: 4px;
    flex-wrap: wrap;
}

.cal-pill-btn {
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.15s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.cal-pill-btn.active {
    background: var(--bg-card);
    color: var(--accent-navy);
    box-shadow: var(--shadow-sm);
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 8px;
}

.cal-weekday-head {
    text-align: center;
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-tertiary);
    padding: 8px 4px;
}

.cal-day-cell {
    min-height: 112px;
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: 10px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    transition: border-color 0.15s ease, transform 0.15s ease;
}

.cal-day-cell:hover {
    border-color: var(--accent-navy);
}

.cal-day-cell.today {
    border: 2px solid var(--accent-amber);
    background: var(--bg-card);
}

.cal-day-cell.muted {
    opacity: 0.42;
}

.cal-day-num {
    font-size: 0.76rem;
    font-weight: 700;
    color: var(--text-secondary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cal-event-chip {
    width: 100%;
    text-align: left;
    padding: 5px 7px;
    border-radius: 6px;
    font-size: 0.71rem;
    font-weight: 600;
    line-height: 1.25;
    cursor: pointer;
    transition: transform 0.12s ease;
    border-left: 3px solid transparent;
}

.cal-event-chip:hover {
    transform: translateY(-1px);
}

.cal-event-chip.free {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
    border-left-color: var(--accent-emerald);
}

.cal-event-chip.paid {
    background: var(--accent-navy-soft);
    color: var(--accent-navy);
    border-left-color: var(--accent-amber);
}

.calendar-agenda-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
}

.cal-agenda-card {
    background: var(--bg-cream);
    border: 1px solid var(--border-soft);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.cal-agenda-card:hover {
    border-color: var(--accent-navy);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
}

.session-tier-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
}

.session-tier-badge.free {
    background: var(--accent-emerald-soft);
    color: var(--accent-emerald);
}

.session-tier-badge.paid {
    background: var(--accent-amber-soft);
    color: var(--accent-amber);
}

/* 6-Digit Email OTP Input Grid */
.otp-6-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
    margin: 14px 0 18px;
}

.otp-digit-box {
    width: 100%;
    height: 52px;
    text-align: center;
    font-family: 'Fira Code', monospace;
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--accent-navy);
    background: var(--bg-cream);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-sm);
    transition: all 0.15s ease;
}

.otp-digit-box:focus {
    outline: none;
    border-color: var(--accent-navy);
    background: var(--bg-card);
    box-shadow: 0 0 0 3px var(--accent-navy-soft);
}

.otp-preview-banner {
    background: var(--accent-amber-soft);
    border: 1px solid var(--accent-amber);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 14px;
    font-size: 0.8rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.otp-preview-code {
    font-family: 'Fira Code', monospace;
    font-weight: 800;
    font-size: 1.05rem;
    color: var(--accent-navy);
    letter-spacing: 2px;
}

.btn-autofill-otp {
    padding: 5px 10px;
    background: var(--accent-navy);
    color: #fff;
    border-radius: 6px;
    font-size: 0.74rem;
    font-weight: 600;
    white-space: nowrap;
}

/* Footer */
.site-footer {
    border-top: 1px solid var(--border-soft);
    background: var(--bg-cream-subtle);
    padding: 28px 0;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.footer-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

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

/* Toast */
.toast-container {
    position: fixed;
    bottom: 84px;
    left: 24px;
    z-index: 1200;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast-msg {
    background: #0F172A;
    color: #F8FAFC;
    padding: 11px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 500;
    box-shadow: var(--shadow-md);
    border-left: 3px solid var(--accent-amber);
}

/* Mobile-First Responsive Layout */
@media (max-width: 920px) {
    .container {
        padding: 0 20px;
    }

    .view-container {
        padding: 28px 0 80px;
    }

    .calm-hero-section {
        padding: 28px 24px;
        margin-bottom: 44px;
    }

    .ai-solver-card {
        padding: 24px 20px;
    }

    .calm-hero-grid,
    .excellence-badges-grid,
    .career-timeline-grid,
    .philosophy-cards-grid,
    .calm-two-cards-grid,
    .calm-three-cards-grid,
    .calm-four-cards-grid,
    .calendar-agenda-grid,
    .deep-reader-layout,
    .live-classroom-card,
    .notes-vault-grid,
    .courses-tier-grid-3 {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .calendar-month-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .inline-math-figure.align-left,
    .inline-math-figure.align-right {
        float: none;
        max-width: 100%;
        margin: 14px auto;
    }

    .philosophy-interactive-card.span-wide {
        grid-column: span 1;
    }

    .reader-sidebar {
        position: static;
        max-height: none;
    }

    .reader-canvas {
        padding: 28px 22px;
    }

    .streamlined-portal-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .closing-quote-box {
        padding: 30px 22px;
    }
}


/* ==========================================================================
   SDMATHS-INSPIRED MODERN RE-ARCHITECTURE EXTENSIONS
   (Floating Announcement Ticker, 2-Column Hero with Floating Badges,
   4-Column Structured Course Grid, 5 Horizontal Philosophy Cards,
   Live Routine Preview & Refined Header Ergonomics)
   ========================================================================== */

/* 1. Top Announcement Micro-Bar */
.top-ticker-bar {
    background: #1C2430;
    color: #F8FAFC;
    font-size: 0.82rem;
    padding: 8px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    z-index: 210;
}
