/* ============================================================
   OrthoRoutes — Styles
   Dark/Light mode, teal/cyan accent, glassmorphism design
   ============================================================ */

/* --- CSS Variables (Dark Mode Default) --- */
:root {
    --bg-primary: #0a0f1a;
    --bg-secondary: #131b2e;
    --bg-card: rgba(19, 27, 46, 0.85);
    --bg-overlay: rgba(5, 8, 18, 0.92);
    --text-primary: #d8dee9;
    --text-secondary: #8892a4;
    --text-heading: #eceff4;
    --accent: #00c9a7;
    --accent-glow: rgba(0, 201, 167, 0.15);
    --border: rgba(255,255,255,0.06);
    --border-accent: rgba(0, 201, 167, 0.25);
    --shadow: rgba(0,0,0,0.3);
    --card-hover-bg: rgba(0, 201, 167, 0.05);
    --skeleton-fill: rgba(200,220,255,0.08);
    --skeleton-stroke: rgba(200,220,255,0.25);
    --code-bg: rgba(0,0,0,0.3);
}

/* --- Light Mode --- */
body.light-mode {
    --bg-primary: #f5f7fa;
    --bg-secondary: #ffffff;
    --bg-card: rgba(255, 255, 255, 0.92);
    --bg-overlay: rgba(245, 247, 250, 0.95);
    --text-primary: #2d3748;
    --text-secondary: #6b7a8d;
    --text-heading: #1a202c;
    --accent: #0d9488;
    --accent-glow: rgba(13, 148, 136, 0.1);
    --border: rgba(0,0,0,0.08);
    --border-accent: rgba(13, 148, 136, 0.3);
    --shadow: rgba(0,0,0,0.08);
    --card-hover-bg: rgba(13, 148, 136, 0.05);
    --skeleton-fill: rgba(45,55,72,0.05);
    --skeleton-stroke: rgba(45,55,72,0.2);
    --code-bg: rgba(0,0,0,0.05);
}

/* --- Reset & Base --- */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    transition: background 0.3s ease, color 0.3s ease;
}

/* --- Theme Toggle Button --- */
.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 38px; height: 38px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.3s ease;
    margin-right: 8px;
}
.theme-toggle:hover {
    color: var(--accent);
    border-color: var(--accent);
    background: var(--accent-glow);
}
.theme-toggle .icon-moon { display: block; }
.theme-toggle .icon-sun { display: none; }
body.light-mode .theme-toggle .icon-moon { display: none; }
body.light-mode .theme-toggle .icon-sun { display: block; }

