        button {
            padding: 6px 12px;
            border-radius: 6px;
            border: 1px solid #d1d5db;
            background: #f3f4f6;
            color: #111;
            cursor: pointer;
            font-size: 14px;
        }

        button:hover {
            background: #e5e7eb;
        }

        .primary-btn {
            background: #1e40af;
            color: white;
            border: none;
        }

        .primary-btn:hover {
            background: #1e3a8a;
        }

        .delete-btn {
            color: #b91c1c;
            background: #f3f4f6;
            border: 1px solid #d1d5db;
        }

.delete-btn:hover {
    background: #fee2e2;
}

.secondary-btn {
    color: #5f6672;
}

.input-field {
    width: 420px;
    padding: 4px;
    box-sizing: border-box;
}

 .reference-divider {
    margin: 32px 0 14px;
    border: none;
    height: 4px;
    background: #9ca3af;
}

.reference-library-title {
    color: #7c2d12;
    font-weight: 700;
    font-size: 16px;
    margin-bottom: 6px;
}

.reference-library-description {
    font-size: 13px;
    color: #555;
    margin: 0 0 16px 0;
}

.overlap-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
}

.overlap-badge-high {
    background: #7f1d1d;
    color: #ffffff;
}

.overlap-badge-medium {
    background: #b45309;
    color: #ffffff;
}

.overlap-badge-low {
    background: #d97706;
    color: #111827;
}

.overlap-badge-none {
    background: #e5e7eb;
    color: #374151;
}

/* ==========================================================
   Symptom Analyzer UI Components
   ========================================================== */

/* ---------- Match Score Badge ---------- */

.match-score-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    padding: 4px 7px;
    border-radius: 999px;
    color: #ffffff;
    font-weight: 700;
    font-size: 14px;
    line-height: 1;
    box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

/* ---------- Type Badge Base ---------- */

.type-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;

    padding: 5px 12px;

    border-radius: 999px;

    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;

    border: 1px solid transparent;

    box-shadow: 0 1px 3px rgba(0,0,0,.08);

    transition: all .15s ease;
}

.type-badge svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* ---------- Medication ---------- */

.medication-badge {

    background: #e8f1ff;
    color: #0b5ed7;
    border-color: #b8d4ff;
}

/* ---------- Supplement ---------- */

.supplement-badge {

    background: #e8f8ef;
    color: #146c43;
    border-color: #bde7cb;
}

/* ---------- Marijuana ---------- */

.marijuana-badge {

    background: #f2eaff;
    color: #7c3aed;
    border-color: #d8c3ff;
}

/* ---------- Microdosing ---------- */

.microdosing-badge {
    
    background: #e6fbff;
    color: #0b6475;
    border-color: #b8edf7;
}

/* ---------- Optional Hover ---------- */

.type-badge:hover {

    transform: translateY(-1px);

    box-shadow: 0 3px 8px rgba(0,0,0,.12);
}

/* ==========================================================
   Symptom Analyzer Scenario Comparison Printing
   ========================================================== */

@media print {

    body.printing-optimizer-comparison * {
        visibility: hidden !important;
    }

    body.printing-optimizer-comparison
    #optimizerScenarioComparisonDocument,
    body.printing-optimizer-comparison
    #optimizerScenarioComparisonDocument * {
        visibility: visible !important;
    }

    body.printing-optimizer-comparison
    #optimizerScenarioComparisonDocument {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        margin: 0;
        padding: 0;
        border: none;
        background: white;
    }

    body.printing-optimizer-comparison
    #optimizerScenarioComparisonDocument button {
        display: none !important;
    }

    body.printing-optimizer-comparison table {
        width: 100% !important;
        border-collapse: collapse !important;
    }

    body.printing-optimizer-comparison tr,
    body.printing-optimizer-comparison td,
    body.printing-optimizer-comparison th {
        break-inside: avoid;
        page-break-inside: avoid;
    }
}

@keyframes add-item-spinner {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================
   Global Loading Overlay
   ========================================================== */

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay[hidden] {
    display: none;
}

.loading-box {
    background: #ffffff;
    padding: 24px 36px;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,.18);
    text-align: center;
    min-width: 220px;
}

.loading-spinner {
    width: 44px;
    height: 44px;
    margin: 0 auto 16px;
    border: 5px solid #d9d9d9;
    border-top: 5px solid #2563eb;
    border-radius: 50%;
    animation: loadingOverlaySpin .8s linear infinite;
}

#loadingMessage {
    font-size: 16px;
    font-weight: 600;
    color: #374151;
}

@keyframes loadingOverlaySpin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Hide Microsoft Edge's built-in password reveal button.
   The app uses its own permanent eye control. */
::-ms-reveal {
    display: none;
}

@media (min-width: 769px) {
    #medList {
        margin-right: 18px;
    }
}

@media (max-width: 768px) {
    #medList {
        max-height: none !important;
        overflow-y: visible !important;
    }

    #mainNavigation {
        width: 100%;
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    #mainNavigation > button {
        flex: 0 0 auto;
    }

    #output {
        width: calc(100vw - 16px);
        max-width: none;
        box-sizing: border-box;
    }

    #reportsPage > div {
        width: 100%;
        box-sizing: border-box;
    }

    #reportTemplate {
        width: 100%;
        max-width: 100%;
    }

    .effect-category-title {
        text-align: left;
        line-height: 1.25;
    }

    #deleteLoadingStatus {
        position: fixed;
        left: 8px;
        right: 8px;
        bottom: 16px;
        max-width: none !important;
        box-sizing: border-box;
        z-index: 1000;
    }
}

:focus-visible {
    outline: 3px solid #2563eb;
    outline-offset: 2px;
}

.skip-link {
    position: absolute;
    left: 12px;
    top: -60px;
    z-index: 10000;
    padding: 10px 14px;
    background: #ffffff;
    color: #111827;
    border: 2px solid #2563eb;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 700;
}

.skip-link:focus {
    top: 12px;
}

#optimizerNavBtn:disabled,
#reportsNavBtn:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    border-color: #d1d5db;
    cursor: not-allowed;
    opacity: 0.75;
}