/* ==========================================================================
   Bounce USA SOP — Main Stylesheet
   Light/Dark Theme with Brand Colors
   ========================================================================== */

/* ---------- CSS Variables — Light Mode (default) ---------- */
:root {
    --bg: #F8F9FC;
    --surface: #FFFFFF;
    --surface-2: #EEF0F6;
    --border: #D8DBE5;
    --text: #1A1A2E;
    --text-dim: #6B7084;
    --accent: #1e17be;
    --accent-glow: rgba(30,23,190,0.10);
    --accent-hover: #1610a0;
    --red: #ff0909;
    --sky: #00b9ff;
    --blue: #1e17be;
    --green: #0D9F6E;
    --yellow: #D97706;
    --purple: #7C3AED;
    --orange: #EA580C;
    --pink: #DB2777;
    --teal: #0D9488;

    /* Composite / semi-transparent */
    --header-bg: rgba(248, 249, 252, 0.85);
    --mobile-overlay-bg: rgba(248, 249, 252, 0.98);
    --shadow-color: rgba(0, 0, 0, 0.08);
    --shadow-heavy: rgba(0, 0, 0, 0.12);
    --blob-1: rgba(30, 23, 190, 0.05);
    --blob-2: rgba(0, 185, 255, 0.04);
    --callout-critical-bg: rgba(255, 9, 9, 0.06);
    --callout-warning-bg: rgba(217, 119, 6, 0.06);
    --callout-info-bg: rgba(30, 23, 190, 0.06);
    --callout-success-bg: rgba(13, 159, 110, 0.06);
    --severity-standard-bg: rgba(30, 23, 190, 0.10);
    --severity-important-bg: rgba(217, 119, 6, 0.10);
    --severity-critical-bg: rgba(255, 9, 9, 0.10);
    --severity-nn-bg: rgba(255, 9, 9, 0.12);
    --severity-nn-border: rgba(255, 9, 9, 0.25);
    --severity-absolute-bg: rgba(255, 9, 9, 0.15);
    --role-badge-bg: rgba(107, 112, 132, 0.08);
    --role-badge-border: rgba(107, 112, 132, 0.15);

    --hero-bg: #1e17be;
    --hero-text: #ffffff;
    --cta-bg: #ff0909;
    --cta-hover: #d90000;

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;
    --font-primary: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-display: 'Instrument Serif', Georgia, 'Times New Roman', serif;
    --transition: 0.2s ease;
}

/* ---------- CSS Variables — Dark Mode ---------- */
[data-theme="dark"] {
    --bg: #0B0D1A;
    --surface: #141627;
    --surface-2: #1C1F35;
    --border: #2A2D45;
    --text: #E8E9F0;
    --text-dim: #8B8FA8;
    --accent: #4F47E5;
    --accent-glow: rgba(79,71,229,0.15);
    --accent-hover: #3D36C9;
    --red: #FF4040;
    --sky: #38CBFF;
    --blue: #4F47E5;
    --green: #3ECF8E;
    --yellow: #FFD166;
    --purple: #A78BFA;
    --orange: #FF8C42;
    --pink: #F472B6;
    --teal: #2DD4BF;

    --hero-bg: #1a1466;
    --hero-text: #ffffff;
    --cta-bg: #ff4040;
    --cta-hover: #e63636;

    --header-bg: rgba(11, 13, 26, 0.85);
    --mobile-overlay-bg: rgba(11, 13, 26, 0.95);
    --shadow-color: rgba(0, 0, 0, 0.3);
    --shadow-heavy: rgba(0, 0, 0, 0.4);
    --blob-1: rgba(79, 71, 229, 0.08);
    --blob-2: rgba(56, 203, 255, 0.06);
    --callout-critical-bg: rgba(255, 64, 64, 0.08);
    --callout-warning-bg: rgba(255, 209, 102, 0.08);
    --callout-info-bg: rgba(79, 71, 229, 0.08);
    --callout-success-bg: rgba(62, 207, 142, 0.08);
    --severity-standard-bg: rgba(79, 71, 229, 0.15);
    --severity-important-bg: rgba(255, 209, 102, 0.15);
    --severity-critical-bg: rgba(255, 64, 64, 0.15);
    --severity-nn-bg: rgba(255, 64, 64, 0.20);
    --severity-nn-border: rgba(255, 64, 64, 0.30);
    --severity-absolute-bg: rgba(255, 64, 64, 0.25);
    --role-badge-bg: rgba(139, 143, 168, 0.10);
    --role-badge-border: rgba(139, 143, 168, 0.20);
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-primary);
    font-weight: 400;
    font-size: 16px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    min-height: 100vh;
}

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

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ---------- Layout ---------- */
.busa-container {
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
}

