:root {
    --primary-bg: #FAF9F5;
    --secondary-bg: #F2EFE9;
    --surface-bg: #FFFFFF;
    --surface-subtle: #F7F5F0;
    --primary-text: #191B1F;
    --secondary-text: #545A66;
    --muted-text: #828997;
    --accent-primary: #1E40AF;
    --accent-secondary: #0F766E;
    --accent-highlight: #D97706;
    --border-subtle: #E6E2D8;
    --border-medium: #D3CEBF;
    --border-strong: #B8B1A0;
    --card-bg: #FFFFFF;
    --card-bg-alt: #FBFBF9;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--primary-bg);
    color: var(--primary-text);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

.text-muted {
    color: #828997 !important;
}

.font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== header ===== */
.site-header {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-header .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

/* ===== see_how_the_literature_fits_together_before_you_start_writing ===== */
.hero-section {
    background-color: #191B1F;
}

.hero-section .hero-feature-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hero-section .hero-feature-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0, 0, 0, 0.12);
}

/* ===== main_idea ===== */
.main-idea-section {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    box-sizing: border-box;
}

.main-idea-section * {
    box-sizing: border-box;
}

.main-idea-section h2 {
    font-family: 'Newsreader', Georgia, serif;
}

.main-idea-section .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* ===== for_whom ===== */
.for-whom-section .audience-tab {
    background-color: #FFFFFF;
    color: #545A66;
    border-color: #D3CEBF;
    cursor: pointer;
}

.for-whom-section .audience-tab:hover {
    background-color: #F7F5F0;
    color: #191B1F;
    border-color: #B8B1A0;
}

.for-whom-section .audience-tab.active-tab {
    background-color: #1E40AF;
    color: #FFFFFF;
    border-color: #1E40AF;
    box-shadow: 0 1px 3px rgba(30, 64, 175, 0.2);
}

.for-whom-section .audience-card {
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.for-whom-section .audience-card.card-highlighted {
    border-color: #1E40AF;
    box-shadow: 0 8px 20px rgba(30, 64, 175, 0.12);
    transform: translateY(-2px);
}

/* ===== worksheets ===== */
.worksheets-section {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.worksheets-section .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.worksheets-section .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.worksheets-section .js-tab-btn.active {
    background-color: #1E40AF;
    color: #FFFFFF;
    border-color: #1E40AF;
}

.worksheets-section .js-tab-btn:not(.active) {
    background-color: #FFFFFF;
    color: #545A66;
    border-color: #D3CEBF;
}

.worksheets-section .js-worksheet-card.is-hidden {
    display: none;
}

/* ===== featured_workbook ===== */
.featured-workbook-section {
    position: relative;
    width: 100%;
    box-sizing: border-box;
}

.featured-workbook-section .js-mode-toggle {
    outline: none;
}

.featured-workbook-section .js-mode-toggle:focus-visible {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
}

.featured-workbook-section .js-view-panel.active-panel {
    display: block;
}

.featured-workbook-section .js-view-panel.hidden-panel {
    display: none;
}

/* ===== free_audit_checklist ===== */
.evidence-free-audit .audit-form-input::placeholder {
    color: #828997;
    opacity: 1;
}

.evidence-free-audit .audit-form-input::-webkit-input-placeholder {
    color: #828997;
    opacity: 1;
}

.evidence-free-audit .audit-form-input::-moz-placeholder {
    color: #828997;
    opacity: 1;
}

.evidence-free-audit .audit-form-input:-ms-input-placeholder {
    color: #828997;
    opacity: 1;
}

/* ===== us_vs_typical_approach ===== */
.us-vs-typical-section {
    box-sizing: border-box;
}

.us-vs-typical-section .us-vs-typical-matrix {
    transition: box-shadow 0.2s ease-in-out;
}

.us-vs-typical-section h2,
.us-vs-typical-section h3 {
    hyphens: auto;
}

/* ===== common_mistakes_in_the_niche ===== */
.common-mistakes-section .js-mistake-card {
    will-change: transform, opacity;
}

.common-mistakes-section .js-mistake-card.hidden-card {
    display: none;
}

.common-mistakes-section .js-mistake-filter-btn {
    cursor: pointer;
}

/* ===== what_happens_after_start ===== */
.evidence-timeline-section .js-timeline-tab.active {
    background-color: #FFFFFF;
    color: #1E40AF;
    box-shadow: 0 1px 3px rgba(25, 27, 31, 0.08);
}

.evidence-timeline-section .js-timeline-card.is-hidden {
    display: none;
}

/* ===== book_a_consultation ===== */
.evidence-consultation-section .evidence-slot {
    position: relative;
}

.evidence-consultation-section .evidence-slot.is-selected {
    border-color: #1E40AF;
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.08);
}

.evidence-consultation-section .evidence-slot.is-selected .slot-indicator {
    border-color: #1E40AF;
    background-color: #1E40AF;
}

.evidence-consultation-section .evidence-slot.is-selected .slot-indicator svg {
    display: block;
}

.evidence-consultation-section .consult-input::placeholder {
    color: #828997;
    opacity: 1;
}

.evidence-consultation-section .consult-input:focus {
    box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.15);
}

