/* Base reset + layout — covers pre-JS render before app.css is injected */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: 'IBM Plex Sans', Inter, system-ui, sans-serif;
    background: #f5f7fb;
    color: #16253d;
    line-height: 1.6;
}
a { color: inherit; }
.container {
    width: min(1180px, calc(100% - 2rem));
    margin: 0 auto;
}
.shell-topbar {
    position: sticky; top: 0; z-index: 20;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.9);
    border-bottom: 1px solid rgba(24,45,76,0.15);
}
.shell-row {
    min-height: 70px; display: flex; align-items: center; gap: 1rem;
}
.brand-lockup { text-decoration: none; display: flex; flex-direction: column; }
.brand-name { font-weight: 700; font-size: 1rem; color: #16253d; }
.brand-descriptor { font-size: 0.68rem; color: #566b88; }
.nav-modern { display: flex; gap: 1.25rem; margin-left: auto; }
.nav-modern a { text-decoration: none; font-size: 0.88rem; font-weight: 500; color: #16253d; }
.eyebrow {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #566b88; margin: 0 0 0.5rem;
}
.hero-lead { font-size: 1.05rem; color: #4e5868; line-height: 1.65; margin: 0; max-width: 60ch; }
.hero-ctas { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.btn-primary, .btn-secondary {
    display: inline-block; padding: 0.6rem 1.25rem; border-radius: 8px;
    font-weight: 600; font-size: 0.88rem; text-decoration: none;
    cursor: pointer; border: 1px solid transparent; font-family: inherit;
}
.btn-primary  { background: #0f3d79; color: #fff; border-color: #0f3d79; }
.btn-secondary { background: #fff; color: #16253d; border-color: rgba(24,45,76,0.2); }
.hero-grid-bg { display: none; }
.kicker {
    font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.1em; color: #566b88; margin: 0 0 0.25rem;
}

:root {
    --chapter-bg: linear-gradient(180deg, #f8f9fb 0%, #f0f2f5 100%);
    --chapter-line: rgba(26, 33, 46, 0.12);
    --chapter-soft: rgba(26, 33, 46, 0.06);
    --chapter-highlight: rgba(185, 133, 44, 0.2);

    /* Aliases so module.css works in both marketing and app.css contexts */
    --ink-900: #1a2230;
    --ink-800: #243040;
    --text-900: #1a2230;
    --text-800: #2c3a4f;
    --text-700: #4e5868;
    --accent:   #0f3d79;
    --font-display: 'Libre Baskerville', Georgia, serif;
}

.chapter-hero {
    padding: 3.5rem 0 4rem;
    background: linear-gradient(160deg, #0b2d5e 0%, #0f3d79 100%);
}
.chapter-hero .hero-inner { position: relative; z-index: 2; }
.chapter-hero .eyebrow { color: #f2b35c; }
.chapter-hero h1 {
    font-family: var(--font-display);
    font-size: clamp(1.9rem, 4vw, 2.8rem);
    line-height: 1.12;
    color: #fff;
    margin: 0.25rem 0 0.75rem;
}
.chapter-hero .hero-lead { color: rgba(255,255,255,0.82); max-width: 64ch; }

.chapter-hero.has-module-hero {
    position: relative;
}

.module-hero-media {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    filter: saturate(1.12) contrast(1.08) brightness(0.82);
    transform: scale(1.02);
}

.chapter-hero.has-module-hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(1150px 420px at 0% 0%, rgba(27, 34, 48, 0.46), transparent 58%),
        radial-gradient(920px 360px at 92% 18%, rgba(210, 144, 61, 0.2), transparent 60%),
        linear-gradient(180deg, rgba(5, 13, 26, 0.66), rgba(7, 18, 34, 0.52) 52%, rgba(236, 242, 250, 0.95) 100%);
}

.chapter-hero.has-module-hero .hero-grid-bg {
    opacity: 0.4;
}

.chapter-hero.has-module-hero .hero-inner,
.chapter-hero.has-module-hero .chapter-switcher {
    position: relative;
    z-index: 2;
}

.chapter-hero.has-module-hero .eyebrow {
    color: #deebfb;
    text-shadow: 0 1px 2px rgba(7, 21, 40, 0.45);
}

.chapter-hero.has-module-hero h1 {
    color: #ffffff;
    text-shadow: 0 3px 14px rgba(4, 16, 32, 0.52);
}

.chapter-hero.has-module-hero .hero-lead {
    color: #f4f8ff;
    text-shadow: 0 2px 10px rgba(4, 16, 32, 0.44);
}

.chapter-hero.has-module-hero .hero-support {
    color: #dfeaf8;
    text-shadow: 0 1px 6px rgba(4, 16, 32, 0.34);
}

.chapter-switcher {
    width: min(1220px, calc(100% - 3rem));
    margin: -2.1rem auto 1rem;
    padding: 0.7rem;
    border: 1px solid var(--chapter-line);
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 14px 26px rgba(16, 23, 35, 0.08);
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 0.45rem;
    position: relative;
    z-index: 4;
}

.workspace-enabled .chapter-switcher {
    display: none;
}

.chapter-pill {
    text-decoration: none;
    text-align: center;
    border: 1px solid rgba(29, 46, 73, 0.2);
    border-radius: 999px;
    background: #ffffff;
    color: var(--ink-900);
    font-weight: 700;
    font-size: 0.77rem;
    letter-spacing: 0.03em;
    padding: 0.55rem 0.6rem;
}

.chapter-pill:hover,
.chapter-pill:focus-visible {
    border-color: rgba(29, 46, 73, 0.4);
    box-shadow: 0 8px 18px rgba(16, 23, 35, 0.1);
}

.chapter-pill.is-current {
    border-color: #2a3343;
    background: #2a3343;
    color: #f3f8ff;
}

.chapter-main {
    background: var(--chapter-bg);
    border-top: 1px solid rgba(30, 47, 73, 0.12);
    padding: 4rem 0 5rem;
}

.chapter-shell {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.chapter-nav {
    position: sticky;
    top: 92px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid var(--chapter-line);
    border-radius: 16px;
    padding: 1rem;
    backdrop-filter: blur(8px);
}

.chapter-nav .kicker {
    color: var(--text-700);
}

.chapter-link {
    display: block;
    text-decoration: none;
    color: var(--text-900);
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    margin-top: 0.35rem;
    font-size: 0.92rem;
    font-weight: 600;
}

.chapter-link.is-current,
.chapter-link:hover,
.chapter-link:focus-visible {
    border-color: rgba(29, 46, 73, 0.22);
    background: rgba(255, 255, 255, 0.84);
}

.chapter-content {
    display: grid;
    gap: 1.5rem;
}

.chapter-panel {
    background: #fff;
    border: 1px solid var(--chapter-line);
    border-radius: 16px;
    padding: 1.75rem 2rem;
    box-shadow: 0 4px 16px rgba(16, 23, 35, 0.05);
}

.chapter-panel h2 {
    margin-top: 0.5rem;
    font-family: var(--font-display);
    font-size: clamp(1.25rem, 2.2vw, 1.65rem);
    line-height: 1.2;
    color: var(--ink-900);
}

.module-status-panel {
    border: 1px solid rgba(31, 39, 53, 0.18);
    background: linear-gradient(165deg, #fafbfc 0%, #f2f4f7 100%);
    box-shadow: 0 14px 30px rgba(16, 23, 35, 0.08);
}

.module-status-top {
    margin: 0.75rem 0 0.85rem;
}

.module-status-panel h2 {
    font-size: clamp(1.25rem, 2vw, 1.9rem);
    margin-top: 0.4rem;
}

.module-status-panel .status-control-bar {
    margin-top: 0.65rem;
    padding: 0.68rem;
    border: 1px solid rgba(31, 39, 53, 0.18);
    background: #ffffff;
    border-radius: 12px;
}

.module-status-controls .status-control-pill {
    font-size: 0.66rem;
}

.module-report-sheet {
    border: 1px solid rgba(17, 47, 84, 0.22);
    border-radius: 14px;
    background: #fff;
    padding: 1rem;
}

.module-report-head {
    border-bottom: 1px solid rgba(17, 47, 84, 0.16);
    padding-bottom: 0.7rem;
    margin-bottom: 0.8rem;
}

.module-report-brand {
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.68rem;
    color: #626c7d;
    font-weight: 700;
}

.module-report-head h3 {
    margin: 0.32rem 0 0.35rem;
    font-family: var(--font-display);
    font-size: clamp(1.2rem, 2.1vw, 1.7rem);
    color: #1a2230;
}

.module-report-meta {
    margin: 0.22rem 0 0;
    font-size: 0.84rem;
    color: #56606f;
}

.module-report-section {
    margin-top: 0.85rem;
}

.module-report-section h4 {
    margin: 0;
    color: #2b3444;
    font-size: 0.96rem;
    letter-spacing: 0.02em;
}

.module-report-section ol,
.module-report-section ul {
    margin: 0.5rem 0 0;
    padding-left: 1.05rem;
    display: grid;
    gap: 0.36rem;
    color: #3d4757;
    font-size: 0.9rem;
}

.module-report-footer {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(26, 33, 46, 0.16);
}

.module-report-footer p {
    margin: 0.3rem 0 0;
    font-size: 0.86rem;
    color: #566172;
}

.module-status-panel .status-control-label {
    font-size: 0.78rem;
    color: #4f596a;
    margin-right: 0.3rem;
}

.module-status-panel .status-compact-btn {
    font-size: 0.76rem;
    padding: 0.42rem 0.66rem;
    border-radius: 999px;
    border: 1px solid rgba(31, 39, 53, 0.18);
    background: #ffffff;
    color: #2d3747;
    font-weight: 700;
}

.module-status-panel .status-compact-btn:hover,
.module-status-panel .status-compact-btn:focus-visible {
    border-color: rgba(31, 39, 53, 0.35);
    background: #f1f4f8;
    color: #1f2736;
}

.module-hero-control {
    margin-top: 0.9rem;
    border: 1px solid rgba(196, 202, 214, 0.54);
    border-radius: 16px;
    background:
        radial-gradient(140% 200% at 0% -45%, rgba(255, 255, 255, 0.32), transparent 48%),
        linear-gradient(145deg, rgba(250, 251, 253, 0.92), rgba(242, 245, 249, 0.9));
    backdrop-filter: blur(10px);
    box-shadow:
        0 16px 34px rgba(8, 20, 38, 0.22),
        inset 0 1px 0 rgba(255, 255, 255, 0.58);
    padding: 0.78rem 0.85rem 0.72rem;
}

.module-hero-control .kicker {
    color: #596374;
}

.module-hero-control .form-note {
    color: #4f5869;
    font-weight: 500;
}

.module-hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    align-items: center;
    margin-bottom: 0.15rem;
}

.module-hero-badges .status-control-label {
    color: #515c6d;
    margin-right: 0.1rem;
}

.module-hero-actions {
    margin-top: 0.46rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.36rem;
    align-items: center;
}

.module-hero-generate-btn {
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 170% at 10% -25%, rgba(255, 255, 255, 0.35), transparent 48%),
        linear-gradient(132deg, #f0b457 0%, #dd9d3f 56%, #c9872d 100%);
    color: #132642;
    border-color: rgba(219, 160, 79, 0.56);
    box-shadow:
        0 12px 26px rgba(110, 70, 18, 0.28),
        inset 0 1px 0 rgba(255, 251, 239, 0.62);
    font-size: 0.86rem;
    letter-spacing: 0.02em;
    padding: 0.68rem 1.15rem;
    transition: transform 190ms ease, box-shadow 220ms ease, filter 220ms ease;
}

.module-hero-generate-btn::before {
    content: "";
    position: absolute;
    top: -120%;
    left: -55%;
    width: 52%;
    height: 320%;
    transform: rotate(18deg);
    background: linear-gradient(95deg, transparent, rgba(255, 255, 255, 0.28), transparent);
    animation: cbpShimmer 2.9s ease-in-out infinite;
    pointer-events: none;
}

.module-hero-generate-btn:hover,
.module-hero-generate-btn:focus-visible {
    transform: translateY(-1px);
    filter: saturate(1.08) brightness(1.03);
    box-shadow:
        0 16px 32px rgba(110, 70, 18, 0.34),
        inset 0 1px 0 rgba(255, 251, 239, 0.72);
}

.module-hero-generate-btn.is-upsell {
    background:
        radial-gradient(120% 170% at 10% -25%, rgba(255, 255, 255, 0.34), transparent 48%),
        linear-gradient(132deg, #2a3343 0%, #3a465a 56%, #4a5a71 100%);
    color: #f4f9ff;
    border-color: rgba(126, 142, 168, 0.48);
}

.chapter-panel p {
    margin-top: 0.9rem;
    color: var(--text-700);
}

.preview-gate-card {
    border: 1px solid rgba(223, 145, 47, 0.55);
    background:
        radial-gradient(1200px 320px at 10% -10%, rgba(255, 194, 91, 0.34), transparent 62%),
        radial-gradient(900px 280px at 100% 0%, rgba(61, 73, 96, 0.18), transparent 60%),
        linear-gradient(165deg, #fff9ef, #f3f5f9 58%, #eceff4);
    box-shadow: 0 20px 44px rgba(22, 39, 64, 0.18);
}

.preview-gate-card h2 {
    font-size: clamp(1.35rem, 2.5vw, 2rem);
    color: #112a4a;
    margin-top: 0.45rem;
}

.preview-gate-card .hero-ctas .btn-primary {
    box-shadow: 0 10px 24px rgba(16, 66, 132, 0.35);
}

.preview-lock-count {
    margin: 0 0 0.35rem;
    display: inline-flex;
    align-items: center;
    gap: 0.38rem;
    border: 1px solid rgba(223, 145, 47, 0.55);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    padding: 0.22rem 0.56rem;
    font-size: 0.64rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #7a4d12;
    font-weight: 700;
}

.chapter-link.is-locked {
    opacity: 0.56;
}

.preview-locked {
    display: block;
    position: relative;
    pointer-events: none;
    user-select: none;
    border-style: dashed;
    overflow: hidden;
    min-height: 170px;
    opacity: 0.96;
}

.preview-locked p,
.preview-locked ul,
.preview-locked ol,
.preview-locked .chapter-grid,
.preview-locked .definition-grid,
.preview-locked .framework-body,
.preview-locked .insight-block {
    filter: blur(2px) saturate(0.76);
    opacity: 0.62;
}

.preview-locked::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 85px;
    background: linear-gradient(180deg, rgba(238, 244, 252, 0.04), rgba(238, 244, 252, 0.9));
}

.preview-locked::before {
    content: "Premium Section";
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 2;
    border: 1px solid rgba(223, 145, 47, 0.56);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.18rem 0.48rem;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #7a4d12;
    font-weight: 700;
}

.cbp-modal-open {
    overflow: hidden;
}

.cbp-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(9, 16, 28, 0.58);
    backdrop-filter: blur(4px);
    z-index: 1400;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.cbp-modal-backdrop.is-open {
    display: flex;
    animation: cbp-modal-fade 180ms ease;
}

.cbp-modal-sheet {
    position: relative;
    width: min(640px, 100%);
    border: 1px solid rgba(29, 46, 73, 0.26);
    border-radius: 18px;
    background: linear-gradient(165deg, #ffffff 0%, #f1f6ff 100%);
    box-shadow: 0 22px 50px rgba(10, 20, 36, 0.32);
    padding: 1.1rem 1.1rem 1rem;
}

.cbp-modal-close {
    position: absolute;
    top: 0.48rem;
    right: 0.5rem;
    border: 1px solid rgba(29, 46, 73, 0.2);
    border-radius: 999px;
    width: 30px;
    height: 30px;
    background: #ffffff;
    color: #1d2e49;
    font-size: 1.05rem;
    line-height: 1;
    cursor: pointer;
}

.cbp-modal-lead {
    margin: 0.55rem 0 0;
    color: var(--text-800);
    font-size: 0.99rem;
    line-height: 1.62;
}

.cbp-modal-list {
    margin: 0.8rem 0 0;
    padding-left: 1.05rem;
    display: grid;
    gap: 0.45rem;
    color: var(--text-900);
    font-size: 0.92rem;
}

@keyframes cbp-modal-fade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.highlight-callout {
    margin-top: 1rem;
    border: 1px solid var(--chapter-highlight);
    border-left: 4px solid var(--accent);
    border-radius: 14px;
    background: #fffaf1;
    padding: 0.9rem;
}

.highlight-callout p {
    margin-top: 0;
    color: var(--text-900);
    font-size: 0.95rem;
}

.chapter-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.7rem;
}

.chapter-grid section {
    border: 1px solid var(--chapter-line);
    border-radius: 14px;
    background: #fff;
    padding: 0.85rem;
}

.chapter-grid h3 {
    font-size: 0.95rem;
    color: var(--ink-900);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.chapter-grid ul {
    margin-top: 0.65rem;
    padding-left: 1rem;
    display: grid;
    gap: 0.35rem;
    color: var(--text-900);
    font-size: 0.92rem;
}

.framework-accordion {
    margin-top: 1rem;
    display: grid;
    gap: 0.7rem;
}

.framework-item {
    border: 1px solid var(--chapter-line);
    border-radius: 16px;
    background: #fff;
    overflow: hidden;
}

.framework-item summary {
    cursor: pointer;
    list-style: none;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 0.7rem;
    align-items: center;
    padding: 0.95rem;
}

.framework-item summary::-webkit-details-marker {
    display: none;
}

.framework-index {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.8rem;
    min-height: 1.8rem;
    border-radius: 999px;
    border: 1px solid rgba(29, 46, 73, 0.26);
    color: var(--ink-900);
    font-size: 0.78rem;
    font-weight: 700;
}

.framework-title {
    font-family: var(--font-display);
    color: var(--ink-900);
    font-size: clamp(1rem, 1.2vw, 1.25rem);
}

.framework-state {
    font-size: 0.74rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-700);
}

.framework-item[open] .framework-state {
    color: var(--ink-900);
}

.framework-body {
    border-top: 1px solid var(--chapter-soft);
    padding: 0.85rem 0.95rem 1rem;
}

.framework-body p {
    margin-top: 0;
    color: var(--text-700);
    font-size: 0.96rem;
}

.framework-body .chapter-grid {
    margin-top: 0.75rem;
}

.metric-strip {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0.6rem;
}

.metric {
    background: #fff;
    border: 1px solid var(--chapter-line);
    border-radius: 12px;
    padding: 0.75rem;
}

.metric-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-700);
}

.metric-value {
    display: block;
    margin-top: 0.35rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: var(--ink-900);
}

.partner-note {
    background: linear-gradient(135deg, #ffffff 0%, #fff3e1 100%);
    border-color: rgba(242, 179, 92, 0.36);
}

.related-panel {
    background: #f7fbff;
}

.related-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.related-grid a {
    text-decoration: none;
    border: 1px solid var(--chapter-line);
    border-radius: 12px;
    background: #ffffff;
    color: var(--ink-900);
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.35;
    padding: 0.75rem;
}

.related-grid a:hover,
.related-grid a:focus-visible {
    border-color: rgba(29, 46, 73, 0.3);
    box-shadow: 0 10px 22px rgba(16, 23, 35, 0.08);
}

.definition-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.6rem;
}

.definition-item {
    border: 1px solid var(--chapter-line);
    border-radius: 12px;
    background: #ffffff;
    padding: 0.75rem;
}

.definition-item h3 {
    font-size: 0.88rem;
    color: var(--ink-900);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.definition-item p {
    margin-top: 0.45rem;
    font-size: 0.92rem;
}

.definition-item a {
    color: var(--ink-900);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.glossary-grid {
    margin-top: 1rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.7rem;
}

.glossary-term {
    border: 1px solid var(--chapter-line);
    border-radius: 12px;
    background: #ffffff;
    padding: 0.85rem;
}

.glossary-term h3 {
    color: var(--ink-900);
    font-size: 0.97rem;
}

.glossary-term p {
    margin-top: 0.45rem;
    font-size: 0.93rem;
}

/* ── Narrative prose ────────────────────── */

.chapter-narrative {
    margin-top: 0.9rem;
    color: var(--text-700);
    font-size: 0.96rem;
    line-height: 1.72;
    max-width: 72ch;
}

.chapter-narrative+.chapter-narrative {
    margin-top: 0.65rem;
}

.chapter-narrative strong {
    color: var(--text-900);
    font-weight: 600;
}

.chapter-panel h3:not(.framework-title) {
    margin-top: 1.4rem;
    font-size: 1.08rem;
    color: var(--ink-900);
    font-weight: 700;
    letter-spacing: 0.01em;
}

.chapter-panel h3:not(.framework-title)+.chapter-narrative {
    margin-top: 0.6rem;
}

/* ── Insight callout ───────────────────── */

.insight-block {
    margin-top: 1rem;
    border: 1px solid rgba(29, 46, 73, 0.14);
    border-left: 4px solid var(--ink-800);
    border-radius: 14px;
    background: #f8fbff;
    padding: 0.9rem;
}

.insight-block p {
    margin-top: 0;
    color: var(--text-900);
    font-size: 0.94rem;
    line-height: 1.65;
}

.insight-label {
    display: block;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    color: var(--ink-800);
    margin-bottom: 0.35rem;
}

/* ── Narrative list ────────────────────── */

.narrative-list {
    margin-top: 0.75rem;
    padding-left: 1.1rem;
    display: grid;
    gap: 0.4rem;
    color: var(--text-700);
    font-size: 0.94rem;
    line-height: 1.6;
}

.narrative-list li strong {
    color: var(--text-900);
}

/* ── Framework body narrative support ──── */

.framework-body .chapter-narrative {
    margin-top: 0.5rem;
}

.framework-body .chapter-narrative:first-child {
    margin-top: 0;
}

.framework-body .chapter-grid {
    margin-top: 0.85rem;
}

.framework-body h4 {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--ink-800);
}

/* ── Chapter overview panel ────────────── */

.chapter-overview {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.92), rgba(243, 247, 253, 0.95));
    border-color: rgba(29, 46, 73, 0.08);
}

.chapter-overview .chapter-narrative {
    font-size: 1.01rem;
    color: var(--text-900);
    line-height: 1.78;
}

.chapter-overview-hero {
    width: 100%;
    min-height: clamp(170px, 28vw, 260px);
    border-radius: 14px;
    margin: 0.7rem 0 1rem;
    border: 1px solid rgba(26, 33, 46, 0.12);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    box-shadow: 0 14px 26px rgba(16, 23, 35, 0.1);
}

.chapter-reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 360ms ease, transform 360ms ease;
}

.chapter-reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}


/* -------------------------------------------------------------------------
   Canonical Module Theme (CoworkingConsulting-Aligned)
   ------------------------------------------------------------------------- */
:root {
    --cc-navy: #02042d;
    --cc-charcoal: #1b1e23;
    --cc-gold: #d4b980;
    --cc-offwhite: #f7f7f5;
    --cc-white: #ffffff;
}

.chapter-main {
    background: linear-gradient(180deg, #fafaf8 0%, #f2f3f1 100%);
    border-top-color: rgba(2, 4, 45, 0.12);
}

.chapter-nav {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(2, 4, 45, 0.14);
    box-shadow: 0 10px 24px rgba(12, 18, 30, 0.06);
}

.chapter-link {
    color: #2f394a;
    border-radius: 6px;
}

.chapter-link.is-current,
.chapter-link:hover,
.chapter-link:focus-visible {
    border-color: rgba(2, 4, 45, 0.2);
    background: rgba(2, 4, 45, 0.05);
    color: #1f2736;
}

.chapter-panel {
    background: #ffffff;
    border-color: rgba(2, 4, 45, 0.12);
    box-shadow: 0 14px 30px rgba(13, 21, 32, 0.06);
}

.chapter-panel h2 {
    color: #1a2230;
}

.chapter-panel p {
    color: #4e5868;
}

.module-status-panel {
    border-color: rgba(2, 4, 45, 0.16);
    background: linear-gradient(165deg, #fafbfc 0%, #f2f4f7 100%);
}

.module-status-panel .status-control-bar {
    border-color: rgba(2, 4, 45, 0.16);
}

.module-hero-control {
    border-color: rgba(2, 4, 45, 0.16);
    background:
        radial-gradient(140% 200% at 0% -45%, rgba(255, 255, 255, 0.38), transparent 50%),
        linear-gradient(145deg, rgba(251, 252, 253, 0.95), rgba(243, 246, 250, 0.92));
}

.module-hero-control .kicker,
.module-hero-badges .status-control-label,
.module-hero-control .form-note {
    color: #5d6778;
}

.module-hero-generate-btn {
    background:
        radial-gradient(120% 170% at 10% -25%, rgba(255, 255, 255, 0.36), transparent 48%),
        linear-gradient(132deg, #dbc190 0%, #d4b980 56%, #b69456 100%);
    color: #11141f;
    border-color: rgba(176, 138, 65, 0.45);
    box-shadow:
        0 12px 26px rgba(112, 86, 38, 0.3),
        inset 0 1px 0 rgba(255, 251, 239, 0.62);
    border-radius: 6px;
}

.module-hero-generate-btn:hover,
.module-hero-generate-btn:focus-visible {
    box-shadow:
        0 16px 32px rgba(112, 86, 38, 0.34),
        inset 0 1px 0 rgba(255, 251, 239, 0.72);
}

.dm-header-meta {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.18rem 0.7rem;
    margin: 0.6rem 0 0;
    font-size: 0.86rem;
    color: #2c4a6f;
}

.dm-header-meta div {
    display: contents;
}

.dm-header-meta dt {
    font-weight: 600;
    color: #173b67;
    text-transform: uppercase;
    font-size: 0.7rem;
    letter-spacing: 0.05em;
    align-self: center;
}

.dm-header-meta dd {
    margin: 0;
}

.dm-section {
    margin-top: 0.95rem;
}

.dm-section h4 {
    margin: 0 0 0.5rem;
    color: #173b67;
    font-family: var(--font-display);
    font-size: 1.02rem;
    font-weight: 700;
}

.dm-section p {
    margin: 0.4rem 0 0;
    color: #2c4a6f;
    line-height: 1.6;
    font-size: 0.92rem;
}

.dm-section p:first-of-type {
    margin-top: 0;
}

.dm-context-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 0.32rem;
}

.dm-context-list li {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: 0.65rem;
    padding: 0.45rem 0.6rem;
    background: #f3f7fc;
    border-left: 3px solid #173b67;
    border-radius: 3px;
    font-size: 0.88rem;
}

.dm-context-label {
    font-weight: 600;
    color: #173b67;
}

.dm-context-value {
    color: #2c4a6f;
}

.dm-context-interp {
    margin: 0.7rem 0 0;
    font-style: italic;
    color: #2c4a6f;
    line-height: 1.55;
}

.dm-list {
    margin: 0.45rem 0 0;
    padding-left: 1.4rem;
    color: #2c4a6f;
    font-size: 0.92rem;
    line-height: 1.6;
}

.dm-list li {
    margin: 0.32rem 0;
}

.dm-list li::marker {
    color: #173b67;
}

.dm-list--ordered {
    padding-left: 1.55rem;
}

.dm-module-note {
    margin: 0;
    padding: 0.55rem 0.7rem;
    background: #f7f8fb;
    border-left: 3px solid #b8c5d8;
    font-size: 0.86rem;
    color: #4d6989;
    font-style: italic;
}

.dm-footer p {
    margin: 0.28rem 0 0;
    font-size: 0.8rem;
    color: #355377;
}

@media (max-width: 1100px) {
    .chapter-switcher {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        margin-top: -1.2rem;
    }

    .chapter-shell {
        grid-template-columns: 1fr;
    }

    .chapter-nav {
        position: static;
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.4rem;
    }

    .chapter-link {
        margin-top: 0;
    }
}

@media (max-width: 900px) {
    .chapter-switcher {
        width: min(1220px, calc(100% - 1.5rem));
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: -0.9rem;
    }

    .chapter-grid,
    .metric-strip,
    .related-grid,
    .definition-grid,
    .glossary-grid {
        grid-template-columns: 1fr;
    }

    .framework-item summary {
        grid-template-columns: auto 1fr;
    }

    .framework-state {
        grid-column: 1 / -1;
        margin-left: 2.55rem;
    }

    .chapter-panel {
        padding: 1rem;
    }
}

/* ── FAQ list ───────────────────────────────────────────────────────────── */
.faq-list {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.6rem;
}
.faq-list details {
    background: #fff;
    border: 1px solid var(--chapter-line);
    border-radius: 10px;
    padding: 0.85rem 1rem;
}
.faq-list summary {
    cursor: pointer;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink-900);
    list-style: none;
    position: relative;
    padding-right: 1.5rem;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
    content: "+";
    position: absolute;
    right: 0; top: 0;
    color: #566b88;
    font-weight: 700;
}
.faq-list details[open] summary::after { content: "−"; }
.faq-list p {
    margin: 0.65rem 0 0;
    color: #4a6182;
    font-size: 0.9rem;
    line-height: 1.6;
}

/* ══════════════════════════════════════════════════════════════════════════
   FLEX CONVERSION PLANNING GUIDE — Enhanced Components
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Chapter read indicator ─────────────────────────────────────────────── */
.chapter-read-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.85rem;
    background: #fff;
    border: 1px solid var(--chapter-line);
    border-radius: 10px;
    margin-bottom: 1.5rem;
}
.chapter-read-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d0d8e4;
    flex-shrink: 0;
    transition: background 0.3s ease;
}
.chapter-read-dot.is-read {
    background: #2a6a2d;
}
.chapter-read-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #8a96a6;
    transition: color 0.3s ease;
}
.chapter-read-dot.is-read + .chapter-read-label,
.chapter-read-indicator:has(.is-read) .chapter-read-label {
    color: #2a6a2d;
}

/* ── Chapter progress tracker (legacy — kept for potential future use) ───── */
.chapter-progress-track {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 1.75rem;
    background: #fff;
    border: 1px solid rgba(2, 4, 45, 0.1);
    border-radius: 12px;
    overflow: hidden;
}
.chapter-progress-step {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
    padding: 0.7rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    color: #8a96a6;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-right: 1px solid rgba(2, 4, 45, 0.08);
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    text-decoration: none;
}
.chapter-progress-step:last-child { border-right: none; }
.chapter-progress-step:hover { background: #f5f7fb; color: #3a4a60; }
.chapter-progress-step.is-active {
    background: #0f3d79;
    color: #fff;
}
.chapter-progress-step.is-done {
    background: #f0f6ee;
    color: #2d6a2d;
}
.chapter-progress-dot {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.6rem;
    flex-shrink: 0;
}
.chapter-progress-step.is-done .chapter-progress-dot::after {
    content: '✓';
    font-weight: 700;
}
.chapter-progress-step.is-active .chapter-progress-dot {
    background: rgba(255,255,255,0.25);
    border-color: rgba(255,255,255,0.7);
}
@media (max-width: 640px) {
    .chapter-progress-step span:not(.chapter-progress-dot) { display: none; }
    .chapter-progress-step { padding: 0.65rem 0.25rem; }
}

/* ── Stat callout ───────────────────────────────────────────────────────── */
.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1.25rem;
}
.stat-callout {
    background: #f5f8ff;
    border: 1px solid rgba(15, 61, 121, 0.14);
    border-radius: 12px;
    padding: 0.9rem 1rem;
}
.stat-callout-value {
    display: block;
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 700;
    font-family: var(--font-display);
    color: #0f3d79;
    line-height: 1;
}
.stat-callout-label {
    display: block;
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: #566b88;
    line-height: 1.35;
}
.stat-callout.is-warning {
    background: #fff9f0;
    border-color: rgba(200, 120, 20, 0.2);
}
.stat-callout.is-warning .stat-callout-value { color: #b06010; }

/* ── Data table ─────────────────────────────────────────────────────────── */
.guide-table-wrap {
    margin-top: 1.25rem;
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid rgba(2, 4, 45, 0.1);
}
.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    background: #fff;
}
.guide-table thead th {
    background: #0f3d79;
    color: #fff;
    font-weight: 700;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.65rem 0.9rem;
    text-align: left;
    white-space: nowrap;
}
.guide-table thead th:first-child { border-radius: 11px 0 0 0; }
.guide-table thead th:last-child  { border-radius: 0 11px 0 0; }
.guide-table tbody tr:nth-child(even) td { background: #f8fafd; }
.guide-table tbody td {
    padding: 0.6rem 0.9rem;
    border-bottom: 1px solid rgba(2, 4, 45, 0.07);
    color: #2c3a4f;
    vertical-align: top;
    line-height: 1.45;
}
.guide-table tbody tr:last-child td { border-bottom: none; }
.guide-table td strong { color: #0f3d79; font-weight: 600; }
.guide-table td .tag {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.tag-risk   { background: #fef0e6; color: #9a3d10; }
.tag-caution{ background: #fefbe6; color: #7a6010; }
.tag-ok     { background: #edf7ed; color: #2a6a2a; }

/* ── Checklist panel ────────────────────────────────────────────────────── */
.checklist-panel {
    margin-top: 1.25rem;
    display: grid;
    gap: 0.45rem;
}
.checklist-group-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #566b88;
    margin: 0.75rem 0 0.2rem;
}
.checklist-group-label:first-child { margin-top: 0; }
.checklist-item {
    display: grid;
    grid-template-columns: 22px 1fr;
    gap: 0.65rem;
    align-items: start;
    padding: 0.6rem 0.75rem;
    background: #fff;
    border: 1px solid rgba(2, 4, 45, 0.1);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.12s, background 0.12s;
    user-select: none;
}
.checklist-item:hover { border-color: rgba(15, 61, 121, 0.25); background: #f8faff; }
.checklist-item.is-checked {
    background: #f0f6ee;
    border-color: rgba(34, 130, 34, 0.25);
}
.checklist-item input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: #0f3d79;
    cursor: pointer;
    flex-shrink: 0;
    margin-top: 1px;
}
.checklist-item-body { min-width: 0; }
.checklist-item-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: #1a2230;
    display: block;
    line-height: 1.3;
}
.checklist-item.is-checked .checklist-item-title {
    color: #2d6a2d;
    text-decoration: line-through;
    text-decoration-color: rgba(34,130,34,0.4);
}
.checklist-item-note {
    display: block;
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: #566b88;
    line-height: 1.4;
}
.checklist-completion {
    margin-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
}
.checklist-completion-bar {
    flex: 1;
    height: 6px;
    background: rgba(2, 4, 45, 0.1);
    border-radius: 99px;
    overflow: hidden;
}
.checklist-completion-fill {
    height: 100%;
    background: #0f3d79;
    border-radius: 99px;
    transition: width 0.3s ease;
}
.checklist-completion-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #566b88;
    white-space: nowrap;
}

/* ── Next action panel ──────────────────────────────────────────────────── */
.next-action-panel {
    background: linear-gradient(135deg, #0b2d5e 0%, #0f3d79 100%);
    border-color: rgba(15, 61, 121, 0.3);
}
.next-action-panel .kicker { color: #f2b35c; }
.next-action-panel h2 { color: #fff; }
.next-action-panel p { color: rgba(255,255,255,0.78); }
.next-action-panel .btn { display: inline-block; }

/* ── Section label pill ─────────────────────────────────────────────────── */
.section-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.25rem 0.65rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 0.6rem;
}
.section-pill-overview  { background: #e8f0fe; color: #1a4fa0; border: 1px solid #c5d8f8; }
.section-pill-decisions { background: #fef3e8; color: #a04a10; border: 1px solid #f8d8b5; }
.section-pill-framework { background: #f0fce8; color: #2a6a10; border: 1px solid #c5e8b5; }
.section-pill-kpis      { background: #fef8e8; color: #7a6010; border: 1px solid #f0e0a0; }
.section-pill-faq       { background: #f0f0fe; color: #3a3a9a; border: 1px solid #c8c8f5; }