/* --- Disclaimer Overlay --- */
.disclaimer-overlay {
    position: fixed; inset: 0;
    background: rgba(5, 8, 18, 0.92);
    backdrop-filter: blur(20px);
    z-index: 10000;
    display: flex; align-items: center; justify-content: center;
    padding: 24px;
    opacity: 1; transition: opacity 0.4s ease;
}
.disclaimer-overlay.hidden { opacity: 0; pointer-events: none; }
.disclaimer-modal {
    background: linear-gradient(135deg, #131b2e 0%, #0d1321 100%);
    border: 1px solid rgba(56, 189, 248, 0.15);
    border-radius: 20px;
    padding: 48px 40px 40px;
    max-width: 620px; width: 100%;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6), 0 0 60px rgba(56, 189, 248, 0.06);
    text-align: center;
    animation: modalIn 0.5s ease;
}
@keyframes modalIn {
    from { opacity: 0; transform: translateY(30px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}
.disclaimer-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 80px; height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.15), rgba(239, 68, 68, 0.12));
    color: #fb923c;
    margin-bottom: 20px;
}
.disclaimer-modal h2 {
    font-size: 1.6rem; font-weight: 700;
    color: #f1f5f9;
    margin-bottom: 20px;
}
.disclaimer-content {
    text-align: left;
    max-height: 280px; overflow-y: auto;
    padding-right: 8px;
    margin-bottom: 28px;
    font-size: 0.88rem; line-height: 1.75;
    color: #94a3b8;
}
.disclaimer-content p { margin-bottom: 12px; }
.disclaimer-content strong { color: #cbd5e1; }
.disclaimer-content::-webkit-scrollbar { width: 4px; }
.disclaimer-content::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.2); border-radius: 4px; }
.disclaimer-actions { display: flex; flex-direction: column; gap: 16px; }
.disclaimer-checkbox-label {
    display: flex; align-items: flex-start; gap: 12px;
    text-align: left; font-size: 0.82rem; color: #94a3b8;
    cursor: pointer; user-select: none;
    padding: 14px 16px;
    background: rgba(56, 189, 248, 0.04);
    border: 1px solid rgba(56, 189, 248, 0.08);
    border-radius: 12px;
    transition: border-color 0.3s;
}
.disclaimer-checkbox-label:hover { border-color: rgba(56, 189, 248, 0.25); }
.disclaimer-checkbox-label input[type="checkbox"] { display: none; }
.disclaimer-checkbox-label .checkmark {
    flex-shrink: 0;
    width: 22px; height: 22px;
    border: 2px solid rgba(56, 189, 248, 0.3);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.25s;
    margin-top: 1px;
}
.disclaimer-checkbox-label input:checked + .checkmark {
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border-color: #0ea5e9;
}
.disclaimer-checkbox-label input:checked + .checkmark::after {
    content: '✓'; color: #fff; font-size: 13px; font-weight: 700;
}
.btn-accept {
    width: 100%; padding: 14px;
    font-family: inherit; font-size: 0.95rem; font-weight: 600;
    color: #fff;
    background: linear-gradient(135deg, #0ea5e9, #06b6d4);
    border: none; border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(14, 165, 233, 0.3);
}
.btn-accept:disabled {
    opacity: 0.35; cursor: not-allowed;
    box-shadow: none;
}
.btn-accept:not(:disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(14, 165, 233, 0.45);
}

/* --- Header --- */
.site-header {
    position: sticky; top: 0; z-index: 1000;
    background: rgba(10, 15, 26, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
}
.header-inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 24px; height: 64px;
}
.logo {
    display: flex; align-items: center; gap: 10px;
    text-decoration: none; color: #f1f5f9;
    font-weight: 700; font-size: 1.05rem;
}
.logo-icon { color: #22d3ee; }
.logo:hover .logo-icon { color: #67e8f9; }
.main-nav { display: flex; gap: 4px; }
.nav-link {
    font-family: inherit; font-size: 0.85rem; font-weight: 500;
    color: #94a3b8; background: none; border: none;
    padding: 8px 16px; border-radius: 8px;
    cursor: pointer; transition: all 0.25s;
}
.nav-link:hover { color: #e2e8f0; background: rgba(56, 189, 248, 0.06); }
.nav-link.active { color: #22d3ee; background: rgba(34, 211, 238, 0.08); }
.mobile-menu-btn {
    display: none; background: none; border: none;
    cursor: pointer; padding: 4px; width: 32px; height: 32px;
    flex-direction: column; gap: 5px; justify-content: center;
}
.mobile-menu-btn span {
    display: block; width: 22px; height: 2px;
    background: #94a3b8; border-radius: 2px;
    transition: all 0.3s;
}
.mobile-menu-btn.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.mobile-menu-btn.open span:nth-child(2) { opacity: 0; }
.mobile-menu-btn.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* --- Mobile Nav --- */
.mobile-nav {
    display: none; position: fixed; top: 64px; left: 0; right: 0;
    background: rgba(10, 15, 26, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(56, 189, 248, 0.08);
    padding: 8px 16px; z-index: 999;
    transform: translateY(-110%);
    transition: transform 0.35s ease;
}
.mobile-nav.open { transform: translateY(0); }
.mobile-nav-link {
    display: block; width: 100%;
    font-family: inherit; font-size: 0.92rem; font-weight: 500;
    color: #94a3b8; background: none; border: none;
    padding: 14px 16px; text-align: left; border-radius: 10px;
    cursor: pointer; transition: all 0.25s;
}
.mobile-nav-link:hover, .mobile-nav-link.active { color: #22d3ee; background: rgba(34, 211, 238, 0.06); }

/* --- Pages --- */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }

/* --- Hero --- */
.hero {
    padding: 80px 24px 60px;
    background: radial-gradient(ellipse at 50% 0%, rgba(14, 165, 233, 0.08) 0%, transparent 60%);
    text-align: center;
}
.hero-inner { max-width: 680px; margin: 0 auto; }
.hero-badge {
    display: inline-block;
    font-size: 0.72rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 1.5px; color: #22d3ee;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.15);
    padding: 6px 18px; border-radius: 100px;
    margin-bottom: 24px;
}
.hero h1 {
    font-size: 2.8rem; font-weight: 800;
    line-height: 1.15;
    background: linear-gradient(135deg, #f8fafc 0%, #67e8f9 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 18px;
}
.hero-subtitle {
    font-size: 1.05rem; color: #64748b;
    line-height: 1.7; margin-bottom: 36px;
}

/* --- Search --- */
.search-container { max-width: 520px; margin: 0 auto; }
.search-input-wrapper {
    position: relative; display: flex; align-items: center;
}
.search-icon {
    position: absolute; left: 16px; color: #475569;
    pointer-events: none;
}
.search-input {
    width: 100%;
    font-family: inherit; font-size: 0.92rem;
    color: #e2e8f0;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(56, 189, 248, 0.12);
    padding: 14px 44px 14px 48px;
    border-radius: 14px;
    outline: none;
    transition: all 0.3s;
}
.search-input::placeholder { color: #475569; }
.search-input:focus {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.08);
}
.search-clear {
    position: absolute; right: 14px;
    background: none; border: none;
    color: #64748b; font-size: 1.3rem;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px;
}
.search-clear:hover { color: #e2e8f0; }

/* --- Category Cards --- */
.categories-grid {
    display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px;
    max-width: 680px; margin: 0 auto;
    padding: 0 24px 40px;
}
.category-card {
    background: linear-gradient(135deg, rgba(15, 23, 42, 0.7) 0%, rgba(15, 23, 42, 0.4) 100%);
    border: 1px solid rgba(56, 189, 248, 0.08);
    border-radius: 16px;
    padding: 32px 24px 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.35s;
    position: relative;
    overflow: hidden;
}
.category-card::before {
    content: ''; position: absolute; inset: 0;
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.04), transparent);
    opacity: 0; transition: opacity 0.35s;
}
.category-card:hover {
    border-color: rgba(34, 211, 238, 0.2);
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}
.category-card:hover::before { opacity: 1; }
.category-card-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 64px; height: 64px;
    border-radius: 16px;
    background: rgba(34, 211, 238, 0.06);
    color: #22d3ee;
    margin-bottom: 16px;
}
.category-card h2 {
    font-size: 1.1rem; font-weight: 700; color: #f1f5f9;
    margin-bottom: 10px;
}
.category-card p {
    font-size: 0.82rem; color: #64748b;
    line-height: 1.6; margin-bottom: 16px;
}
.card-count {
    display: block; font-size: 0.72rem; font-weight: 600;
    color: #22d3ee;
    text-transform: uppercase; letter-spacing: 1px;
    margin-bottom: 8px;
}
.card-link {
    font-size: 0.82rem; font-weight: 600; color: #0ea5e9;
    transition: color 0.25s;
}
.category-card:hover .card-link { color: #38bdf8; }

/* --- Education Footer Banner --- */
.edu-footer-banner {
    display: flex; align-items: center; gap: 10px;
    max-width: 680px; margin: 0 auto 48px;
    padding: 14px 20px;
    background: rgba(251, 146, 60, 0.05);
    border: 1px solid rgba(251, 146, 60, 0.12);
    border-radius: 12px;
    font-size: 0.78rem; color: #94a3b8;
}
.edu-footer-banner svg { flex-shrink: 0; color: #fb923c; }
.edu-footer-banner strong { color: #fbbf24; }

/* --- Page Container --- */
.page-container {
    max-width: 800px; margin: 0 auto;
    padding: 24px 24px 80px;
}
.back-btn {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: inherit; font-size: 0.85rem; font-weight: 500;
    color: #64748b; background: none; border: none;
    cursor: pointer; margin-bottom: 24px;
    padding: 8px 0;
    transition: color 0.25s;
}
.back-btn:hover { color: #22d3ee; }
.page-title {
    font-size: 1.8rem; font-weight: 800; color: #f1f5f9;
    margin-bottom: 8px;
}
.page-description {
    font-size: 0.92rem; color: #64748b;
    margin-bottom: 28px;
}

/* --- Presentation List Items --- */
.presentations-list { display: flex; flex-direction: column; gap: 8px; }
.presentation-item {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.06);
    border-radius: 12px;
    padding: 18px 20px;
    cursor: pointer;
    transition: all 0.3s;
}
.presentation-item:hover {
    background: rgba(14, 165, 233, 0.04);
    border-color: rgba(34, 211, 238, 0.15);
    transform: translateX(4px);
}
.presentation-item-text h3 {
    font-size: 0.95rem; font-weight: 600; color: #e2e8f0;
    margin-bottom: 4px;
}
.presentation-item-text p {
    font-size: 0.8rem; color: #64748b;
}
.presentation-item-arrow { color: #334155; flex-shrink: 0; transition: color 0.25s; }
.presentation-item:hover .presentation-item-arrow { color: #22d3ee; }
.search-result-category {
    display: inline-block;
    font-size: 0.68rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #0ea5e9;
    background: rgba(14, 165, 233, 0.08);
    padding: 3px 10px; border-radius: 6px;
    margin-top: 6px;
}
.no-results {
    text-align: center; padding: 60px 20px;
    color: #475569;
}
.no-results svg { margin-bottom: 16px; opacity: 0.4; }
.no-results h3 { font-size: 1.1rem; color: #64748b; margin-bottom: 8px; }

/* --- Presentation Article --- */
.presentation-title {
    font-size: 1.8rem; font-weight: 800; color: #f1f5f9;
    margin-bottom: 24px;
    line-height: 1.25;
}
.presentation-body section {
    margin-bottom: 28px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.4);
    border: 1px solid rgba(56, 189, 248, 0.06);
    border-radius: 14px;
}
.section-header {
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 16px;
    color: #22d3ee;
}
.section-header h2 {
    font-size: 1.1rem; font-weight: 700; color: #e2e8f0;
}

/* --- Education Banner (per page) --- */
.edu-banner {
    display: flex; align-items: flex-start; gap: 12px;
    padding: 16px 20px;
    background: rgba(251, 146, 60, 0.05);
    border: 1px solid rgba(251, 146, 60, 0.12);
    border-radius: 12px;
    font-size: 0.8rem; color: #94a3b8;
    margin-bottom: 28px;
}
.edu-banner svg { flex-shrink: 0; color: #fb923c; margin-top: 1px; }
.edu-banner strong { color: #fbbf24; }

/* --- Overview / Description --- */
.presentation-description p {
    margin-bottom: 12px; font-size: 0.9rem; color: #cbd5e1;
}

/* --- Timeline --- */
.timeline-list {
    list-style: none; position: relative;
    padding-left: 24px;
}
.timeline-list::before {
    content: ''; position: absolute;
    left: 7px; top: 4px; bottom: 4px;
    width: 2px;
    background: linear-gradient(180deg, rgba(34, 211, 238, 0.3), rgba(34, 211, 238, 0.05));
}
.timeline-item {
    position: relative; margin-bottom: 20px;
    padding-left: 16px;
}
.timeline-item::before {
    content: ''; position: absolute;
    left: -20px; top: 8px;
    width: 10px; height: 10px;
    border-radius: 50%;
    background: #0ea5e9;
    box-shadow: 0 0 8px rgba(14, 165, 233, 0.4);
}
.timeline-time {
    font-size: 0.78rem; font-weight: 700;
    color: #22d3ee;
    text-transform: uppercase; letter-spacing: 0.5px;
    margin-bottom: 4px;
}
.timeline-content {
    font-size: 0.88rem; color: #94a3b8; line-height: 1.65;
}

/* --- Key Points --- */
.keypoints-list {
    list-style: none; display: flex; flex-direction: column; gap: 10px;
}
.keypoints-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.88rem; color: #cbd5e1;
    padding: 10px 14px;
    background: rgba(34, 211, 238, 0.03);
    border-radius: 10px;
    border-left: 3px solid rgba(34, 211, 238, 0.25);
}
.keypoint-icon {
    flex-shrink: 0; color: #22d3ee; margin-top: 2px;
}

/* --- Red Flags --- */
.redflags-list {
    list-style: none; display: flex; flex-direction: column; gap: 8px;
}
.redflags-list li {
    display: flex; align-items: flex-start; gap: 10px;
    font-size: 0.88rem; color: #fca5a5;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.04);
    border-radius: 10px;
    border-left: 3px solid rgba(239, 68, 68, 0.3);
}
.redflag-icon {
    flex-shrink: 0; color: #ef4444; margin-top: 2px;
}

/* --- Radiographs --- */
.xray-content p {
    font-size: 0.88rem; color: #94a3b8; margin-bottom: 12px;
}
.measurements-table {
    width: 100%; border-collapse: collapse;
    font-size: 0.84rem;
}
.measurements-table th {
    text-align: left; padding: 10px 14px;
    background: rgba(14, 165, 233, 0.06);
    color: #22d3ee; font-weight: 600;
    border-bottom: 1px solid rgba(56, 189, 248, 0.1);
}
.measurements-table td {
    padding: 10px 14px; color: #cbd5e1;
    border-bottom: 1px solid rgba(56, 189, 248, 0.04);
}
.measurements-table tr:hover td {
    background: rgba(14, 165, 233, 0.02);
}

/* --- References --- */
.references-toggle {
    display: flex; align-items: center; justify-content: space-between;
    width: 100%; font-family: inherit;
    font-size: 0.95rem; font-weight: 600;
    color: #94a3b8; background: none; border: none;
    cursor: pointer; padding: 0;
    transition: color 0.25s;
}
.references-toggle:hover { color: #e2e8f0; }
.references-toggle svg { transition: transform 0.3s; }
.references-toggle.open svg { transform: rotate(180deg); }
.references-content {
    max-height: 0; overflow: hidden;
    transition: max-height 0.5s ease, padding 0.3s;
}
.references-content.open {
    max-height: 3000px;
    padding-top: 16px;
}
.references-list {
    list-style: none; counter-reset: ref-counter;
    display: flex; flex-direction: column; gap: 10px;
}
.references-list li {
    font-size: 0.8rem; color: #64748b;
    line-height: 1.6;
    padding: 10px 14px;
    background: rgba(15, 23, 42, 0.5);
    border-radius: 8px;
    display: flex; gap: 8px;
}
.ref-number {
    font-weight: 700; color: #0ea5e9;
    flex-shrink: 0;
}
.references-list a {
    color: #38bdf8; text-decoration: none;
    font-weight: 500;
    transition: color 0.25s;
}
.references-list a:hover { color: #67e8f9; text-decoration: underline; }

/* In-text reference link */
a.ref {
    color: #0ea5e9; text-decoration: none;
    font-weight: 600; font-size: 0.75em;
    vertical-align: super;
    cursor: pointer;
    transition: color 0.25s;
}
a.ref:hover { color: #67e8f9; }

/* --- Skeleton Section --- */
.skeleton-section {
    max-width: 1000px; margin: 0 auto;
    padding: 40px 24px 60px;
    text-align: center;
}
.skeleton-header { margin-bottom: 32px; }
.skeleton-title {
    font-size: 1.4rem; font-weight: 700; color: #f1f5f9;
    margin-bottom: 8px;
}
.skeleton-subtitle {
    font-size: 0.88rem; color: #64748b;
}
.skeleton-container {
    display: flex; justify-content: center;
    padding: 24px;
    background: radial-gradient(ellipse at 50% 30%, rgba(15, 23, 42, 0.6) 0%, rgba(10, 15, 26, 0.9) 70%);
    border: 1px solid rgba(56, 189, 248, 0.06);
    border-radius: 20px;
    max-width: 520px; margin: 0 auto;
}
.skeleton-svg {
    width: 100%; max-width: 420px; height: auto;
}
/* Clickable bones — filled style */
.bone-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
}
.bone-clickable:hover {
    filter: url(#glow);
}
.bone-clickable:hover path,
.bone-clickable:hover rect,
.bone-clickable:hover ellipse,
.bone-clickable:hover circle {
    fill: rgba(34, 211, 238, 0.25);
    stroke: #22d3ee;
}
.bone-clickable:hover line {
    stroke: #22d3ee;
    stroke-width: 3;
}
/* Clickable joints */
.joint-clickable {
    cursor: pointer;
    transition: all 0.3s ease;
    fill: rgba(34, 211, 238, 0.05);
}
.joint-clickable:hover {
    fill: rgba(34, 211, 238, 0.3);
    stroke: #67e8f9;
    filter: url(#glow-strong);
}
/* Decorative bones */
.bone-decorative {
    pointer-events: none;
    opacity: 0.5;
}

/* --- Bone Detail Page --- */
.bone-type-badge {
    display: inline-block;
    font-size: 0.72rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 1px;
    padding: 4px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
}
.bone-type-badge.type-bone {
    color: #22d3ee;
    background: rgba(34, 211, 238, 0.08);
    border: 1px solid rgba(34, 211, 238, 0.15);
}
.bone-type-badge.type-joint {
    color: #a78bfa;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.15);
}
.bone-filter-tabs {
    display: flex; gap: 6px;
    margin-bottom: 20px;
}
.bone-filter-btn {
    font-family: inherit; font-size: 0.82rem; font-weight: 500;
    color: #64748b; background: rgba(15, 23, 42, 0.5);
    border: 1px solid rgba(56, 189, 248, 0.08);
    padding: 8px 18px; border-radius: 8px;
    cursor: pointer; transition: all 0.25s;
}
.bone-filter-btn:hover { color: #e2e8f0; border-color: rgba(56, 189, 248, 0.2); }
.bone-filter-btn.active {
    color: #22d3ee; background: rgba(34, 211, 238, 0.08);
    border-color: rgba(34, 211, 238, 0.25);
}
.bone-article-count {
    font-size: 0.82rem; color: #64748b;
    margin-bottom: 16px;
}

/* --- Footer --- */
.site-footer {
    border-top: 1px solid rgba(56, 189, 248, 0.06);
    padding: 24px;
    text-align: center;
}
.footer-inner {
    max-width: 700px; margin: 0 auto;
    font-size: 0.78rem; color: #475569;
}
.footer-inner strong { color: #fbbf24; }

/* --- Table Scroll Wrapper (mobile) --- */
.table-scroll-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -4px;
    padding: 0 4px;
}
.table-scroll-wrapper::-webkit-scrollbar { height: 4px; }
.table-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(56, 189, 248, 0.15); border-radius: 4px; }
.table-scroll-wrapper .measurements-table { min-width: 520px; }

/* --- Google AdSense Containers --- */
.ad-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 12px 24px;
    text-align: center;
}
.ad-container .ad-label {
    display: block;
    font-size: 0.62rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: #334155;
    margin-bottom: 6px;
}
.ad-container ins {
    display: block;
    border-radius: 8px;
    overflow: hidden;
}
.ad-container-home {
    padding: 20px 24px 8px;
}
.ad-container-article {
    margin-top: 12px;
    padding: 16px 0 4px;
    border-top: 1px solid rgba(56, 189, 248, 0.04);
}
.ad-container-footer {
    padding: 8px 24px 4px;
    border-top: 1px solid rgba(56, 189, 248, 0.04);
}
.ad-container-sidebar {
    margin-bottom: 16px;
}

/* --- Responsive --- */
@media (max-width: 768px) {
    .main-nav { display: none; }
    .mobile-menu-btn { display: flex; }
    .mobile-nav { display: block; }
    .hero { padding: 60px 20px 40px; }
    .hero h1 { font-size: 2rem; }
    .categories-grid { grid-template-columns: 1fr; gap: 14px; padding: 0 20px 32px; }
    .category-card { padding: 24px 20px 20px; }
    .page-container { padding: 20px 16px 60px; }
    .presentation-title { font-size: 1.4rem; }
    .presentation-body section { padding: 18px 16px; }
    .disclaimer-modal { padding: 32px 24px 28px; max-width: 94vw; }
    .disclaimer-modal h2 { font-size: 1.3rem; }
    .disclaimer-content { max-height: 220px; font-size: 0.82rem; }

    /* Mobile touch targets — minimum 44px */
    .mobile-nav-link { padding: 16px 16px; min-height: 48px; }
    .back-btn { padding: 12px 0; min-height: 44px; }
    .presentation-item { padding: 16px 14px; min-height: 60px; }

    /* Skeleton mobile scaling */
    .skeleton-section { padding: 32px 16px 48px; }
    .skeleton-container { padding: 16px; max-width: 100%; }
    .skeleton-svg { max-width: 300px; }
    .skeleton-title { font-size: 1.2rem; }
    .skeleton-subtitle { font-size: 0.82rem; }

    /* Bone detail mobile */
    .bone-filter-tabs { flex-wrap: wrap; gap: 8px; }
    .bone-filter-btn { padding: 10px 16px; font-size: 0.84rem; min-height: 40px; flex: 1 1 auto; text-align: center; }

    /* Timeline mobile */
    .timeline-item { padding-left: 12px; }
    .timeline-time { font-size: 0.74rem; }
    .timeline-content { font-size: 0.84rem; }

    /* Key points / red flags mobile */
    .keypoints-list li, .redflags-list li { padding: 10px 12px; font-size: 0.84rem; }

    /* References mobile */
    .references-list li { padding: 8px 10px; font-size: 0.76rem; flex-direction: column; gap: 4px; }

    /* Search mobile */
    .search-container { padding: 0 4px; }

    /* Edu banner mobile */
    .edu-footer-banner { flex-direction: column; gap: 8px; padding: 12px 16px; font-size: 0.74rem; }
    .edu-banner { flex-direction: column; gap: 8px; padding: 12px 16px; font-size: 0.76rem; }

    /* Ad mobile */
    .ad-container { padding: 8px 16px; }
    .ad-container-home { padding: 16px 16px 4px; }

    /* Section header mobile */
    .section-header h2 { font-size: 1rem; }

    /* Footer mobile */
    .site-footer { padding: 20px 16px; }
    .footer-inner { font-size: 0.72rem; }
}

@media (max-width: 480px) {
    .hero { padding: 48px 16px 32px; }
    .hero h1 { font-size: 1.65rem; }
    .hero-subtitle { font-size: 0.88rem; margin-bottom: 28px; }
    .hero-badge { font-size: 0.68rem; padding: 5px 14px; }
    .search-input { font-size: 0.85rem; padding: 12px 40px 12px 44px; }
    .categories-grid { padding: 0 16px 28px; gap: 12px; }
    .category-card { padding: 20px 16px 16px; }
    .category-card h2 { font-size: 1rem; }
    .category-card p { font-size: 0.78rem; }
    .page-container { padding: 16px 14px 48px; }
    .presentation-title { font-size: 1.25rem; }
    .page-title { font-size: 1.4rem; }
    .page-description { font-size: 0.85rem; }
    .presentation-body section { padding: 14px 12px; margin-bottom: 20px; }
    .skeleton-svg { max-width: 260px; }
    .disclaimer-modal { padding: 24px 18px 22px; }
    .disclaimer-content { max-height: 180px; font-size: 0.78rem; }
    .btn-accept { padding: 12px; font-size: 0.88rem; }

    /* Header mobile small */
    .header-inner { padding: 0 16px; height: 56px; }
    .logo-text { font-size: 0.92rem; }
}

@media (max-width: 360px) {
    .hero h1 { font-size: 1.45rem; }
    .hero-subtitle { font-size: 0.82rem; }
    .presentation-title { font-size: 1.15rem; }
    .page-title { font-size: 1.25rem; }
    .skeleton-svg { max-width: 220px; }
    .category-card-icon { width: 48px; height: 48px; }
    .category-card-icon svg { width: 28px; height: 28px; }
    .header-inner { height: 52px; }
    .logo-text { font-size: 0.85rem; }
    .logo-icon { width: 22px; height: 22px; }
}

/* ============================================================
   LIGHT MODE — Comprehensive Overrides
   ============================================================ */
body.light-mode {
    background: #f0f4f8;
    color: #334155;
}

/* Header */
body.light-mode .site-header {
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .logo { color: #1e293b; }
body.light-mode .logo-icon { color: #0d9488; }
body.light-mode .logo:hover .logo-icon { color: #14b8a6; }
body.light-mode .nav-link { color: #64748b; }
body.light-mode .nav-link:hover { color: #1e293b; background: rgba(0,0,0,0.04); }
body.light-mode .nav-link.active { color: #0d9488; background: rgba(13, 148, 136, 0.08); }
body.light-mode .mobile-menu-btn span { background: #64748b; }

/* Mobile Nav */
body.light-mode .mobile-nav { background: rgba(255, 255, 255, 0.97); border-bottom: 1px solid rgba(0,0,0,0.06); }
body.light-mode .mobile-nav-link { color: #475569; }
body.light-mode .mobile-nav-link:hover,
body.light-mode .mobile-nav-link.active { color: #0d9488; background: rgba(13, 148, 136, 0.06); }

/* Hero */
body.light-mode .hero {
    background: radial-gradient(ellipse at 50% 0%, rgba(13, 148, 136, 0.06) 0%, transparent 60%);
}
body.light-mode .hero h1 {
    background: linear-gradient(135deg, #1e293b 0%, #0d9488 100%);
    -webkit-background-clip: text; -webkit-text-fill-color: transparent;
    background-clip: text;
}
body.light-mode .hero-subtitle { color: #64748b; }
body.light-mode .hero-badge {
    color: #0d9488;
    background: rgba(13, 148, 136, 0.06);
    border-color: rgba(13, 148, 136, 0.15);
}

/* Search */
body.light-mode .search-input {
    color: #1e293b;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .search-input::placeholder { color: #94a3b8; }
body.light-mode .search-input:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
}
body.light-mode .search-icon { color: #94a3b8; }
body.light-mode .search-clear { color: #94a3b8; }
body.light-mode .search-clear:hover { color: #334155; }

/* Category Cards */
body.light-mode .category-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
body.light-mode .category-card::before {
    background: linear-gradient(135deg, rgba(13, 148, 136, 0.04), transparent);
}
body.light-mode .category-card:hover {
    border-color: #0d9488;
    box-shadow: 0 8px 30px rgba(0,0,0,0.08);
}
body.light-mode .category-card-icon {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
}
body.light-mode .category-card h2 { color: #1e293b; }
body.light-mode .category-card p { color: #64748b; }
body.light-mode .card-count { color: #0d9488; }
body.light-mode .card-link { color: #0d9488; }
body.light-mode .category-card:hover .card-link { color: #14b8a6; }

/* Education Banners */
body.light-mode .edu-footer-banner,
body.light-mode .edu-banner {
    background: rgba(251, 146, 60, 0.06);
    border-color: rgba(251, 146, 60, 0.15);
    color: #64748b;
}
body.light-mode .edu-footer-banner strong,
body.light-mode .edu-banner strong { color: #d97706; }

/* Page Titles & Back Buttons */
body.light-mode .page-title { color: #1e293b; }
body.light-mode .page-description { color: #64748b; }
body.light-mode .back-btn { color: #64748b; }
body.light-mode .back-btn:hover { color: #0d9488; }

/* Presentation List Items */
body.light-mode .presentation-item {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.light-mode .presentation-item:hover {
    background: rgba(13, 148, 136, 0.03);
    border-color: #0d9488;
}
body.light-mode .presentation-item-text h3 { color: #1e293b; }
body.light-mode .presentation-item-text p { color: #64748b; }
body.light-mode .presentation-item-arrow { color: #cbd5e1; }
body.light-mode .presentation-item:hover .presentation-item-arrow { color: #0d9488; }
body.light-mode .search-result-category {
    color: #0d9488;
    background: rgba(13, 148, 136, 0.08);
}
body.light-mode .no-results { color: #94a3b8; }
body.light-mode .no-results h3 { color: #64748b; }

/* Presentation Article */
body.light-mode .presentation-title { color: #1e293b; }
body.light-mode .presentation-body section {
    background: #ffffff;
    border: 1px solid #e2e8f0;
}
body.light-mode .section-header { color: #0d9488; }
body.light-mode .section-header h2 { color: #1e293b; }
body.light-mode .presentation-description p { color: #475569; }

/* Timeline */
body.light-mode .timeline-list::before {
    background: linear-gradient(180deg, rgba(13, 148, 136, 0.3), rgba(13, 148, 136, 0.05));
}
body.light-mode .timeline-item::before {
    background: #0d9488;
    box-shadow: 0 0 8px rgba(13, 148, 136, 0.3);
}
body.light-mode .timeline-time { color: #0d9488; }
body.light-mode .timeline-content { color: #475569; }

/* Key Points */
body.light-mode .keypoints-list li {
    color: #334155;
    background: rgba(13, 148, 136, 0.04);
    border-left-color: rgba(13, 148, 136, 0.3);
}
body.light-mode .keypoint-icon { color: #0d9488; }

/* Red Flags */
body.light-mode .redflags-list li {
    color: #991b1b;
    background: rgba(239, 68, 68, 0.04);
    border-left-color: rgba(239, 68, 68, 0.3);
}
body.light-mode .redflag-icon { color: #dc2626; }

/* Radiograph Table */
body.light-mode .xray-content p { color: #475569; }
body.light-mode .measurements-table th {
    background: rgba(13, 148, 136, 0.06);
    color: #0d9488;
    border-bottom-color: #e2e8f0;
}
body.light-mode .measurements-table td {
    color: #334155;
    border-bottom-color: #f1f5f9;
}
body.light-mode .measurements-table tr:hover td {
    background: rgba(13, 148, 136, 0.02);
}

/* References */
body.light-mode .references-toggle { color: #64748b; }
body.light-mode .references-toggle:hover { color: #1e293b; }
body.light-mode .references-list li {
    color: #64748b;
    background: #f8fafc;
}
body.light-mode .ref-number { color: #0d9488; }
body.light-mode .references-list a { color: #0d9488; }
body.light-mode .references-list a:hover { color: #14b8a6; }
body.light-mode a.ref { color: #0d9488; }
body.light-mode a.ref:hover { color: #14b8a6; }

/* Skeleton Section */
body.light-mode .skeleton-title { color: #1e293b; }
body.light-mode .skeleton-subtitle { color: #64748b; }
body.light-mode .skeleton-container {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Bone Detail Page */
body.light-mode .bone-type-badge.type-bone {
    color: #0d9488; background: rgba(13, 148, 136, 0.08); border-color: rgba(13, 148, 136, 0.2);
}
body.light-mode .bone-type-badge.type-joint {
    color: #7c3aed; background: rgba(124, 58, 237, 0.08); border-color: rgba(124, 58, 237, 0.2);
}
body.light-mode .bone-filter-btn {
    color: #64748b; background: #ffffff; border-color: #e2e8f0;
}
body.light-mode .bone-filter-btn:hover { color: #1e293b; border-color: #cbd5e1; }
body.light-mode .bone-filter-btn.active {
    color: #0d9488; background: rgba(13, 148, 136, 0.08); border-color: rgba(13, 148, 136, 0.3);
}
body.light-mode .bone-article-count { color: #64748b; }

/* Footer */
body.light-mode .site-footer { border-top-color: #e2e8f0; }
body.light-mode .footer-inner { color: #94a3b8; }
body.light-mode .footer-inner strong { color: #d97706; }

/* Disclaimer (modal) */
body.light-mode .disclaimer-overlay { background: rgba(0, 0, 0, 0.4); }
body.light-mode .disclaimer-modal {
    background: #ffffff;
    border-color: #e2e8f0;
    box-shadow: 0 25px 80px rgba(0,0,0,0.15);
}
body.light-mode .disclaimer-modal h2 { color: #1e293b; }
body.light-mode .disclaimer-content { color: #475569; }
body.light-mode .disclaimer-content strong { color: #1e293b; }
body.light-mode .disclaimer-checkbox-label {
    color: #475569;
    background: rgba(13, 148, 136, 0.03);
    border-color: #e2e8f0;
}
body.light-mode .disclaimer-checkbox-label:hover { border-color: #0d9488; }

/* Ad Containers */
body.light-mode .ad-container .ad-label { color: #94a3b8; }
body.light-mode .ad-container-article { border-top-color: #e2e8f0; }
body.light-mode .ad-container-footer { border-top-color: #e2e8f0; }

/* Scrollbar in light mode */
body.light-mode .disclaimer-content::-webkit-scrollbar-thumb { background: rgba(13, 148, 136, 0.2); }
body.light-mode .table-scroll-wrapper::-webkit-scrollbar-thumb { background: rgba(13, 148, 136, 0.15); }

/* ============================================================
   Injury Date Calculator
   ============================================================ */
.injury-calc {
    margin-bottom: 1.2rem;
    padding: 0.9rem 1rem;
    background: var(--accent-glow);
    border: 1px solid var(--border-accent);
    border-radius: 10px;
}
.injury-calc-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.injury-calc label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-heading);
    white-space: nowrap;
}
.injury-date-input {
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border-accent);
    border-radius: 8px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 160px;
}
.injury-date-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}
.injury-weeks-display {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--accent);
    background: var(--bg-card);
    border: 1px solid var(--border-accent);
    border-radius: 20px;
    padding: 0.35rem 0.8rem;
    opacity: 0;
    transform: translateX(-8px);
    transition: opacity 0.35s ease, transform 0.35s ease;
}
.injury-weeks-display.visible {
    opacity: 1;
    transform: translateX(0);
}

/* ============================================================
   Scoring System Boxes
   ============================================================ */
.scoring-systems-section {
    margin-bottom: 1rem;
}
.scoring-box {
    margin-bottom: 0.6rem;
    border: 1px solid var(--border-accent);
    border-radius: 10px;
    overflow: hidden;
    background: var(--bg-card);
}
.scoring-box-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.7rem 1rem;
    background: transparent;
    border: none;
    color: var(--text-heading);
    font-family: 'Inter', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.scoring-box-toggle:hover { background: var(--accent-glow); }
.scoring-box-icon { font-size: 1.1rem; }
.scoring-box-title { flex: 1; text-align: left; }
.scoring-chevron {
    transition: transform 0.3s ease;
    color: var(--text-secondary);
}
.scoring-box-toggle.open .scoring-chevron {
    transform: rotate(180deg);
}
.scoring-box-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.3s ease;
    padding: 0 1rem;
}
.scoring-box-content.open {
    max-height: 600px;
    padding: 0.6rem 1rem 1rem;
}
.scoring-box-content p {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.55;
    margin-bottom: 0.5rem;
}
.scoring-box-ref {
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 0.5rem;
    margin-top: 0.5rem;
}
.scoring-box-ref a { color: var(--accent); text-decoration: none; }
.scoring-box-ref a:hover { text-decoration: underline; }
.scoring-grades-table { margin-bottom: 0.5rem; }

/* ============================================================
   Algorithm Button & Beta Badge
   ============================================================ */
.algorithm-launch {
    margin-bottom: 1.2rem;
    text-align: center;
}
.algorithm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    box-shadow: 0 4px 15px rgba(0, 201, 167, 0.25);
}
.algorithm-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 201, 167, 0.35);
}
.algorithm-btn:active {
    transform: translateY(0);
}
.beta-badge {
    display: inline-block;
    padding: 0.15rem 0.45rem;
    background: rgba(255,255,255,0.22);
    border-radius: 6px;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* ============================================================
   Algorithm Modal
   ============================================================ */
.algorithm-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: var(--bg-overlay);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: 2rem 1rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s ease, visibility 0.35s;
}
.algorithm-overlay.open {
    opacity: 1;
    visibility: visible;
}
.algorithm-modal {
    width: 100%;
    max-width: 640px;
    position: relative;
}
.algorithm-close-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 1.1rem;
    z-index: 2;
    transition: background 0.2s, color 0.2s;
}
.algorithm-close-btn:hover { background: var(--accent); color: #fff; }

/* Breadcrumb */
.algorithm-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary);
}
.algorithm-breadcrumb span {
    padding: 0.15rem 0.4rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    white-space: nowrap;
}
.algorithm-breadcrumb .bc-current {
    background: var(--accent-glow);
    border-color: var(--border-accent);
    color: var(--accent);
    font-weight: 600;
}
.algorithm-breadcrumb .bc-arrow {
    background: none;
    border: none;
    padding: 0;
    color: var(--text-secondary);
}

/* Step Card */
.algorithm-step-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.5rem;
    box-shadow: 0 8px 30px var(--shadow);
    animation: stepSlideIn 0.35s ease forwards;
}
@keyframes stepSlideIn {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
.algorithm-step-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.6rem;
}
.algorithm-step-body {
    font-size: 0.88rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1.2rem;
}
.algorithm-question {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 0.7rem;
}
.algorithm-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.algorithm-option-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 10px;
    color: var(--text-primary);
    font-family: 'Inter', sans-serif;
    font-size: 0.88rem;
    text-align: left;
    cursor: pointer;
    transition: all 0.2s;
}
.algorithm-option-btn:hover {
    border-color: var(--accent);
    background: var(--accent-glow);
    color: var(--text-heading);
    transform: translateX(4px);
}
.algorithm-option-arrow {
    margin-left: auto;
    color: var(--text-secondary);
    transition: color 0.2s;
}
.algorithm-option-btn:hover .algorithm-option-arrow { color: var(--accent); }

/* Endpoint Card */
.algorithm-endpoint {
    text-align: center;
    padding: 1.5rem;
}
.algorithm-endpoint-icon {
    font-size: 2.5rem;
    margin-bottom: 0.8rem;
}
.algorithm-endpoint-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.4rem;
}
.algorithm-endpoint-outcome {
    font-size: 0.95rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 1rem;
}
.algorithm-endpoint-body {
    font-size: 0.85rem;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 1rem;
}
.algorithm-endpoint.surgery { border-color: #e74c3c; }
.algorithm-endpoint.surgery .algorithm-endpoint-outcome { color: #e74c3c; }
.algorithm-endpoint.referral { border-color: #f59e0b; }
.algorithm-endpoint.referral .algorithm-endpoint-outcome { color: #f59e0b; }

/* Surgery / Info step banners */
.algorithm-step-banner {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.6rem 1rem; border-radius: 8px; margin-bottom: 1rem;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.02em;
}
.algorithm-step-banner.surgery-banner { background: rgba(231,76,60,0.12); color: #e74c3c; }
.algorithm-step-banner.info-banner { background: rgba(14,165,233,0.12); color: #0ea5e9; }
.algorithm-step-banner.rehab-banner { background: rgba(16,185,129,0.12); color: #10b981; }
.algorithm-step-banner.postop-banner { background: rgba(139,92,246,0.12); color: #8b5cf6; }

.algorithm-continue-btn {
    display: inline-flex; align-items: center; gap: 0.5rem;
    padding: 0.7rem 1.6rem; margin-top: 1rem;
    background: linear-gradient(135deg, var(--accent), #0ea5e9);
    border: none; border-radius: 10px;
    color: #fff; font-family: 'Inter', sans-serif;
    font-size: 0.88rem; font-weight: 600;
    cursor: pointer; transition: all 0.25s;
    box-shadow: 0 2px 8px rgba(14,165,233,0.3);
}
.algorithm-continue-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(14,165,233,0.45);
}

.algorithm-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text-secondary);
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-top: 0.5rem;
}
.algorithm-back-btn:hover { color: var(--accent); border-color: var(--accent); }

.algorithm-restart-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.5rem 1.2rem;
    background: var(--accent);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-family: 'Inter', sans-serif;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.5rem;
}
.algorithm-restart-btn:hover { background: #0ea5e9; }

.algorithm-footer {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    margin-top: 1rem;
}

/* Light mode overrides */
body.light-mode .injury-date-input { background: #fff; border-color: rgba(13, 148, 136, 0.25); }
body.light-mode .scoring-box { background: #fff; }
body.light-mode .algorithm-step-card { background: #fff; }
body.light-mode .algorithm-option-btn { background: #f8fafc; }
body.light-mode .algorithm-overlay { background: rgba(245, 247, 250, 0.96); }

/* Responsive */
@media (max-width: 600px) {
    .injury-calc-inner { flex-direction: column; align-items: flex-start; }
    .algorithm-modal { max-width: 100%; }
    .algorithm-step-card { padding: 1rem; }
    .algorithm-breadcrumb { font-size: 0.68rem; }
}