.busa-container--narrow {
    max-width: 860px;
}

.busa-main {
    position: relative;
    min-height: calc(100vh - 160px);
    padding-bottom: 80px;
}

/* ---------- Background Blobs ---------- */
.busa-bg-blobs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.busa-bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.4;
}

.busa-bg-blob--1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--blob-1) 0%, transparent 70%);
    top: -200px;
    right: -200px;
}

.busa-bg-blob--2 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--blob-2) 0%, transparent 70%);
    bottom: -100px;
    left: -200px;
}

/* ---------- Header ---------- */
.busa-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
    height: 64px;
}

.busa-header__inner {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    height: 100%;
    gap: 24px;
}

.busa-header__logo {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.busa-header__logo-img {
    height: 40px;
    width: auto;
    flex-shrink: 0;
}

.busa-header__logo-mark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--accent);
    color: #fff;
    font-weight: 800;
    font-size: 16px;
    border-radius: 6px;
}

.busa-header__logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.busa-header__logo-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--text);
}

.busa-header__logo-sub {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 400;
}

/* Search */
.busa-header__search {
    flex: 1;
    max-width: 480px;
    margin: 0 auto;
}

.busa-search-wrapper {
    position: relative;
}

.busa-search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-dim);
    pointer-events: none;
}

.busa-search-input {
    width: 100%;
    height: 40px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 0 80px 0 38px;
    color: var(--text);
    font-family: var(--font-primary);
    font-size: 14px;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
}

.busa-search-input::placeholder {
    color: var(--text-dim);
}

.busa-search-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.busa-search-kbd {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 4px;
    padding: 2px 6px;
    font-size: 11px;
    color: var(--text-dim);
    font-family: var(--font-primary);
    pointer-events: none;
}

/* Search Results Dropdown */
.busa-search-results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 200;
    box-shadow: 0 16px 48px var(--shadow-heavy);
}

.busa-search-results.active {
    display: block;
}

.busa-search-results__group {
    padding: 8px 0;
}

.busa-search-results__group + .busa-search-results__group {
    border-top: 1px solid var(--border);
}

.busa-search-results__label {
    padding: 4px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
}

.busa-search-results__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    cursor: pointer;
    transition: background var(--transition);
}

.busa-search-results__item:hover,
.busa-search-results__item.focused {
    background: var(--surface-2);
}

.busa-search-results__item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
}

.busa-search-results__item-meta {
    font-size: 12px;
    color: var(--text-dim);
}

.busa-search-results__empty {
    padding: 20px 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 14px;
}

/* Mobile toggle */
.busa-header__mobile-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.busa-header__mobile-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text);
    transition: var(--transition);
}

/* Header CTA */
.busa-header__cta {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    background: var(--cta-bg);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 13px;
    font-weight: 600;
    border-radius: 100px;
    white-space: nowrap;
    transition: background var(--transition), transform var(--transition);
    flex-shrink: 0;
}
.busa-header__cta:hover {
    background: var(--cta-hover);
    transform: translateY(-1px);
}

/* Avatar */
.busa-header__avatar {
    flex-shrink: 0;
}

.busa-avatar-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--surface-2);
    border: 1px solid var(--border);
    font-size: 12px;
    font-weight: 600;
    color: var(--text-dim);
}

/* ---------- Hero ---------- */
.busa-hero {
    position: relative;
    z-index: 1;
    padding: 48px 0 40px;
}