/* ===== materials_grid ===== */
.materials-grid-section .materials-card {
    display: flex;
    flex-direction: column;
}

/* ===== knowledge_base_grid ===== */
.evidence-kb-grid .evidence-kb-card {
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.evidence-kb-grid .evidence-kb-card:hover {
    transform: translateY(-2px);
}

/* ===== footer ===== */
.emw-footer {
    background-color: #FAF9F5;
    color: #545A66;
}

.emw-footer .emw-footer-link {
    position: relative;
    transition: color 0.2s ease;
}

.emw-footer .emw-footer-link:hover {
    color: #1E40AF;
}

.site-header {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-header .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-footer {
    background-color: #FAF9F5;
    color: #545A66;
}

.emw-footer .emw-footer-link {
    position: relative;
    transition: color 0.2s ease;
}

.emw-footer .emw-footer-link:hover {
    color: #1E40AF;
}

.kb-category-section .js-kb-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.kb-category-section .js-kb-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px -5px rgba(25, 27, 31, 0.08);
}

.kb-category-section .js-kb-search::placeholder {
    color: #828997;
    opacity: 1;
}


/* ===== PAGE: brand-support ===== */
.brand-support-block select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23545A66'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.5rem center; background-size: 1rem; padding-right: 1.75rem; }
.brand-support-block .js-tab-btn.active { background-color: #1E40AF; color: #FFFFFF; border-color: #1E40AF; }
.brand-support-block .js-tab-btn:not(.active) { background-color: #FFFFFF; color: #191B1F; border-color: #D3CEBF; }
.brand-support-block .js-tab-btn:not(.active):hover { border-color: #1E40AF; }

/* ===== PAGE: contacts ===== */
.contacts-section .contacts-input::placeholder { color: #828997; opacity: 1; }
.contacts-section .contacts-input:focus { box-shadow: 0 0 0 2px rgba(30, 64, 175, 0.12); }

/* ===== PAGE: privacy ===== */
.privacy-content-section a { transition: color 0.2s ease-in-out; }
.privacy-content-section li::marker { color: #1E40AF; }

/* ===== PAGE: terms ===== */
.terms-matrix-section .js-clause.highlighted { border-color: #1E40AF; background-color: #FAF9F5; }
.terms-matrix-section .js-nav-item.active { color: #1E40AF; background-color: #FAF9F5; border-left: 2px solid #1E40AF; font-weight: 600; }
.terms-matrix-section ::placeholder { color: #828997; opacity: 1; }

/* ===== PAGE: disclaimer ===== */
.disclaimer-section { -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; } .disclaimer-section .js-toc-link.is-active { color: #1E40AF; background-color: #FAF9F5; font-weight: 600; border-left: 2px solid #1E40AF; padding-left: 10px; }

.scholarly-comment-card .comment-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid #D3CEBF;
    background-color: #F2EFE9;
    display: block;
}

.scholarly-comment-card .comment-body {
    color: #545A66;
    word-break: break-word;
}

.scholarly-comment-card .comment-action-btn:focus-visible {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
    border-radius: 4px;
}

.scholarly-reply-card .comment-avatar.reply-avatar {
    width: 36px;
    height: 36px;
    min-width: 36px;
    border-radius: 9999px;
    object-fit: cover;
    border: 1px solid #D3CEBF;
    background-color: #F2EFE9;
    display: block;
}

.scholarly-reply-card .comment-body {
    color: #545A66;
    word-break: break-word;
}

.scholarly-reply-card .comment-action-btn:focus-visible {
    outline: 2px solid #1E40AF;
    outline-offset: 2px;
    border-radius: 4px;
}

/* ===== Comment responsive fixes ===== */
.scholarly-comment-card .comment-body,
.scholarly-reply-card .comment-body {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    max-width: 100%;
}

.scholarly-comment-card .comment-body p,
.scholarly-reply-card .comment-body p {
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
}

.scholarly-comment-card header,
.scholarly-reply-card header {
    flex-wrap: wrap;
    max-width: 100%;
}

.scholarly-comment-card header > div,
.scholarly-reply-card header > div {
    min-width: 0;
}

.scholarly-comment-card header h3,
.scholarly-comment-card header h4,
.scholarly-reply-card header h3,
.scholarly-reply-card header h4 {
    overflow-wrap: break-word;
    word-break: break-word;
}

.scholarly-comment-card footer,
.scholarly-reply-card footer {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.scholarly-comment-card footer > div,
.scholarly-reply-card footer > div {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

@media (max-width: 640px) {
    .scholarly-comment-card,
    .scholarly-reply-card {
        overflow: hidden;
    }
    .scholarly-comment-card .comment-body,
    .scholarly-reply-card .comment-body {
        font-size: 13px;
        line-height: 1.6;
    }
    .scholarly-comment-card header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .scholarly-comment-card header > div:first-child {
        width: 100%;
    }
    .scholarly-reply-card header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .scholarly-comment-card footer,
    .scholarly-reply-card footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    .scholarly-comment-card footer > div,
    .scholarly-reply-card footer > div {
        width: 100%;
        flex-wrap: wrap;
    }
}


/* ===== PAGE TEMPLATE: materials ===== */
.site-header {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-header .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-detail-main {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.emw-detail-main .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-detail-main .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.emw-detail-main .emw-prose-content h2,
.emw-detail-main .emw-prose-content h3 {
    color: #191B1F;
}

.emw-detail-main .emw-prose-content p {
    color: #545A66;
}

.emw-detail-main input::placeholder,
.emw-detail-main textarea::placeholder {
    color: #828997;
    opacity: 1;
}

.emw-footer {
    background-color: #FAF9F5;
    color: #545A66;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.emw-footer .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-footer .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.emw-footer .emw-footer-link {
    position: relative;
    transition: color 0.2s ease;
}

.emw-footer .emw-footer-link:hover {
    color: #1E40AF;
}

/* ===== PAGE TEMPLATE: knowledge-base ===== */
.site-header {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.site-header .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-detail-main {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.emw-detail-main .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-detail-main .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.emw-detail-main .emw-prose-content h2,
.emw-detail-main .emw-prose-content h3 {
    color: #191B1F;
}

.emw-detail-main .emw-prose-content p {
    color: #545A66;
}

.emw-detail-main input::placeholder,
.emw-detail-main textarea::placeholder {
    color: #828997;
    opacity: 1;
}

.emw-footer {
    background-color: #FAF9F5;
    color: #545A66;
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
}

.emw-footer .font-serif {
    font-family: 'Newsreader', Georgia, serif;
}

.emw-footer .font-mono {
    font-family: 'JetBrains Mono', monospace;
}

.emw-footer .emw-footer-link {
    position: relative;
    transition: color 0.2s ease;
}

.emw-footer .emw-footer-link:hover {
    color: #1E40AF;
}
/* ===== Comment buttons & badges single-line fixes ===== */
.emw-comments-wrapper .js-comment-count-badge {
    white-space: nowrap;
    flex-shrink: 0;
}

.emw-comments-wrapper .comment-action-btn {
    white-space: nowrap;
    flex-shrink: 0;
}

.emw-comments-wrapper .comment-action-btn svg {
    flex-shrink: 0;
}

.emw-comments-wrapper .comment-action-btn .js-like-count {
    white-space: nowrap;
}

.emw-comment-form-container .flex.items-center.justify-between {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}

.emw-comment-form-container .flex.items-center.justify-between > span {
    flex-shrink: 0;
}

.emw-comment-form-container .flex.items-center.justify-between > button {
    white-space: nowrap;
    flex-shrink: 0;
}

.scholarly-comment-card header .flex.items-center.gap-2.flex-wrap > span,
.scholarly-reply-card header .flex.items-center.gap-2.flex-wrap > span {
    white-space: nowrap;
}

.scholarly-comment-card header > div:last-child,
.scholarly-reply-card header > span:last-child {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .emw-comments-wrapper > .flex.items-center.justify-between {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 0.5rem;
        align-items: center;
    }
    .emw-comments-wrapper > .flex.items-center.justify-between > div {
        min-width: 0;
        flex: 1 1 auto;
    }
    .emw-comments-wrapper > .flex.items-center.justify-between > .js-comment-count-badge {
        flex: 0 0 auto;
    }
    .emw-comment-form-container .flex.items-center.justify-between {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .emw-comment-form-container .flex.items-center.justify-between > span {
        text-align: center;
        white-space: normal;
        word-break: break-word;
        overflow-wrap: break-word;
        line-height: 1.5;
    }
    .emw-comment-form-container .flex.items-center.justify-between > button {
        width: 100%;
        justify-content: center;
    }
    .scholarly-comment-card header {
        flex-wrap: wrap;
    }
    .scholarly-comment-card header > div:last-child,
    .scholarly-reply-card header > span:last-child {
        font-size: 10px;
    }
}
/* ===== Materials/Knowledge-base cards single-line fixes ===== */
.js-kb-card .flex.items-center.justify-between > div {
    white-space: nowrap;
}

.js-kb-card .flex.items-center.justify-between > div > span {
    white-space: nowrap;
}

.js-kb-card .flex.items-center.justify-between a {
    white-space: nowrap;
}

@media (max-width: 640px) {
    .js-kb-card .flex.items-center.justify-between {
        gap: 0.5rem;
    }
}
/* ===== EndNote CTA buttons single-line ===== */
.endnote-cta-block a {
    white-space: nowrap;
}

.endnote-cta-block a svg {
    flex-shrink: 0;
}
/* ===== General small badge/label single-line fix ===== */
.flex.items-center.justify-between > span.font-mono,
.flex.items-center.justify-between > div.font-mono {
    white-space: nowrap;
}

/* Exception: moderation note in comment form should wrap */
.emw-comment-form-container .flex.items-center.justify-between > span.font-mono {
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
}

/* Tags block: allow wrapping on mobile */
.flex.items-center.gap-2.text-\[12px\].font-mono.text-\[\#828997\] {
    flex-wrap: wrap;
    gap: 0.375rem 0.5rem;
}

.flex.items-center.gap-2.text-\[12px\].font-mono.text-\[\#828997\] > span {
    white-space: nowrap;
    flex-shrink: 0;
}

@media (max-width: 640px) {
    .flex.flex-col.sm\:flex-row.items-center.justify-between.gap-4 {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    .flex.items-center.gap-2.text-\[12px\].font-mono.text-\[\#828997\] {
        width: 100%;
    }
}

/* ===== Hero stats single-line ===== */
.grid.grid-cols-3 > div > div {
    white-space: nowrap;
}