/**
 * TB-500 mastery course styles
 *
 * extends the base learn page styles with course-specific theming,
 * paywall ui, loading states, and interactive visualization containers.
 * aligned to the shared mountain-meadow course palette.
 * uses tb5- prefix for all course-specific classes.
 */

/* ============================================================
   course header badge
   ============================================================ */

.tb5-course-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 14px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: lowercase;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.2), rgba(5, 150, 105, 0.12));
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(16, 185, 129, 0.3);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 2px 8px rgba(16, 185, 129, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.tb5-course-badge i {
    width: 14px;
    height: 14px;
}

/* ============================================================
   loading skeleton for paid content
   ============================================================ */

.tb5-loading {
    position: relative;
    min-height: 120px;
}

.tb5-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: linear-gradient(90deg,
            var(--color-bg-card, rgba(255, 255, 255, 0.03)) 25%,
            rgba(255, 255, 255, 0.06) 50%,
            var(--color-bg-card, rgba(255, 255, 255, 0.03)) 75%);
    background-size: 200% 100%;
    animation: tb5-shimmer 1.5s ease-in-out infinite;
}

@keyframes tb5-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* light mode loading skeleton */
[data-theme="light"] .tb5-loading::after {
    background: linear-gradient(90deg,
            rgba(0, 0, 0, 0.04) 25%,
            rgba(0, 0, 0, 0.08) 50%,
            rgba(0, 0, 0, 0.04) 75%);
    background-size: 200% 100%;
}

/* ============================================================
   paywall cta
   ============================================================ */

.tb5-paywall {
    text-align: center;
    padding: 48px 24px;
    border-radius: 16px;
    background: var(--color-bg-card, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.08));
    margin: 32px 0;
}

.tb5-paywall-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    margin-bottom: 16px;
}

.tb5-paywall-icon i {
    width: 28px;
    height: 28px;
    color: var(--meadow-400, #34d39e);
}

.tb5-paywall-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--color-text, #fff);
}

.tb5-paywall--cert {
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.3);
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.06);
}

.tb5-paywall-title--success {
    color: var(--color-primary, #34d39e);
}

.tb5-paywall-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    max-width: 480px;
    margin: 0 auto 24px;
}

.tb5-paywall-consent {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    max-width: 440px;
    margin: 0 auto 24px;
    font-size: 0.82rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    cursor: pointer;
}

.tb5-paywall-consent input[type="checkbox"] {
    margin-top: 3px;
    flex-shrink: 0;
    accent-color: var(--color-primary, #34d39e);
}

.tb5-paywall-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 360px;
    margin: 0 auto 16px;
}

.tb5-buy-btn {
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.tb5-buy-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.tb5-paywall-guarantee {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
}

.tb5-cert-form {
    display: flex;
    gap: 10px;
    max-width: 400px;
    margin: 0 auto;
}

.tb5-cert-input {
    flex: 1;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid var(--color-border, rgba(255, 255, 255, 0.1));
    background: var(--color-bg-card, rgba(255, 255, 255, 0.03));
    color: var(--color-text, #fff);
    font-size: 0.9rem;
}

/* ============================================================
   interactive visualization containers
   ============================================================ */

.tb5-interactive-wrap {
    margin: 24px 0;
    border-radius: 16px;
    overflow: hidden;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.06) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.04) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.12),
        inset 0 0 16px rgba(255, 255, 255, 0.02);
}

.tb5-interactive-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    color: var(--color-primary, #34d39e);
    border-bottom: 1px solid var(--color-border, rgba(255, 255, 255, 0.06));
}

.tb5-interactive-header i {
    width: 16px;
    height: 16px;
}

.tb5-interactive-body {
    padding: 20px;
    min-height: 300px;
}

.tb5-interactive-hint {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
    text-align: center;
    padding: 8px 16px 16px;
    margin: 0;
}

/* ============================================================
   data highlight cards (stat grid)
   ============================================================ */

.tb5-stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.tb5-stat-card {
    padding: 16px;
    border-radius: 12px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.07) 0%,
            rgba(255, 255, 255, 0.02) 50%,
            rgba(255, 255, 255, 0.05) 100%);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.25),
        inset 0 1px 0 rgba(255, 255, 255, 0.15),
        inset 0 0 12px rgba(255, 255, 255, 0.02);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tb5-stat-card:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.35),
        inset 0 1px 0 rgba(255, 255, 255, 0.2),
        inset 0 0 16px rgba(255, 255, 255, 0.03);
}