.busa-hero__banner {
    background: var(--hero-bg);
    border-radius: var(--radius-lg);
    padding: 56px 48px 48px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.busa-hero__title {
    font-family: var(--font-primary);
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.2;
    color: var(--hero-text);
    max-width: 700px;
    margin: 0 auto 16px;
}

.busa-hero__title em {
    color: var(--sky);
    font-style: italic;
}

.busa-hero__subtitle {
    font-size: clamp(0.95rem, 1.8vw, 1.1rem);
    color: rgba(255, 255, 255, 0.8);
    max-width: 540px;
    margin: 0 auto 28px;
    line-height: 1.6;
}

/* Hero Stats (inline) */
.busa-hero__stats {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0;
}

.busa-hero__stat {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
}

.busa-hero__stat + .busa-hero__stat {
    border-left: 1px solid rgba(255, 255, 255, 0.2);
}

.busa-hero__stat-value {
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--hero-text);
}

.busa-hero__stat-label {
    font-weight: 400;
    opacity: 0.8;
}

/* ---------- Role Filter ---------- */
.busa-role-filter {
    position: relative;
    z-index: 1;
    padding: 0 0 32px;
}

.busa-role-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.busa-role-pill {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    border-radius: 100px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-dim);
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
}

.busa-role-pill:hover {
    border-color: var(--text-dim);
    color: var(--text);
}

.busa-role-pill--active,
.busa-role-pill.active {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.busa-role-pill--active:hover,
.busa-role-pill.active:hover {
    background: var(--red);
    border-color: var(--red);
}

/* ---------- Feature Cards ---------- */
.busa-features {
    position: relative;
    z-index: 1;
    padding: 0 0 48px;
}

.busa-features__grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.busa-feature-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.busa-feature-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 32px var(--shadow-color);
    border-color: var(--accent);
}

.busa-feature-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: var(--accent-glow);
    color: var(--accent);
    flex-shrink: 0;
    font-size: 22px;
}

.busa-feature-card__body {
    flex: 1;
    min-width: 0;
}

.busa-feature-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
}

.busa-feature-card__desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.busa-feature-card__link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cta-bg);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: gap var(--transition);
}

.busa-feature-card:hover .busa-feature-card__link {
    gap: 8px;
}

/* ---------- Department Cards Grid ---------- */
.busa-departments {
    position: relative;
    z-index: 1;
}

.busa-departments__heading {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 24px;
}

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

.busa-dept-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px 24px;
    transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.busa-dept-card:hover {
    transform: translateY(-2px);
    border-color: var(--dept-color, var(--accent));
    box-shadow: 0 8px 32px var(--shadow-color);
}

.busa-dept-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    border: 2px solid var(--dept-color, var(--accent));
    font-size: 24px;
    line-height: 1;
    flex-shrink: 0;
    background: var(--surface);
}

.busa-dept-card__body {
    flex: 1;
    min-width: 0;
}

.busa-dept-card__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 4px;
    line-height: 1.3;
}

.busa-dept-card__desc {
    font-size: 13px;
    color: var(--text-dim);
    line-height: 1.5;
}

.busa-dept-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--cta-bg);
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    transition: gap var(--transition);
}

.busa-dept-card:hover .busa-dept-card__cta {
    gap: 8px;
}

/* ---------- Breadcrumb ---------- */
.busa-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-dim);
    margin-bottom: 24px;
    padding-top: 32px;
}

.busa-breadcrumb a {
    color: var(--text-dim);
    transition: color var(--transition);
}

.busa-breadcrumb a:hover {
    color: var(--accent);
}

.busa-breadcrumb__sep {
    opacity: 0.4;
}

.busa-breadcrumb__current {
    color: var(--text);
    font-weight: 500;
}

/* ---------- Department Header ---------- */
.busa-dept-header {
    position: relative;
    z-index: 1;
    padding-bottom: 40px;
}

.busa-dept-header__badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 100px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-dim);
    margin-bottom: 16px;
}

.busa-dept-header__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 400;
    color: var(--text);
    margin-bottom: 24px;
    line-height: 1.15;
}

.busa-dept-header__purpose {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px;
    margin-bottom: 24px;
}

.busa-dept-header__purpose h3 {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 8px;
}

.busa-dept-header__purpose p {
    color: var(--text);
    line-height: 1.7;
}

