/* =========================================================
   CAMPUSNOTES — RESOURCE PAGE STYLES
   Exact 1:1 match to the design specification
   ========================================================= */

/* --- RESET & GLOBAL --- */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Lexend", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    background:
        radial-gradient(circle at 75% 35%,
            #e7e1ff 0%,
            transparent 32%),
        radial-gradient(circle at 15% 75%,
            #f0ebff 0%,
            transparent 35%),
        linear-gradient(120deg,
            #fafaff,
            #f2f1ff);
    background-attachment: fixed;
    color: #111827;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    font-family: inherit;
    cursor: pointer;
}

/* --- MAIN PAGE WRAPPER --- */
.resource-page-wrapper {
    width: 100%;
    max-width: 1380px;
    margin: 0 auto;
    padding: 28px 24px 60px;
}

/* --- BACK BUTTON --- */
.back-btn-container {
    margin-bottom: 20px;
}

.back-to-subject-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 18px;
    background-color: #ede9fe;
    color: #5b36f5;
    font-size: 13px;
    font-weight: 600;
    border-radius: 9999px;
    text-decoration: none;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.back-to-subject-btn:hover {
    background-color: #e4ddfe;
    transform: translateX(-3px);
}

.back-to-subject-btn .arrow {
    font-size: 15px;
    line-height: 1;
}

/* --- TOP 6 RESOURCE CATEGORY TABS --- */
.category-tabs-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}

.category-tab-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #ffffff;
    border: 1px solid #e8eaf2;
    border-radius: 14px;
    padding: 16px 10px 14px;
    text-decoration: none;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.category-tab-card:hover {
    transform: translateY(-2px);
    border-color: #c4b5fd;
    box-shadow: 0 4px 14px rgba(101, 66, 245, 0.06);
}

/* Tab Icon Container */
.tab-icon-badge {
    width: 60px;
    height: 60px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 11px;
    flex-shrink: 0;
}

.tab-icon-badge img {
    width: 46px;
    height: 46px;
    object-fit: contain;
    display: block;
}

/* Tab Texts */
.tab-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #111827;
    margin-bottom: 4px;
    line-height: 1.25;
}

.tab-description {
    font-size: 11px;
    color: #64748b;
    line-height: 1.35;
    max-width: 130px;
}

/* Active Tab State */
.category-tab-card.active {
    background: #f7f5ff;
    border: 1.5px solid #7c5cfc;
}

.category-tab-card.active .tab-title {
    color: #5b36f5;
}

.category-tab-card.active::after {
    content: "";
    position: absolute;
    bottom: -7px;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 3px;
    background: #6f4df6;
    border-radius: 9999px;
}

/* --- MAIN CONTAINER CARD --- */
.main-resource-card {
    background: #ffffff;
    border: 1px solid #e8eaf2;
    border-radius: 20px;
    padding: 28px 28px 32px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.02);
}

/* Top Header Bar */
.resource-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.resource-header-left {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-category-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: #ede9fe;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f4df6;
    flex-shrink: 0;
}

.header-category-icon img {
    width: 30px;
    height: 30px;
    object-fit: contain;
    display: block;
}

.header-text-group h1 {
    font-size: 21px;
    font-weight: 800;
    color: #111827;
    line-height: 1.2;
    margin-bottom: 3px;
}

.header-text-group p {
    font-size: 13.5px;
    color: #64748b;
    margin: 0;
}

/* Download Button */
.download-action-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: #f3effe;
    color: #6f4df6;
    border: none;
    border-radius: 10px;
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 600;
    transition: background-color 0.2s ease, transform 0.15s ease;
}

.download-action-btn:hover {
    background-color: #eae3fe;
    transform: translateY(-1px);
}

.download-action-btn svg {
    width: 16px;
    height: 16px;
}

/* --- TWO COLUMN LAYOUT --- */
.resource-columns-layout {
    display: grid;
    grid-template-columns: 260px minmax(0, 1fr);
    gap: 26px;
    align-items: stretch;
    width: 100%;
    max-width: 100%;
}