.tb5-stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary, #34d39e);
    margin-bottom: 4px;
}

.tb5-stat-label {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
}

/* ============================================================
   evidence tier badges
   ============================================================ */

.tb5-evidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.03em;
}

.tb5-evidence-badge--animal {
    background: rgba(var(--meadow-400-rgb, 52, 211, 158), 0.12);
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(var(--meadow-400-rgb, 52, 211, 158), 0.22);
}

.tb5-evidence-badge--invitro {
    background: rgba(var(--meadow-300-rgb, 110, 231, 191), 0.14);
    color: var(--meadow-200, #a7f3da);
    border: 1px solid rgba(var(--meadow-300-rgb, 110, 231, 191), 0.24);
}

.tb5-evidence-badge--human {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.14);
    color: var(--meadow-300, #6ee7bf);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.24);
}

/* ============================================================
   timeline explorer (unit 1)
   ============================================================ */

.tb5-timeline {
    padding: 8px 0;
}

.tb5-timeline-track {
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
    padding-left: 24px;
}

.tb5-timeline-track::before {
    content: '';
    position: absolute;
    left: 10px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.2);
}

.tb5-timeline-node {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: none;
    border: 1px solid transparent;
    border-radius: 10px;
    cursor: pointer;
    text-align: left;
    color: var(--color-text, #fff);
    font-size: 0.85rem;
    transition: background 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.tb5-timeline-node:hover {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.06);
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.15);
}

.tb5-timeline-node.active {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.1);
    border-color: var(--meadow-500, #10b981);
}