.busa-dept-header__roles {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.busa-dept-header__roles-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.busa-role-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 500;
    background: var(--role-badge-bg);
    border: 1px solid var(--role-badge-border);
    color: var(--role-color, var(--text-dim));
}

/* ---------- Section Title ---------- */
.busa-section-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 24px;
    padding-top: 16px;
}

/* ---------- SOP List ---------- */
.busa-sop-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.busa-sop-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), background var(--transition);
}

.busa-sop-item:hover {
    border-color: var(--text-dim);
    background: var(--surface-2);
}

.busa-sop-item__left {
    display: flex;
    align-items: center;
    gap: 16px;
    min-width: 0;
}

.busa-sop-item__number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 48px;
    height: 32px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    flex-shrink: 0;
}

.busa-sop-item__info {
    min-width: 0;
}

.busa-sop-item__title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text);
    margin: 0;
}

.busa-sop-item__roles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.busa-sop-item__role-tag {
    font-size: 11px;
    color: var(--text-dim);
    background: var(--surface-2);
    padding: 1px 8px;
    border-radius: 4px;
}

.busa-sop-item__dept {
    font-size: 12px;
    color: var(--text-dim);
}

.busa-sop-item__right {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.busa-sop-item__arrow {
    font-size: 16px;
    color: var(--text-dim);
    transition: transform var(--transition), color var(--transition);
}

.busa-sop-item:hover .busa-sop-item__arrow {
    transform: translateX(4px);
    color: var(--red);
}

/* ---------- Severity Badges ---------- */
.busa-severity-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.busa-severity-badge--standard {
    background: var(--severity-standard-bg);
    color: var(--blue);
}

.busa-severity-badge--important {
    background: var(--severity-important-bg);
    color: var(--yellow);
}

.busa-severity-badge--critical {
    background: var(--severity-critical-bg);
    color: var(--red);
}

.busa-severity-badge--non-negotiable {
    background: var(--severity-nn-bg);
    color: var(--red);
    border: 1px solid var(--severity-nn-border);
}

.busa-severity-badge--absolute {
    background: var(--severity-absolute-bg);
    color: var(--red);
    border: 2px solid var(--red);
    font-weight: 700;
}

/* ---------- Single SOP Layout ---------- */
.busa-sop-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: start;
    position: relative;
    z-index: 1;
}

.busa-sop-content {
    min-width: 0;
}

.busa-sop-header {
    margin-bottom: 32px;
    padding-bottom: 0;
}

.busa-sop-header__meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

.busa-sop-header__number {
    font-size: 13px;
    font-weight: 600;
    color: var(--dept-color, var(--accent));
    background: var(--accent-glow);
    padding: 4px 10px;
    border-radius: 6px;
}

.busa-sop-header__title {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 400;
    color: var(--text);
    margin-bottom: 16px;
    line-height: 1.2;
}

.busa-sop-header__details {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.busa-sop-header__roles {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}

.busa-sop-header__roles-label {
    font-size: 13px;
    color: var(--text-dim);
    font-weight: 500;
}

.busa-sop-header__dept-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: var(--text-dim);
    transition: color var(--transition);
}

.busa-sop-header__dept-link:hover {
    color: var(--accent);
}

/* ---------- Sidebar / TOC ---------- */
.busa-sop-sidebar {
    position: relative;
}

.busa-sidebar-sticky {
    position: sticky;
    top: 88px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: var(--border) transparent;
}

.busa-toc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-bottom: 16px;
}

.busa-toc__title {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-dim);
    margin-bottom: 12px;
}

.busa-toc__nav a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: var(--text-dim);
    transition: color var(--transition);
    border-left: 2px solid transparent;
    padding-left: 12px;
}

.busa-toc__nav a:hover,
.busa-toc__nav a.active {
    color: var(--accent);
    border-left-color: var(--accent);
}

.busa-toc__nav a.busa-toc--h3 {
    padding-left: 24px;
    font-size: 12px;
}

.busa-sidebar-back {
    display: block;
    padding: 12px 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    font-size: 14px;
    color: var(--text-dim);
    transition: color var(--transition), border-color var(--transition);
}