/* --- LEFT SIDEBAR --- */
.resource-sidebar-nav {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.topics-nav-list {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.topic-nav-item,
.resource-list-item {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13.5px;
    font-weight: 500;
    color: #4b5563;
    text-decoration: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.topic-nav-item:hover,
.resource-list-item:hover {
    background-color: #f8fafc;
    color: #111827;
}

.topic-nav-item.active,
.resource-list-item.active {
    background-color: #f3effe;
    color: #6f4df6;
    font-weight: 700;
    border-left: 3.5px solid #6f4df6;
    border-radius: 0 8px 8px 0;
}

/* Quick Tip Card */
.sidebar-quick-tip-box {
    margin-top: 36px;
    background: #f5f2fe;
    border-radius: 14px;
    padding: 14px 14px 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.quick-tip-bulb-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6f4df6;
    flex-shrink: 0;
}

.quick-tip-text h4 {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 4px;
}

.quick-tip-text p {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
    margin: 0;
}

/* --- RIGHT CONTENT CARD --- */
.resource-content-card {
    min-width: 0;
    max-width: 100%;
    border: 1px solid #e8eaf2;
    border-radius: 16px;
    padding: 24px 26px;
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.content-topic-heading {
    font-size: 19px;
    font-weight: 800;
    color: #111827;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}

.content-topic-subtitle {
    font-size: 13.5px;
    color: #64748b;
    margin-bottom: 22px;
    line-height: 1.5;
}

/* --- DIAGRAM SHOWCASE CONTAINER --- */
.diagram-canvas-box {
    border: 1px solid #e9edf5;
    border-radius: 12px;
    background: #fafbff;
    padding: 30px 24px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 280px;
}

.diagram-canvas-box img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

/* --- DBMS ARCHITECTURE DIAGRAM (HTML/SVG implementation) --- */
.dbms-architecture-diagram {
    width: 100%;
    max-width: 620px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.diagram-users-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.diagram-user-box {
    background: #dbeafe;
    border: 1px solid #bfdbfe;
    border-radius: 8px;
    padding: 10px 8px;
    text-align: center;
    color: #1e293b;
}

.diagram-user-box strong {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #0f172a;
}

.diagram-user-box span {
    display: block;
    font-size: 11px;
    color: #334155;
    margin-top: 1px;
}

/* Vertical double arrows */
.diagram-arrows-trio {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    height: 32px;
    align-items: center;
    justify-items: center;
}

.diagram-arrow-v {
    color: #334155;
    font-size: 18px;
    line-height: 1;
    font-weight: 700;
}

/* DBMS Middle Box */
.diagram-middle-dbms-box {
    width: 100%;
    background: #f3e8ff;
    border: 1px solid #e9d5ff;
    border-radius: 8px;
    padding: 14px 16px;
    text-align: center;
}

.diagram-middle-dbms-box strong {
    display: block;
    font-size: 14px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.3px;
}

.diagram-middle-dbms-box span {
    display: block;
    font-size: 11.5px;
    color: #334155;
    margin-top: 2px;
}

/* Single center arrow */
.diagram-arrow-single {
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 3D Database Cylinder */
.diagram-database-cylinder {
    position: relative;
    width: 180px;
    text-align: center;
}

.db-cylinder-top-oval {
    width: 180px;
    height: 38px;
    background: #a855f7;
    border-radius: 50%;
    border: 1px solid #9333ea;
}

.db-cylinder-body {
    width: 180px;
    height: 62px;
    margin-top: -19px;
    background: linear-gradient(180deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 0 0 90px 90px / 0 0 24px 24px;
    border: 1px solid #6d28d9;
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    box-shadow: 0 8px 16px rgba(109, 40, 217, 0.25);
}

.db-cylinder-body strong {
    font-size: 12.5px;
    font-weight: 700;
    color: #ffffff;
}

.db-cylinder-body span {
    font-size: 10.5px;
    color: #e9d5ff;
    margin-top: 1px;
}

/* --- EXPLANATION SECTION --- */
.content-explanation-box {
    margin-bottom: 24px;
}

.explanation-header-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.explanation-doc-icon {
    width: 22px;
    height: 22px;
    background: #6f4df6;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    flex-shrink: 0;
}

.explanation-doc-icon svg {
    width: 13px;
    height: 13px;
}

.explanation-header-title h3 {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.explanation-bullets-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.explanation-bullets-list li {
    position: relative;
    padding-left: 18px;
    font-size: 13.5px;
    color: #334155;
    line-height: 1.6;
    margin-bottom: 8px;
}

.explanation-bullets-list li::before {
    content: "•";
    position: absolute;
    left: 2px;
    top: -1px;
    color: #4338ca;
    font-size: 18px;
    line-height: 1.2;
}

/* Markdown prose fallback slot styling */
.markdown-prose-content {
    margin-bottom: 24px;
    color: #334155;
    font-size: 14px;
    line-height: 1.7;
}

.markdown-prose-content h2,
.markdown-prose-content h3 {
    color: #0f172a;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 8px;
}

.markdown-prose-content p {
    margin-bottom: 12px;
}

/* --- BOTTOM NAVIGATION BAR --- */
.content-bottom-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 20px;
}

.nav-pill-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 18px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: background-color 0.15s ease, transform 0.15s ease;
}

.nav-pill-btn.prev-btn.disabled {
    background: #f1f3f8;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

.nav-pill-btn.prev-btn:not(.disabled) {
    background: #f1f3f8;
    color: #475569;
}

.nav-pill-btn.prev-btn:not(.disabled):hover {
    background: #e2e8f0;
}

.nav-counter-display {
    font-size: 13.5px;
    font-weight: 600;
    color: #475569;
}

.nav-pill-btn.next-btn {
    background: #ede9fe;
    color: #6f4df6;
}

.nav-pill-btn.next-btn:hover {
    background: #e2dcfe;
    transform: translateX(2px);
}

.nav-pill-btn.next-btn.disabled {
    background: #f1f3f8;
    color: #94a3b8;
    cursor: not-allowed;
    pointer-events: none;
}

/* --- RESPONSIVE BREAKPOINTS --- */
@media (max-width: 1080px) {
    .category-tabs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .resource-columns-layout {
        grid-template-columns: 200px 1fr;
    }
}

@media (max-width: 820px) {
    .resource-columns-layout {
        display: block;
    }

    .resource-sidebar-nav {
        margin-bottom: 24px;
    }

    .topics-nav-list {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .topic-nav-item {
        flex: 0 0 auto;
        white-space: nowrap;
    }

    .topic-nav-item.active {
        border-left: none;
        border-bottom: 3px solid #6f4df6;
        border-radius: 6px 6px 0 0;
    }

    .sidebar-quick-tip-box {
        margin-top: 16px;
    }
}

@media (max-width: 768px) {
    .category-tabs-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
        padding-bottom: 0;
        overflow-x: visible;
    }

    .category-tab-card {
        flex: none;
        padding: 10px 6px 10px;
    }

    .category-tab-card .tab-icon-badge {
        width: 40px;
        height: 40px;
        margin-bottom: 6px;
    }

    .category-tab-card .tab-icon-badge img {
        width: 30px;
        height: 30px;
    }

    .category-tab-card .tab-title {
        font-size: 11px;
        margin-bottom: 2px;
    }

    .category-tab-card .tab-description {
        font-size: 9px;
        line-height: 1.25;
        max-width: 100px;
    }

    .resource-top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
    }

    .main-resource-card {
        padding: 20px 16px;
    }

    .resource-content-card {
        padding: 18px 16px;
    }

    .diagram-users-row {
        gap: 8px;
    }

    .diagram-user-box {
        padding: 8px 4px;
    }

    .diagram-user-box strong {
        font-size: 11px;
    }

    .diagram-user-box span {
        font-size: 9.5px;
    }

    .content-bottom-nav {
        flex-direction: column;
        gap: 12px;
    }

    .nav-pill-btn {
        width: 100%;
        justify-content: center;
    }
}


/* =========================================================
   BREADCRUMBS
   ========================================================= */
.breadcrumbs-nav {
    margin-bottom: 12px;
}

.breadcrumbs-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 12.5px;
    color: #64748b;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
    gap: 0;
}

.breadcrumb-item a {
    color: #6f4df6;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.breadcrumb-item a:hover {
    color: #5b36f5;
    text-decoration: underline;
}

.breadcrumb-item span[aria-current="page"] {
    color: #334155;
    font-weight: 600;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #94a3b8;
    font-size: 14px;
    line-height: 1;
    user-select: none;
}


/* =========================================================
   NOTES PROSE CONTENT  (rendered Markdown)
   ========================================================= */
.notes-prose-content {
    color: #1e293b;
    font-size: 16px;
    line-height: 1.82;
    margin-bottom: 28px;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* ── Headings ── */
.notes-prose-content h1 {
    font-size: 24px;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 16px;
    line-height: 1.3;
    letter-spacing: -0.3px;
}

.notes-prose-content h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1e1b4b;
    margin: 32px 0 12px;
    padding-bottom: 8px;
    border-bottom: 2px solid #ede9fe;
    line-height: 1.35;
}

.notes-prose-content h3 {
    font-size: 17px;
    font-weight: 700;
    color: #312e81;
    margin: 24px 0 10px;
    line-height: 1.4;
}

.notes-prose-content h4 {
    font-size: 15.5px;
    font-weight: 600;
    color: #3730a3;
    margin: 20px 0 8px;
    line-height: 1.4;
}

/* ── Paragraphs ── */
.notes-prose-content p {
    margin: 0 0 14px;
}

/* ── Links ── */
.notes-prose-content a {
    color: #6f4df6;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.notes-prose-content a:hover {
    color: #5b36f5;
}

/* ── Lists ── */
.notes-prose-content ul,
.notes-prose-content ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

.notes-prose-content li {
    margin-bottom: 6px;
    line-height: 1.7;
}

.notes-prose-content li > ul,
.notes-prose-content li > ol {
    margin-top: 6px;
    margin-bottom: 0;
}

/* ── Tables ── */
.notes-prose-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    font-size: 13.5px;
    line-height: 1.55;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.notes-prose-content thead {
    background: #f3effe;
}

.notes-prose-content th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 700;
    color: #1e1b4b;
    border: 1px solid #e2e0f0;
    white-space: normal;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    vertical-align: middle;
}

.notes-prose-content td {
    padding: 10px 14px;
    border: 1px solid #e2e0f0;
    white-space: normal;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    vertical-align: top;
    line-height: 1.55;
}

/* ── Specialized Accounting & Financial Statement Tables ── */
.notes-prose-content table.accounting-table,
.notes-prose-content .accounting-table-wrapper table {
    display: table !important;
    width: 100% !important;
    table-layout: auto !important;
    border-collapse: collapse !important;
    margin: 20px 0 !important;
    font-size: 13.5px !important;
}

.notes-prose-content table.accounting-table th,
.notes-prose-content .accounting-table-wrapper table th {
    background: #f3effe !important;
    color: #1e1b4b !important;
    font-weight: 700 !important;
    padding: 10px 14px !important;
    border: 1px solid #e2e0f0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    text-align: left;
    vertical-align: middle;
}

.notes-prose-content table.accounting-table td,
.notes-prose-content .accounting-table-wrapper table td {
    padding: 10px 14px !important;
    border: 1px solid #e2e0f0 !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    vertical-align: top;
    line-height: 1.55;
    color: #334155;
}

/* 4-column Schedule III / Corporate Balance Sheet Tables ONLY */
.notes-prose-content table.schedule-table,
.notes-prose-content table.balance-sheet-table {
    display: table !important;
    width: 100% !important;
    table-layout: fixed !important;
    border-collapse: collapse !important;
    margin: 22px 0 !important;
    font-size: 13.5px !important;
}

.notes-prose-content table.schedule-table th:first-child,
.notes-prose-content table.balance-sheet-table th:first-child {
    width: 54% !important;
    min-width: 250px !important;
}

.notes-prose-content table.schedule-table th:nth-child(2),
.notes-prose-content table.balance-sheet-table th:nth-child(2) {
    width: 12% !important;
    text-align: center !important;
}

.notes-prose-content table.schedule-table th:nth-child(3),
.notes-prose-content table.schedule-table th:nth-child(4),
.notes-prose-content table.balance-sheet-table th:nth-child(3),
.notes-prose-content table.balance-sheet-table th:nth-child(4) {
    width: 17% !important;
    text-align: right !important;
}

.notes-prose-content table.schedule-table td:nth-child(2),
.notes-prose-content table.balance-sheet-table td:nth-child(2) {
    text-align: center !important;
}

.notes-prose-content table.schedule-table td:nth-child(3),
.notes-prose-content table.schedule-table td:nth-child(4),
.notes-prose-content table.balance-sheet-table td:nth-child(3),
.notes-prose-content table.balance-sheet-table td:nth-child(4) {
    text-align: right !important;
    font-variant-numeric: tabular-nums;
}

/* ── Journal Entries & Accounting Vouchers (Light/Clean Background) ── */
.journal-box,
.journal-entry-card {
    background: #ffffff !important;
    border: 1px solid #e2e8f0 !important;
    border-left: 4px solid #6366f1 !important;
    border-radius: 10px !important;
    padding: 16px 20px !important;
    margin: 20px 0 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.05) !important;
}

.journal-box .journal-title,
.journal-entry-card .journal-title {
    font-size: 14px;
    font-weight: 700;
    color: #312e81;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 1px dashed #e2e8f0;
}

.notes-prose-content .journal-box pre,
.notes-prose-content pre.journal-entry,
.notes-prose-content pre.accounting-box,
.notes-prose-content pre.journal {
    background: #ffffff !important;
    color: #1e293b !important;
    border: 1.5px solid #e2e8f0 !important;
    border-left: 4px solid #6366f1 !important;
    border-radius: 10px !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04) !important;
    font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace !important;
    font-size: 13.5px !important;
    line-height: 1.75 !important;
    padding: 16px 20px !important;
}

.notes-prose-content .journal-box pre code,
.notes-prose-content pre.journal-entry code,
.notes-prose-content pre.accounting-box code,
.notes-prose-content pre.journal code {
    color: #1e293b !important;
    background: transparent !important;
}

.notes-prose-content td {
    padding: 9px 14px;
    border: 1px solid #e8eaf2;
    color: #334155;
    vertical-align: top;
}

.notes-prose-content tbody tr:nth-child(even) {
    background: #fafaff;
}

.notes-prose-content tbody tr:hover {
    background: #f5f2fe;
}

/* ── Blockquotes ── */
.notes-prose-content blockquote {
    margin: 18px 0;
    padding: 14px 18px;
    border-left: 4px solid #7c5cfc;
    background: #f8f6ff;
    border-radius: 0 8px 8px 0;
    color: #334155;
    font-style: normal;
}

.notes-prose-content blockquote p {
    margin-bottom: 0;
}

/* ── Inline code ── */
.notes-prose-content code {
    background: #f1eff9;
    color: #5b21b6;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13.5px;
    font-family: "Cascadia Code", "Fira Code", "JetBrains Mono", monospace;
}

.notes-prose-content h1 code,
.notes-prose-content h2 code,
.notes-prose-content h3 code,
.notes-prose-content h4 code {
    background: transparent;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    font-family: inherit;
    font-weight: inherit;
}

/* ── Code blocks (Programming & SQL Queries) ── */
.notes-prose-content pre,
.notes-prose-content pre.astro-code {
    background: #0f172a !important;
    color: #f8fafc !important;
    border: 1.5px solid #334155 !important;
    border-radius: 12px;
    padding: 18px 22px !important;
    margin: 20px 0;
    font-size: 13.5px;
    line-height: 1.7;
    box-shadow: 0 4px 18px rgba(15, 23, 42, 0.15);
    font-family: 'Fira Code', 'Cascadia Code', Consolas, 'SF Mono', Monaco, monospace;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.notes-prose-content pre code {
    background: transparent !important;
    color: inherit;
    padding: 0;
    border-radius: 0;
    font-size: inherit;
    font-family: inherit;
}

.notes-prose-content pre code span[style*="color:#6A737D"],
.notes-prose-content pre code span[style*="color: #6A737D"],
.notes-prose-content pre code span[style*="color:#6a737d"],
.notes-prose-content pre code span[style*="color: #6a737d"] {
    color: #94a3b8 !important;
    font-style: italic;
}

/* ── Images ── */
.notes-prose-content img {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    margin: 16px 0;
    display: block;
}

/* ── Horizontal rules ── */
.notes-prose-content hr {
    border: none;
    border-top: 2px solid #ede9fe;
    margin: 28px 0;
}

/* ── Strong / Bold ── */
.notes-prose-content strong {
    font-weight: 700;
    color: #0f172a;
}

/* ── Definition-style emphasis ── */
.notes-prose-content em {
    font-style: italic;
    color: #475569;
}


/* =========================================================
   SYSTEMATIC VISUAL DIAGRAMS (Pure CSS)
   ========================================================= */
.visual-diagram {
    background: #fbfaff;
    border: 1.5px solid #e6e0f8;
    border-radius: 12px;
    padding: 22px 24px;
    margin: 22px 0;
    box-shadow: 0 2px 10px rgba(111, 77, 246, 0.04);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}

.diagram-caption,
.diagram-title {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6366f1;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    border-bottom: 1px solid #ede9fe;
    padding-bottom: 8px;
}

.diagram-caption::before,
.diagram-title::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #6f4df6;
    box-shadow: 0 0 0 3px rgba(111, 77, 246, 0.2);
}

/* 1. Grid of Nodes / Concepts / Pillars */
.diagram-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 14px;
    width: 100%;
    align-items: stretch;
    box-sizing: border-box;
}

.diagram-grid.grid-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.diagram-grid.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.diagram-grid.grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (max-width: 768px) {
    .diagram-grid.grid-2,
    .diagram-grid.grid-3,
    .diagram-grid.grid-4 {
        grid-template-columns: 1fr;
    }
}

/* Card components inside diagram-grid */
.diagram-card {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 9px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
    min-width: 0;
}

.diagram-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(111, 77, 246, 0.08);
    border-color: #cbd5e1;
}

.diagram-card h4,
.diagram-card .card-title {
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
    line-height: 1.35 !important;
    margin: 0 0 3px 0 !important;
}

.diagram-card p,
.diagram-card .card-desc {
    font-size: 12px !important;
    color: #475569 !important;
    line-height: 1.5 !important;
    margin: 0 !important;
}

.diagram-card ul {
    margin: 4px 0 0 0 !important;
    padding-left: 18px !important;
    font-size: 12px !important;
    color: #475569 !important;
    line-height: 1.5 !important;
}

.diagram-card li {
    margin-bottom: 2px !important;
}

.diagram-card .card-icon {
    font-size: 18px;
    margin-bottom: 2px;
    display: inline-block;
}

.diagram-flow .arrow,
.flow-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6366f1;
    font-size: 16px;
    font-weight: 700;
    flex-shrink: 0;
}

