        /* OrthoMynd Brand Colors:
           - Copper: #c16036
           - Navy: #3c4e7c
           - Silver: #dad7de
           - Dark Navy Background: #1a2744
        */
        :root {
            /* Light Theme - Navy Chrome */
            --bg-primary: #f5f7fa;
            --bg-secondary: #eef1f5;
            --bg-card: #f5f7fa;
            --bg-elevated: #e8ebf0;
            --border: #c5cdd8;
            --border-light: #d8dde6;
            --text-primary: #1a2332;
            --text-secondary: #4a5568;
            --text-muted: #8b97a8;
            --accent: #3c4e7c;
            --accent-light: rgba(60, 78, 124, 0.1);
            --accent-dark: #2d3d63;
            --accent-secondary: #8a9bb8;
            --accent-secondary-light: rgba(138, 155, 184, 0.1);
            --tier1: #059669;
            --tier2: #d97706;
            --tier3: #ea580c;
            --tier4: #dc2626;
            --shadow: 0 1px 3px rgba(0,0,0,0.08);
            --radius: 12px;
            --radius-sm: 8px;
            --safe-bottom: env(safe-area-inset-bottom, 0px);
            --safe-top: env(safe-area-inset-top, 0px);
            --safe-left: env(safe-area-inset-left, 0px);
            --safe-right: env(safe-area-inset-right, 0px);
        }

        [data-theme="dark"] {
            /* Dark Theme - Navy Chrome */
            --bg-primary: #0f1728;
            --bg-secondary: #1a2338;
            --bg-card: #1e2c45;
            --bg-elevated: #283650;
            --border: #2d3d5a;
            --border-light: #3c4e7c;
            --text-primary: #f0f2f5;
            --text-secondary: #b8c4d4;
            --text-muted: #7a8ba0;
            --accent: #6b82b0;
            --accent-light: rgba(107, 130, 176, 0.2);
            --accent-dark: #5a71a0;
            --accent-secondary: #b0bdd4;
            --accent-secondary-light: rgba(176, 189, 212, 0.2);
            --shadow: 0 2px 8px rgba(0,0,0,0.4);
        }

        /* Health Icons - SVG icon styling */
        .hi {
            display: inline-block;
            width: 1em;
            height: 1em;
            vertical-align: -0.125em;
            fill: currentColor;
        }
        .hi-img {
            display: inline-block;
            width: 1em;
            height: 1em;
            vertical-align: -0.125em;
            object-fit: contain;
            filter: var(--hi-filter, none);
        }
        /* Dark mode filter for health icons to match text color */
        [data-theme="dark"] .hi-img {
            filter: brightness(0) saturate(100%) invert(85%) sepia(5%) saturate(300%) hue-rotate(180deg) brightness(95%);
        }
        /* Accent colored health icons */
        .hi-img.hi-accent {
            filter: brightness(0) saturate(100%) invert(45%) sepia(60%) saturate(500%) hue-rotate(340deg) brightness(90%);
        }
        [data-theme="dark"] .hi-img.hi-accent {
            filter: brightness(0) saturate(100%) invert(65%) sepia(40%) saturate(400%) hue-rotate(340deg) brightness(100%);
        }
        /* Size variants */
        .hi-sm { width: 0.875em; height: 0.875em; }
        .hi-lg { width: 1.25em; height: 1.25em; }
        .hi-xl { width: 1.5em; height: 1.5em; }
        .hi-2x { width: 2em; height: 2em; }

        * { margin: 0; padding: 0; box-sizing: border-box; }
        
        /* ===== ACCESSIBILITY ===== */
        /* Focus visible styles for keyboard navigation */
        *:focus { outline: none; }
        *:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
        }
        button:focus-visible,
        .btn-main:focus-visible,
        .chip:focus-visible,
        .tab:focus-visible,
        .toggle-item:focus-visible,
        .region-card:focus-visible,
        .accordion-header:focus-visible {
            outline: 2px solid var(--accent);
            outline-offset: 2px;
            box-shadow: 0 0 0 4px var(--accent-light);
        }
        /* Screen reader only text */
        .sr-only {
            position: absolute;
            width: 1px;
            height: 1px;
            padding: 0;
            margin: -1px;
            overflow: hidden;
            clip: rect(0, 0, 0, 0);
            white-space: nowrap;
            border: 0;
        }
        /* Skip link for keyboard users */
        .skip-link {
            position: absolute;
            top: -100px;
            left: 50%;
            transform: translateX(-50%);
            background: var(--accent);
            color: white;
            padding: 8px 16px;
            border-radius: var(--radius);
            z-index: 9999;
            transition: top 0.2s;
        }
        .skip-link:focus {
            top: 10px;
        }
        
        /* ===== TOAST NOTIFICATIONS ===== */
        .toast-container {
            position: fixed;
            top: calc(20px + var(--safe-top));
            left: 50%;
            transform: translateX(-50%);
            z-index: 10000;
            display: flex;
            flex-direction: column;
            gap: 8px;
            pointer-events: none;
            max-width: calc(100% - 32px);
            width: 360px;
        }
        .toast {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px 16px;
            display: flex;
            align-items: flex-start;
            gap: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            animation: toastIn 0.3s ease;
            pointer-events: auto;
        }
        .toast.hiding {
            animation: toastOut 0.3s ease forwards;
        }
        @keyframes toastIn {
            from { opacity: 0; transform: translateY(-20px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes toastOut {
            from { opacity: 1; transform: translateY(0); }
            to { opacity: 0; transform: translateY(-20px); }
        }
        .toast-icon {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            font-size: 14px;
        }
        .toast.success .toast-icon { background: rgba(5,150,105,0.15); color: var(--tier1); }
        .toast.error .toast-icon { background: rgba(220,38,38,0.15); color: var(--tier4); }
        .toast.warning .toast-icon { background: rgba(217,119,6,0.15); color: var(--tier2); }
        .toast.info .toast-icon { background: var(--accent-light); color: var(--accent); }
        .toast-content { flex: 1; min-width: 0; }
        .toast-title { font-weight: 600; font-size: 13px; margin-bottom: 2px; }
        .toast-message { font-size: 12px; color: var(--text-secondary); line-height: 1.4; }
        .toast-close {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            margin: -4px;
            font-size: 16px;
            flex-shrink: 0;
        }
        .toast-close:hover { color: var(--text-primary); }
        
        /* ===== TOOLTIP ===== */
        .tooltip-trigger {
            position: relative;
            cursor: help;
            border-bottom: 1px dotted var(--text-muted);
        }
        .tooltip-trigger::after {
            content: attr(data-tooltip);
            position: absolute;
            bottom: 100%;
            left: 50%;
            transform: translateX(-50%);
            background: var(--text-primary);
            color: var(--bg-primary);
            padding: 6px 10px;
            border-radius: 6px;
            font-size: 11px;
            font-weight: 500;
            white-space: nowrap;
            opacity: 0;
            visibility: hidden;
            transition: all 0.2s;
            z-index: 1000;
            max-width: 250px;
            white-space: normal;
            text-align: center;
            line-height: 1.4;
        }
        .tooltip-trigger:hover::after,
        .tooltip-trigger:focus::after {
            opacity: 1;
            visibility: visible;
            bottom: calc(100% + 6px);
        }
        
        /* ===== VALIDATION STATES ===== */
        .validation-error {
            color: var(--tier4);
            font-size: 12px;
            margin-top: 6px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .validation-error i { font-size: 14px; }
        .input-error {
            border-color: var(--tier4) !important;
            box-shadow: 0 0 0 3px rgba(220,38,38,0.1) !important;
        }
        
        /* ===== SESSION RECOVERY BANNER ===== */
        .session-recovery-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.4);
            backdrop-filter: blur(4px);
            -webkit-backdrop-filter: blur(4px);
            z-index: 999;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
        }
        .session-recovery {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 20px;
            box-shadow: 0 8px 32px rgba(0,0,0,0.2);
            max-width: 360px;
            width: 100%;
            display: flex;
            flex-direction: column;
            gap: 16px;
            animation: scaleIn 0.25s ease;
        }
        @keyframes scaleIn {
            from { opacity: 0; transform: scale(0.95); }
            to { opacity: 1; transform: scale(1); }
        }
        .session-recovery-text {
            display: flex;
            align-items: flex-start;
            gap: 12px;
        }
        .session-recovery-text i {
            font-size: 28px;
            color: var(--accent);
            flex-shrink: 0;
        }
        .session-recovery-text div h4 {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 4px;
        }
        .session-recovery-text div p {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.4;
        }
        .session-recovery-btns {
            display: flex;
            gap: 10px;
        }
        .session-recovery-btns button {
            flex: 1;
            padding: 12px;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            border: none;
            transition: opacity 0.2s;
        }
        .session-recovery-btns button:hover {
            opacity: 0.9;
        }
        .session-recovery-btns .btn-resume {
            background: var(--accent);
            color: white;
        }
        .session-recovery-btns .btn-discard {
            background: var(--bg-secondary);
            color: var(--text-secondary);
        }

        body {
            font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
            background: var(--bg-primary);
            color: var(--text-primary);
            min-height: 100vh;
            min-height: 100dvh;
            overflow: hidden;
            -webkit-font-smoothing: antialiased;
        }

        .app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; }

        /* Header */
        /* Standalone mode (Add to Home Screen) adjustments */
        @supports (padding-top: env(safe-area-inset-top)) {
            .header {
                padding-top: calc(8px + var(--safe-top));
            }
        }
        
        .header {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 16px;
            padding-left: calc(16px + var(--safe-left));
            padding-right: calc(16px + var(--safe-right));
            background: var(--bg-primary);
            border-bottom: 1px solid var(--border);
            flex-shrink: 0; z-index: 100;
        }
        
        /* Mobile header - more compact */
        @media (max-width: 767px) {
            .header {
                padding: 8px 12px;
                padding-left: calc(12px + var(--safe-left));
                padding-right: calc(12px + var(--safe-right));
            }
            .back-btn, .icon-btn {
                width: 34px; height: 34px;
                font-size: 18px;
            }
            .header-left { gap: 8px; }
            .header-title { font-size: 15px; }
            .header-right { gap: 4px; }
            .mode-badge {
                font-size: 9px;
                padding: 3px 6px;
            }
        }
        
        .header-left { display: flex; align-items: center; gap: 12px; }
        .back-btn {
            width: 40px; height: 40px;
            border-radius: var(--radius-sm); border: none;
            background: var(--bg-secondary); color: var(--text-secondary);
            font-size: 20px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
        }
        .back-btn:disabled { opacity: 0; pointer-events: none; }
        .header-title { font-size: 17px; font-weight: 600; }
        .header-right { display: flex; align-items: center; gap: 8px; }
        .icon-btn {
            width: 40px; height: 40px;
            border-radius: var(--radius-sm); border: none;
            background: transparent; color: var(--text-secondary);
            font-size: 20px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
        }
        .mode-badge {
            font-size: 10px; font-weight: 600;
            padding: 4px 8px; border-radius: 4px;
            text-transform: uppercase;
            background: var(--accent-light); color: var(--accent);
        }

        /* Teaching Toggle Button in Header */
        .teaching-toggle-btn {
            width: 36px; height: 36px;
            border-radius: var(--radius-sm);
            border: 2px solid transparent;
            background: transparent;
            color: var(--text-muted);
            font-size: 18px;
            display: flex; align-items: center; justify-content: center;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .teaching-toggle-btn:hover {
            background: var(--accent-light);
            color: var(--accent);
        }
        .teaching-toggle-btn.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .teaching-toggle-btn.active i::before {
            content: "\F50A"; /* bi-mortarboard-fill */
        }

        /* App Content */
        .app-content {
            height: calc(100vh - 65px);
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .workflow-view {
            display: flex;
            flex-direction: column;
            height: calc(100vh - 65px);
            overflow: hidden;
        }
        .workflow-view .main-content {
            flex: 1;
            min-height: 0; /* Important for flex children to shrink */
            overflow: hidden;
        }

        /* Breadcrumb Navigation */
        .breadcrumb-nav {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px 20px;
            background: var(--bg-primary);
            border-bottom: 1px solid var(--border);
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
            scrollbar-width: none;
        }
        .breadcrumb-nav::-webkit-scrollbar {
            display: none;
        }
        .breadcrumb-item {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 15px;
            font-weight: 500;
            color: var(--text-muted);
            white-space: nowrap;
            text-decoration: none;
            cursor: default;
            transition: color 0.15s;
        }
        .breadcrumb-item.completed {
            color: var(--accent);
            cursor: pointer;
        }
        .breadcrumb-item.completed:hover {
            text-decoration: underline;
        }
        .breadcrumb-item.active {
            color: var(--text-primary);
            font-weight: 700;
        }
        .breadcrumb-icon {
            font-size: 16px;
            flex-shrink: 0;
        }
        .breadcrumb-text {
            display: inline;
        }
        .breadcrumb-sep {
            color: var(--text-muted);
            font-size: 18px;
            font-weight: 400;
            flex-shrink: 0;
            opacity: 0.6;
        }
        
        /* Step indicator button (mobile only) */
        .step-indicator-btn {
            display: none;
            align-items: center;
            justify-content: center;
            padding: 6px 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-secondary);
            white-space: nowrap;
            cursor: pointer;
            flex-shrink: 0;
            transition: all 0.15s;
        }
        .step-indicator-btn:hover {
            background: var(--bg-card);
            border-color: var(--accent);
            color: var(--accent);
        }
        
        /* Mobile: hide future steps, show indicator button, icon-only for completed */
        @media (max-width: 767px) {
            .breadcrumb-nav {
                padding: 10px 12px;
                gap: 8px;
            }
            .breadcrumb-item {
                font-size: 14px;
            }
            .breadcrumb-sep {
                font-size: 16px;
            }
            .breadcrumb-item.future,
            .breadcrumb-sep.future {
                display: none;
            }
            .step-indicator-btn {
                display: flex;
            }
            /* Completed items: icon only on mobile */
            .breadcrumb-item.completed .breadcrumb-text {
                display: none;
            }
            .breadcrumb-item.completed .breadcrumb-icon {
                font-size: 18px;
            }
            /* Hide step header on mobile */
            .step-header {
                display: none !important;
            }
        }
        
        /* Tablet/Desktop: show all breadcrumbs including future, icon + text */
        @media (min-width: 768px) {
            .breadcrumb-item.future {
                display: flex;
            }
            .breadcrumb-sep.future {
                display: block;
            }
        }

        /* Main */
        .main-content {
            flex: 1;
            overflow: hidden;
            display: flex;
            flex-direction: column;
        }
        .step-container {
            width: 100%;
            flex: 1;
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
        }
        .step {
            display: none;
            padding: 20px 16px;
            animation: fadeIn 0.25s ease;
        }
        @media (max-width: 767px) {
            .step {
                padding: 14px 12px;
            }
        }
        .step.active { display: block; }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

        /* Step Header */
        .step-header { margin-bottom: 20px; }
        .step-label { font-size: 11px; font-weight: 600; color: var(--accent); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
        .step-title { font-size: 21px; font-weight: 700; margin-bottom: 6px; }
        .step-desc { font-size: 14px; color: var(--text-secondary); line-height: 1.4; }
        
        @media (max-width: 767px) {
            .step-header { margin-bottom: 14px; }
            .step-label { font-size: 10px; margin-bottom: 2px; }
            .step-title { font-size: 18px; margin-bottom: 4px; }
            .step-desc { font-size: 13px; }
        }

        /* Anatomy SVG */
        .anatomy-container { 
            display: flex; 
            flex-direction: column; 
            align-items: center; 
            margin-bottom: 16px;
            max-height: 50vh;
        }
        .body-svg-wrapper {
            width: 100%;
            max-width: 240px;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            background-image: url('/static/core/images/human-anatomy.png');
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
        }
        .body-svg {
            width: 100%;
            height: auto;
            opacity: 0;
            max-height: 100%;
        }
        .body-region, .spine-region {
            cursor: pointer;
            transition: fill 0.2s ease;
            fill: #e2e8f0;
            stroke: #fff;
            stroke-width: 2px;
        }
        [data-theme="dark"] .body-region, [data-theme="dark"] .spine-region {
            fill: #475569;
            stroke: #1e293b;
        }
        .body-region:hover, .spine-region:hover {
            fill: rgba(43, 65, 98, 0.3);
        }
        [data-theme="dark"] .body-region:hover, [data-theme="dark"] .spine-region:hover {
            fill: rgba(90, 138, 196, 0.4);
        }
        .body-region.selected, .spine-region.selected {
            fill: var(--accent);
        }
        [data-theme="dark"] .body-region.selected, [data-theme="dark"] .spine-region.selected {
            fill: var(--accent);
        }

        /* Selection Summary */
        .selection-bar {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px 14px;
            margin-bottom: 16px;
        }
        .selection-header {
            display: flex; align-items: center; justify-content: space-between;
            margin-bottom: 8px;
        }
        .selection-header span { font-size: 12px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; }
        .selection-count {
            font-size: 11px; font-weight: 600;
            padding: 3px 8px; border-radius: 10px;
            background: var(--accent-light); color: var(--accent);
        }
        .selection-chips {
            display: flex; flex-wrap: wrap; gap: 8px;
            min-height: 28px;
        }
        .sel-chip {
            display: inline-flex; align-items: center; gap: 6px;
            padding: 5px 10px;
            background: var(--accent-light);
            border: 1px solid var(--accent);
            border-radius: 14px;
            font-size: 12px; font-weight: 500;
            color: var(--accent);
        }
        .sel-chip .x {
            width: 14px; height: 14px;
            border-radius: 50%;
            background: var(--accent);
            color: white;
            display: flex; align-items: center; justify-content: center;
            font-size: 9px;
            cursor: pointer;
        }
        .sel-chip .x:hover { background: var(--accent-dark); }
        .sel-empty { color: var(--text-muted); font-size: 13px; }

        /* Region Grid */
        .region-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
        }
        .region-section-label {
            grid-column: 1 / -1;
            text-align: center;
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 12px 0 4px;
        }
        .region-section-label:first-child {
            padding-top: 0;
        }
        /* Collapsible Region Category Blocks */
        .region-category-blocks {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 16px;
        }
        .region-category-block {
            background: var(--bg-secondary);
            border: none;
            border-radius: var(--radius);
            padding: 14px 16px;
            margin-bottom: 12px;
            cursor: pointer;
            transition: all 0.2s ease;
            display: flex;
            flex-direction: row;
            align-items: center;
            gap: 14px;
        }
        .region-category-block:last-child {
            margin-bottom: 0;
        }
        .region-category-block:hover {
            opacity: 0.85;
        }
        .region-category-block.has-selection {
            background: var(--accent-light);
        }
        .region-category-block .category-icon {
            width: 44px;
            height: 44px;
            border-radius: 10px;
            background: var(--bg-primary);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: var(--accent);
            flex-shrink: 0;
        }
        .region-category-block.has-selection .category-icon {
            background: var(--accent);
            color: white;
        }
        .region-category-block.has-selection .category-icon .hi-img {
            filter: brightness(0) saturate(100%) invert(100%);
        }
        .region-category-block .category-info {
            flex: 1;
            min-width: 0;
        }
        .region-category-block .category-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.3;
        }
        .region-category-block .category-subtitle {
            font-size: 12px;
            color: var(--text-muted);
            line-height: 1.3;
        }
        .region-category-block .category-badge {
            display: inline-flex;
            align-items: center;
            gap: 4px;
            padding: 4px 10px;
            background: var(--accent);
            color: white;
            border-radius: 12px;
            font-size: 11px;
            font-weight: 600;
            flex-shrink: 0;
        }
        .region-category-block .category-chevron {
            color: var(--text-muted);
            font-size: 16px;
            flex-shrink: 0;
        }
        /* Expanded region section */
        .region-section-expanded {
            margin-bottom: 12px;
        }
        .region-section-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            background: var(--bg-secondary);
            border: none;
            border-radius: var(--radius) var(--radius) 0 0;
            cursor: pointer;
        }
        .region-section-header .header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .region-section-header .header-icon-wrap {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            background: var(--bg-primary);
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .region-section-header .header-icon {
            font-size: 16px;
            color: var(--accent);
        }
        .region-section-header .header-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .region-section-header .header-close {
            background: none;
            border: none;
            color: var(--text-muted);
            cursor: pointer;
            padding: 4px;
            font-size: 16px;
            line-height: 1;
            border-radius: 4px;
        }
        .region-section-header .header-close:hover {
            color: var(--accent);
        }
        .region-section-content {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            padding: 12px;
            background: var(--bg-secondary);
            border: none;
            border-top: 1px solid var(--bg-primary);
            border-radius: 0 0 var(--radius) var(--radius);
        }
        /* Collapsible regions visibility - desktop shows desktop, mobile shows mobile */
        .collapsible-regions-desktop {
            display: block;
        }
        .collapsible-regions-mobile {
            display: none;
        }
        @media (max-width: 1023px) {
            .collapsible-regions-desktop {
                display: none;
            }
            .collapsible-regions-mobile {
                display: block;
            }
        }
        /* Region Cards - Mobile (Layout 3: Single Row Inline) */
        .region-card {
            padding: 8px 10px;
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius);
            display: flex;
            align-items: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .region-card:active { transform: scale(0.98); }
        .region-card.selected { background: var(--accent-light); border-color: var(--accent); }
        .region-card .icon { font-size: 18px; color: var(--accent); flex-shrink: 0; }
        .region-card .icon .hi-img { width: 18px; height: 18px; filter: brightness(0) saturate(100%) invert(45%) sepia(60%) saturate(500%) hue-rotate(340deg) brightness(90%); }
        [data-theme="dark"] .region-card .icon .hi-img { filter: brightness(0) saturate(100%) invert(65%) sepia(40%) saturate(400%) hue-rotate(340deg) brightness(100%); }
        .region-card .name { 
            font-size: 11px; 
            font-weight: 600; 
            color: var(--text-primary); 
            flex: 1;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .region-card.selected .name { color: var(--accent); }
        .region-card .side-btns {
            display: flex; gap: 4px; flex-shrink: 0;
        }
        .region-card .side-btn {
            padding: 6px 10px;
            min-width: 36px;
            min-height: 32px;
            border-radius: 6px;
            font-size: 11px; font-weight: 600;
            border: 1px solid var(--border);
            background: var(--bg-secondary);
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.15s;
            text-align: center;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .region-card .side-btn:hover { border-color: var(--accent); color: var(--accent); }
        .region-card .side-btn.on { background: var(--accent); border-color: var(--accent); color: white; }
        .region-card .side-btn.hide { display: none; }
        
        /* Region Cards - Tablet/Desktop (Layout 2: Compact Horizontal with Icon Box) */
        @media (min-width: 768px) {
            .region-card {
                padding: 8px 10px;
                gap: 8px;
            }
            .region-card .icon {
                width: 36px; height: 36px;
                min-width: 36px;
                background: var(--bg-secondary);
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 18px;
            }
            .region-card.selected .icon {
                background: var(--accent);
                color: white;
            }
            .region-card.selected .icon .hi-img {
                filter: brightness(0) saturate(100%) invert(100%);
            }
            .region-card .name {
                font-size: 11px;
            }
            .region-card .side-btns {
                gap: 4px;
            }
            .region-card .side-btn {
                padding: 6px 10px;
                min-width: 36px;
                font-size: 10px;
            }
        }

        /* Forms */
        .form-group { margin-bottom: 20px; }
        .form-label { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
        .form-label i { color: var(--accent); }

        .chip-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
        .chip {
            padding: 10px 16px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            display: inline-flex;
            align-items: center;
            gap: 6px;
        }
        .chip:hover { border-color: var(--accent); }
        .chip.on { background: var(--accent-light); border-color: var(--accent); color: var(--accent); }
        .chip .flag-icon { color: var(--tier4); font-size: 12px; }
        .chip.on .flag-icon { color: var(--accent); }

        .select-box { position: relative; }
        .select-box select {
            width: 100%; padding: 12px 14px; padding-right: 40px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 15px; color: var(--text-primary);
            font-family: inherit;
            appearance: none; cursor: pointer;
        }
        .select-box::after {
            content: '▾'; position: absolute;
            right: 14px; top: 50%; transform: translateY(-50%);
            color: var(--text-muted); pointer-events: none;
        }

        /* Alert */
        .alert {
            padding: 14px;
            border-radius: var(--radius);
            margin-bottom: 16px;
            display: flex; gap: 12px;
        }
        .alert.warn { background: rgba(220,38,38,0.08); border: 1px solid rgba(220,38,38,0.2); }
        .alert.warn i { color: var(--tier4); font-size: 22px; }
        .alert h4 { font-size: 14px; font-weight: 600; color: var(--tier4); margin-bottom: 2px; }
        .alert p { font-size: 13px; color: var(--text-secondary); }

        /* Toggle Items */
        .toggle-list { display: flex; flex-direction: column; gap: 8px; }
        .toggle-item {
            display: flex; align-items: center; justify-content: space-between;
            padding: 14px 16px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            min-height: 52px;
            transition: all 0.15s;
        }
        .toggle-item:hover { border-color: var(--border-light); }
        .toggle-item:active { transform: scale(0.995); }
        .toggle-item span { font-size: 14px; display: flex; align-items: center; gap: 8px; flex: 1; padding-right: 12px; }
        .toggle-item span i { color: var(--text-muted); }
        .toggle-item span .flag-icon { color: var(--tier4); }
        .toggle { width: 48px; height: 28px; background: var(--bg-elevated); border-radius: 14px; position: relative; cursor: pointer; transition: background 0.2s; flex-shrink: 0; }
        .toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; background: white; border-radius: 50%; box-shadow: var(--shadow); transition: left 0.2s; }
        .toggle.on { background: var(--accent); }
        .toggle.on::after { left: 23px; }
        .toggle-item.on .toggle { background: var(--accent); }
        .toggle-item.on .toggle::after { left: 23px; }
        .toggle-item.red-flag.on { border-color: var(--tier4); background: rgba(220,38,38,0.03); }
        .toggle-item.red-flag.on .toggle { background: var(--tier4); }

        /* Attestation Section */
        .attestation-section {
            margin-top: 20px;
            padding: 16px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
        }
        .attestation-header {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 12px;
            padding-bottom: 10px;
            border-bottom: 1px solid var(--border);
        }
        .attestation-header i { color: var(--accent); }
        .attestation-item {
            display: flex;
            gap: 12px;
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
            cursor: pointer;
        }
        .attestation-item:last-child { border-bottom: none; }
        .attestation-checkbox {
            width: 22px;
            height: 22px;
            border: 2px solid var(--border);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.2s;
            margin-top: 2px;
        }
        .attestation-checkbox i { display: none; color: white; font-size: 12px; }
        .attestation-item.checked .attestation-checkbox {
            background: var(--accent);
            border-color: var(--accent);
        }
        .attestation-item.checked .attestation-checkbox i { display: block; }
        .attestation-content { flex: 1; }
        .attestation-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .attestation-text {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.5;
        }
        .attestation-required {
            margin-top: 12px;
            padding: 10px 12px;
            background: rgba(217,119,6,0.08);
            border-radius: var(--radius-sm);
            font-size: 11px;
            color: var(--tier2);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .attestation-complete {
            margin-top: 12px;
            padding: 10px 12px;
            background: rgba(5,150,105,0.08);
            border-radius: var(--radius-sm);
            font-size: 11px;
            color: var(--tier1);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        /* Tabs */
        .tabs-wrap { margin-bottom: 16px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
        .tabs { display: flex; gap: 6px; }
        .tab {
            padding: 10px 14px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 18px;
            font-size: 12px; font-weight: 500;
            white-space: nowrap;
            cursor: pointer;
        }
        .tab.on { background: var(--accent); border-color: var(--accent); color: white; }
        .tab-panel { display: none; }
        .tab-panel.on { display: block; }

        /* Subregion Selection in Assessment */
        .subregion-section {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            margin-bottom: 16px;
        }
        .subregion-section .form-label { margin-bottom: 10px; }
        .sub-chips { display: flex; flex-wrap: wrap; gap: 8px; }
        .sub-chip {
            padding: 8px 14px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: 16px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .sub-chip:hover { border-color: var(--accent); }
        .sub-chip.on { background: var(--accent); border-color: var(--accent); color: white; }

        /* Pain */
        .pain-box {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            margin-bottom: 16px;
        }
        .pain-top { display: flex; justify-content: space-between; margin-bottom: 10px; }
        .pain-lbl { font-size: 13px; color: var(--text-secondary); }
        .pain-val { font-size: 26px; font-weight: 700; }
        .pain-val.c1 { color: var(--tier1); }
        .pain-val.c2 { color: var(--tier2); }
        .pain-val.c3 { color: var(--tier3); }
        .pain-val.c4 { color: var(--tier4); }
        .pain-slider {
            width: 100%; height: 6px;
            border-radius: 3px;
            appearance: none;
            -webkit-appearance: none;
            background: linear-gradient(90deg, var(--tier1), var(--tier2), var(--tier4));
        }
        .pain-slider::-webkit-slider-thumb {
            -webkit-appearance: none;
            width: 24px; height: 24px;
            background: white;
            border: 3px solid var(--text-primary);
            border-radius: 50%;
            box-shadow: var(--shadow);
        }
        .pain-range { display: flex; justify-content: space-between; margin-top: 4px; font-size: 10px; color: var(--text-muted); }

        /* Assessment Accordion Sections */
        .assess-accordion {
            margin-bottom: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            background: var(--bg-card);
            overflow: hidden;
        }
        .assess-accordion-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px;
            background: var(--bg-secondary);
            cursor: pointer;
            transition: background 0.2s;
        }
        .assess-accordion-header:hover {
            background: var(--bg-elevated);
        }
        .assess-accordion-header h5 {
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }
        .assess-accordion-header h5 i { color: var(--accent); }
        .assess-accordion-header .header-right {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .assess-accordion-header .chevron {
            transition: transform 0.2s;
            color: var(--text-muted);
        }
        .assess-accordion.open .assess-accordion-header .chevron {
            transform: rotate(180deg);
        }
        .assess-accordion-body {
            display: none;
            padding: 14px;
            border-top: 1px solid var(--border);
        }
        .assess-accordion.open .assess-accordion-body {
            display: block;
            animation: accordionExpand 0.25s ease;
        }
        @keyframes accordionExpand {
            from { opacity: 0; transform: translateY(-10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        /* Collapsing animation when auto-advancing */
        .assess-accordion.collapsing {
            animation: accordionCollapse 0.25s ease forwards;
        }
        .assess-accordion.collapsing .assess-accordion-body {
            animation: accordionBodyCollapse 0.2s ease forwards;
        }
        @keyframes accordionCollapse {
            from { opacity: 1; transform: scale(1); }
            to { opacity: 0.7; transform: scale(0.98); }
        }
        @keyframes accordionBodyCollapse {
            from { opacity: 1; max-height: 500px; }
            to { opacity: 0; max-height: 0; padding: 0 14px; }
        }
        /* Completed section highlight */
        .assess-accordion.just-completed {
            animation: completedPulse 0.5s ease;
        }
        @keyframes completedPulse {
            0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
            50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0.2); }
            100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
        }

        /* Status Badges */
        .status-badge {
            font-size: 10px;
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 10px;
            text-transform: uppercase;
            white-space: nowrap;
        }
        .status-badge.complete {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .status-badge.required {
            background: rgba(217, 119, 6, 0.1);
            color: var(--tier2);
        }
        .status-badge.in-progress {
            background: rgba(13, 148, 136, 0.1);
            color: var(--accent);
        }
        .status-badge.optional {
            background: var(--bg-elevated);
            color: var(--text-muted);
        }
        .status-badge.positive {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }
        .status-badge.negative {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }

        /* Rule Progress Inline */
        .rule-inline-progress {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 16px;
        }
        .rule-inline-dots {
            display: flex;
            gap: 6px;
        }
        .rule-inline-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--border);
            transition: all 0.2s;
        }
        .rule-inline-dot.complete {
            background: var(--accent);
        }
        .rule-inline-dot.current {
            background: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-light);
        }
        .rule-inline-text {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* Rule Question Card */
        .rule-question-card {
            background: var(--bg-secondary);
            border-radius: var(--radius);
            padding: 16px;
        }
        .rule-question-card p {
            font-size: 12px;
            color: var(--text-muted);
            margin-bottom: 8px;
        }
        .rule-question-card h4 {
            font-size: 15px;
            font-weight: 600;
            margin-bottom: 16px;
            line-height: 1.4;
        }

        /* Rule Result Inline */
        .rule-result-inline {
            text-align: center;
            padding: 24px 16px;
        }
        .rule-result-inline i {
            font-size: 36px;
            margin-bottom: 10px;
        }
        .rule-result-inline.positive i { color: var(--tier4); }
        .rule-result-inline.negative i { color: var(--tier1); }
        .rule-result-inline h4 {
            font-size: 15px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .rule-result-inline.positive h4 { color: var(--tier4); }
        .rule-result-inline.negative h4 { color: var(--tier1); }
        .rule-result-inline p {
            font-size: 12px;
            color: var(--text-muted);
        }

        /* Mark Complete Button */
        .btn-mark-complete {
            width: 100%;
            padding: 12px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            margin-top: 12px;
            transition: all 0.2s;
        }
        .btn-mark-complete:hover {
            background: var(--accent-dark);
        }
        .btn-mark-complete.complete {
            background: var(--tier1);
        }
        .btn-mark-complete.complete:hover {
            background: #047857;
        }

        /* Workup Placeholder */
        .workup-placeholder {
            text-align: center;
            padding: 24px 16px;
            color: var(--text-muted);
        }
        .workup-placeholder i {
            font-size: 24px;
            opacity: 0.4;
            margin-bottom: 8px;
        }
        .workup-placeholder p {
            font-size: 13px;
            line-height: 1.5;
        }

        /* Reference Images Section */
        .ref-images-section {
            margin-top: 16px;
        }
        .ref-images-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 12px;
        }
        .ref-images-header h5 {
            font-size: 13px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .ref-images-header h5 i { color: var(--accent); }

        /* Image Tabs */
        .img-tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 12px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            padding: 3px;
        }
        .img-tab {
            flex: 1;
            padding: 8px 10px;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .img-tab:hover { color: var(--text-secondary); }
        .img-tab.active {
            background: var(--bg-card);
            color: var(--accent);
            box-shadow: var(--shadow);
        }
        .img-tab .count {
            font-size: 9px;
            background: var(--bg-secondary);
            padding: 2px 5px;
            border-radius: 8px;
        }
        .img-tab.active .count {
            background: var(--accent-light);
            color: var(--accent);
        }

        /* Image Grid */
        .img-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
            gap: 10px;
            margin-bottom: 16px;
        }
        .img-card {
            position: relative;
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
            aspect-ratio: 1;
        }
        .img-card:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .img-card.selected {
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-light);
        }
        .img-card img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .img-card-overlay {
            position: absolute;
            bottom: 0;
            left: 0;
            right: 0;
            background: linear-gradient(transparent, rgba(0,0,0,0.8));
            padding: 20px 6px 6px;
        }
        .img-card-label {
            font-size: 9px;
            font-weight: 600;
            color: white;
            text-shadow: 0 1px 2px rgba(0,0,0,0.5);
            line-height: 1.2;
        }
        .img-card-badge {
            position: absolute;
            top: 4px;
            right: 4px;
            padding: 2px 5px;
            border-radius: 4px;
            font-size: 8px;
            font-weight: 700;
            text-transform: uppercase;
        }
        .img-card-badge.normal {
            background: rgba(5, 150, 105, 0.9);
            color: white;
        }
        .img-card-badge.pathology {
            background: rgba(220, 38, 38, 0.9);
            color: white;
        }
        .img-card-delete {
            position: absolute;
            top: 4px;
            right: 4px;
            width: 20px;
            height: 20px;
            background: rgba(220, 38, 38, 0.9);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 10px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            opacity: 0;
            transition: opacity 0.2s;
        }
        .img-card:hover .img-card-delete { opacity: 1; }

        /* Upload Zone */
        .upload-zone {
            border: 2px dashed var(--border);
            border-radius: var(--radius);
            padding: 20px;
            text-align: center;
            cursor: pointer;
            transition: all 0.2s;
            background: var(--bg-secondary);
        }
        .upload-zone:hover, .upload-zone.dragover {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .upload-zone i {
            font-size: 28px;
            color: var(--text-muted);
            margin-bottom: 8px;
        }
        .upload-zone:hover i, .upload-zone.dragover i {
            color: var(--accent);
        }
        .upload-zone p {
            font-size: 12px;
            color: var(--text-muted);
            margin: 0;
        }
        .upload-zone small {
            font-size: 10px;
            color: var(--text-muted);
            opacity: 0.7;
        }
        .upload-zone input {
            display: none;
        }

        /* Comparison Button */
        .compare-btn {
            width: 100%;
            padding: 10px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
            margin-top: 12px;
        }
        .compare-btn:hover {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .compare-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .compare-btn:disabled:hover {
            background: var(--bg-secondary);
            border-color: var(--border);
            color: var(--text-secondary);
        }

        /* Image Viewer Modal */
        .img-viewer-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.95);
            z-index: 2000;
            display: none;
            flex-direction: column;
        }
        .img-viewer-modal.open { display: flex; }
        .img-viewer-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: rgba(0,0,0,0.5);
            color: white;
        }
        .img-viewer-title {
            font-size: 14px;
            font-weight: 600;
        }
        .img-viewer-subtitle {
            font-size: 11px;
            opacity: 0.7;
        }
        .img-viewer-close {
            width: 36px;
            height: 36px;
            background: rgba(255,255,255,0.1);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 18px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .img-viewer-close:hover { background: rgba(255,255,255,0.2); }
        .img-viewer-body {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            overflow: auto;
        }
        .img-viewer-body img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: var(--radius);
        }
        .img-viewer-info {
            padding: 16px;
            background: rgba(0,0,0,0.5);
            color: white;
        }
        .img-viewer-desc {
            font-size: 13px;
            line-height: 1.5;
            margin-bottom: 10px;
        }
        .img-viewer-findings {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .img-viewer-finding {
            font-size: 10px;
            padding: 4px 8px;
            background: rgba(255,255,255,0.1);
            border-radius: 10px;
        }
        .img-viewer-source {
            font-size: 10px;
            opacity: 0.6;
            margin-top: 10px;
        }
        .img-viewer-source a {
            color: var(--accent);
        }

        /* Comparison Modal */
        .comparison-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.95);
            z-index: 2000;
            display: none;
            flex-direction: column;
        }
        .comparison-modal.open { display: flex; }
        .comparison-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: rgba(0,0,0,0.5);
            color: white;
        }
        .comparison-body {
            flex: 1;
            display: flex;
            gap: 4px;
            padding: 16px;
            overflow: hidden;
        }
        .comparison-panel {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: rgba(255,255,255,0.05);
            border-radius: var(--radius);
            overflow: hidden;
        }
        .comparison-panel-header {
            padding: 10px 12px;
            background: rgba(0,0,0,0.3);
            font-size: 12px;
            font-weight: 600;
            color: white;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .comparison-panel-header i {
            color: var(--accent);
        }
        .comparison-panel-body {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 16px;
            overflow: auto;
        }
        .comparison-panel-body img {
            max-width: 100%;
            max-height: 100%;
            object-fit: contain;
            border-radius: var(--radius-sm);
        }
        .comparison-empty {
            text-align: center;
            color: rgba(255,255,255,0.4);
        }
        .comparison-empty i {
            font-size: 36px;
            display: block;
            margin-bottom: 8px;
        }

        /* Empty State */
        .img-empty {
            text-align: center;
            padding: 20px;
            color: var(--text-muted);
        }
        .img-empty i {
            font-size: 24px;
            opacity: 0.3;
            margin-bottom: 8px;
        }
        .img-empty p {
            font-size: 12px;
        }

        /* Imaging Section Enhanced */
        .imaging-section {
            margin-top: 8px;
        }
        .imaging-tabs {
            display: flex;
            gap: 2px;
            margin-bottom: 16px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            padding: 3px;
        }
        .imaging-tab {
            flex: 1;
            padding: 10px 8px;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
        }
        .imaging-tab i { font-size: 14px; }
        .imaging-tab:hover { color: var(--text-secondary); }
        .imaging-tab.active {
            background: var(--bg-card);
            color: var(--accent);
            box-shadow: var(--shadow);
        }
        .imaging-tab .badge {
            font-size: 8px;
            background: var(--bg-secondary);
            padding: 2px 5px;
            border-radius: 8px;
        }
        .imaging-tab.active .badge {
            background: var(--accent-light);
            color: var(--accent);
        }

        /* Protocol Card */
        .protocol-section {
            margin-bottom: 16px;
        }
        .protocol-section-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .protocol-section-title i { color: var(--accent); }
        .protocol-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
            overflow: hidden;
        }
        .protocol-view-row {
            display: flex;
            align-items: flex-start;
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            gap: 10px;
        }
        .protocol-view-row:last-child { border-bottom: none; }
        .protocol-view-name {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-primary);
            min-width: 80px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .protocol-view-name i {
            color: var(--accent);
            font-size: 10px;
        }
        .protocol-view-eval {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.4;
            flex: 1;
        }

        /* Key Findings */
        .key-findings-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .key-finding-item {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 8px 0;
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.4;
            border-bottom: 1px solid var(--border);
        }
        .key-finding-item:last-child { border-bottom: none; }
        .key-finding-item i {
            color: var(--tier2);
            font-size: 10px;
            margin-top: 3px;
            flex-shrink: 0;
        }

        /* Imaging Alert */
        .imaging-alert {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px;
            border-radius: var(--radius);
            margin-bottom: 16px;
        }
        .imaging-alert.positive {
            background: rgba(220, 38, 38, 0.08);
            border: 1px solid var(--tier4);
        }
        .imaging-alert.positive i { color: var(--tier4); font-size: 18px; }
        .imaging-alert.info {
            background: rgba(13, 148, 136, 0.08);
            border: 1px solid var(--accent);
        }
        .imaging-alert.info i { color: var(--accent); font-size: 18px; }
        .imaging-alert-content h4 {
            font-size: 13px;
            font-weight: 600;
            margin-bottom: 4px;
        }
        .imaging-alert-content p {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Findings Checklist */
        .findings-checklist {
            display: flex;
            flex-direction: column;
            gap: 6px;
        }
        .finding-item {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
        }
        .finding-item:hover {
            border-color: var(--accent);
        }
        .finding-item.selected {
            background: var(--accent-light);
            border-color: var(--accent);
        }
        .finding-item.selected.negative {
            background: rgba(5, 150, 105, 0.1);
            border-color: var(--tier1);
        }
        .finding-item.selected.positive {
            background: rgba(220, 38, 38, 0.1);
            border-color: var(--tier4);
        }
        .finding-checkbox {
            width: 20px;
            height: 20px;
            border: 2px solid var(--border);
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            transition: all 0.2s;
        }
        .finding-item.selected .finding-checkbox {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }
        .finding-item.selected.negative .finding-checkbox {
            background: var(--tier1);
            border-color: var(--tier1);
        }
        .finding-item.selected.positive .finding-checkbox {
            background: var(--tier4);
            border-color: var(--tier4);
        }
        .finding-checkbox i { font-size: 12px; }
        .finding-icon {
            width: 28px;
            height: 28px;
            border-radius: 6px;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 12px;
        }
        .finding-item.selected .finding-icon {
            background: rgba(13, 148, 136, 0.15);
            color: var(--accent);
        }
        .finding-label {
            font-size: 12px;
            font-weight: 500;
            color: var(--text-primary);
        }

        /* Findings Notes */
        .findings-notes {
            margin-top: 12px;
        }
        .findings-notes-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            margin-bottom: 6px;
            display: block;
        }
        .findings-notes-input {
            width: 100%;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-secondary);
            font-size: 12px;
            color: var(--text-primary);
            resize: vertical;
            min-height: 60px;
            font-family: inherit;
        }
        .findings-notes-input:focus {
            outline: none;
            border-color: var(--accent);
        }

        /* Findings Summary */
        .findings-summary {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
            margin-top: 12px;
        }
        .finding-tag {
            font-size: 10px;
            font-weight: 600;
            padding: 4px 8px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .finding-tag.normal {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .finding-tag.abnormal {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }

        /* Physical Exam Section */
        .exam-section {
            margin-top: 16px;
        }
        .exam-tabs {
            display: flex;
            gap: 4px;
            margin-bottom: 12px;
            background: var(--bg-elevated);
            border-radius: var(--radius-sm);
            padding: 3px;
        }
        .exam-tab {
            flex: 1;
            padding: 8px 10px;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }
        .exam-tab:hover { color: var(--text-secondary); }
        .exam-tab.active {
            background: var(--bg-card);
            color: var(--accent);
            box-shadow: var(--shadow);
        }
        .exam-tab .count {
            font-size: 9px;
            background: var(--bg-secondary);
            padding: 2px 5px;
            border-radius: 8px;
        }
        .exam-tab.active .count {
            background: var(--accent-light);
            color: var(--accent);
        }

        /* Exam Card */
        .exam-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 12px;
            margin-bottom: 10px;
            cursor: pointer;
            transition: all 0.2s;
        }
        .exam-card:hover {
            border-color: var(--accent);
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        .exam-card.completed {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.05);
        }
        .exam-card.completed.positive {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.05);
        }
        .exam-card-header {
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            gap: 8px;
            margin-bottom: 6px;
        }
        .exam-card-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.3;
        }
        .exam-card-target {
            font-size: 11px;
            color: var(--accent);
            margin-bottom: 4px;
        }
        .exam-card-desc {
            font-size: 11px;
            color: var(--text-muted);
            line-height: 1.4;
        }
        .exam-card-footer {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 8px;
            padding-top: 8px;
            border-top: 1px solid var(--border);
        }
        .exam-card-stats {
            display: flex;
            gap: 10px;
            font-size: 10px;
            color: var(--text-muted);
        }
        .exam-card-stat {
            display: flex;
            align-items: center;
            gap: 3px;
        }
        .exam-card-stat i { font-size: 10px; }
        .exam-card-assets {
            display: flex;
            gap: 4px;
        }
        .exam-asset-badge {
            width: 20px;
            height: 20px;
            border-radius: 4px;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 10px;
            color: var(--text-muted);
        }
        .exam-asset-badge.video { color: var(--tier4); }
        .exam-asset-badge.image { color: var(--accent); }
        .exam-asset-badge.pdf { color: var(--tier2); }

        /* Exam Result Badge */
        .exam-result-badge {
            font-size: 9px;
            font-weight: 700;
            padding: 3px 6px;
            border-radius: 8px;
            text-transform: uppercase;
        }
        .exam-result-badge.positive {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }
        .exam-result-badge.negative {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .exam-result-badge.equivocal {
            background: rgba(217, 119, 6, 0.1);
            color: var(--tier2);
        }

        /* Exam Empty State */
        .exam-empty {
            text-align: center;
            padding: 24px 16px;
            color: var(--text-muted);
        }
        .exam-empty i {
            font-size: 28px;
            opacity: 0.3;
            margin-bottom: 8px;
        }
        .exam-empty p {
            font-size: 12px;
            line-height: 1.5;
        }

        /* Exam Detail Modal */
        .exam-modal {
            position: fixed;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(0,0,0,0.6);
            z-index: 2000;
            display: none;
            align-items: flex-end;
            justify-content: center;
        }
        .exam-modal.open { display: flex; }
        @media (min-width: 768px) {
            .exam-modal { align-items: center; }
        }
        .exam-modal-content {
            background: var(--bg-card);
            border-radius: var(--radius) var(--radius) 0 0;
            width: 100%;
            max-height: 90vh;
            overflow-y: auto;
            animation: slideUp 0.3s ease;
        }
        @media (min-width: 768px) {
            .exam-modal-content {
                max-width: 600px;
                border-radius: var(--radius);
                max-height: 85vh;
            }
        }
        .exam-modal-header {
            padding: 16px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: flex-start;
            justify-content: space-between;
            position: sticky;
            top: 0;
            background: var(--bg-card);
            z-index: 1;
        }
        .exam-modal-title {
            font-size: 16px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .exam-modal-target {
            font-size: 12px;
            color: var(--accent);
        }
        .exam-modal-close {
            width: 32px;
            height: 32px;
            background: var(--bg-secondary);
            border: none;
            border-radius: 50%;
            color: var(--text-muted);
            font-size: 16px;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .exam-modal-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
        .exam-modal-body {
            padding: 16px;
        }
        .exam-modal-section {
            margin-bottom: 20px;
        }
        .exam-modal-section:last-child { margin-bottom: 0; }
        .exam-modal-section-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .exam-modal-section-title i { color: var(--accent); }
        .exam-modal-text {
            font-size: 13px;
            line-height: 1.6;
            color: var(--text-secondary);
        }
        .exam-modal-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }
        .exam-modal-list li {
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-secondary);
            padding: 6px 0;
            padding-left: 20px;
            position: relative;
        }
        .exam-modal-list li::before {
            content: '';
            position: absolute;
            left: 0;
            top: 12px;
            width: 6px;
            height: 6px;
            background: var(--accent);
            border-radius: 50%;
        }
        .exam-interpretation-box {
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            padding: 12px;
            margin-bottom: 8px;
        }
        .exam-interpretation-label {
            font-size: 11px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .exam-interpretation-label.positive { color: var(--tier4); }
        .exam-interpretation-label.negative { color: var(--tier1); }
        .exam-interpretation-label.equivocal { color: var(--tier2); }
        .exam-interpretation-text {
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.4;
        }
        .exam-stats-row {
            display: flex;
            gap: 16px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
        }
        .exam-stat-item {
            text-align: center;
        }
        .exam-stat-value {
            font-size: 18px;
            font-weight: 700;
            color: var(--accent);
        }
        .exam-stat-label {
            font-size: 10px;
            color: var(--text-muted);
            text-transform: uppercase;
        }
        .exam-pearl {
            display: flex;
            gap: 8px;
            padding: 10px;
            background: rgba(13, 148, 136, 0.08);
            border-left: 3px solid var(--accent);
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            margin-bottom: 6px;
        }
        .exam-pearl i { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
        .exam-pearl-text {
            font-size: 12px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        /* Exam Assets Gallery */
        .exam-assets-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
            gap: 10px;
        }
        .exam-asset-card {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
            cursor: pointer;
            transition: all 0.2s;
        }
        .exam-asset-card:hover {
            border-color: var(--accent);
            transform: translateY(-2px);
        }
        .exam-asset-thumb {
            aspect-ratio: 4/3;
            background: var(--bg-elevated);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
        }
        .exam-asset-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .exam-asset-thumb .placeholder-icon {
            font-size: 24px;
            color: var(--text-muted);
            opacity: 0.5;
        }
        .exam-asset-type-badge {
            position: absolute;
            top: 4px;
            right: 4px;
            padding: 2px 6px;
            border-radius: 4px;
            font-size: 9px;
            font-weight: 700;
            text-transform: uppercase;
        }
        .exam-asset-type-badge.video {
            background: rgba(220, 38, 38, 0.9);
            color: white;
        }
        .exam-asset-type-badge.image {
            background: rgba(13, 148, 136, 0.9);
            color: white;
        }
        .exam-asset-info {
            padding: 8px;
        }
        .exam-asset-name {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.3;
        }

        /* Exam Record Actions */
        .exam-modal-actions {
            padding: 16px;
            border-top: 1px solid var(--border);
            background: var(--bg-secondary);
            position: sticky;
            bottom: 0;
        }
        .exam-result-selector {
            display: flex;
            gap: 8px;
            margin-bottom: 12px;
        }
        .exam-result-btn {
            flex: 1;
            padding: 12px;
            border: 2px solid var(--border);
            background: var(--bg-card);
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
        }
        .exam-result-btn:hover { border-color: var(--text-muted); }
        .exam-result-btn.selected.positive {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }
        .exam-result-btn.selected.negative {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .exam-result-btn.selected.equivocal {
            border-color: var(--tier2);
            background: rgba(217, 119, 6, 0.1);
            color: var(--tier2);
        }
        .exam-save-btn {
            width: 100%;
            padding: 14px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
        }
        .exam-save-btn:hover { background: var(--accent-dark); }
        .exam-save-btn:disabled {
            background: var(--bg-elevated);
            color: var(--text-muted);
            cursor: not-allowed;
        }

        /* Rule Card */
        .rule-box {
            background: var(--accent-light);
            border: 1px solid var(--accent);
            border-radius: var(--radius);
            padding: 14px;
            margin-top: 16px;
        }
        .rule-box h5 { font-size: 14px; font-weight: 600; color: var(--accent); margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
        .rule-box p { font-size: 12px; color: var(--text-secondary); margin-bottom: 10px; }
        .rule-box button {
            padding: 10px 14px;
            background: var(--accent); color: white;
            border: none; border-radius: var(--radius-sm);
            font-size: 13px; font-weight: 600;
            cursor: pointer;
            display: flex; align-items: center; gap: 6px;
        }

        /* Exam Card */
        .exam-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 12px;
        }
        .exam-img {
            height: 140px;
            background: linear-gradient(135deg, var(--bg-secondary), var(--bg-elevated));
            display: flex; flex-direction: column;
            align-items: center; justify-content: center;
            color: var(--text-muted);
            border-bottom: 1px solid var(--border);
        }
        .exam-img i { font-size: 36px; margin-bottom: 6px; opacity: 0.4; }
        .exam-img span { font-size: 11px; }
        .exam-body { padding: 14px; }
        .exam-body h4 { font-size: 15px; font-weight: 600; margin-bottom: 6px; }
        .exam-body p { font-size: 13px; color: var(--text-secondary); margin-bottom: 14px; line-height: 1.4; }
        .exam-btns { display: flex; gap: 10px; }
        .exam-btns button {
            flex: 1; padding: 12px;
            border-radius: var(--radius-sm);
            font-size: 14px; font-weight: 600;
            cursor: pointer;
            background: var(--bg-card);
            border: 2px solid var(--border);
            color: var(--text-primary);
            transition: all 0.15s;
        }
        .exam-btns button:hover {
            border-color: var(--text-muted);
            background: var(--bg-secondary);
        }
        .exam-btns .btn-yes:hover {
            border-color: var(--tier4);
            background: rgba(220,38,38,0.05);
            color: var(--tier4);
        }
        .exam-btns .btn-no:hover {
            border-color: var(--tier1);
            background: rgba(5,150,105,0.05);
            color: var(--tier1);
        }
        .exam-btns button:active {
            transform: scale(0.97);
        }

        /* Rule Progress */
        .rule-prog { margin-bottom: 20px; }
        .rule-bar { height: 5px; background: var(--bg-elevated); border-radius: 3px; overflow: hidden; margin-bottom: 6px; }
        .rule-fill { height: 100%; background: var(--accent); }
        .rule-txt { font-size: 12px; color: var(--text-muted); text-align: center; }

        /* Rule Result */
        .rule-result {
            text-align: center;
            padding: 24px;
            border: 2px solid;
            border-radius: var(--radius);
        }
        .rule-result.pos { border-color: var(--tier4); background: rgba(220,38,38,0.05); }
        .rule-result.neg { border-color: var(--tier1); background: rgba(5,150,105,0.05); }
        .rule-result i { font-size: 40px; margin-bottom: 10px; }
        .rule-result.pos i { color: var(--tier4); }
        .rule-result.neg i { color: var(--tier1); }
        .rule-result h4 { font-size: 16px; font-weight: 700; margin-bottom: 4px; }
        .rule-result.pos h4 { color: var(--tier4); }
        .rule-result.neg h4 { color: var(--tier1); }
        .rule-result p { font-size: 13px; color: var(--text-secondary); }

        /* Results */
        .results-top { text-align: center; padding: 16px 0; }
        .results-icon {
            width: 52px; height: 52px;
            background: var(--accent-light);
            border-radius: 50%;
            display: flex; align-items: center; justify-content: center;
            margin: 0 auto 10px;
            font-size: 22px; color: var(--accent);
        }
        .priority-box {
            border: 2px solid;
            border-radius: var(--radius);
            padding: 18px;
            text-align: center;
            margin-bottom: 14px;
        }
        .priority-box.t1 { border-color: var(--tier1); background: rgba(5,150,105,0.05); }
        .priority-box.t2 { border-color: var(--tier2); background: rgba(217,119,6,0.05); }
        .priority-box.t3 { border-color: var(--tier3); background: rgba(234,88,12,0.05); }
        .priority-box.t4 { border-color: var(--tier4); background: rgba(220,38,38,0.05); }
        .priority-tier { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 2px; }
        .priority-box.t1 .priority-tier, .priority-box.t1 .priority-name { color: var(--tier1); }
        .priority-box.t2 .priority-tier, .priority-box.t2 .priority-name { color: var(--tier2); }
        .priority-box.t3 .priority-tier, .priority-box.t3 .priority-name { color: var(--tier3); }
        .priority-box.t4 .priority-tier, .priority-box.t4 .priority-name { color: var(--tier4); }
        .priority-name { font-size: 17px; font-weight: 700; margin-bottom: 2px; }
        .priority-desc { font-size: 12px; color: var(--text-secondary); }

        .stats-row { display: grid; grid-template-columns: repeat(3,1fr); gap: 8px; margin-bottom: 16px; }
        .stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; text-align: center; }
        .stat-val { font-size: 20px; font-weight: 700; color: var(--accent); }
        .stat-lbl { font-size: 10px; color: var(--text-muted); text-transform: uppercase; margin-top: 2px; }

        .sec-title { font-size: 13px; font-weight: 600; margin-bottom: 10px; display: flex; align-items: center; gap: 6px; }
        .sec-title i { color: var(--accent); }

        .finding-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 8px;
            overflow: hidden;
        }
        .finding-head {
            display: flex; align-items: center; justify-content: space-between;
            padding: 12px 14px;
            cursor: pointer;
        }
        .finding-head h5 { font-size: 13px; font-weight: 600; }
        .tier-tag {
            padding: 3px 8px;
            border-radius: 10px;
            font-size: 10px; font-weight: 600;
        }
        .tier-tag.t1 { background: rgba(5,150,105,0.1); color: var(--tier1); }
        .tier-tag.t2 { background: rgba(217,119,6,0.1); color: var(--tier2); }
        .tier-tag.t3 { background: rgba(234,88,12,0.1); color: var(--tier3); }
        .tier-tag.t4 { background: rgba(220,38,38,0.1); color: var(--tier4); }
        .finding-body {
            display: none;
            padding: 0 14px 12px;
            border-top: 1px solid var(--border);
        }
        .finding-card.open .finding-body { display: block; padding-top: 12px; }
        .detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 12px; }
        .detail-lbl { color: var(--text-muted); }
        .detail-val { font-weight: 500; }

        .ddx-section { margin-top: 10px; }
        .ddx-title { font-size: 10px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; margin-bottom: 6px; }
        .ddx-item {
            display: flex; align-items: center; gap: 6px;
            padding: 6px 10px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            margin-bottom: 4px;
            font-size: 12px;
        }
        .ddx-item i { color: var(--accent); }
        .ddx-item.alert { background: rgba(220,38,38,0.05); }
        .ddx-item.alert i { color: var(--tier4); }

        .care-box {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 14px;
            margin-top: 16px;
        }
        .care-item {
            display: flex; align-items: flex-start; gap: 8px;
            padding: 6px 0;
            border-bottom: 1px solid var(--border);
            font-size: 12px; color: var(--text-secondary);
        }
        .care-item:last-child { border-bottom: none; }
        .care-item i { color: var(--accent); margin-top: 1px; }
        .care-item.urgent i { color: var(--tier4); }

        /* Recommendations Screen - Enhanced */
        .rec-header {
            text-align: center;
            padding: 20px 0;
            border-bottom: 1px solid var(--border);
            margin-bottom: 16px;
        }
        .rec-header .tier-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            border-radius: 24px;
            font-size: 14px;
            font-weight: 700;
            margin-bottom: 12px;
        }
        .rec-header .tier-badge.t1 { background: rgba(5,150,105,0.1); color: var(--tier1); }
        .rec-header .tier-badge.t2 { background: rgba(217,119,6,0.1); color: var(--tier2); }
        .rec-header .tier-badge.t3 { background: rgba(234,88,12,0.1); color: var(--tier3); }
        .rec-header .tier-badge.t4 { background: rgba(220,38,38,0.1); color: var(--tier4); }
        .rec-header .tier-badge i { font-size: 18px; }
        .rec-header .rec-summary { font-size: 15px; font-weight: 600; color: var(--text-primary); margin-bottom: 8px; }
        .rec-header .rec-meta { font-size: 11px; color: var(--text-muted); }
        .rec-header .rec-meta span { margin: 0 6px; }

        /* Actions Bar */
        .actions-bar {
            display: flex;
            gap: 8px;
            padding: 12px 0;
            margin-bottom: 16px;
            overflow-x: auto;
            -webkit-overflow-scrolling: touch;
        }
        .action-btn {
            flex: 1;
            min-width: 70px;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 4px;
            padding: 12px 8px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s;
        }
        .action-btn:hover { border-color: var(--accent); }
        .action-btn:active { transform: scale(0.97); }
        .action-btn i { font-size: 20px; color: var(--accent); }
        .action-btn span { font-size: 10px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; }
        .action-btn.primary { background: var(--accent); border-color: var(--accent); }
        .action-btn.primary i, .action-btn.primary span { color: white; }

        /* Recommendation Cards */
        .rec-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 12px;
            overflow: hidden;
        }
        .rec-card.urgent { border-color: var(--tier4); }
        .rec-card.positive { border-color: var(--tier1); }
        .rec-card-header {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 14px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
        }
        .rec-card.urgent .rec-card-header { background: rgba(220,38,38,0.05); }
        .rec-card-header i { font-size: 18px; color: var(--accent); }
        .rec-card.urgent .rec-card-header i { color: var(--tier4); }
        .rec-card-header h4 { font-size: 13px; font-weight: 600; flex: 1; }
        .rec-card-body { padding: 14px; }
        .rec-card-body p { font-size: 13px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }
        .rec-card-body p:last-child { margin-bottom: 0; }

        /* Disposition Card */
        .disposition-main {
            font-size: 16px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .disposition-time {
            font-size: 13px;
            color: var(--accent);
            font-weight: 600;
            margin-bottom: 12px;
        }
        .disposition-list { list-style: none; }
        .disposition-list li {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 6px 0;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .disposition-list li i { color: var(--accent); margin-top: 2px; }

        /* Imaging Card */
        .imaging-item {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
        }
        .imaging-item:last-child { border-bottom: none; }
        .imaging-icon {
            width: 36px;
            height: 36px;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
        }
        .imaging-icon.indicated { background: rgba(220,38,38,0.1); color: var(--tier4); }
        .imaging-icon.not-indicated { background: rgba(5,150,105,0.1); color: var(--tier1); }
        .imaging-details { flex: 1; }
        .imaging-region { font-size: 13px; font-weight: 600; color: var(--text-primary); }
        .imaging-result { font-size: 12px; color: var(--text-secondary); margin-top: 2px; }
        .imaging-views { font-size: 11px; color: var(--text-muted); margin-top: 4px; }

        /* Care Plan Enhanced */
        .care-section { margin-bottom: 16px; }
        .care-section:last-child { margin-bottom: 0; }
        .care-section-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }

        /* Accordion */
        .accordion { margin-bottom: 12px; }
        .accordion-item {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 8px;
            overflow: hidden;
        }
        .accordion-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .accordion-header:hover { background: var(--bg-secondary); }
        .accordion-header h5 {
            font-size: 13px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .accordion-header h5 i { color: var(--accent); }
        .accordion-header .chevron {
            transition: transform 0.2s;
            color: var(--text-muted);
        }
        .accordion-item.open .accordion-header .chevron { transform: rotate(180deg); }
        .accordion-body {
            display: none;
            padding: 0 14px 14px;
            border-top: 1px solid var(--border);
        }
        .accordion-item.open .accordion-body { display: block; padding-top: 14px; }
        .accordion-link {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            margin-bottom: 6px;
            font-size: 12px;
            color: var(--text-primary);
            cursor: pointer;
            transition: background 0.2s;
        }
        .accordion-link:hover { background: var(--bg-elevated); }
        .accordion-link:last-child { margin-bottom: 0; }
        .accordion-link i { color: var(--accent); }

        /* AI Assistant */
        .ai-assistant {
            background: linear-gradient(135deg, rgba(13,148,136,0.05), rgba(13,148,136,0.1));
            border: 1px solid var(--accent);
            border-radius: var(--radius);
            padding: 16px;
            margin-top: 16px;
        }
        .ai-header {
            display: flex;
            align-items: center;
            gap: 10px;
            margin-bottom: 14px;
        }
        .ai-icon {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            background: var(--accent);
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 18px;
        }
        .ai-header-text h5 { font-size: 14px; font-weight: 600; color: var(--text-primary); }
        .ai-header-text p { font-size: 11px; color: var(--text-muted); }
        .ai-questions { margin-bottom: 12px; }
        .ai-q-btn {
            display: block;
            width: 100%;
            text-align: left;
            padding: 10px 12px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 6px;
            font-size: 12px;
            color: var(--text-primary);
            cursor: pointer;
            transition: all 0.2s;
        }
        .ai-q-btn:hover { border-color: var(--accent); background: var(--bg-secondary); }
        .ai-q-btn:last-child { margin-bottom: 0; }
        .ai-input-wrap {
            display: flex;
            gap: 8px;
        }
        .ai-input {
            flex: 1;
            padding: 10px 12px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-family: inherit;
            color: var(--text-primary);
        }
        .ai-input:focus { outline: none; border-color: var(--accent); }
        .ai-send {
            width: 40px;
            height: 40px;
            border-radius: var(--radius-sm);
            background: var(--accent);
            border: none;
            color: white;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .ai-response {
            margin-top: 12px;
            padding: 12px;
            background: var(--bg-card);
            border-radius: var(--radius-sm);
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .ai-disclaimer {
            font-size: 10px;
            color: var(--text-muted);
            text-align: center;
            margin-top: 10px;
        }

        /* Report Modal */
        .report-modal .modal-sheet {
            max-height: 95vh;
        }
        .report-content {
            font-size: 12px;
            line-height: 1.6;
        }
        .report-section {
            margin-bottom: 16px;
            padding-bottom: 16px;
            border-bottom: 1px solid var(--border);
        }
        .report-section:last-child { border-bottom: none; margin-bottom: 0; }
        .report-section-title {
            font-size: 11px;
            font-weight: 700;
            color: var(--accent);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .report-row {
            display: flex;
            padding: 4px 0;
        }
        .report-label { 
            width: 120px; 
            flex-shrink: 0; 
            color: var(--text-muted); 
        }
        .report-value { 
            flex: 1; 
            color: var(--text-primary);
            font-weight: 500;
        }
        .report-disclaimer {
            margin-top: 16px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            font-size: 10px;
            color: var(--text-muted);
            text-align: center;
        }

        /* Share Modal */
        .share-options { display: flex; flex-direction: column; gap: 8px; }
        .share-option {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 14px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s;
        }
        .share-option:hover { border-color: var(--accent); background: var(--bg-secondary); }
        .share-option i { font-size: 20px; color: var(--accent); }
        .share-option-text h5 { font-size: 14px; font-weight: 600; }
        .share-option-text p { font-size: 11px; color: var(--text-muted); }

        /* Template Creation Modal */
        .template-preview {
            display: flex;
            align-items: center;
            gap: 14px;
            padding: 16px;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            margin-bottom: 20px;
        }
        .template-preview-icon {
            width: 52px;
            height: 52px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 24px;
            flex-shrink: 0;
            background: var(--accent);
        }
        .template-preview-name {
            font-weight: 600;
            font-size: 16px;
            margin-bottom: 2px;
        }
        .template-preview-desc {
            font-size: 13px;
            color: var(--text-secondary);
        }
        .template-field {
            margin-bottom: 16px;
        }
        .template-field label {
            display: block;
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .template-field input {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 15px;
            background: var(--bg-primary);
            color: var(--text-primary);
        }
        .template-field input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .template-icon-grid {
            display: grid;
            grid-template-columns: repeat(8, 1fr);
            gap: 6px;
        }
        .template-icon-option {
            aspect-ratio: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            border-radius: 8px;
            cursor: pointer;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border: 2px solid transparent;
            transition: all 0.15s;
        }
        .template-icon-option:hover {
            background: var(--bg-elevated);
            color: var(--text-primary);
        }
        .template-icon-option.selected {
            border-color: var(--accent);
            color: var(--accent);
            background: var(--accent-light);
        }
        .template-color-grid {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .template-color-option {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            cursor: pointer;
            border: 3px solid transparent;
            transition: all 0.15s;
            position: relative;
        }
        .template-color-option:hover {
            transform: scale(1.1);
        }
        .template-color-option.selected {
            border-color: var(--text-primary);
        }
        .template-color-option.selected::after {
            content: '✓';
            position: absolute;
            inset: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 16px;
            font-weight: bold;
            text-shadow: 0 1px 2px rgba(0,0,0,0.3);
        }
        .btn-secondary {
            padding: 12px 16px;
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
        }
        .btn-secondary:hover {
            background: var(--bg-elevated);
        }

        /* Print Styles */
        @media print {
            body { background: white !important; overflow: visible !important; }
            .app { height: auto !important; overflow: visible !important; }
            .header, .breadcrumb-nav, .step-footer, .disc-bar, .side-panel, .actions-bar, .ai-assistant, .modal, .main-nav { display: none !important; }
            .main-content { display: block !important; }
            .step-container { overflow: visible !important; height: auto !important; }
            .step { padding: 20px !important; }
            .rec-card, .accordion-item, .finding-card { break-inside: avoid; }
            .accordion-body { display: block !important; padding-top: 14px !important; }
            .finding-body { display: block !important; padding-top: 12px !important; }
            .app-with-nav { margin-left: 0 !important; }
        }

        /* Step Footer - inside main-content for natural responsive flow */
        .step-footer {
            padding: 16px;
            padding-bottom: calc(16px + var(--safe-bottom));
            background: var(--bg-primary);
            border-top: 1px solid var(--border);
        }
        @media (max-width: 767px) {
            .step-footer {
                padding: 12px;
                padding-bottom: calc(12px + var(--safe-bottom));
            }
        }
        @media (min-width: 1024px) {
            .step-footer {
                padding: 16px 24px;
                max-width: 580px;
                margin: 0 auto;
                border-top: none;
                background: transparent;
            }
        }
        .btn-main {
            width: 100%;
            padding: 14px 20px;
            background: var(--accent); color: white;
            border: none; border-radius: var(--radius);
            font-size: 15px; font-weight: 600;
            cursor: pointer;
            display: flex; align-items: center; justify-content: center; gap: 8px;
        }
        @media (max-width: 767px) {
            .btn-main {
                padding: 12px 16px;
                font-size: 14px;
            }
        }
        .btn-main:disabled { opacity: 0.5; cursor: not-allowed; }
        .btn-main.emergency { background: var(--tier4); }
        .btn-logout {
            width: 100%;
            padding: 12px 20px;
            background: transparent;
            color: var(--tier4);
            border: 1px solid var(--tier4);
            border-radius: var(--radius);
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: all 0.15s;
        }
        .btn-logout:hover {
            background: rgba(239,68,68,0.1);
        }

        /* Modal */
        .modal { position: fixed; inset: 0; background: rgba(0,0,0,0.4); backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px); display: none; align-items: flex-end; justify-content: center; z-index: 1000; }
        .modal.show { display: flex; }
        .modal-sheet {
            width: 100%; max-width: 500px; max-height: 85vh;
            background: var(--bg-primary);
            border-radius: 16px 16px 0 0;
            animation: slideUp 0.25s ease;
        }
        @keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
        .modal-bar { width: 32px; height: 4px; background: var(--border); border-radius: 2px; margin: 10px auto; }
        .modal-body { padding: 0 20px 20px; max-height: calc(85vh - 30px); overflow-y: auto; }
        .modal-title { font-size: 17px; font-weight: 700; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
        .modal-title i { color: var(--accent); }
        .modal-text { font-size: 14px; color: var(--text-secondary); line-height: 1.5; margin-bottom: 10px; }

        /* Settings Side Panel */
        .settings-panel {
            position: fixed;
            top: 0;
            right: 0;
            width: 340px;
            max-width: 90vw;
            height: 100vh;
            background: var(--bg-primary);
            border-left: 1px solid var(--border);
            box-shadow: -4px 0 20px rgba(0,0,0,0.1);
            transform: translateX(100%);
            transition: transform 0.3s ease;
            z-index: 1001;
            display: flex;
            flex-direction: column;
        }
        .settings-panel.open {
            transform: translateX(0);
        }
        .settings-panel.pinned {
            box-shadow: none;
        }
        .settings-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px 20px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-secondary);
            flex-shrink: 0;
        }
        .settings-panel-header h2 {
            font-size: 16px;
            font-weight: 700;
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
        }
        .settings-panel-header h2 i {
            color: var(--accent);
        }
        .settings-panel-actions {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .settings-panel-actions button {
            width: 32px;
            height: 32px;
            border: none;
            background: transparent;
            color: var(--text-muted);
            border-radius: var(--radius-sm);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.15s ease;
        }
        .settings-panel-actions button:hover {
            background: var(--bg-card);
            color: var(--text-primary);
        }
        .settings-panel-actions button.pinned {
            color: var(--accent);
            background: var(--accent-light);
        }
        .settings-panel-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }
        .settings-panel-overlay {
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.3);
            backdrop-filter: blur(2px);
            -webkit-backdrop-filter: blur(2px);
            z-index: 1000;
            opacity: 0;
            visibility: hidden;
            transition: opacity 0.3s ease, visibility 0.3s ease;
        }
        .settings-panel-overlay.show {
            opacity: 1;
            visibility: visible;
        }
        .settings-panel.pinned ~ .settings-panel-overlay {
            display: none;
        }
        /* Adjust main content when panel is pinned */
        body.settings-pinned #appWithNav {
            margin-right: 340px;
            transition: margin-right 0.3s ease;
        }
        body.settings-pinned .settings-panel {
            box-shadow: none;
        }
        /* Hide pin button on tablets and phones (under 1024px) */
        @media (max-width: 1023px) {
            .settings-panel {
                width: 100%;
                max-width: 100%;
            }
            body.settings-pinned #appWithNav {
                margin-right: 0;
            }
            .settings-panel-actions .pin-btn {
                display: none;
            }
        }

        /* iPad landscape (1024px+): 40/60 split */
        @media (min-width: 1024px) {
            .main-content {
                display: grid;
                grid-template-columns: 40fr 60fr;
                grid-template-rows: 1fr auto;
            }
            .side-panel {
                background: var(--bg-secondary);
                border-right: 1px solid var(--border);
                display: flex;
                flex-direction: column;
                overflow: hidden;
                grid-row: 1 / -1;
            }
            .step-container {
                overflow-y: auto;
            }
            .step-footer {
                grid-column: 2;
            }
            .step { max-width: 580px; margin: 0 auto; }
            .step .anatomy-container { display: none; }
            .modal-sheet { max-width: 420px; border-radius: 16px; margin-bottom: 20px; }
        }

        /* Color Customizer Styles */
        .color-customizer {
            background: var(--bg-secondary);
            border-radius: var(--radius);
            padding: 12px;
        }
        .color-row {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 0;
            border-bottom: 1px solid var(--border);
        }
        .color-row:last-child {
            border-bottom: none;
            padding-bottom: 0;
        }
        .color-row:first-child {
            padding-top: 0;
        }
        .color-label {
            display: flex;
            flex-direction: column;
            gap: 2px;
        }
        .color-name {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .color-desc {
            font-size: 10px;
            color: var(--text-muted);
        }
        .color-picker-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .color-picker-wrap input[type="color"] {
            width: 32px;
            height: 32px;
            padding: 0;
            border: 2px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            background: none;
        }
        .color-picker-wrap input[type="color"]::-webkit-color-swatch-wrapper {
            padding: 2px;
        }
        .color-picker-wrap input[type="color"]::-webkit-color-swatch {
            border: none;
            border-radius: 4px;
        }
        .color-value {
            font-size: 11px;
            font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
            color: var(--text-muted);
            min-width: 60px;
        }
        .color-presets {
            display: flex;
            align-items: center;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid var(--border);
        }
        .color-preset {
            width: 28px;
            height: 28px;
            padding: 3px;
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: 6px;
            cursor: pointer;
            margin-right: 6px;
            transition: all 0.15s ease;
        }
        .color-preset:hover {
            border-color: var(--text-muted);
            transform: scale(1.1);
        }
        .color-preset span {
            display: block;
            width: 100%;
            height: 100%;
            border-radius: 3px;
        }

        /* Feature Toggle Styles */
        .feature-item:hover {
            background: var(--bg-secondary);
        }
        .feature-group-header:hover {
            background: var(--bg-card) !important;
        }

        /* iPad Pro landscape (1366px+): 60/40 split */
        @media (min-width: 1366px) {
            .main-content { grid-template-columns: 60fr 40fr; }
        }
        @media (max-width: 1023px) { .side-panel { display: none; } }

        /* Segmented Control */
        .segment-control-wrap {
            display: flex;
            justify-content: center;
            padding: 12px;
            flex-shrink: 0;
        }
        .segment-control {
            display: inline-flex;
            background: var(--bg-elevated);
            border-radius: var(--radius);
            padding: 4px;
        }
        .segment-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            padding: 10px 16px;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }
        .segment-btn:hover { color: var(--text-secondary); }
        .segment-btn.active {
            background: var(--bg-card);
            color: var(--accent);
            box-shadow: var(--shadow);
        }
        .segment-btn i { font-size: 16px; }
        
        /* Mobile Segment Control (shown only on mobile in Step 1) */
        .mobile-segment-wrap {
            display: flex;
            justify-content: center;
            margin-bottom: 16px;
        }
        .mobile-segment {
            display: inline-flex;
            background: var(--bg-elevated);
            border-radius: var(--radius);
            padding: 3px;
        }
        .mobile-segment-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
            padding: 8px 12px;
            border: none;
            background: transparent;
            border-radius: var(--radius-sm);
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            cursor: pointer;
            transition: all 0.2s;
        }
        .mobile-segment-btn:hover { color: var(--text-secondary); }
        .mobile-segment-btn.active {
            background: var(--bg-card);
            color: var(--accent);
            box-shadow: var(--shadow);
        }
        .mobile-segment-btn i { font-size: 14px; }
        
        /* Hide mobile segment on iPad landscape+ */
        @media (min-width: 1024px) {
            .mobile-segment-wrap { display: none; }
        }
        
        /* Mobile view containers */
        .mobile-view-cards,
        .mobile-view-diagram,
        .mobile-view-3d {
            display: none;
        }
        .mobile-view-cards.active,
        .mobile-view-diagram.active {
            display: block;
        }
        .mobile-view-3d.active {
            display: block;
        }
        
        /* When 3D is active, hide step header and make container full height */
        @media (max-width: 1023px) {
            .step-container:has(.mobile-3d-active) {
                overflow: hidden;
            }
            .step.mobile-3d-active {
                padding: 0 !important;
                display: flex !important;
                flex-direction: column;
                height: 100%;
                min-height: 100%;
                overflow: hidden;
            }
            .step.mobile-3d-active .step-header,
            .step.mobile-3d-active .mobile-segment-wrap,
            .step.mobile-3d-active .mobile-view-cards,
            .step.mobile-3d-active .mobile-view-diagram,
            .step.mobile-3d-active .region-grid {
                display: none !important;
            }
            .step.mobile-3d-active .mobile-view-3d {
                flex: 1;
                display: flex !important;
                flex-direction: column;
                position: relative;
                min-height: 0;
            }
        }
        
        /* Mobile 3D viewer - matches desktop viewer-container */
        .mobile-3d-container {
            flex: 1;
            position: relative;
            background: var(--bg-secondary);
            overflow: hidden;
            min-height: 0;
        }
        .mobile-3d-container #mobile-three-canvas {
            position: absolute;
            top: 0;
            left: 0;
            width: 100% !important;
            height: 100% !important;
            display: block;
        }
        .mobile-3d-container .viewer-loading {
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            color: var(--text-muted);
            z-index: 5;
        }
        .mobile-3d-container .viewer-loading i {
            font-size: 24px;
            animation: spin 1s linear infinite;
        }
        .mobile-3d-container .viewer-loading span {
            font-size: 12px;
        }
        .mobile-3d-container .viewer-controls {
            position: absolute;
            bottom: 16px;
            left: 50%;
            transform: translateX(-50%);
            z-index: 10;
        }
        /* Mobile filter panel - same as desktop */
        .mobile-3d-container .filter-panel {
            display: none;
            position: absolute;
            bottom: 72px;
            left: 50%;
            transform: translateX(-50%);
            width: 300px;
            max-width: calc(100% - 24px);
            max-height: calc(100% - 100px);
            z-index: 20;
            background: var(--bg-card);
            border-radius: var(--radius);
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            overflow: hidden;
            flex-direction: column;
        }
        .mobile-3d-container .filter-panel.open {
            display: flex;
        }
        /* Selection chips overlay at top of 3D - next to back button */
        .mobile-view-3d .mobile-3d-chips {
            position: absolute;
            top: 12px;
            left: 56px;
            right: 12px;
            z-index: 10;
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .mobile-view-3d .mobile-3d-chips .selection-chip {
            background: rgba(255,255,255,0.95);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        [data-theme="dark"] .mobile-view-3d .mobile-3d-chips .selection-chip {
            background: rgba(30,41,59,0.95);
        }
        /* Hide chips container if empty */
        .mobile-view-3d .mobile-3d-chips:empty {
            display: none;
        }
        /* Back button for mobile 3D */
        .mobile-3d-back {
            position: absolute;
            top: 12px;
            left: 12px;
            z-index: 15;
            width: 36px;
            height: 36px;
            border-radius: 50%;
            border: none;
            background: rgba(255,255,255,0.95);
            color: var(--text-primary);
            font-size: 18px;
            display: flex;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        [data-theme="dark"] .mobile-3d-back {
            background: rgba(30,41,59,0.95);
        }
        .mobile-3d-back:active {
            transform: scale(0.95);
        }
        
        /* On iPad landscape+, always show region-grid, hide mobile views */
        @media (min-width: 1024px) {
            .mobile-view-cards,
            .mobile-view-diagram,
            .mobile-view-3d {
                display: none !important;
            }
            .region-grid {
                display: grid !important;
            }
        }
        
        /* On mobile/tablet portrait, region-grid visibility controlled by mobile view state */
        @media (max-width: 1023px) {
            .region-grid {
                display: none;
            }
            .region-grid.mobile-visible {
                display: grid;
            }
            /* Collapsible region blocks mobile adjustments */
            .region-category-block {
                padding: 12px 14px;
            }
            .region-category-block .category-icon {
                width: 40px;
                height: 40px;
                font-size: 18px;
            }
            .region-category-block .category-title {
                font-size: 13px;
            }
            .region-category-block .category-subtitle {
                font-size: 11px;
            }
        }

        /* 3D Viewer */
        .viewer-container {
            flex: 1;
            position: relative;
            overflow: hidden;
            display: none;
            min-height: 0;
        }
        .viewer-container.active { display: block; }
        .svg-container {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            overflow: hidden;
            min-height: 0;
        }
        .svg-container .body-svg-wrapper {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            max-width: none;
            background-image: url('/static/core/images/human-anatomy.png');
            background-size: contain;
            background-position: center;
            background-repeat: no-repeat;
        }
        .svg-container .body-svg {
            max-width: 100%;
            max-height: 100%;
            opacity: 0;
            width: auto;
            height: auto;
        }
        .svg-container.hidden { display: none; }
        #three-canvas {
            width: 100%;
            height: 100%;
            display: block;
        }
        .viewer-controls {
            position: absolute;
            bottom: 12px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 8px;
            background: var(--bg-card);
            padding: 8px 12px;
            border-radius: 20px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        .viewer-control-btn {
            width: 32px;
            height: 32px;
            border: none;
            background: var(--bg-secondary);
            border-radius: 50%;
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
            transition: all 0.2s;
        }
        .viewer-control-btn:hover {
            background: var(--accent-light);
            color: var(--accent);
        }
        .viewer-control-btn.active {
            background: var(--accent);
            color: white;
        }

        /* 3D Filter Panel - Popover style */
        .filter-panel {
            position: absolute;
            bottom: 72px;
            left: 50%;
            transform: translateX(-50%);
            width: 320px;
            max-width: calc(100% - 24px);
            max-height: calc(100% - 100px);
            background: var(--bg-card);
            border-radius: var(--radius);
            box-shadow: 0 4px 20px rgba(0,0,0,0.2);
            display: none;
            flex-direction: column;
        }
        .filter-panel.open { display: flex; }
        .filter-panel::after {
            content: '';
            position: absolute;
            bottom: -6px;
            left: 50%;
            margin-left: -6px;
            width: 12px;
            height: 12px;
            background: var(--bg-card);
            transform: rotate(45deg);
            box-shadow: 2px 2px 4px rgba(0,0,0,0.1);
            z-index: 0;
        }
        .filter-panel-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            border-bottom: 1px solid var(--border);
            flex-shrink: 0;
            position: relative;
            z-index: 1;
            background: var(--bg-card);
            border-radius: var(--radius) var(--radius) 0 0;
        }
        .filter-panel-header h4 {
            font-size: 13px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .filter-panel-header h4 i { color: var(--accent); }
        .filter-panel-close {
            width: 28px;
            height: 28px;
            border: none;
            background: var(--bg-secondary);
            border-radius: 50%;
            color: var(--text-muted);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 14px;
        }
        .filter-panel-close:hover { background: var(--bg-elevated); color: var(--text-primary); }
        .filter-panel-body {
            padding: 12px 14px;
            overflow-y: auto;
            flex: 1;
            position: relative;
            z-index: 1;
            background: var(--bg-card);
        }
        .filter-group {
            margin-bottom: 14px;
        }
        .filter-group:last-child { margin-bottom: 0; }
        .filter-group-label {
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 8px;
        }
        .filter-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .filter-chip {
            padding: 6px 10px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 14px;
            font-size: 11px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s;
        }
        .filter-chip:hover { border-color: var(--accent); }
        .filter-chip.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .filter-panel-footer {
            display: flex;
            gap: 8px;
            padding: 12px 14px;
            border-top: 1px solid var(--border);
            flex-shrink: 0;
            position: relative;
            z-index: 1;
            background: var(--bg-card);
            border-radius: 0 0 var(--radius) var(--radius);
        }
        .filter-btn {
            flex: 1;
            padding: 10px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 12px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s;
        }
        .filter-btn.secondary {
            background: var(--bg-secondary);
            color: var(--text-secondary);
        }
        .filter-btn.secondary:hover { background: var(--bg-elevated); }
        .filter-btn.primary {
            background: var(--accent);
            color: white;
        }
        .filter-btn.primary:hover { background: var(--accent-dark); }
        .filter-active-badge {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 16px;
            height: 16px;
            background: var(--tier4);
            border-radius: 50%;
            font-size: 9px;
            font-weight: 700;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .viewer-loading {
            position: absolute;
            inset: 0;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: var(--bg-secondary);
            color: var(--text-muted);
            font-size: 13px;
        }
        .viewer-loading i {
            font-size: 32px;
            margin-bottom: 10px;
            animation: spin 1s linear infinite;
        }
        @keyframes spin {
            from { transform: rotate(0deg); }
            to { transform: rotate(360deg); }
        }

        /* ===== LEFT NAVIGATION ===== */
        .main-nav {
            position: fixed;
            left: 0;
            top: 0;
            bottom: 0;
            width: 220px;
            background: var(--bg-card);
            border-right: 1px solid var(--border);
            display: flex;
            flex-direction: column;
            z-index: 100;
            transition: width 0.2s ease;
        }
        .main-nav.collapsed {
            width: 64px;
        }
        .nav-brand {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 12px;
        }
        .nav-logo {
            width: 40px;
            height: 40px;
            border-radius: 8px;
            flex-shrink: 0;
            object-fit: contain;
        }
        .nav-title {
            font-weight: 700;
            font-size: 16px;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
        }
        .nav-title .title-accent {
            color: var(--accent);
        }
        .main-nav.collapsed .nav-title {
            display: none;
        }
        .nav-items {
            flex: 1;
            padding: 12px 8px;
            display: flex;
            flex-direction: column;
            gap: 4px;
            overflow-y: auto;
        }
        .nav-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
            text-decoration: none;
            white-space: nowrap;
        }
        .nav-item:hover {
            background: var(--bg-secondary);
            color: var(--text-primary);
        }
        .nav-item.active {
            background: var(--accent-light);
            color: var(--accent);
        }
        .nav-item i {
            font-size: 20px;
            width: 24px;
            text-align: center;
            flex-shrink: 0;
        }
        .nav-item span {
            font-size: 14px;
            font-weight: 500;
        }
        .main-nav.collapsed .nav-item span {
            display: none;
        }
        .main-nav.collapsed .nav-item {
            justify-content: center;
            padding: 12px 8px;
        }
        .nav-footer {
            padding: 8px;
            display: flex;
            flex-direction: column;
            gap: 4px;
        }
        .nav-collapse-btn {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 10px;
            border: none;
            background: var(--bg-secondary);
            color: var(--text-muted);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .nav-collapse-btn:hover {
            background: var(--border);
            color: var(--text-primary);
        }
        .nav-collapse-btn i {
            font-size: 16px;
            transition: transform 0.2s ease;
        }
        .main-nav.collapsed .nav-collapse-btn i {
            transform: rotate(180deg);
        }
        .nav-collapse-btn span {
            font-size: 12px;
        }
        .main-nav.collapsed .nav-collapse-btn span {
            display: none;
        }

        /* Nav overlay for mobile */
        .nav-overlay {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.5);
            backdrop-filter: blur(2px);
            z-index: 99;
        }
        .nav-overlay.show {
            display: block;
        }

        /* Mobile menu button */
        .mobile-menu-btn {
            display: none;
            align-items: center;
            justify-content: center;
            width: 40px;
            height: 40px;
            border: none;
            background: none;
            color: var(--text-primary);
            font-size: 24px;
            cursor: pointer;
            border-radius: var(--radius-sm);
        }
        .mobile-menu-btn:hover {
            background: var(--bg-secondary);
        }

        /* App container with nav */
        .app-with-nav {
            margin-left: 220px;
            min-height: 100vh;
            transition: margin-left 0.2s ease;
        }
        .main-nav.collapsed ~ .app-with-nav {
            margin-left: 64px;
        }

        /* Responsive nav */
        @media (max-width: 1366px) {
            .main-nav:not(.drawer-open) {
                width: 64px;
            }
            .main-nav:not(.drawer-open) .nav-title,
            .main-nav:not(.drawer-open) .nav-item span,
            .main-nav:not(.drawer-open) .nav-collapse-btn span {
                display: none;
            }
            .main-nav:not(.drawer-open) .nav-item {
                justify-content: center;
                padding: 12px 8px;
            }
            .main-nav:not(.drawer-open) .nav-collapse-btn i {
                transform: rotate(180deg);
            }
            .app-with-nav {
                margin-left: 64px;
            }
        }
        @media (max-width: 767px) {
            .main-nav {
                transform: translateX(-100%);
                width: 280px;
                box-shadow: 4px 0 24px rgba(0,0,0,0.15);
            }
            .main-nav.drawer-open {
                transform: translateX(0);
            }
            .main-nav .nav-title,
            .main-nav .nav-item span,
            .main-nav .nav-collapse-btn {
                display: flex !important;
            }
            .main-nav .nav-item {
                justify-content: flex-start !important;
                padding: 12px !important;
            }
            .app-with-nav {
                margin-left: 0;
            }
            .mobile-menu-btn {
                display: flex;
            }
            .nav-collapse-btn {
                display: none !important;
            }
        }

        /* ===== VIEW-SPECIFIC STYLES ===== */
        .view-container {
            padding: 20px;
            max-width: 900px;
            margin: 0 auto;
        }

        /* Dashboard */
        .dashboard-welcome {
            margin-bottom: 24px;
        }
        .dashboard-welcome h2 {
            font-size: 24px;
            font-weight: 700;
            margin-bottom: 4px;
        }
        .dashboard-actions {
            display: flex;
            flex-direction: column;
            gap: 12px;
            margin-bottom: 24px;
        }
        .resume-card {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: var(--accent-light);
            border: 1px solid var(--accent);
            border-radius: var(--radius);
        }
        .resume-card i {
            font-size: 24px;
            color: var(--accent);
        }
        .resume-card > div {
            flex: 1;
        }
        .resume-card h4 {
            font-size: 14px;
            font-weight: 600;
            margin-bottom: 2px;
        }
        .resume-card p {
            font-size: 12px;
            color: var(--text-secondary);
        }
        .resume-card button {
            padding: 8px 16px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius-sm);
            font-weight: 600;
            cursor: pointer;
        }
        .btn-start-large {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 16px 24px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            width: 100%;
            transition: opacity 0.2s;
        }
        .btn-start-large:hover {
            opacity: 0.9;
        }
        /* KPI Cards */
        .dashboard-kpi-grid {
            display: grid;
            grid-template-columns: 1fr;
            gap: 16px;
            margin-bottom: 24px;
        }
        @media (min-width: 600px) {
            .dashboard-kpi-grid {
                grid-template-columns: repeat(2, 1fr);
            }
        }
        .kpi-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .kpi-header {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .kpi-icon {
            width: 36px;
            height: 36px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
        }
        .kpi-icon.assessments {
            background: rgba(193, 96, 54, 0.12);
            color: var(--accent);
        }
        .kpi-icon.learnings {
            background: rgba(139, 92, 246, 0.12);
            color: #8b5cf6;
        }
        .kpi-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
        }
        .kpi-body {
            display: flex;
            align-items: flex-end;
            gap: 16px;
        }
        .kpi-main {
            flex-shrink: 0;
        }
        .kpi-number {
            font-size: 36px;
            font-weight: 700;
            color: var(--text-primary);
            line-height: 1;
        }
        .kpi-label {
            font-size: 12px;
            color: var(--text-muted);
            margin-top: 4px;
        }
        .kpi-chart {
            flex: 1;
            height: 50px;
            min-width: 0;
        }
        .kpi-footer {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding-top: 8px;
            border-top: 1px solid var(--border);
        }
        .kpi-total {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
        }
        .kpi-period {
            font-size: 11px;
            color: var(--text-muted);
        }
        @media (max-width: 400px) {
            .kpi-number {
                font-size: 28px;
            }
            .kpi-chart {
                height: 40px;
            }
        }
        .dashboard-section {
            margin-bottom: 24px;
        }
        .dashboard-section h3 {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 12px;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .template-quick-list {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .template-quick-item {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.15s;
        }
        .template-quick-item:hover {
            border-color: var(--accent);
            background: var(--bg-secondary);
        }
        .template-quick-icon {
            width: 36px;
            height: 36px;
            border-radius: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 16px;
            flex-shrink: 0;
        }
        .template-quick-info {
            flex: 1;
            min-width: 0;
        }
        .template-quick-name {
            font-weight: 600;
            font-size: 14px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .template-quick-meta {
            font-size: 12px;
            color: var(--text-muted);
        }
        .empty-state {
            text-align: center;
            padding: 48px 24px;
            background: var(--bg-secondary);
            border-radius: var(--radius);
        }
        .empty-state i {
            font-size: 48px;
            color: var(--text-muted);
            margin-bottom: 16px;
        }
        .empty-state h3 {
            font-size: 18px;
            margin-bottom: 8px;
        }
        .empty-state p {
            color: var(--text-secondary);
            margin-bottom: 16px;
            font-size: 14px;
        }

        /* Intake View */
        .intake-view {
            max-width: 600px;
            margin: 0 auto;
            padding: 40px 20px;
            text-align: center;
        }
        .intake-logo {
            height: 100px;
            margin-bottom: 24px;
        }
        .intake-header h1 {
            font-size: 24px;
            color: var(--text-primary);
            margin-bottom: 8px;
        }
        .intake-header p {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 32px;
        }
        .intake-section {
            margin-bottom: 28px;
            text-align: left;
        }
        .intake-section-title {
            font-size: 14px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .role-cards {
            display: grid;
            grid-template-columns: repeat(3, 1fr);
            gap: 12px;
        }
        @media (max-width: 500px) {
            .role-cards {
                grid-template-columns: 1fr;
            }
        }
        .role-card {
            background: var(--bg-card);
            border: 2px solid var(--border);
            border-radius: var(--radius);
            padding: 20px 12px;
            cursor: pointer;
            transition: all 0.2s;
            text-align: center;
        }
        .role-card:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .role-card.selected {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .role-card i {
            font-size: 32px;
            color: var(--accent);
            display: block;
            margin-bottom: 8px;
        }
        .role-card-title {
            display: block;
            font-weight: 600;
            font-size: 14px;
            margin-bottom: 4px;
        }
        .role-card-desc {
            color: var(--text-muted);
            font-size: 11px;
        }
        .intake-input {
            width: 100%;
            padding: 14px 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 16px;
            background: var(--bg-card);
            color: var(--text-primary);
            margin-bottom: 12px;
        }
        .intake-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 3px var(--accent-light);
        }
        .quick-regions {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            justify-content: center;
        }
        .quick-region-chip {
            padding: 8px 16px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .quick-region-chip:hover {
            border-color: var(--accent);
            background: var(--accent-light);
            color: var(--accent);
        }
        .quick-region-chip.selected {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }
        .intake-scope {
            background: var(--bg-secondary);
            border-radius: var(--radius);
            padding: 16px;
            margin: 24px 0;
            text-align: left;
            display: flex;
            gap: 12px;
            align-items: flex-start;
        }
        .intake-scope i {
            color: var(--accent);
            font-size: 20px;
            flex-shrink: 0;
        }
        .intake-scope p {
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin: 0;
        }
        .intake-start-btn {
            width: 100%;
            padding: 16px 24px;
            background: var(--accent);
            color: white;
            border: none;
            border-radius: var(--radius);
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            transition: opacity 0.2s;
        }
        .intake-start-btn:hover:not(:disabled) {
            opacity: 0.9;
        }
        .intake-start-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }

        /* Palpation Map */
        .palpation-section {
            padding: 12px;
        }
        .palp-tabs {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
        }
        .palp-tab {
            flex: 1;
            padding: 10px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-secondary);
            cursor: pointer;
            font-size: 13px;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            transition: all 0.2s;
        }
        .palp-tab:hover {
            border-color: var(--accent);
        }
        .palp-tab.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .palpation-diagram {
            position: relative;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            padding: 20px;
            margin-bottom: 12px;
            min-height: 200px;
        }
        .palpation-diagram-placeholder {
            width: 100%;
            height: 160px;
            background: linear-gradient(135deg, var(--bg-elevated) 0%, var(--bg-secondary) 100%);
            border-radius: var(--radius-sm);
            display: flex;
            align-items: center;
            justify-content: center;
            color: var(--text-muted);
            font-size: 13px;
        }
        .palp-points-overlay {
            position: absolute;
            inset: 20px;
        }
        .palp-point {
            position: absolute;
            width: 32px;
            height: 32px;
            transform: translate(-50%, -50%);
            border: 2px solid var(--text-muted);
            border-radius: 50%;
            background: var(--bg-card);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: all 0.2s;
            z-index: 2;
        }
        .palp-point:hover {
            transform: translate(-50%, -50%) scale(1.1);
            box-shadow: 0 2px 8px rgba(0,0,0,0.15);
        }
        .palp-point.ok {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.15);
        }
        .palp-point.tender {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.15);
        }
        .palp-point-dot {
            width: 10px;
            height: 10px;
            border-radius: 50%;
            background: var(--text-muted);
        }
        .palp-point.ok .palp-point-dot { background: var(--tier1); }
        .palp-point.tender .palp-point-dot { background: var(--tier4); }
        .palp-point-ottawa {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 14px;
            height: 14px;
            background: var(--accent);
            color: white;
            font-size: 8px;
            font-weight: bold;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .palp-legend {
            display: flex;
            flex-wrap: wrap;
            gap: 12px;
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 12px;
            padding: 8px 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
        }
        .palp-legend-item {
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .palp-legend-dot {
            width: 12px;
            height: 12px;
            border-radius: 50%;
            border: 2px solid var(--text-muted);
        }
        .palp-legend-dot.tender { border-color: var(--tier4); background: rgba(220, 38, 38, 0.2); }
        .palp-legend-dot.ok { border-color: var(--tier1); background: rgba(5, 150, 105, 0.2); }

        /* Palpation Cards Grid Layout */
        .palp-cards-grid {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 12px;
            margin-bottom: 16px;
        }
        @media (max-width: 600px) {
            .palp-cards-grid {
                grid-template-columns: 1fr;
            }
        }
        .palp-card {
            display: flex;
            align-items: flex-start;
            gap: 12px;
            padding: 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            cursor: pointer;
            transition: all 0.2s;
        }
        .palp-card:hover {
            border-color: var(--accent);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .palp-card.ok {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.08);
        }
        .palp-card.tender {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.08);
        }
        .palp-card-circle {
            flex-shrink: 0;
            width: 36px;
            height: 36px;
            border: 2px solid var(--text-muted);
            border-radius: 50%;
            background: var(--bg-card);
            display: flex;
            align-items: center;
            justify-content: center;
            position: relative;
            font-size: 16px;
            color: var(--text-muted);
        }
        .palp-card-circle.ok {
            border-color: var(--tier1);
            color: var(--tier1);
            background: rgba(5, 150, 105, 0.15);
        }
        .palp-card-circle.tender {
            border-color: var(--tier4);
            color: var(--tier4);
            background: rgba(220, 38, 38, 0.15);
        }
        .palp-card-ottawa {
            position: absolute;
            top: -4px;
            right: -4px;
            width: 14px;
            height: 14px;
            background: var(--accent);
            color: white;
            font-size: 8px;
            font-weight: bold;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
        }
        .palp-card-content {
            flex: 1;
            min-width: 0;
        }
        .palp-card-name {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 4px;
            display: flex;
            align-items: center;
            gap: 6px;
            flex-wrap: wrap;
        }
        .palp-ottawa-badge {
            display: inline-flex;
            align-items: center;
            padding: 2px 6px;
            background: var(--accent);
            color: white;
            font-size: 9px;
            font-weight: 600;
            border-radius: 10px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
        }
        .palp-card-sig {
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.4;
        }

        .palp-findings {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .palp-finding-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
        }
        .palp-finding-item:last-child {
            border-bottom: none;
        }
        .palp-finding-name {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .palp-finding-badge {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 600;
        }
        .palp-finding-badge.tender {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }
        .palp-finding-badge.ok {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .palp-finding-sig {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* Neurovascular Exam */
        .nv-exam-section {
            margin-top: 16px;
            padding: 16px;
            background: var(--bg-secondary);
            border-radius: var(--radius);
            border: 1px solid var(--border);
        }
        .nv-exam-section.abnormal {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.05);
        }
        .nv-region-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 12px;
            overflow: hidden;
        }
        .nv-region-header {
            padding: 10px 12px;
            background: var(--bg-elevated);
            font-weight: 600;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
        }
        .nv-category {
            padding: 12px;
        }
        .nv-category:not(:last-child) {
            border-bottom: 1px solid var(--border);
        }
        .nv-category-title {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            margin-bottom: 10px;
        }
        .nv-item {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 12px;
            margin-bottom: 8px;
        }
        .nv-item:last-child {
            margin-bottom: 0;
        }
        .nv-item-name {
            font-size: 13px;
            font-weight: 500;
        }
        .nv-options {
            display: flex;
            gap: 4px;
        }
        .nv-option {
            padding: 6px 10px;
            font-size: 11px;
            font-weight: 500;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-secondary);
            color: var(--accent);
            cursor: pointer;
            transition: all 0.15s;
        }
        .nv-option:hover {
            border-color: var(--accent);
        }
        .nv-option.selected {
            background: var(--accent);
            border-color: var(--accent);
            color: #fff;
            font-weight: 600;
        }
        .nv-option.selected.critical {
            background: var(--tier4);
            border-color: var(--tier4);
            color: #fff;
            font-weight: 600;
        }
        .nv-warning {
            display: flex;
            gap: 12px;
            padding: 12px;
            background: rgba(220, 38, 38, 0.1);
            border: 1px solid var(--tier4);
            border-radius: var(--radius-sm);
            margin-top: 12px;
            color: var(--tier4);
        }
        .nv-warning i {
            font-size: 20px;
            flex-shrink: 0;
        }
        .nv-warning strong {
            display: block;
            margin-bottom: 2px;
        }
        .nv-warning p {
            font-size: 12px;
            margin: 0;
            opacity: 0.9;
        }

        /* ROM Assessment */
        .rom-section {
            padding: 12px;
        }
        .rom-header-info {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
            margin-bottom: 16px;
            font-size: 12px;
            color: var(--text-muted);
        }
        .rom-header-info i {
            color: var(--accent);
            margin-top: 1px;
        }
        .rom-grid {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .rom-grid-header {
            display: grid;
            grid-template-columns: 1.5fr 0.8fr 1fr 1fr 0.6fr;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-elevated);
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            border-bottom: 1px solid var(--border);
        }
        .rom-row {
            display: grid;
            grid-template-columns: 1.5fr 0.8fr 1fr 1fr 0.6fr;
            gap: 8px;
            padding: 10px 12px;
            align-items: center;
            border-bottom: 1px solid var(--border);
            font-size: 13px;
        }
        .rom-row:last-child {
            border-bottom: none;
        }
        .rom-row.significant-deficit {
            background: rgba(220, 38, 38, 0.05);
        }
        .rom-motion-col {
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .rom-motion-col i {
            color: var(--accent);
            font-size: 14px;
        }
        .rom-normal-col {
            text-align: center;
        }
        .rom-normal-value {
            color: var(--text-muted);
            font-size: 12px;
        }
        .rom-value-col {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 2px;
        }
        .rom-input-wrapper {
            display: flex;
            align-items: center;
            gap: 2px;
        }
        .rom-input {
            width: 50px;
            padding: 6px 8px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 13px;
            text-align: center;
            background: var(--bg-card);
        }
        .rom-input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .rom-input.deficit {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.05);
        }
        .rom-unit {
            font-size: 11px;
            color: var(--text-muted);
        }
        .rom-deficit {
            font-size: 10px;
            color: var(--tier4);
            font-weight: 600;
        }
        .rom-pain-col {
            display: flex;
            justify-content: center;
        }
        .rom-checkbox {
            position: relative;
            cursor: pointer;
        }
        .rom-checkbox input {
            position: absolute;
            opacity: 0;
            cursor: pointer;
        }
        .rom-checkbox-mark {
            display: block;
            width: 20px;
            height: 20px;
            border: 2px solid var(--border);
            border-radius: 4px;
            background: var(--bg-card);
            transition: all 0.2s;
        }
        .rom-checkbox input:checked ~ .rom-checkbox-mark {
            background: var(--tier4);
            border-color: var(--tier4);
        }
        .rom-checkbox input:checked ~ .rom-checkbox-mark::after {
            content: '';
            position: absolute;
            left: 6px;
            top: 2px;
            width: 5px;
            height: 10px;
            border: solid white;
            border-width: 0 2px 2px 0;
            transform: rotate(45deg);
        }
        .rom-summary {
            margin-top: 16px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .rom-summary-header {
            padding: 10px 12px;
            background: var(--bg-elevated);
            font-weight: 600;
            font-size: 12px;
            border-bottom: 1px solid var(--border);
            display: flex;
            align-items: center;
            gap: 6px;
        }
        .rom-summary-header i {
            color: var(--accent);
        }
        .rom-summary-item {
            padding: 10px 12px;
            font-size: 12px;
            display: flex;
            align-items: flex-start;
            gap: 8px;
        }
        .rom-summary-item i {
            margin-top: 1px;
        }
        .rom-summary-item.ok {
            color: var(--tier1);
        }
        .rom-summary-item.deficit {
            color: var(--tier4);
            background: rgba(220, 38, 38, 0.05);
        }
        .rom-summary-item.pain {
            color: var(--tier3);
            background: rgba(217, 119, 6, 0.05);
        }
        @media (max-width: 600px) {
            .rom-grid-header,
            .rom-row {
                grid-template-columns: 1.2fr 0.6fr 1fr 0.5fr;
                font-size: 11px;
            }
            .rom-input {
                width: 40px;
                padding: 5px 4px;
                font-size: 12px;
            }
        }

        /* Bilateral Comparison */
        .bilateral-comparison-bar {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius);
        }
        .btn-compare {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-card);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .btn-compare:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .btn-compare.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .comparison-view {
            background: var(--bg-card);
            border: 2px solid var(--accent);
            border-radius: var(--radius);
            margin-bottom: 16px;
            overflow: hidden;
        }
        .comparison-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            background: var(--accent-light);
            border-bottom: 1px solid var(--accent);
        }
        .comparison-header h4 {
            font-size: 14px;
            font-weight: 600;
            color: var(--accent);
            margin: 0;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .btn-close-comparison {
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 50%;
            background: transparent;
            color: var(--accent);
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: background 0.2s;
        }
        .btn-close-comparison:hover {
            background: rgba(0,0,0,0.1);
        }
        .comparison-grid {
            display: grid;
            grid-template-columns: 1.2fr 1fr 1fr;
            font-size: 13px;
        }
        .comp-col {
            padding: 10px 12px;
            border-bottom: 1px solid var(--border);
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 4px;
        }
        .comp-col.comp-header {
            background: var(--bg-elevated);
            font-weight: 600;
            font-size: 12px;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            justify-content: center;
        }
        .comp-col.left {
            border-right: 1px solid var(--border);
            background: rgba(59, 130, 246, 0.03);
        }
        .comp-col.right {
            background: rgba(34, 197, 94, 0.03);
        }
        .comp-col.comp-section-header {
            background: var(--bg-secondary);
            font-weight: 600;
            font-size: 11px;
        }
        .comp-row-label {
            padding: 10px 12px;
            font-weight: 500;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
            border-right: 1px solid var(--border);
        }
        .comp-row-label.sub {
            font-weight: 400;
            font-size: 12px;
            padding-left: 20px;
        }
        .comp-row-label.comp-section-header {
            font-weight: 600;
            text-transform: uppercase;
            font-size: 11px;
            letter-spacing: 0.5px;
            color: var(--text-muted);
        }
        .comp-normal {
            font-weight: 400;
            color: var(--text-muted);
            font-size: 11px;
        }
        .comp-value {
            font-weight: 500;
        }
        .comp-value.high {
            color: var(--tier4);
        }
        .comp-value.moderate {
            color: var(--tier3);
        }
        .comp-value.deficit {
            color: var(--tier4);
        }
        .comp-deficit {
            font-size: 10px;
            color: var(--tier4);
            font-weight: 600;
            margin-left: 4px;
        }
        .comp-pain {
            color: var(--tier3);
            font-size: 11px;
            margin-left: 2px;
        }
        .comp-chip {
            display: inline-block;
            padding: 2px 6px;
            background: var(--bg-elevated);
            border-radius: 4px;
            font-size: 11px;
        }
        .comp-chip.tender {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }
        .comp-none {
            color: var(--text-muted);
            font-style: italic;
            font-size: 12px;
        }
        .comp-ok {
            color: var(--tier1);
            font-size: 12px;
        }
        @media (max-width: 600px) {
            .comparison-grid {
                grid-template-columns: 1fr 1fr 1fr;
                font-size: 11px;
            }
            .comp-col, .comp-row-label {
                padding: 8px;
            }
            .comp-row-label.sub {
                padding-left: 12px;
            }
        }

        /* Spine Detail Selector */
        .spine-selector {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 16px;
            overflow: hidden;
        }
        .spine-selector-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 16px;
            background: var(--bg-elevated);
            font-weight: 600;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
        }
        .spine-selector-header i {
            color: var(--accent);
        }
        .spine-visual {
            padding: 16px;
        }
        .spine-column {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-width: 400px;
            margin: 0 auto;
        }
        .spine-level-row {
            display: flex;
            flex-direction: column;
            align-items: stretch;
        }
        .spine-vertebra {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 10px 14px;
            background: var(--bg-secondary);
            border: 2px solid var(--border);
            border-radius: var(--radius-sm);
            cursor: pointer;
            transition: all 0.2s;
            font-size: 13px;
            font-weight: 500;
        }
        .spine-vertebra:hover {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .spine-vertebra.selected {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .spine-vertebra.has-symptoms {
            border-color: var(--tier4);
        }
        .spine-vertebra i {
            color: var(--accent);
        }
        .vertebra-label {
            font-weight: 600;
        }
        .spine-disc {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 4px 8px;
            margin: 2px auto;
            width: 70%;
            background: var(--bg-elevated);
            border: 1px dashed var(--border);
            border-radius: 12px;
            cursor: pointer;
            font-size: 10px;
            color: var(--text-muted);
            transition: all 0.2s;
        }
        .spine-disc:hover {
            border-color: var(--accent-secondary);
            background: var(--accent-secondary-light);
        }
        .spine-disc.selected {
            background: var(--accent-secondary-light);
            border-color: var(--accent-secondary);
            border-style: solid;
            color: var(--accent-secondary);
            font-weight: 600;
        }
        .spine-symptoms {
            display: flex;
            gap: 12px;
            padding: 8px 14px;
            background: rgba(193, 96, 54, 0.05);
            border-left: 2px solid var(--accent);
            margin-bottom: 4px;
        }
        .spine-symptom-check {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            cursor: pointer;
        }
        .spine-symptom-check input {
            width: 14px;
            height: 14px;
            cursor: pointer;
        }
        .spine-legend {
            display: flex;
            justify-content: center;
            gap: 16px;
            margin-top: 16px;
            padding-top: 12px;
            border-top: 1px solid var(--border);
            font-size: 11px;
            color: var(--text-muted);
        }
        .spine-legend .legend-dot {
            display: inline-block;
            width: 16px;
            height: 12px;
            border-radius: 3px;
            margin-right: 4px;
            vertical-align: middle;
        }
        .spine-legend .legend-dot.vertebra {
            background: var(--bg-secondary);
            border: 2px solid var(--border);
        }
        .spine-legend .legend-dot.disc {
            background: var(--bg-elevated);
            border: 1px dashed var(--border);
            width: 24px;
            height: 8px;
            border-radius: 8px;
        }
        .spine-legend .legend-dot.selected {
            background: var(--accent-light);
            border: 2px solid var(--accent);
        }
        .spine-summary {
            border-top: 1px solid var(--border);
        }
        .spine-summary-header {
            padding: 10px 16px;
            background: var(--bg-elevated);
            font-weight: 600;
            font-size: 12px;
            display: flex;
            align-items: center;
            gap: 6px;
            border-bottom: 1px solid var(--border);
        }
        .spine-summary-header i {
            color: var(--accent);
        }
        .spine-summary-content {
            padding: 12px 16px;
        }
        .spine-summary-section {
            margin-bottom: 8px;
        }
        .spine-summary-section:last-child {
            margin-bottom: 0;
        }
        .summary-label {
            font-size: 11px;
            font-weight: 600;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.5px;
            display: block;
            margin-bottom: 4px;
        }
        .summary-values {
            font-size: 13px;
            font-weight: 500;
        }
        .summary-findings {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .finding-chip {
            display: inline-block;
            padding: 4px 8px;
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
            border-radius: 4px;
            font-size: 11px;
            font-weight: 500;
        }

        /* Teaching Mode */
        .teaching-toggle {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-card);
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
        }
        .teaching-toggle:hover {
            border-color: var(--accent);
        }
        .teaching-toggle.active {
            background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
            border-color: #d97706;
            color: white;
        }
        .teaching-toggle.active i {
            color: white;
        }
        .teaching-toggle i {
            color: #f59e0b;
        }

        /* STAT Pearls */
        .stat-pearl {
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
            border: 1px solid rgba(245, 158, 11, 0.3);
            border-radius: var(--radius);
            padding: 14px;
            margin: 12px 0;
        }
        .pearl-header {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-bottom: 10px;
        }
        .pearl-header i {
            color: #f59e0b;
            font-size: 16px;
        }
        .pearl-category {
            font-size: 10px;
            font-weight: 600;
            text-transform: uppercase;
            letter-spacing: 0.5px;
            padding: 2px 6px;
            background: rgba(245, 158, 11, 0.2);
            color: #b45309;
            border-radius: 4px;
        }
        .pearl-title {
            font-weight: 600;
            font-size: 13px;
        }
        .pearl-content {
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-secondary);
            margin-bottom: 10px;
        }
        .pearl-pitfall {
            background: rgba(220, 38, 38, 0.08);
            border-left: 3px solid var(--tier4);
            padding: 8px 12px;
            font-size: 12px;
            margin-bottom: 10px;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
        }
        .pearl-pitfall i {
            color: var(--tier4);
            margin-right: 4px;
        }
        .pearl-evidence {
            font-size: 11px;
            color: var(--text-muted);
            font-style: italic;
        }
        .pearl-evidence i {
            margin-right: 4px;
        }

        /* Micro Lessons */
        .teaching-panel {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-top: 16px;
            overflow: hidden;
        }
        .teaching-panel-header {
            padding: 12px 16px;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.15) 0%, rgba(217, 119, 6, 0.08) 100%);
            border-bottom: 1px solid rgba(245, 158, 11, 0.2);
        }
        .teaching-panel-header h4 {
            margin: 0;
            font-size: 14px;
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        .teaching-panel-header i {
            color: #f59e0b;
        }
        .teaching-panel-body {
            padding: 12px;
        }
        .micro-lesson {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
            overflow: hidden;
        }
        .micro-lesson:last-child {
            margin-bottom: 0;
        }
        .lesson-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 14px;
            cursor: pointer;
            transition: background 0.2s;
        }
        .lesson-header:hover {
            background: var(--bg-elevated);
        }
        .lesson-info {
            display: flex;
            align-items: center;
            gap: 10px;
        }
        .lesson-info > i {
            color: var(--accent);
            font-size: 16px;
        }
        .lesson-title {
            font-weight: 600;
            font-size: 13px;
        }
        .lesson-duration {
            font-size: 11px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .lesson-body {
            padding: 0 14px 14px;
            border-top: 1px solid var(--border);
        }
        .lesson-section {
            padding: 12px 0;
            border-bottom: 1px solid var(--border);
        }
        .lesson-section:last-of-type {
            border-bottom: none;
        }
        .lesson-section h5 {
            font-size: 12px;
            font-weight: 600;
            color: var(--accent);
            margin: 0 0 6px 0;
        }
        .lesson-section p {
            font-size: 13px;
            line-height: 1.5;
            color: var(--text-secondary);
            margin: 0;
        }

        /* Quiz */
        .lesson-quiz {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            padding: 14px;
            margin-top: 12px;
        }
        .lesson-quiz.correct {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.05);
        }
        .lesson-quiz.incorrect {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.05);
        }
        .quiz-header {
            display: flex;
            align-items: center;
            gap: 6px;
            margin-bottom: 10px;
            font-weight: 600;
            font-size: 12px;
            color: var(--accent);
        }
        .quiz-question {
            font-size: 13px;
            font-weight: 500;
            margin: 0 0 12px 0;
        }
        .quiz-options {
            display: flex;
            flex-direction: column;
            gap: 8px;
        }
        .quiz-option {
            display: flex;
            align-items: center;
            gap: 10px;
            padding: 10px 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            background: var(--bg-secondary);
            cursor: pointer;
            transition: all 0.2s;
            text-align: left;
            font-size: 13px;
        }
        .quiz-option:hover:not(:disabled) {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .quiz-option.selected {
            border-color: var(--accent);
            background: var(--accent-light);
        }
        .quiz-option.correct {
            border-color: var(--tier1);
            background: rgba(5, 150, 105, 0.1);
        }
        .quiz-option.incorrect {
            border-color: var(--tier4);
            background: rgba(220, 38, 38, 0.1);
        }
        .quiz-option:disabled {
            cursor: default;
        }
        .option-letter {
            width: 24px;
            height: 24px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--bg-elevated);
            border-radius: 50%;
            font-weight: 600;
            font-size: 12px;
        }
        .quiz-option.correct .option-letter {
            background: var(--tier1);
            color: white;
        }
        .quiz-option.incorrect .option-letter {
            background: var(--tier4);
            color: white;
        }
        .quiz-option i {
            margin-left: auto;
            color: var(--tier1);
        }
        .quiz-feedback {
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 12px;
            padding: 10px 12px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
        }
        .quiz-feedback.correct {
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .quiz-feedback.incorrect {
            background: rgba(220, 38, 38, 0.1);
            color: var(--tier4);
        }

        /* P3.2: Outcome Feedback Styles */
        .outcome-feedback-trigger {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
            margin-top: 20px;
        }
        .btn-outcome-feedback {
            display: flex;
            align-items: center;
            justify-content: space-between;
            width: 100%;
            padding: 14px 16px;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 14px;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.2s ease;
        }
        .btn-outcome-feedback:hover {
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(60, 78, 124, 0.3);
        }
        .btn-outcome-feedback span {
            flex: 1;
            text-align: left;
            margin-left: 12px;
        }
        .outcome-feedback-hint {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 12px 0 0;
            font-size: 12px;
            color: var(--text-muted);
        }
        .outcome-feedback-panel {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-top: 20px;
            overflow: hidden;
        }
        .outcome-feedback-panel.submitted {
            border-color: var(--tier1);
        }
        .feedback-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 16px;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
            color: white;
        }
        .feedback-header h4 {
            display: flex;
            align-items: center;
            gap: 10px;
            font-size: 15px;
            font-weight: 600;
            margin: 0;
        }
        .btn-close-feedback {
            background: rgba(255,255,255,0.2);
            border: none;
            color: white;
            width: 32px; height: 32px;
            border-radius: var(--radius-sm);
            cursor: pointer;
        }
        .feedback-intro {
            padding: 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
        }
        .feedback-intro p {
            margin: 0;
            font-size: 13px;
            color: var(--text-secondary);
        }
        .feedback-body {
            padding: 16px;
        }
        .feedback-section {
            margin-bottom: 20px;
        }
        .feedback-section:last-child {
            margin-bottom: 0;
        }
        .feedback-label {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            margin-bottom: 10px;
        }
        .feedback-label i {
            color: var(--accent);
        }
        .feedback-input {
            width: 100%;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            background: var(--bg-secondary);
            color: var(--text-primary);
        }
        .feedback-input.small {
            width: 150px;
        }
        .feedback-input:focus {
            outline: none;
            border-color: var(--accent);
        }
        .feedback-textarea {
            width: 100%;
            min-height: 80px;
            padding: 12px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 14px;
            background: var(--bg-secondary);
            color: var(--text-primary);
            resize: vertical;
            font-family: inherit;
        }
        .feedback-textarea:focus {
            outline: none;
            border-color: var(--accent);
        }
        .diagnosis-suggestions {
            margin-bottom: 10px;
        }
        .suggestions-label {
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            margin-bottom: 6px;
            display: block;
        }
        .suggestion-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .suggestion-chip {
            padding: 6px 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: 20px;
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .suggestion-chip:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .suggestion-chip.selected {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .imaging-match-toggle {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-top: 12px;
            padding: 12px;
            background: var(--bg-secondary);
            border-radius: var(--radius-sm);
        }
        .imaging-match-toggle span {
            font-size: 13px;
            color: var(--text-secondary);
        }
        .toggle-btns {
            display: flex;
            gap: 6px;
        }
        .toggle-btns button {
            padding: 6px 14px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
        }
        .toggle-btns button.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .disposition-grid {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
            gap: 8px;
        }
        .disposition-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .disposition-btn i {
            font-size: 16px;
        }
        .disposition-btn:hover {
            border-color: var(--accent);
        }
        .disposition-btn.selected {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .outcome-options {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
        }
        .outcome-btn {
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
            min-width: 90px;
            transition: all 0.15s ease;
        }
        .outcome-btn i {
            font-size: 20px;
            color: var(--btn-color, var(--text-muted));
        }
        .outcome-btn:hover {
            border-color: var(--btn-color, var(--accent));
        }
        .outcome-btn.selected {
            background: var(--bg-card);
            border-color: var(--btn-color, var(--accent));
            border-width: 2px;
            color: var(--text-primary);
        }
        .complication-chips {
            display: flex;
            flex-wrap: wrap;
            gap: 6px;
        }
        .complication-chip {
            padding: 6px 12px;
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 12px;
            color: var(--text-secondary);
            cursor: pointer;
        }
        .complication-chip:hover {
            border-color: var(--tier3);
        }
        .complication-chip.selected {
            background: rgba(220, 38, 38, 0.1);
            border-color: var(--tier4);
            color: var(--tier4);
        }
        .feedback-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding: 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
        }
        .btn-cancel-feedback {
            padding: 10px 20px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
        }
        .btn-submit-feedback {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            background: var(--accent);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
        }
        .btn-submit-feedback:disabled {
            opacity: 0.5;
            cursor: not-allowed;
        }
        .feedback-submitted-header {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 16px;
            background: rgba(5, 150, 105, 0.1);
            color: var(--tier1);
        }
        .feedback-submitted-header i {
            font-size: 24px;
        }
        .feedback-submitted-header h4 {
            margin: 0;
            font-size: 15px;
        }
        .feedback-submitted-summary {
            padding: 16px;
        }
        .feedback-summary-item {
            display: flex;
            justify-content: space-between;
            padding: 8px 0;
            border-bottom: 1px solid var(--border);
        }
        .feedback-summary-item:last-child {
            border-bottom: none;
        }
        .feedback-summary-item .label {
            font-size: 13px;
            color: var(--text-secondary);
        }
        .feedback-summary-item .value {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .feedback-summary-item .value.positive {
            color: var(--tier1);
        }
        .feedback-summary-item .value.negative {
            color: var(--tier4);
        }
        .feedback-thank-you {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: 0;
            padding: 16px;
            background: var(--bg-secondary);
            font-size: 12px;
            color: var(--text-muted);
        }
        .feedback-thank-you i {
            color: var(--accent);
        }

        /* P3.3: Camera Section & Annotation Styles */
        .camera-section {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
            margin-top: 16px;
        }
        .camera-header {
            display: flex;
            flex-direction: column;
            gap: 4px;
            margin-bottom: 16px;
        }
        .camera-header h5 {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            color: var(--text-primary);
            margin: 0;
        }
        .camera-header h5 i {
            color: var(--accent);
        }
        .camera-hint {
            font-size: 12px;
            color: var(--text-muted);
        }
        .camera-actions {
            display: flex;
            gap: 10px;
            margin-bottom: 16px;
        }
        .camera-btn {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px 20px;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .camera-btn.primary {
            background: var(--accent);
            border: none;
            color: white;
        }
        .camera-btn.primary:hover {
            background: var(--accent-dark);
        }
        .camera-btn.secondary {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            color: var(--text-secondary);
        }
        .camera-btn.secondary:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .camera-preview {
            position: relative;
            background: #000;
            border-radius: var(--radius);
            overflow: hidden;
            margin-bottom: 16px;
        }
        .camera-preview video {
            width: 100%;
            max-height: 300px;
            display: block;
        }
        .camera-controls {
            position: absolute;
            bottom: 16px;
            left: 50%;
            transform: translateX(-50%);
            display: flex;
            gap: 16px;
        }
        .camera-capture-btn {
            width: 60px; height: 60px;
            background: white;
            border: 4px solid rgba(255,255,255,0.5);
            border-radius: 50%;
            font-size: 24px;
            color: var(--accent);
            cursor: pointer;
            transition: transform 0.15s ease;
        }
        .camera-capture-btn:hover {
            transform: scale(1.1);
        }
        .camera-cancel-btn {
            width: 44px; height: 44px;
            background: rgba(255,255,255,0.2);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 18px;
            cursor: pointer;
        }
        .camera-captures {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
            gap: 12px;
            margin-bottom: 16px;
        }
        .capture-item {
            background: var(--bg-secondary);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
            position: relative;
        }
        .capture-thumb {
            position: relative;
            height: 100px;
            overflow: hidden;
            cursor: pointer;
        }
        .capture-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }
        .capture-overlay {
            position: absolute;
            top: 0; left: 0; right: 0; bottom: 0;
            background: rgba(60, 78, 124, 0.8);
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            color: white;
            font-size: 12px;
            opacity: 0;
            transition: opacity 0.15s ease;
        }
        .capture-overlay i {
            font-size: 20px;
        }
        .capture-thumb:hover .capture-overlay {
            opacity: 1;
        }
        .capture-info {
            display: flex;
            align-items: center;
            gap: 6px;
            padding: 8px;
            font-size: 10px;
        }
        .capture-time {
            color: var(--text-muted);
        }
        .capture-badge {
            background: var(--accent-light);
            color: var(--accent);
            padding: 2px 6px;
            border-radius: 10px;
            font-weight: 500;
        }
        .capture-notes {
            width: calc(100% - 16px);
            margin: 0 8px 8px;
            padding: 6px 8px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            font-size: 11px;
            background: var(--bg-card);
        }
        .capture-notes:focus {
            outline: none;
            border-color: var(--accent);
        }
        .capture-remove {
            position: absolute;
            top: 4px; right: 4px;
            width: 24px; height: 24px;
            background: rgba(220, 38, 38, 0.9);
            border: none;
            border-radius: 50%;
            color: white;
            font-size: 12px;
            cursor: pointer;
            opacity: 0;
            transition: opacity 0.15s ease;
        }
        .capture-item:hover .capture-remove {
            opacity: 1;
        }
        .camera-empty {
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 24px;
            text-align: center;
            color: var(--text-muted);
        }
        .camera-empty i {
            font-size: 36px;
            margin-bottom: 12px;
            opacity: 0.5;
        }
        .camera-empty p {
            margin: 0 0 4px;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-secondary);
        }
        .camera-empty span {
            font-size: 12px;
        }
        .camera-tip {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 10px 12px;
            background: var(--accent-light);
            border-radius: var(--radius-sm);
            font-size: 11px;
            color: var(--accent);
        }
        .camera-tip i {
            flex-shrink: 0;
            margin-top: 1px;
        }

        /* Annotation Editor */
        .annotation-editor {
            display: flex;
            flex-direction: column;
        }
        .annotation-toolbar {
            display: flex;
            align-items: center;
            gap: 16px;
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
        }
        .tool-group, .color-group {
            display: flex;
            gap: 6px;
        }
        .tool-btn {
            width: 36px; height: 36px;
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 14px;
            cursor: pointer;
            transition: all 0.15s ease;
        }
        .tool-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .tool-btn.active {
            background: var(--accent-light);
            border-color: var(--accent);
            color: var(--accent);
        }
        .color-btn {
            width: 28px; height: 28px;
            background: var(--btn-color);
            border: 2px solid transparent;
            border-radius: 50%;
            cursor: pointer;
        }
        .color-btn.active {
            border-color: var(--text-primary);
        }
        .annotation-canvas-container {
            flex: 1;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 20px;
            background: #f0f0f0;
            min-height: 300px;
        }
        #annotationCanvas {
            border-radius: var(--radius-sm);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        .canvas-placeholder {
            color: var(--text-muted);
            font-size: 14px;
        }
        .annotation-footer {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            padding: 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
        }
        .annotation-footer .btn-cancel {
            padding: 10px 20px;
            background: transparent;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            color: var(--text-secondary);
            font-size: 13px;
            cursor: pointer;
        }
        .annotation-footer .btn-save {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 20px;
            background: var(--accent);
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
        }

        /* P3.4: Research Corner Styles */
        .research-corner {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-top: 16px;
            overflow: hidden;
        }
        .research-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 14px 16px;
            background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
            color: white;
        }
        .research-header h4 {
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 14px;
            font-weight: 600;
            margin: 0;
        }
        .research-source {
            font-size: 11px;
            opacity: 0.8;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        .research-intro {
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-bottom: 1px solid var(--border);
        }
        .research-intro p {
            margin: 0;
            font-size: 12px;
            color: var(--text-secondary);
        }
        .research-topics {
            padding: 12px 16px;
        }
        .research-topic {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 8px;
            overflow: hidden;
        }
        .research-topic:last-child {
            margin-bottom: 0;
        }
        .research-topic-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 12px;
            background: var(--bg-secondary);
            cursor: pointer;
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .research-topic-header:hover {
            background: var(--bg-primary);
        }
        .article-count {
            margin-left: auto;
            font-size: 10px;
            font-weight: 600;
            color: var(--text-muted);
            background: var(--bg-card);
            padding: 2px 8px;
            border-radius: 10px;
        }
        .research-topic-header i {
            color: var(--text-muted);
        }
        .research-articles {
            padding: 12px;
            background: var(--bg-card);
        }
        .research-article {
            padding: 12px;
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            margin-bottom: 10px;
        }
        .research-article:last-child {
            margin-bottom: 0;
        }
        .article-title {
            font-size: 13px;
            font-weight: 600;
            color: var(--text-primary);
            line-height: 1.4;
            margin-bottom: 4px;
        }
        .article-authors {
            font-size: 11px;
            color: var(--text-muted);
            margin-bottom: 6px;
        }
        .article-journal {
            display: flex;
            align-items: center;
            gap: 6px;
            font-size: 11px;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }
        .article-journal i {
            color: #2563eb;
        }
        .article-findings {
            display: flex;
            gap: 8px;
            padding: 8px 10px;
            background: rgba(37, 99, 235, 0.05);
            border-left: 3px solid #2563eb;
            border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
            font-size: 11px;
            color: var(--text-secondary);
            line-height: 1.5;
            margin-bottom: 10px;
        }
        .article-findings i {
            color: #2563eb;
            flex-shrink: 0;
            margin-top: 2px;
        }
        .article-links {
            display: flex;
            gap: 12px;
        }
        .article-link {
            display: flex;
            align-items: center;
            gap: 4px;
            font-size: 11px;
            color: #2563eb;
            text-decoration: none;
            font-weight: 500;
        }
        .article-link:hover {
            text-decoration: underline;
        }
        .research-footer {
            padding: 12px 16px;
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
        }
        .btn-search-literature {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 8px;
            width: 100%;
            padding: 10px 16px;
            background: #2563eb;
            border: none;
            border-radius: var(--radius-sm);
            color: white;
            font-size: 12px;
            font-weight: 500;
            cursor: pointer;
            transition: background 0.15s ease;
        }
        .btn-search-literature:hover {
            background: #1d4ed8;
        }

        /* Injury Signature Card */
        .injury-signature-card {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            margin-bottom: 16px;
            overflow: hidden;
        }
        .injury-signature-card .sig-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 14px 16px;
            background: linear-gradient(135deg, var(--accent) 0%, var(--accent-dark) 100%);
            color: white;
            font-weight: 600;
            font-size: 15px;
        }
        .injury-signature-card .sig-header i {
            font-size: 20px;
        }
        .injury-signature-card .sig-intro {
            padding: 16px 16px 8px;
            font-size: 13px;
            color: var(--text-secondary);
            line-height: 1.5;
        }
        .injury-signature-card .sig-primary {
            padding: 8px 16px 16px;
        }
        .injury-signature-card .sig-pattern-name {
            font-size: 18px;
            font-weight: 700;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .injury-signature-card .sig-additional {
            font-size: 12px;
            color: var(--text-muted);
        }
        .injury-signature-card .sig-components {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 1px;
            background: var(--border);
            border-top: 1px solid var(--border);
            border-bottom: 1px solid var(--border);
        }
        .injury-signature-card .sig-component {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 12px;
            background: var(--bg-card);
        }
        .injury-signature-card .sig-comp-icon {
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: var(--accent-light);
            color: var(--accent);
            border-radius: var(--radius-sm);
            flex-shrink: 0;
        }
        .injury-signature-card .sig-comp-label {
            font-size: 11px;
            color: var(--text-muted);
            text-transform: uppercase;
            letter-spacing: 0.3px;
            margin-bottom: 2px;
        }
        .injury-signature-card .sig-comp-value {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
        }
        .injury-signature-card .sig-differentials {
            padding: 12px 16px;
            background: var(--bg-secondary);
        }
        .injury-signature-card .sig-diff-title {
            font-size: 12px;
            font-weight: 600;
            color: var(--text-secondary);
            margin-bottom: 8px;
        }
        .injury-signature-card .sig-differentials ul {
            margin: 0;
            padding-left: 20px;
        }
        .injury-signature-card .sig-differentials li {
            font-size: 13px;
            color: var(--text-primary);
            margin-bottom: 4px;
        }
        .injury-signature-card .sig-differentials li:last-child {
            margin-bottom: 0;
        }
        .injury-signature-card .sig-disclaimer {
            display: flex;
            align-items: flex-start;
            gap: 8px;
            padding: 12px 16px;
            font-size: 11px;
            color: var(--text-muted);
            background: var(--bg-secondary);
            border-top: 1px solid var(--border);
        }
        .injury-signature-card .sig-disclaimer i {
            flex-shrink: 0;
            margin-top: 1px;
        }
        @media (max-width: 480px) {
            .injury-signature-card .sig-components {
                grid-template-columns: 1fr;
            }
        }

        /* Interactive Plan Builder */
        .plan-builder {
            display: flex;
            flex-direction: column;
            gap: 16px;
        }
        .plan-category {
            border: 1px solid var(--border);
            border-radius: var(--radius-sm);
            overflow: hidden;
        }
        .plan-category-header {
            display: flex;
            align-items: center;
            gap: 8px;
            padding: 10px 12px;
            background: var(--bg-secondary);
            font-weight: 600;
            font-size: 13px;
            border-bottom: 1px solid var(--border);
        }
        .plan-category-header i {
            color: var(--accent);
        }
        .plan-category-header .multi-hint {
            font-weight: 400;
            font-size: 11px;
            color: var(--text-muted);
            margin-left: auto;
        }
        .plan-options {
            display: flex;
            flex-direction: column;
        }
        .plan-options.single .plan-option,
        .plan-options.multi .plan-option {
            display: flex;
            align-items: flex-start;
            gap: 10px;
            padding: 10px 12px;
            background: var(--bg-card);
            border: none;
            border-bottom: 1px solid var(--border);
            text-align: left;
            cursor: pointer;
            transition: background 0.15s;
            width: 100%;
        }
        .plan-option:last-child {
            border-bottom: none;
        }
        .plan-option:hover {
            background: var(--bg-secondary);
        }
        .plan-option.selected {
            background: var(--accent-light);
        }
        .plan-option-check {
            flex-shrink: 0;
            color: var(--text-muted);
            font-size: 16px;
            margin-top: 1px;
        }
        .plan-option.selected .plan-option-check {
            color: var(--accent);
        }
        .plan-option-content {
            flex: 1;
            min-width: 0;
        }
        .plan-option-label {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            margin-bottom: 2px;
        }
        .plan-option-desc {
            font-size: 11px;
            color: var(--text-muted);
        }
        .plan-option.selected .plan-option-label {
            color: var(--accent);
        }
        @media (min-width: 600px) {
            .plan-options.single,
            .plan-options.multi {
                display: grid;
                grid-template-columns: repeat(2, 1fr);
            }
            .plan-option {
                border-bottom: none !important;
                border-right: 1px solid var(--border);
            }
            .plan-option:nth-child(2n) {
                border-right: none;
            }
            .plan-option:nth-child(n+3) {
                border-top: 1px solid var(--border);
            }
        }

        /* History */
        .history-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            gap: 16px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .history-search {
            flex: 1;
            min-width: 200px;
            max-width: 300px;
            padding: 10px 14px;
            border: 1px solid var(--border);
            border-radius: var(--radius);
            font-size: 14px;
            background: var(--bg-card);
            color: var(--text-primary);
        }
        .history-filters {
            display: flex;
            gap: 8px;
            margin-bottom: 16px;
            flex-wrap: wrap;
        }
        .filter-chip-btn {
            padding: 6px 14px;
            border: 1px solid var(--border);
            background: var(--bg-card);
            color: var(--text-secondary);
            border-radius: 20px;
            font-size: 13px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .filter-chip-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .filter-chip-btn.active {
            background: var(--accent);
            border-color: var(--accent);
            color: white;
        }
        .history-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .history-item {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .history-item:hover {
            border-color: var(--accent);
            box-shadow: 0 2px 8px rgba(0,0,0,0.08);
        }
        .history-item-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }
        .history-item-body {
            margin-bottom: 12px;
        }
        .history-regions {
            font-weight: 600;
            margin-bottom: 4px;
        }
        .history-mechanism {
            font-size: 13px;
            color: var(--text-secondary);
        }
        .history-date {
            font-size: 12px;
            color: var(--text-muted);
        }
        .history-item-actions {
            display: flex;
            gap: 8px;
            flex-wrap: wrap;
        }
        .history-item-actions button {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 6px 10px;
            border: 1px solid var(--border);
            background: var(--bg-secondary);
            color: var(--text-secondary);
            border-radius: var(--radius-sm);
            font-size: 12px;
            cursor: pointer;
            transition: all 0.15s;
        }
        .history-item-actions button:hover {
            border-color: var(--accent);
            color: var(--accent);
        }
        .history-item-actions button.danger:hover {
            border-color: var(--tier4);
            color: var(--tier4);
        }
        .history-item.compact {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
        }
        .history-item-icon {
            width: 40px;
            height: 40px;
            border-radius: 10px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            background: var(--bg-secondary);
        }
        .history-item-icon .hi-img {
            width: 22px;
            height: 22px;
            opacity: 0.8;
        }
        .history-item-icon i {
            font-size: 18px;
            color: var(--text-muted);
        }
        .history-item-icon.head-neck { background: rgba(59, 130, 246, 0.12); }
        .history-item-icon.head-neck .hi-img { filter: var(--health-icon-filter, none); }
        .history-item-icon.upper-extremity { background: rgba(16, 185, 129, 0.12); }
        .history-item-icon.trunk { background: rgba(245, 158, 11, 0.12); }
        .history-item-icon.lower-extremity { background: rgba(139, 92, 246, 0.12); }
        .history-item.compact .history-item-main {
            display: flex;
            flex-direction: column;
            gap: 4px;
            flex: 1;
            min-width: 0;
        }
        .history-item.compact .history-regions {
            margin-bottom: 0;
            font-weight: 500;
        }
        .history-meta {
            display: flex;
            align-items: center;
            gap: 8px;
            flex-wrap: wrap;
        }
        .history-item.compact .history-time {
            font-size: 12px;
            color: var(--text-muted);
        }
        .history-edition {
            font-size: 10px;
            padding: 2px 6px;
            border-radius: 4px;
            font-weight: 500;
        }
        .history-edition.cds {
            background: rgba(193, 96, 54, 0.12);
            color: var(--accent);
        }
        .history-edition.edu {
            background: rgba(139, 92, 246, 0.12);
            color: #8b5cf6;
        }
        .history-flags {
            font-size: 11px;
            color: var(--tier4);
            display: flex;
            align-items: center;
            gap: 3px;
        }
        .history-flags i {
            font-size: 10px;
        }

        /* Saved */
        .saved-desc {
            color: var(--text-secondary);
            font-size: 14px;
            margin-bottom: 20px;
        }
        .saved-list {
            display: flex;
            flex-direction: column;
            gap: 12px;
        }
        .saved-item {
            background: var(--bg-card);
            border: 1px solid var(--border);
            border-radius: var(--radius);
            padding: 16px;
        }
        .saved-item-main {
            display: flex;
            gap: 14px;
            margin-bottom: 12px;
        }
        .saved-item-icon {
            width: 48px;
            height: 48px;
            border-radius: 12px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: white;
            font-size: 22px;
            flex-shrink: 0;
        }
        .saved-item-info {
            flex: 1;
            min-width: 0;
        }
        .saved-name {
            font-size: 16px;
            font-weight: 600;
            margin-bottom: 2px;
        }
        .saved-desc {
            font-size: 13px;
            color: var(--text-secondary);
            margin-bottom: 6px;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        .saved-meta {
            display: flex;
            gap: 8px;
            font-size: 12px;
            color: var(--text-muted);
        }
        .saved-meta i {
            font-size: 11px;
        }
        .saved-item-actions {
            display: flex;
            gap: 8px;
        }
        .saved-item-actions button {
            display: flex;
            align-items: center;
            gap: 4px;
            padding: 8px 12px;
            border: none;
            border-radius: var(--radius-sm);
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: opacity 0.15s;
        }
        .saved-item-actions button:hover {
            opacity: 0.85;
        }
        .saved-item-actions .btn-primary {
            background: var(--accent);
            color: white;
        }
        .saved-item-actions .btn-secondary {
            background: var(--bg-secondary);
            color: var(--text-secondary);
        }
        .saved-item-actions .btn-danger {
            background: rgba(239,68,68,0.1);
            color: var(--tier4);
        }

        /* Workflow view adjustments */
        .workflow-view .app {
            display: block;
        }
        .workflow-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border);
            background: var(--bg-card);
        }
        .workflow-header-left {
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .workflow-title {
            font-weight: 600;
            font-size: 16px;
        }

        @media (max-width: 600px) {
            .history-header {
                flex-direction: column;
                align-items: stretch;
            }
            .history-search {
                max-width: none;
            }
        }