.busa-sidebar-back:hover {
    color: var(--accent);
    border-color: var(--accent);
}

/* ---------- Content Block (Gutenberg output) ---------- */
.busa-content-block {
    color: var(--text);
    line-height: 1.7;
    position: relative;
    z-index: 1;
}

.busa-content-block h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 40px 0 16px;
    color: var(--text);
    scroll-margin-top: 80px;
}

.busa-content-block h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 32px 0 12px;
    color: var(--text);
    scroll-margin-top: 80px;
}

.busa-content-block h4 {
    font-size: 1rem;
    font-weight: 600;
    margin: 24px 0 8px;
    color: var(--text);
}

.busa-content-block p {
    margin-bottom: 16px;
}

.busa-content-block ul,
.busa-content-block ol {
    margin: 0 0 16px 24px;
}

.busa-content-block li {
    margin-bottom: 6px;
}

.busa-content-block li::marker {
    color: var(--accent);
}

.busa-content-block strong {
    font-weight: 600;
    color: var(--text);
}

.busa-content-block blockquote {
    border-left: 3px solid var(--accent);
    padding: 12px 20px;
    margin: 16px 0;
    background: var(--surface);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    color: var(--text-dim);
}

.busa-content-block table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.busa-content-block th,
.busa-content-block td {
    padding: 10px 14px;
    border: 1px solid var(--border);
    text-align: left;
}

.busa-content-block th {
    background: var(--surface-2);
    font-weight: 600;
}

.busa-content-block td {
    background: var(--surface);
}

.busa-content-block code {
    background: var(--surface-2);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.9em;
}

.busa-content-block pre {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 16px;
    overflow-x: auto;
    margin: 16px 0;
}

.busa-content-block a {
    color: var(--blue);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.busa-content-block a:hover {
    color: var(--accent);
}

/* ---------- Callout Blocks ---------- */
.busa-callout,
.wp-block-group.callout-critical,
.wp-block-group.callout-warning,
.wp-block-group.callout-info,
.wp-block-group.callout-success {
    padding: 20px 24px;
    margin: 20px 0;
    border-radius: var(--radius-sm);
    border-left: 4px solid;
}

.busa-callout--critical,
.wp-block-group.callout-critical {
    border-left-color: var(--red);
    background: var(--callout-critical-bg);
}

.busa-callout--warning,
.wp-block-group.callout-warning {
    border-left-color: var(--yellow);
    background: var(--callout-warning-bg);
}

.busa-callout--info,
.wp-block-group.callout-info {
    border-left-color: var(--blue);
    background: var(--callout-info-bg);
}

.busa-callout--success,
.wp-block-group.callout-success {
    border-left-color: var(--green);
    background: var(--callout-success-bg);
}

.busa-callout h3,
.busa-callout h4 {
    margin-top: 0;
    margin-bottom: 8px;
}

/* ---------- Department Enforcement ---------- */
.busa-dept-enforcement {
    position: relative;
    z-index: 1;
    padding: 40px 0;
}

.busa-dept-content {
    position: relative;
    z-index: 1;
    padding-bottom: 24px;
}

/* ---------- Department SOPs section ---------- */
.busa-dept-sops {
    position: relative;
    z-index: 1;
    padding: 24px 0;
}

/* ---------- Page Title ---------- */
.busa-page-title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 400;
    color: var(--text);
    margin-bottom: 32px;
    line-height: 1.2;
}

/* ---------- Search Results Page ---------- */
.busa-search-results-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.busa-search-result {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 20px 24px;
}

.busa-search-result__type {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 6px;
}

.busa-search-result__title {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 6px;
}

.busa-search-result__title a {
    color: var(--text);
    transition: color var(--transition);
}

.busa-search-result__title a:hover {
    color: var(--accent);
}

.busa-search-result__excerpt {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
}

mark {
    background: var(--accent-glow);
    color: var(--accent);
    padding: 1px 2px;
    border-radius: 2px;
}

.busa-highlight {
    color: var(--accent);
}

/* ---------- Empty State / 404 ---------- */
.busa-empty-state {
    text-align: center;
    padding: 80px 24px;
}

