        :root {
            --primary-color: #8a6d3b;
            --secondary-color: #f9f2e9;
            --accent-color: #5d4037;
            --light-gray: #f8f9fa;
            --border-color: #eaeaea;
            --text-color: #333;
            --text-muted: #6c757d;
            --success-color: #28a745;
            --warning-color: #ffc107;
            --medical-red: #dc3545;
            --medical-green: #198754;
            --medical-yellow: #ffc107;
            --medical-orange: #fd7e14;
            --bone-color: #f5e8d0;
            --osteoporosis-primary: #8a6d3b;
            --osteoporosis-secondary: #f9f2e9;
            --osteoporosis-accent: #5d4037;
        }
         
        .page-header {
            background: linear-gradient(135deg, rgba(249, 242, 233, 0.8) 0%, rgba(138, 109, 59, 0.4) 100%);
            padding: 1.5rem 0;
            margin-bottom: 2rem;
            border-bottom: 1px solid rgba(138, 109, 59, 0.2);
            position: relative;
            overflow: hidden;  color: var(--text-color);
        }
         
        .breadcrumb {
            background-color: transparent;
            padding: 0.5rem 0;
            margin-bottom: 0.5rem;
        }
        
        .breadcrumb-item a {
            color: var(--text-muted);
            text-decoration: none;
        }
        
        .breadcrumb-item.active {
            color: var(--text-color);
        }
         
        /* Risk Comparison Grid */
        .risk-comparison-grid {
            display: grid;
            grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
            gap: 1rem;
            margin: 1.5rem 0;
        }
        
        .risk-method-card {
            background: white;
            border-radius: 8px;
            padding: 1.25rem;
            border: 1px solid var(--border-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
            text-align: center;
        }
        
        .risk-method-card.active {
            border: 2px solid var(--osteoporosis-primary);
            background-color: rgba(138, 109, 59, 0.05);
        }
        
        .risk-method-name {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text-color);
        }
        
        .risk-method-value {
            font-size: 1.25rem;
            font-weight: 700;
            color: var(--osteoporosis-primary);
        }
        
        .risk-method-desc {
            font-size: 0.85rem;
            color: var(--text-muted);
            margin-top: 0.5rem;
        }
         
        .medical-info-box {
            background-color: rgba(220, 53, 69, 0.05);
            border-left: 3px solid var(--medical-red);
            padding: 1rem;
            border-radius: 0 4px 4px 0;
            margin: 1.5rem 0;
        }
         
        /* Responsive Adjustments */
        @media (max-width: 768px) { 
            .risk-comparison-grid {
                grid-template-columns: 1fr;
            }
        }
        
        /* Measurement System Toggle */
        .measurement-system {
            display: flex;
            background-color: var(--light-gray);
            border-radius: 6px;
            padding: 4px;
            margin-bottom: 1.5rem;
        }
        
        .system-btn {
            flex: 1;
            text-align: center;
            padding: 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: 600;
        }
        
        .system-btn.active {
            background-color: var(--osteoporosis-primary);
            color: white;
        }
        
        /* Toast notifications */
        .toast-container {
            position: fixed;
            bottom: 20px;
            right: 20px;
            z-index: 1050;
        }
        
        /* Action buttons */
        .action-btn {
            background-color: white;
            border: 1px solid var(--border-color);
            border-radius: 6px;
            padding: 0.5rem 1rem;
            margin-left: 0.5rem;
            transition: all 0.3s;
            color: var(--text-color);
        }
        
        .action-btn:hover {
            background-color: var(--light-gray);
            color: var(--osteoporosis-primary);
        }
        
        /* Input group styling */
        .input-group {
            margin-bottom: 1rem;
        }
        
        /* Reference table */
        .reference-table {
            width: 100%;
            border-collapse: collapse;
            margin: 1.5rem 0;
        }
        
        .reference-table th, .reference-table td {
            padding: 0.75rem;
            text-align: left;
            border: 1px solid var(--border-color);
        }
        
        .reference-table th {
            background-color: var(--light-gray);
            font-weight: 600;
        }
        
        .reference-table tr:nth-child(even) {
            background-color: rgba(138, 109, 59, 0.05);
        }
        
        .generating-indicator {
            display: none;
            text-align: center;
            padding: 1rem;
            color: var(--text-muted);
        }
        
        /* Osteoporosis-specific styles */
        .frax-formula-box {
            background-color: rgba(138, 109, 59, 0.05);
            border-radius: 8px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border: 1px solid rgba(138, 109, 59, 0.2);
        }
        
        .formula-text {
            font-family: 'Courier New', monospace;
            font-size: 1.1rem;
            color: var(--osteoporosis-accent);
            margin-bottom: 0.5rem;
        }
        
        .formula-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--osteoporosis-primary);
        }
        
        .risk-applications {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
            gap: 1rem;
            margin: 1.5rem 0;
        }
        
        .application-card {
            background: white;
            border-radius: 8px;
            padding: 1.25rem;
            border: 1px solid var(--border-color);
            box-shadow: 0 2px 4px rgba(0,0,0,0.05);
        }
        
        .application-icon {
            width: 48px;
            height: 48px;
            border-radius: 8px;
            background-color: rgba(138, 109, 59, 0.1);
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 1rem;
            color: var(--osteoporosis-primary);
            font-size: 1.25rem;
        }
        
        .application-title {
            font-weight: 600;
            margin-bottom: 0.5rem;
            color: var(--text-color);
        }
        
        .application-desc {
            color: var(--text-muted);
            font-size: 0.9rem;
        }
        
        /* Age category indicators */
        .age-category {
            display: inline-block;
            padding: 0.25rem 0.75rem;
            border-radius: 20px;
            font-size: 0.85rem;
            font-weight: 500;
            margin-right: 0.5rem;
        }
        
        .age-young {
            background-color: rgba(40, 167, 69, 0.1);
            color: #28a745;
        }
        
        .age-middle {
            background-color: rgba(0, 123, 255, 0.1);
            color: #007bff;
        }
        
        .age-elderly {
            background-color: rgba(108, 117, 125, 0.1);
            color: #6c757d;
        }
        
        /* Range slider styling */
        .form-range {
            width: 100%;
            height: 1rem;
            padding: 0;
            background-color: transparent;
            -webkit-appearance: none;
        }
        
        .form-range:focus {
            outline: none;
        }
        
        .form-range::-webkit-slider-thumb {
            width: 1rem;
            height: 1rem;
            margin-top: -0.5rem;
            background-color: var(--osteoporosis-primary);
            border: 0;
            border-radius: 1rem;
            -webkit-appearance: none;
        }
        
        .form-range::-webkit-slider-runnable-track {
            width: 100%;
            height: 0.5rem;
            cursor: pointer;
            animate: 0.2s;
            background: var(--light-gray);
            border-radius: 0.5rem;
        }
        
        .slider-value {
            background-color: var(--osteoporosis-primary);
            color: white;
            padding: 0.25rem 0.5rem;
            border-radius: 4px;
            font-size: 0.8rem;
            margin-left: 0.5rem;
        }
        
        /* Risk chart styling */
        .risk-chart-container {
            position: relative;
            height: 350px;
            width: 100%;
            margin: 1.5rem 0;
        }
        
        /* Risk classification */
        .risk-classification {
            padding: 1rem;
            border-radius: 8px;
            margin: 1rem 0;
            border-left: 5px solid;
        }
        
        .risk-low {
            background-color: rgba(40, 167, 69, 0.1);
            border-left-color: var(--medical-green);
        }
        
        .risk-moderate {
            background-color: rgba(255, 193, 7, 0.1);
            border-left-color: var(--medical-yellow);
        }
        
        .risk-high {
            background-color: rgba(220, 53, 69, 0.1);
            border-left-color: var(--medical-red);
        }
        
        .risk-very-high {
            background-color: rgba(108, 0, 0, 0.1);
            border-left-color: #6c0000;
        }
        
        /* Risk factor calculator */
        .risk-factor-calculator {
            background-color: rgba(138, 109, 59, 0.05);
            border-radius: 8px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border: 1px solid rgba(138, 109, 59, 0.2);
        }
        
        /* Risk factor toggle */
        .risk-factor-toggle {
            display: flex;
            align-items: center;
            margin-bottom: 1rem;
            padding: 0.75rem;
            background-color: white;
            border-radius: 6px;
            border: 1px solid var(--border-color);
        }
        
        .risk-factor-label {
            flex-grow: 1;
            margin-bottom: 0;
        }
        
        .toggle-switch {
            position: relative;
            display: inline-block;
            width: 50px;
            height: 24px;
        }
        
        .toggle-switch input {
            opacity: 0;
            width: 0;
            height: 0;
        }
        
        .toggle-slider {
            position: absolute;
            cursor: pointer;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background-color: #ccc;
            transition: .4s;
            border-radius: 24px;
        }
        
        .toggle-slider:before {
            position: absolute;
            content: "";
            height: 16px;
            width: 16px;
            left: 4px;
            bottom: 4px;
            background-color: white;
            transition: .4s;
            border-radius: 50%;
        }
        
        input:checked + .toggle-slider {
            background-color: var(--osteoporosis-primary);
        }
        
        input:checked + .toggle-slider:before {
            transform: translateX(26px);
        }
        
        /* Bone health score */
        .bone-health-score {
            font-size: 2.5rem;
            font-weight: 700;
            text-align: center;
            color: var(--osteoporosis-primary);
            margin: 1rem 0;
        }
        
        /* Progress bars for risk factors */
        .risk-factor-bar {
            height: 10px;
            border-radius: 5px;
            background-color: #e9ecef;
            margin: 0.5rem 0;
            overflow: hidden;
        }
        
        .risk-factor-progress {
            height: 100%;
            border-radius: 5px;
            background-color: var(--osteoporosis-primary);
            transition: width 0.5s ease;
        }
        
        .risk-factor-item {
            margin-bottom: 1.5rem;
        }
        
        /* T-score display */
        .t-score-display {
            font-size: 1.8rem;
            font-weight: 700;
            text-align: center;
            padding: 1rem;
            border-radius: 8px;
            background-color: white;
            border: 2px solid var(--border-color);
            margin: 1rem 0;
        }
        
        /* Gender toggle */
        .gender-toggle {
            display: flex;
            background-color: var(--light-gray);
            border-radius: 6px;
            padding: 4px;
            margin-bottom: 1.5rem;
        }
        
        .gender-btn {
            flex: 1;
            text-align: center;
            padding: 0.75rem;
            border-radius: 4px;
            cursor: pointer;
            transition: all 0.3s;
            font-weight: 600;
        }
        
        .gender-btn.active {
            background-color: var(--osteoporosis-primary);
            color: white;
        }
        
        /* Fracture risk visualization */
        .fracture-risk-visual {
            display: flex;
            justify-content: space-between;
            align-items: flex-end;
            height: 200px;
            margin: 2rem 0;
            padding: 1rem;
            background-color: #f9f9f9;
            border-radius: 8px;
        }
        
        .risk-bar {
            width: 60px;
            background-color: #ddd;
            border-radius: 4px 4px 0 0;
            text-align: center;
            padding-top: 0.5rem;
            color: white;
            font-weight: 600;
            position: relative;
        }
        
        .risk-bar-label {
            position: absolute;
            bottom: -30px;
            left: 0;
            width: 100%;
            text-align: center;
            font-size: 0.8rem;
            color: var(--text-muted);
        }
        
        /* Disclaimer box */
        .disclaimer-box {
            background-color: rgba(255, 193, 7, 0.1);
            border-left: 5px solid var(--warning-color);
            padding: 1.5rem;
            border-radius: 0 8px 8px 0;
            margin: 2rem 0;
        }
        
        /* Statistics highlight */
        .stat-highlight {
            background-color: rgba(138, 109, 59, 0.08);
            border-radius: 8px;
            padding: 1.5rem;
            margin: 1.5rem 0;
            border: 1px dashed rgba(138, 109, 59, 0.3);
        }
        
        .stat-number {
            font-size: 2rem;
            font-weight: 700;
            color: var(--osteoporosis-primary);
            text-align: center;
        }
        
        .stat-label {
            text-align: center;
            color: var(--text-muted);
            font-size: 0.9rem;
        }
        
        /* Treatment timeline */
        .treatment-timeline {
            position: relative;
            padding-left: 2rem;
            margin: 2rem 0;
        }
        
        .treatment-timeline::before {
            content: '';
            position: absolute;
            left: 7px;
            top: 0;
            bottom: 0;
            width: 2px;
            background-color: var(--osteoporosis-primary);
        }
        
        .treatment-step {
            position: relative;
            margin-bottom: 2rem;
            padding-left: 1.5rem;
        }
        
        .treatment-step::before {
            content: '';
            position: absolute;
            left: -8px;
            top: 5px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background-color: var(--osteoporosis-primary);
            border: 3px solid white;
            box-shadow: 0 0 0 2px var(--osteoporosis-primary);
        }
        
        /* Bone density visualization */
        .bone-density-visual {
            width: 100%;
            height: 60px;
            background: linear-gradient(to right, #28a745, #ffc107, #fd7e14, #dc3545);
            border-radius: 8px;
            margin: 1rem 0;
            position: relative;
        }
        
        .bone-density-marker {
            position: absolute;
            top: -10px;
            width: 2px;
            height: 80px;
            background-color: #333;
        }
        
        .bone-density-label {
            position: absolute;
            top: -35px;
            font-size: 0.8rem;
            white-space: nowrap;
            transform: translateX(-50%);
        }
        
        /* Expert insights box */
        .expert-insights {
            background-color: rgba(0, 123, 255, 0.05);
            border-left: 5px solid #007bff;
            padding: 1.5rem;
            border-radius: 0 8px 8px 0;
            margin: 2rem 0;
        }
    