.diagram-card-header {
    padding: 10px 14px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
}

.diagram-card-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.35;
    margin: 0;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

.diagram-card-body {
    padding: 12px 14px;
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    flex: 1 1 auto;
    background: #ffffff;
}

.diagram-card-body ul {
    margin: 0;
    padding-left: 18px;
}

.diagram-card-body li {
    margin-bottom: 6px;
    line-height: 1.45;
}

.diagram-card-body li:last-child {
    margin-bottom: 0;
}

.diagram-pill {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-left: 4px solid #6366f1;
    border-radius: 8px;
    padding: 12px 16px;
    text-align: left;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    gap: 4px;
    box-sizing: border-box;
    min-width: 0;
}

.diagram-pill:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.diagram-pill strong {
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 2px;
    display: block;
}

.diagram-pill span {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    display: block;
}

.diagram-pill .pill-title {
    font-weight: 700;
    font-size: 13px;
    color: #1e1b4b;
    margin-bottom: 4px;
    line-height: 1.35;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

.diagram-pill .pill-desc {
    font-size: 12px;
    color: #475569;
    line-height: 1.5;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

/* 2. Sequential Process Flow & Flowcharts */
.diagram-flow {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
    gap: 8px;
    width: 100%;
    box-sizing: border-box;
}

.diagram-box,
.flow-step {
    background: #ffffff;
    border: 1.5px solid #d8d0f8;
    border-top: 3.5px solid #6f4df6;
    border-radius: 8px;
    padding: 10px 12px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(111, 77, 246, 0.04);
    min-width: 120px;
    max-width: 240px;
    flex: 1 1 140px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
}

.diagram-box:hover,
.flow-step:hover {
    transform: translateY(-2px);
    border-color: #6f4df6;
    box-shadow: 0 4px 12px rgba(111, 77, 246, 0.1);
}

.box-label {
    display: inline-block;
    background: #ede9fe;
    color: #5b36f5;
    font-size: 10.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 6px;
    border-radius: 5px;
    line-height: 1.2;
}

.box-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.35;
}

.box-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

.flow-step {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
}

.flow-step span {
    display: block;
    font-size: 11.5px;
    font-weight: 500;
    color: #64748b;
    margin-top: 2px;
    line-height: 1.4;
}

.flow-step .flow-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 10px;
    border-radius: 9999px;
    font-size: 11.5px;
    font-weight: 800;
    letter-spacing: 0.3px;
    margin-bottom: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.flow-step .flow-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.35;
    margin-bottom: 3px;
    text-align: center;
}