.busa-empty-state h2 {
    font-size: 1.5rem;
    margin-bottom: 12px;
    color: var(--text);
}

.busa-empty-state p {
    color: var(--text-dim);
    margin-bottom: 24px;
}

.busa-404 h1 {
    font-size: 5rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 8px;
}

.busa-btn {
    display: inline-flex;
    align-items: center;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    font-family: var(--font-primary);
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: background var(--transition);
}

.busa-btn:hover {
    background: var(--red);
}

/* ---------- Footer ---------- */
.busa-footer {
    position: relative;
    z-index: 1;
    border-top: 1px solid var(--border);
    padding: 32px 0;
}

.busa-footer__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.busa-footer__brand {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dim);
}

.busa-footer__logo-img {
    height: 32px;
    width: auto;
}

.busa-footer__copy {
    font-size: 13px;
    color: var(--text-dim);
    opacity: 0.6;
}

/* ---------- Posts Navigation ---------- */
.posts-navigation {
    padding: 32px 0;
}

.posts-navigation .nav-links {
    display: flex;
    justify-content: space-between;
}

.posts-navigation a {
    color: var(--accent);
    font-weight: 500;
    transition: opacity var(--transition);
}

.posts-navigation a:hover {
    opacity: 0.8;
}

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
    .busa-sop-layout {
        grid-template-columns: 1fr;
    }

    .busa-sop-sidebar {
        display: none;
    }
}

@media (max-width: 768px) {
    .busa-features__grid {
        grid-template-columns: 1fr;
    }

    .busa-departments__grid {
        grid-template-columns: 1fr;
    }

    .busa-header__search {
        display: none;
    }

    .busa-header__mobile-toggle {
        display: flex;
    }

    .busa-header__cta {
        display: none;
    }

    .busa-header__avatar {
        display: none;
    }

    .busa-header__logo-sub {
        display: none;
    }

    .busa-hero {
        padding: 24px 0 24px;
    }

    .busa-hero__banner {
        padding: 36px 20px 32px;
        border-radius: var(--radius-md);
    }

    .busa-hero__title {
        font-size: 1.5rem;
    }

    .busa-hero__stats {
        flex-direction: column;
        gap: 8px;
    }

    .busa-hero__stat {
        padding: 0;
        font-size: 13px;
    }

    .busa-hero__stat + .busa-hero__stat {
        border-left: none;
        padding-top: 8px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
    }

    .busa-footer__inner {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .busa-sop-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .busa-sop-item__right {
        width: 100%;
        justify-content: space-between;
    }
}

/* Mobile search overlay */
.busa-mobile-search-active .busa-header__search {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--mobile-overlay-bg);
    z-index: 300;
    padding: 80px 24px 24px;
    max-width: none;
    margin: 0;
}

.busa-mobile-search-active .busa-search-input {
    height: 48px;
    font-size: 16px;
}

/* Focus states */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Hidden utility class for filtered cards */
.busa-dept-card--hidden {
    display: none !important;
}

/* ==========================================================================
   Theme Toggle Button
   ========================================================================== */
.busa-theme-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    cursor: pointer;
    color: var(--text-dim);
    transition: color var(--transition), border-color var(--transition), background var(--transition);
    flex-shrink: 0;
}
.busa-theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.busa-theme-toggle svg {
    width: 18px;
    height: 18px;
}
.busa-theme-toggle .busa-icon-moon {
    display: block;
}
.busa-theme-toggle .busa-icon-sun {
    display: none;
}
[data-theme="dark"] .busa-theme-toggle .busa-icon-moon {
    display: none;
}
[data-theme="dark"] .busa-theme-toggle .busa-icon-sun {
    display: block;
}

/* ==========================================================================
   Smart Sticky Header — hide on scroll down
   ========================================================================== */
.busa-header {
    transition: transform 0.3s ease;
}
.busa-header--hidden {
    transform: translateY(-100%);
}

/* ==========================================================================
   Scroll Progress Bar
   ========================================================================== */
.busa-scroll-progress-wrap {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    z-index: 1001;
    background: transparent;
}
.busa-scroll-progress {
    height: 100%;
    width: 0;
    background: var(--red);
    transition: width 0.1s linear;
}