.tb5-timeline-dot {
    position: absolute;
    left: -20px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--meadow-500, #10b981);
    border: 2px solid var(--color-bg, #0a0a0a);
    flex-shrink: 0;
}

.tb5-timeline-node.active .tb5-timeline-dot {
    box-shadow: 0 0 8px rgba(16, 185, 129, 0.5);
}

.tb5-timeline-year {
    font-weight: 700;
    color: var(--meadow-400, #34d39e);
    min-width: 40px;
    font-size: 0.82rem;
}

.tb5-timeline-title {
    color: var(--color-text, #fff);
}

.tb5-timeline-detail {
    margin-top: 16px;
    min-height: 60px;
}

.tb5-timeline-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-left: 3px solid var(--meadow-500, #10b981);
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-timeline-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   structure viewer (unit 2)
   ============================================================ */

.tb5-structure-detail {
    margin-top: 12px;
}

.tb5-structure-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-structure-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   actin dynamics slider (unit 3)
   ============================================================ */

.tb5-actin-wrap {
    padding: 8px 0;
}

.tb5-actin-header {
    display: flex;
    justify-content: space-between;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text, #fff);
    margin-bottom: 8px;
}

.tb5-actin-bar-container {
    margin-bottom: 20px;
}

.tb5-actin-bar {
    display: flex;
    height: 40px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.tb5-actin-g {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.3), rgba(16, 185, 129, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    min-width: 40px;
}

.tb5-actin-f {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.3), rgba(139, 92, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    transition: width 0.3s ease;
    min-width: 40px;
}

.tb5-actin-pct {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--color-text, #fff);
}

.tb5-actin-slider-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.tb5-actin-slider-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text, #fff);
    white-space: nowrap;
}

.tb5-actin-slider {
    flex: 1;
    accent-color: var(--meadow-500, #10b981);
    height: 6px;
}

.tb5-actin-level {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--meadow-400, #34d39e);
    min-width: 60px;
    text-align: right;
}

.tb5-actin-explanation {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
}

.tb5-actin-explanation p {
    margin: 0;
}

/* ============================================================
   migration pathway (unit 4)
   ============================================================ */

.tb5-pathway {
    padding: 8px 0;
}

.tb5-pathway-steps {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 20px;
}

.tb5-pathway-step {
    padding: 10px 14px;
    border-radius: 10px;
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.08);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.2);
    color: var(--color-text, #fff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.tb5-pathway-step:hover {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.15);
    transform: translateY(-1px);
}

.tb5-pathway-step.active {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.2);
    border-color: var(--meadow-500, #10b981);
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.2);
}

.tb5-pathway-arrow {
    color: var(--meadow-500, #10b981);
    font-size: 1.2rem;
    opacity: 0.6;
}

.tb5-pathway-step-name {
    white-space: nowrap;
}

.tb5-pathway-detail {
    min-height: 60px;
}

.tb5-pathway-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-left: 3px solid var(--meadow-500, #10b981);
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-pathway-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   inflammation map (unit 5)
   ============================================================ */

.tb5-inflammation {
    padding: 8px 0;
}

.tb5-inflammation-cascade {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    margin-bottom: 20px;
}

.tb5-inflammation-node {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 12px 20px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--color-text, #fff);
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease;
    min-width: 220px;
    text-align: center;
}

.tb5-inflammation-node:hover {
    background: rgba(255, 255, 255, 0.07);
}

.tb5-inflammation-node.active {
    border-color: var(--meadow-500, #10b981);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.1);
}

.tb5-inflammation-node--inhibited {
    border-color: rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.06);
}

.tb5-inflammation-node--inhibited.active {
    border-color: var(--meadow-500, #10b981);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.1);
}

.tb5-inflammation-block {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: lowercase;
    color: var(--meadow-400, #34d39e);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.12);
    padding: 1px 8px;
    border-radius: 100px;
}

.tb5-inflammation-node-name {
    color: var(--color-text, #fff);
}

.tb5-inflammation-arrow {
    color: var(--color-muted, rgba(255, 255, 255, 0.3));
    font-size: 1.1rem;
}

.tb5-inflammation-detail {
    min-height: 60px;
}

.tb5-inflammation-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-left: 3px solid var(--meadow-500, #10b981);
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-inflammation-role {
    font-weight: 400;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
}

.tb5-inflammation-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   evidence dashboard (unit 6)
   ============================================================ */

.tb5-evidence-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.tb5-evidence-card {
    padding: 14px;
    border-radius: 12px;
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.02) 100%);
    border: 1px solid rgba(255, 255, 255, 0.08);
    transition: transform 0.2s ease, border-color 0.2s ease;
}

.tb5-evidence-card:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.3);
}

.tb5-evidence-card-header {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.tb5-evidence-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text, #fff);
}

.tb5-evidence-summary {
    font-size: 0.78rem;
    line-height: 1.55;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    margin: 0;
}

.tb5-evidence-legend {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============================================================
   organ map (unit 7)
   ============================================================ */

.tb5-organ-detail {
    margin-top: 12px;
}

.tb5-organ-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-organ-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   trial pipeline (unit 8)
   ============================================================ */

.tb5-pipeline {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 16px;
}

.tb5-pipeline-phase {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tb5-pipeline-phase-header {
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: lowercase;
    color: var(--color-text, #fff);
    padding: 4px 12px;
}

.tb5-pipeline-trials {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding-left: 16px;
}

.tb5-pipeline-trial {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    cursor: pointer;
    color: var(--color-text, #fff);
    font-size: 0.82rem;
    text-align: left;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tb5-pipeline-trial:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tb5-pipeline-trial.active {
    border-color: var(--meadow-500, #10b981);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.08);
}

.tb5-pipeline-trial-name {
    font-weight: 600;
}

.tb5-pipeline-status {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 100px;
    text-transform: lowercase;
}

.tb5-pipeline-status--active {
    background: rgba(16, 185, 129, 0.12);
    color: var(--meadow-300, #6ee7bf);
}

.tb5-pipeline-status--completed {
    background: rgba(139, 92, 246, 0.12);
    color: #c4b5fd;
}

.tb5-pipeline-status--recruiting {
    background: rgba(6, 182, 212, 0.12);
    color: #67e8f9;
}

.tb5-pipeline-status--planned {
    background: rgba(245, 158, 11, 0.12);
    color: #fcd34d;
}

.tb5-pipeline-detail {
    min-height: 60px;
}

.tb5-pipeline-detail-header {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    padding: 8px 12px;
    border-left: 3px solid var(--meadow-500, #10b981);
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-pipeline-detail-sponsor {
    font-size: 0.78rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
    padding: 0 12px;
    margin: 0 0 6px;
}

.tb5-pipeline-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   dosing calculator (unit 9)
   ============================================================ */

.tb5-calc {
    padding: 8px 0;
}

.tb5-calc-disclaimer {
    font-size: 0.72rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.35));
    text-align: center;
    margin: 0 0 16px;
    font-style: italic;
}

.tb5-calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}

.tb5-calc-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tb5-calc-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--color-text, #fff);
}

.tb5-calc-input {
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.04);
    color: var(--color-text, #fff);
    font-size: 0.85rem;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.tb5-calc-input:focus {
    outline: none;
    border-color: var(--meadow-500, #10b981);
}

.tb5-calc-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 12px;
    margin-bottom: 16px;
}

.tb5-calc-explanation {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    padding: 12px;
    border-radius: 8px;
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.05);
    border: 1px solid rgba(var(--meadow-500-rgb, 16, 185, 129), 0.1);
}

.tb5-calc-explanation p {
    margin: 0;
}

/* ============================================================
   safety matrix (unit 10)
   ============================================================ */

.tb5-safety {
    padding: 8px 0;
}

.tb5-safety-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 8px;
    margin-bottom: 16px;
}

.tb5-safety-cell {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-align: left;
    color: var(--color-text, #fff);
    transition: background 0.2s ease, border-color 0.2s ease;
}

.tb5-safety-cell:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tb5-safety-cell.active {
    border-color: var(--meadow-500, #10b981);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.08);
}

.tb5-safety-name {
    font-size: 0.82rem;
    font-weight: 600;
}

.tb5-safety-tags {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.tb5-safety-severity {
    font-size: 0.68rem;
    font-weight: 600;
}

.tb5-safety-evidence {
    font-size: 0.68rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
}

.tb5-safety-detail {
    min-height: 60px;
}

.tb5-safety-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-safety-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

.tb5-safety-legend {
    display: flex;
    gap: 16px;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================================
   regulatory comparison (unit 11)
   ============================================================ */

.tb5-reg-table-wrap {
    overflow-x: auto;
    margin-bottom: 16px;
    -webkit-overflow-scrolling: touch;
}

.tb5-reg-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.78rem;
}

.tb5-reg-table th {
    padding: 10px 12px;
    text-align: left;
    font-weight: 600;
    font-size: 0.72rem;
    text-transform: lowercase;
    letter-spacing: 0.04em;
    color: var(--color-muted, rgba(255, 255, 255, 0.5));
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    white-space: nowrap;
}

.tb5-reg-table td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--color-text, #fff);
    white-space: nowrap;
}

.tb5-reg-table tbody tr {
    transition: background 0.2s ease;
}

.tb5-reg-table tbody tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.tb5-reg-highlight {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.06);
}

.tb5-reg-highlight:hover {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.1) !important;
}

.tb5-reg-name {
    font-weight: 700;
    color: var(--meadow-400, #34d39e);
}

/* mobile stacked cards (hidden on desktop, shown on mobile) */
.tb5-reg-cards {
    display: none;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.tb5-reg-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    text-align: left;
    color: var(--color-text, #fff);
    transition: background 0.2s ease;
}

.tb5-reg-card:hover {
    background: rgba(255, 255, 255, 0.06);
}

.tb5-reg-card--highlight {
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.3);
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.06);
}

.tb5-reg-card-name {
    font-size: 0.85rem;
    font-weight: 700;
}

.tb5-reg-card-category {
    font-size: 0.72rem;
    color: var(--color-muted, rgba(255, 255, 255, 0.4));
}

.tb5-reg-detail {
    min-height: 60px;
}

.tb5-reg-detail-header {
    font-size: 0.9rem;
    padding: 8px 12px;
    border-left: 3px solid var(--meadow-500, #10b981);
    margin-bottom: 8px;
    color: var(--color-text, #fff);
}

.tb5-reg-detail-text {
    font-size: 0.85rem;
    line-height: 1.65;
    color: var(--color-muted, rgba(255, 255, 255, 0.6));
    padding: 0 12px;
    margin: 0;
}

/* ============================================================
   light mode overrides
   ============================================================ */

[data-theme="light"] .tb5-course-badge {
    box-shadow:
        0 2px 8px rgba(16, 185, 129, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

[data-theme="light"] .tb5-interactive-wrap {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.01) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .tb5-interactive-header {
    border-bottom-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tb5-stat-card {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.03) 0%,
            rgba(0, 0, 0, 0.01) 50%,
            rgba(0, 0, 0, 0.02) 100%);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow:
        0 4px 16px rgba(0, 0, 0, 0.06),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

[data-theme="light"] .tb5-stat-card:hover {
    box-shadow:
        0 8px 24px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

[data-theme="light"] .tb5-timeline-node:hover {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.08);
}

[data-theme="light"] .tb5-timeline-node.active {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.12);
}

[data-theme="light"] .tb5-timeline-dot {
    border-color: var(--color-bg, #fff);
}

[data-theme="light"] .tb5-actin-bar {
    border-color: rgba(0, 0, 0, 0.1);
}

[data-theme="light"] .tb5-pathway-step {
    background: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.06);
    border-color: rgba(var(--meadow-500-rgb, 16, 185, 129), 0.15);
}

[data-theme="light"] .tb5-inflammation-node {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tb5-inflammation-node--inhibited {
    background: rgba(239, 68, 68, 0.04);
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="light"] .tb5-evidence-card {
    background: linear-gradient(135deg,
            rgba(0, 0, 0, 0.02) 0%,
            rgba(0, 0, 0, 0.01) 100%);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tb5-pipeline-trial {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tb5-calc-input {
    background: rgba(0, 0, 0, 0.03);
    border-color: rgba(0, 0, 0, 0.12);
    color: var(--color-text, #111);
}

[data-theme="light"] .tb5-safety-cell {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .tb5-reg-table th {
    border-bottom-color: rgba(0, 0, 0, 0.12);
}

[data-theme="light"] .tb5-reg-table td {
    border-bottom-color: rgba(0, 0, 0, 0.06);
}

[data-theme="light"] .tb5-reg-table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

[data-theme="light"] .tb5-reg-card {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.08);
}

/* ============================================================
   responsive
   ============================================================ */

@media (max-width: 768px) {
    .tb5-pathway-steps {
        gap: 6px;
    }

    .tb5-pathway-step {
        padding: 8px 10px;
        font-size: 0.75rem;
    }

    .tb5-pathway-arrow {
        font-size: 1rem;
    }

    .tb5-inflammation-node {
        min-width: 180px;
        padding: 10px 14px;
    }

    .tb5-reg-table-wrap {
        display: none;
    }

    .tb5-reg-cards {
        display: flex;
    }
}

@media (max-width: 640px) {
    .tb5-paywall {
        padding: 32px 16px;
    }

    .tb5-paywall-title {
        font-size: 1.1rem;
    }

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

    .tb5-interactive-body {
        padding: 12px;
        min-height: 240px;
    }

    .tb5-evidence-grid {
        grid-template-columns: 1fr;
    }

    .tb5-safety-grid {
        grid-template-columns: 1fr;
    }

    .tb5-calc-grid {
        grid-template-columns: 1fr;
    }

    .tb5-calc-results {
        grid-template-columns: repeat(2, 1fr);
    }

    .tb5-actin-slider-row {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .tb5-actin-level {
        text-align: left;
    }
}

@media (max-width: 600px) {
    .tb5-pathway-steps {
        flex-direction: column;
        align-items: stretch;
    }

    .tb5-pathway-arrow {
        transform: rotate(90deg);
        text-align: center;
    }

    .tb5-inflammation-node {
        min-width: auto;
        width: 100%;
    }
}

/* ============================================================
   prefers-reduced-motion
   ============================================================ */

@media (prefers-reduced-motion: reduce) {
    .tb5-loading::after {
        animation: none;
    }

    .tb5-stat-card {
        transition: none;
    }

    .tb5-evidence-card {
        transition: none;
    }

    .tb5-pathway-step {
        transition: none;
    }

    .tb5-timeline-node {
        transition: none;
    }

    .tb5-inflammation-node {
        transition: none;
    }

    .tb5-pipeline-trial {
        transition: none;
    }

    .tb5-safety-cell {
        transition: none;
    }
}