.flow-step .flow-desc {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.45;
    text-align: center;
    margin: 0;
}

.diagram-arrow,
.flow-arrow {
    color: #6f4df6;
    font-size: 16px;
    font-weight: 800;
    user-select: none;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
    padding: 0 2px;
    line-height: 1;
}

/* 3. Layered Stack Architecture */
.diagram-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
}

.stack-layer {
    background: #ffffff;
    border: 1.5px solid #e4defa;
    border-left: 5px solid #6f4df6;
    border-radius: 8px;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

.stack-layer:hover {
    transform: translateX(3px);
    box-shadow: 0 4px 12px rgba(111, 77, 246, 0.08);
}

.stack-layer .layer-left,
.stack-layer .stack-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    width: 100%;
}

.stack-layer .layer-num,
.stack-layer .stack-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ede9fe;
    color: #5b36f5;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    white-space: nowrap;
    letter-spacing: 0.3px;
    line-height: 1.25;
}

.stack-layer .layer-name,
.stack-layer .stack-title {
    font-size: 13.5px;
    font-weight: 700;
    color: #1e1b4b;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    line-height: 1.4;
}

.stack-layer .layer-detail,
.stack-layer .stack-desc {
    font-size: 12.5px;
    color: #475569;
    text-align: left;
    line-height: 1.55;
    width: 100%;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
    margin: 0;
}