/* ==========================================================================
   Back to Top Button
   ========================================================================== */
.busa-back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: all 0.3s ease;
    z-index: 100;
    text-decoration: none;
}
.busa-back-to-top:hover {
    background: var(--red);
    color: #fff;
    border-color: var(--red);
    transform: translateY(-2px);
}
.busa-back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* ==========================================================================
   Skip to Content (Accessibility)
   ========================================================================== */
.busa-skip-link {
    position: absolute;
    top: -100%;
    left: 16px;
    background: var(--accent);
    color: #fff;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    z-index: 10000;
    font-weight: 600;
    text-decoration: none;
    transition: top 0.2s ease;
}
.busa-skip-link:focus {
    top: 8px;
}

/* ==========================================================================
   SOP Meta Bar (last updated, reading time, copy link)
   ========================================================================== */
.busa-sop-meta-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    font-size: 13px;
    color: var(--text-dim);
}
.busa-sop-meta-bar svg {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 4px;
    stroke: currentColor;
    fill: none;
}
.busa-sop-meta-bar__item {
    display: flex;
    align-items: center;
    gap: 4px;
}
.busa-copy-link {
    cursor: pointer;
    color: var(--text-dim);
    background: none;
    border: 1px solid var(--border);
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    font-size: 12px;
    transition: all 0.2s ease;
    margin-left: auto;
}
.busa-copy-link:hover {
    color: var(--accent);
    border-color: var(--accent);
}
.busa-copy-link.busa-copied {
    color: var(--green);
    border-color: var(--green);
}

/* ==========================================================================
   Previous / Next SOP Navigation
   ========================================================================== */
.busa-sop-nav {
    display: flex;
    gap: 16px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.busa-sop-nav__link {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-decoration: none;
    transition: all 0.2s ease;
}
.busa-sop-nav__link:hover {
    border-color: var(--accent);
    background: var(--surface-2);
}
.busa-sop-nav__link--next {
    text-align: right;
}
.busa-sop-nav__label {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.busa-sop-nav__title {
    font-size: 14px;
    color: var(--text);
    font-weight: 500;
}

/* ==========================================================================
   Related SOPs (sidebar)
   ========================================================================== */
.busa-related-sops {
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}
.busa-related-sops__title {
    font-size: 12px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
}
.busa-related-sops__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.busa-related-sops__list a {
    display: block;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.busa-related-sops__list a:hover {
    color: var(--text);
    background: var(--surface-2);
}
.busa-related-sops__list a.busa-related--current {
    color: var(--accent);
    background: var(--accent-glow);
    font-weight: 500;
}

/* ==========================================================================
   Section Highlight (on anchor jump)
   ========================================================================== */
.busa-section-highlight {
    animation: busa-flash 1.5s ease;
}
@keyframes busa-flash {
    0%, 100% { background-color: transparent; }
    15% { background-color: var(--accent-glow); }
}

/* ==========================================================================
   Scroll-triggered Animations
   ========================================================================== */
.busa-animate-init {
    opacity: 0;
    transform: translateY(20px);
}
.busa-animate-in {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.5s ease, transform 0.5s ease;
}

/* ==========================================================================
   Reduced Motion — WCAG AA
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .busa-animate-init {
        opacity: 1;
        transform: none;
    }
    .busa-header {
        transition: none;
    }
    .busa-back-to-top {
        transition: none;
    }
}

/* ==========================================================================
   Print Styles — Critical for SOP compliance documents
   ========================================================================== */
@media print {
    /* Reset to white background */
    :root {
        --bg: #fff;
        --surface: #fff;
        --surface-2: #f5f5f5;
        --text: #000;
        --text-dim: #555;
        --border: #ddd;
    }
    body {
        background: #fff !important;
        color: #000 !important;
        font-size: 12pt;
        line-height: 1.5;
    }

    /* Hide non-essential elements */
    .busa-header,
    .busa-footer,
    .busa-bg-blobs,
    .busa-back-to-top,
    .busa-scroll-progress-wrap,
    .busa-skip-link,
    .busa-copy-link,
    .busa-sop-sidebar,
    .busa-search-wrapper,
    .busa-role-filter,
    .busa-sop-nav,
    .busa-header__mobile-toggle,
    .busa-header__cta,
    .busa-theme-toggle,
    .busa-features,
    #busa-back-to-top {
        display: none !important;
    }

    /* Hero banner: light bg for print */
    .busa-hero__banner {
        background: #f0f0f0 !important;
        color: #000 !important;
    }
    .busa-hero__title,
    .busa-hero__title em {
        color: #000 !important;
    }
    .busa-hero__subtitle {
        color: #333 !important;
    }
    .busa-hero__stat {
        color: #000 !important;
        border-left-color: #ccc !important;
    }

    /* Full width content */
    .busa-container {
        max-width: 100% !important;
        padding: 0 !important;
    }
    .busa-sop-layout {
        display: block !important;
    }
    .busa-sop-content {
        max-width: 100% !important;
    }

    /* Proper heading styling */
    h1, h2, h3, h4 {
        color: #000 !important;
        page-break-after: avoid;
    }

    /* Prevent breaks inside important blocks */
    .busa-callout,
    .busa-sop-header,
    .busa-dept-header,
    table, figure, img {
        page-break-inside: avoid;
    }

    /* Show URLs for links */
    .busa-content-block a[href^="http"]::after {
        content: " (" attr(href) ")";
        font-size: 9pt;
        color: #666;
    }

    /* Print header with SOP info */
    .busa-breadcrumb {
        display: block !important;
        font-size: 10pt;
        color: #666;
        border-bottom: 1px solid #ddd;
        padding-bottom: 8px;
        margin-bottom: 16px;
    }
    .busa-breadcrumb a {
        color: #333 !important;
        text-decoration: none;
    }

    /* Severity badges readable in print */
    .busa-severity-badge {
        border: 1px solid #000 !important;
        color: #000 !important;
        background: none !important;
        font-weight: bold;
    }

    /* Role badges */
    .busa-role-badge {
        border: 1px solid #999;
        color: #000 !important;
        background: none !important;
    }

    /* Callouts */
    .busa-callout {
        border: 2px solid #000;
        background: #f9f9f9 !important;
        color: #000 !important;
    }

    /* Content block */
    .busa-content-block {
        background: none !important;
        border: none !important;
        padding: 0 !important;
        color: #000 !important;
    }
    .busa-content-block h2,
    .busa-content-block h3,
    .busa-content-block h4 {
        color: #000 !important;
    }
    .busa-content-block li,
    .busa-content-block p {
        color: #000 !important;
    }
    .busa-content-block table th {
        background: #eee !important;
        color: #000 !important;
    }
    .busa-content-block table td {
        background: #fff !important;
        color: #000 !important;
    }

    /* SOP header print */
    .busa-sop-header {
        border-bottom: 2px solid #000;
        padding-bottom: 16px;
    }
    .busa-sop-header__title {
        color: #000 !important;
    }

    /* Meta bar */
    .busa-sop-meta-bar {
        border-top-color: #ddd;
        color: #555 !important;
    }

    /* Page margins */
    @page {
        margin: 1in;
    }
}

/* ==========================================================================
   Responsive: Previous/Next nav
   ========================================================================== */
@media (max-width: 768px) {
    .busa-sop-nav {
        flex-direction: column;
    }
    .busa-sop-nav__link--next {
        text-align: left;
    }
    .busa-sop-meta-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    .busa-copy-link {
        margin-left: 0;
    }
    .busa-back-to-top {
        bottom: 20px;
        right: 20px;
    }
}

/* ==========================================================================
   Elementor Page Support
   ========================================================================== */
.busa-elementor-page {
    padding-top: 32px;
    padding-bottom: 48px;
}

/* Full-width Elementor sections break out of container */
.busa-elementor-page .elementor-section.elementor-section-stretched {
    max-width: none;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* Elementor canvas inherits theme dark mode */
.busa-elementor-canvas {
    font-family: var(--font-primary);
}

/* Standard page content styling */
.busa-page {
    padding-top: 0;
    padding-bottom: 48px;
}