/* 4. Split Comparison Columns */
.diagram-split {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    width: 100%;
    align-items: stretch;
    box-sizing: border-box;
}

.split-col {
    background: #ffffff;
    border: 1.5px solid #e4defa;
    border-top: 3.5px solid #6f4df6;
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.split-header {
    font-size: 13.5px;
    font-weight: 800;
    color: #1e1b4b;
    margin-bottom: 10px;
    padding-bottom: 6px;
    border-bottom: 2px solid #ede9fe;
}

.split-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.split-list li,
.split-list div {
    font-size: 12px;
    color: #475569;
    padding: 2px 0;
    line-height: 1.45;
}

/* 5. Formula & Calculation Cards */
.formula-card {
    background: #ffffff;
    border: 1.5px solid #e4defa;
    border-left: 4px solid #6f4df6;
    border-radius: 8px;
    padding: 10px 14px;
    margin: 8px 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    box-sizing: border-box;
}

.formula-card .formula-tag {
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6f4df6;
}

.formula-card .formula-expr {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    overflow-x: auto;
}

.formula-card .formula-note {
    font-size: 11.5px;
    color: #64748b;
    line-height: 1.4;
}

/* 5. Hierarchical Tree / Center Model */
.diagram-hierarchy {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    width: 100%;
    position: relative;
}

.hierarchy-top {
    background: #6f4df6;
    color: #ffffff;
    padding: 11px 24px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 13.5px;
    text-align: center;
    box-shadow: 0 3px 8px rgba(111, 77, 246, 0.25);
    z-index: 1;
}

.hierarchy-bottom {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    width: 100%;
}

.hierarchy-node {
    background: #ffffff;
    border: 1.5px solid #d8d0f8;
    border-top: 3px solid #6f4df6;
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 12.5px;
    font-weight: 600;
    color: #1e1b4b;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 6. Document, Letterhead & Corporate Communications Previews */
.document-preview {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    padding: 24px 28px;
    margin: 16px 0;
    color: #1e293b;
    font-family: inherit;
    line-height: 1.6;
    box-sizing: border-box;
}

.document-preview.letterhead {
    border-top: 5px solid #2563eb;
    background: #ffffff;
}

.letterhead-header {
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 14px;
    margin-bottom: 16px;
}

.letterhead-company {
    font-size: 16px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.letterhead-sub {
    font-size: 12px;
    color: #64748b;
    margin-top: 3px;
}

.letter-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 12.5px;
    font-weight: 600;
    color: #334155;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 8px;
}

.letter-recipient {
    font-size: 13px;
    color: #334155;
    margin-bottom: 14px;
    line-height: 1.55;
}

.letter-subject {
    background: #eff6ff;
    padding: 8px 12px;
    border-left: 4px solid #2563eb;
    font-size: 13px;
    font-weight: 700;
    color: #1e3a8a;
    margin-bottom: 14px;
    border-radius: 0 6px 6px 0;
}

.letter-body {
    font-size: 13px;
    color: #334155;
    line-height: 1.65;
}

.letter-signoff {
    margin-top: 20px;
    font-size: 13px;
    color: #334155;
    line-height: 1.5;
}

/* Email Client Mock */
.email-preview-client {
    background: #ffffff;
    border: 1.5px solid #cbd5e1;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    margin: 16px 0;
    box-sizing: border-box;
}

.email-client-header {
    background: #f8fafc;
    border-bottom: 1.5px solid #e2e8f0;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12.5px;
}

.email-header-field {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: wrap;
}

.email-field-label {
    font-weight: 800;
    color: #64748b;
    min-width: 60px;
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.5px;
}

.email-field-value {
    color: #1e293b;
    font-weight: 600;
}

.email-client-body {
    padding: 20px 22px;
    font-size: 13px;
    line-height: 1.65;
    color: #334155;
    background: #ffffff;
}

/* Chat & Dialogue Thread Mock */
.dialogue-thread {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin: 16px 0;
    width: 100%;
    box-sizing: border-box;
}

.dialogue-bubble {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px 16px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
}

.dialogue-bubble.speaker-a {
    border-left: 4px solid #2563eb;
    background: #f8faff;
}

.dialogue-bubble.speaker-b {
    border-left: 4px solid #059669;
    background: #f0fdf9;
}

.dialogue-speaker {
    font-size: 11.5px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.dialogue-speaker.speaker-a { color: #1d4ed8; }
.dialogue-speaker.speaker-b { color: #047857; }

.dialogue-text {
    font-size: 13px;
    color: #334155;
    line-height: 1.55;
}

/* =========================================================
   RESOURCE PAGE TOAST
   ========================================================= */
.resource-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1e1b3a;
    color: #ffffff;
    padding: 12px 28px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    font-family: "Lexend", sans-serif;
    box-shadow: 0 8px 28px rgba(30, 27, 58, 0.25);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    z-index: 9999;
    text-align: center;
    max-width: 90vw;
}

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


/* =========================================================
   SIDEBAR EMPTY STATE
   ========================================================= */
.sidebar-empty-state {
    padding: 24px 14px;
    text-align: center;
}

.sidebar-empty-state p {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}


/* =========================================================
   RESPONSIVE – breadcrumbs & prose additions
   ========================================================= */
@media (max-width: 768px) {
    .breadcrumbs-list {
        font-size: 11px;
    }

    .breadcrumb-sep {
        margin: 0 4px;
    }

    .notes-prose-content {
        font-size: 14px;
        line-height: 1.75;
    }

    .notes-prose-content h1 {
        font-size: 20px;
    }

    .notes-prose-content h2 {
        font-size: 17.5px;
    }

    .notes-prose-content h3 {
        font-size: 15.5px;
    }

    .notes-prose-content table {
        font-size: 12.5px;
    }

    .notes-prose-content th,
    .notes-prose-content td {
        padding: 7px 10px;
    }

    .notes-prose-content pre {
        font-size: 12px;
        padding: 14px 14px;
    }

    .visual-diagram {
        padding: 12px 12px !important;
        margin: 14px 0 !important;
        border-radius: 10px !important;
    }

    .diagram-caption,
    .diagram-title {
        font-size: 11px !important;
        margin-bottom: 10px !important;
        padding-bottom: 6px !important;
    }

    .diagram-grid {
        grid-template-columns: 1fr !important;
        gap: 8px !important;
    }

    .diagram-pill,
    .diagram-card {
        padding: 9px 12px !important;
    }

    .diagram-flow {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 6px !important;
    }

    .diagram-box,
    .flow-step {
        width: 100% !important;
        max-width: 100% !important;
        min-width: 0 !important;
        flex: 1 1 auto !important;
        padding: 8px 12px !important;
        text-align: left !important;
        align-items: flex-start !important;
    }

    .diagram-arrow,
    .flow-arrow {
        transform: rotate(90deg) !important;
        margin: 0 auto !important;
        padding: 0 !important;
        font-size: 14px !important;
        line-height: 1 !important;
    }

    .diagram-stack {
        gap: 6px !important;
    }

    .stack-layer {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 6px !important;
        padding: 9px 12px !important;
    }

    .stack-layer .layer-left,
    .stack-layer .stack-left {
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
        flex-wrap: wrap !important;
    }

    .stack-layer .layer-num,
    .stack-layer .stack-badge {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    .stack-layer .layer-name,
    .stack-layer .stack-title {
        white-space: normal !important;
        word-break: break-word !important;
        font-size: 13px !important;
    }

    .stack-layer .layer-detail,
    .stack-layer .stack-desc {
        text-align: left !important;
        width: 100% !important;
        font-size: 11.5px !important;
        color: #64748b !important;
        line-height: 1.4 !important;
    }

    .diagram-split {
        grid-template-columns: 1fr !important;
        gap: 10px !important;
    }

    .split-col {
        padding: 10px 12px !important;
    }

    .hierarchy-bottom {
        grid-template-columns: 1fr;
        gap: 8px;
    }
}


/* =========================================================
   LARGE DESKTOP ENHANCEMENTS (>= 1400px)
   Eliminates excess empty margins on wide screens & optimizes readability
   ========================================================= */
@media (min-width: 1400px) {
    .resource-page-wrapper {
        max-width: 1520px;
        padding: 32px 32px 70px;
    }

    .resource-columns-layout {
        grid-template-columns: 280px minmax(0, 1fr);
        gap: 32px;
    }

    .main-resource-card {
        padding: 34px 40px 40px;
    }

    .notes-prose-content {
        font-size: 16.5px;
        line-height: 1.86;
    }

    .notes-prose-content h1 {
        font-size: 26px;
    }

    .notes-prose-content h2 {
        font-size: 21.5px;
    }

    .notes-prose-content h3 {
        font-size: 18.5px;
    }

    .notes-prose-content table {
        font-size: 14.5px;
    }

    .notes-prose-content pre {
        font-size: 13.5px;
    }
}

/* Modern Component Styles for diagram-card, card-badge, card-title, card-desc */
.diagram-card {
    background: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    padding: 16px 18px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 2px 6px rgba(0, 0, 0, 0.02) !important;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease !important;
    box-sizing: border-box !important;
    min-width: 0 !important;
}

.diagram-card:has(.diagram-card-header) {
    padding: 0 !important;
    gap: 0 !important;
    border: 1.5px solid #e2e8f0 !important;
}

.diagram-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06) !important;
    border-color: #cbd5e1 !important;
}

/* Contextual Card Border Harmonization */
.diagram-card:has(.card-tag[style*="10b981"]),
.diagram-card:has(.card-tag[style*="green"]),
.diagram-card:has(.card-badge[style*="10b981"]),
.diagram-card:has(.card-tag.merit),
.diagram-card:has(.card-tag.advantage) {
    border-color: #a7f3d0 !important;
    background: #fafdfb !important;
}

.diagram-card:has(.card-tag[style*="ef4444"]),
.diagram-card:has(.card-tag[style*="red"]),
.diagram-card:has(.card-badge[style*="ef4444"]),
.diagram-card:has(.card-tag.demerit),
.diagram-card:has(.card-tag.disadvantage) {
    border-color: #fecaca !important;
    background: #fffafa !important;
}

/* Card Badges & Tags (Compact Inline-Flex Pills) */
.card-tag,
.card-badge,
.diagram-card .card-tag,
.diagram-card .card-badge {
    display: inline-flex !important;
    align-self: flex-start !important;
    width: fit-content !important;
    max-width: 100% !important;
    font-size: 11px !important;
    font-weight: 700 !important;
    letter-spacing: 0.4px !important;
    text-transform: uppercase !important;
    padding: 3px 10px !important;
    border-radius: 6px !important;
    line-height: 1.35 !important;
    margin: 0 0 4px 0 !important;
    box-sizing: border-box !important;
    background: #eef2ff !important;
    color: #4338ca !important;
    border: 1px solid #c7d2fe !important;
}

/* Positive / Merit / Advantage Badges */
.card-tag[style*="10b981"],
.card-tag[style*="green"],
.card-badge[style*="10b981"],
.card-badge[style*="green"],
.card-tag.merit,
.card-tag.advantage,
.card-tag.positive {
    background: #ecfdf5 !important;
    color: #065f46 !important;
    border: 1px solid #a7f3d0 !important;
}

/* Negative / Demerit / Disadvantage Badges */
.card-tag[style*="ef4444"],
.card-tag[style*="red"],
.card-badge[style*="ef4444"],
.card-badge[style*="red"],
.card-tag.demerit,
.card-tag.disadvantage,
.card-tag.negative {
    background: #fef2f2 !important;
    color: #991b1b !important;
    border: 1px solid #fecaca !important;
}

/* Warning / Amber Badges */
.card-tag[style*="f59e0b"],
.card-tag[style*="amber"],
.card-tag[style*="yellow"],
.card-badge[style*="f59e0b"],
.card-tag.warning {
    background: #fffbeb !important;
    color: #92400e !important;
    border: 1px solid #fde68a !important;
}

.card-title,
.diagram-card h4 {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
    line-height: 1.4 !important;
    margin: 0 0 4px 0 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

.card-desc,
.diagram-card p {
    font-size: 13px !important;
    color: #475569 !important;
    line-height: 1.55 !important;
    margin: 0 !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
}

/* Split side support */
.split-side {
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    border-top: 3.5px solid #6366f1;
    border-radius: 8px;
    padding: 14px 18px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.split-side:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.08);
}

.split-side-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1.5px solid #ede9fe;
}

.split-side-item {
    font-size: 12px;
    color: #475569;
    padding: 3px 0;
    line-height: 1.5;
}

/* Flow step detailed structure */
.flow-step .step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ede9fe;
    color: #5b36f5;
    font-size: 11px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 5px;
    margin-bottom: 4px;
}

.flow-step .step-title {
    font-size: 13px;
    font-weight: 700;
    color: #1e1b4b;
    line-height: 1.35;
    margin-bottom: 3px;
}

.flow-step .step-desc {
    font-size: 11.5px;
    font-weight: 400;
    color: #64748b;
    line-height: 1.4;
}

/* Stack layer detailed structure */
.diagram-stack .stack-layer,
.stack-layer {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 6px !important;
    padding: 12px 16px !important;
    background: #ffffff !important;
    border: 1.5px solid #e4defa !important;
    border-left: 5px solid #6f4df6 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    width: 100% !important;
}

.stack-layer .layer-title,
.stack-layer .stack-title,
.stack-layer .stack-heading {
    font-size: 14.5px !important;
    font-weight: 700 !important;
    color: #1e1b4b !important;
    width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    display: block !important;
}

.stack-layer .layer-desc,
.stack-layer .stack-desc {
    font-size: 13px !important;
    color: #475569 !important;
    width: 100% !important;
    white-space: normal !important;
    word-break: normal !important;
    overflow-wrap: normal !important;
    hyphens: none !important;
    line-height: 1.55 !important;
    margin: 0 !important;
    text-align: left !important;
    display: block !important;
}

.stack-layer .stack-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #ede9fe;
    color: #5b36f5;
    font-size: 11px;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    flex-shrink: 0;
    line-height: 1.25;
}

.stack-layer .stack-info {
    font-size: 13px;
    color: #475569;
    text-align: left;
    line-height: 1.55;
    width: 100%;
}
