.marker-loinc {
    font-size: 0.6875rem;
    color: #059669;
    font-weight: 600;
    margin-top: 0.25rem;
    font-family: ui-monospace, monospace;
}

.marker-name { font-weight: 600; color: var(--text-dark); }
a.marker-link {
    color: var(--primary, #0068f8);
    text-decoration: none;
    font-weight: 600;
}
a.marker-link:hover { text-decoration: underline; }
.marker-detail-link {
    display: inline-block;
    margin-top: 0.35rem;
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--primary, #0068f8);
    text-decoration: none;
}
.marker-detail-link:hover { text-decoration: underline; }
tr.marker-row-active { background: #f0f9ff; }
tr.marker-row-active td:first-child { box-shadow: inset 3px 0 0 var(--primary, #0068f8); }

.marker-detail-panel {
    margin-top: 1.25rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: white;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}
.marker-detail-inner { padding: 1.25rem 1.5rem 1.5rem; }
.marker-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.marker-detail-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-dark, #111827);
}
.marker-detail-alias { font-size: 0.875rem; color: var(--text-light, #6b7280); margin-top: 0.25rem; }
.marker-detail-close {
    border: none;
    background: #f3f4f6;
    color: #374151;
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
}
.marker-detail-close:hover { background: #e5e7eb; }
.marker-detail-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}
.marker-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}
.marker-detail-block {
    margin-bottom: 1.25rem;
    padding-top: 0.25rem;
    border-top: 1px solid var(--border, #f3f4f6);
}
.marker-detail-block:first-of-type { border-top: none; }
.marker-detail-block h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light, #6b7280);
}
.marker-detail-test-name { font-weight: 600; margin-bottom: 0.5rem; }
.marker-detail-note { font-size: 0.8125rem; color: var(--text-light, #6b7280); line-height: 1.5; }
.marker-detail-empty { font-size: 0.875rem; color: var(--text-light, #9ca3af); margin: 0; }
.marker-detail-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.875rem;
}
.marker-detail-list > li {
    padding: 0.75rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    background: #fafafa;
}
.marker-detail-item-head {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
    margin-bottom: 0.375rem;
}
.marker-detail-item-title { font-weight: 600; font-size: 0.875rem; margin-bottom: 0.25rem; }
.marker-detail-measure,
.marker-detail-meta,
.marker-detail-desc { font-size: 0.8125rem; color: var(--text-light, #4b5563); line-height: 1.45; }
.marker-detail-outcome-type,
.marker-detail-phase,
.marker-detail-status,
.marker-detail-cat {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
}
.marker-detail-trial-refs { margin-top: 0.375rem; display: flex; flex-wrap: wrap; gap: 0.3rem; }
.marker-detail-articles {
    margin: 0.5rem 0 0;
    padding-left: 1rem;
    font-size: 0.8125rem;
}
.marker-detail-articles a { color: var(--primary, #0068f8); text-decoration: none; }
.marker-detail-articles a:hover { text-decoration: underline; }
.marker-detail-article-meta {
    display: block;
    font-size: 0.6875rem;
    color: var(--text-light, #9ca3af);
    margin-top: 0.125rem;
}
.marker-detail-query {
    font-size: 0.75rem;
    color: var(--text-light, #6b7280);
    margin-top: 0.375rem;
    word-break: break-word;
}
.marker-detail-query code {
    font-family: ui-monospace, monospace;
    font-size: 0.6875rem;
    background: #f3f4f6;
    padding: 0.125rem 0.25rem;
    border-radius: 3px;
}
.marker-detail-subsection { margin-top: 0.75rem; }
.marker-detail-subsection h4 {
    margin: 0 0 0.5rem;
    font-size: 0.8125rem;
    text-transform: none;
    letter-spacing: 0;
    color: var(--text-dark, #374151);
}
.intervention-chip-preview { cursor: default; }
a.consumable-chip { text-decoration: none; }
a.consumable-chip:hover { text-decoration: underline; }
.marker-alias { font-size: 0.75rem; color: var(--text-light); margin-top: 0.125rem; }

.direction-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}

.direction-up { background: var(--up-bg, #fef2f2); color: var(--up-text, #dc2626); }
.direction-down { background: var(--down-bg, #eff6ff); color: var(--down-text, #2563eb); }
.direction-mixed { background: var(--mixed-bg, #fffbeb); color: var(--mixed-text, #d97706); }

.category-tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.ref-link { color: var(--primary, #0068f8); text-decoration: none; font-size: 0.8125rem; }
.ref-link:hover { text-decoration: underline; }

.controls-bar {
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.search-box { flex: 1; min-width: 200px; position: relative; }
.search-box input {
    width: 100%;
    padding: 0.625rem 1rem 0.625rem 2.5rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 0.9375rem;
    font-family: inherit;
}
.search-box::before {
    content: '🔍';
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.875rem;
}

.filter-group { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.filter-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    background: white;
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    font-family: inherit;
}
.filter-btn:hover { border-color: var(--primary, #0068f8); color: var(--primary, #0068f8); }
.filter-btn.active {
    background: var(--primary, #0068f8);
    color: white;
    border-color: var(--primary, #0068f8);
}

.results-count { font-size: 0.875rem; color: var(--text-light, #6b7280); margin-bottom: 1rem; }

.table-wrapper {
    overflow-x: auto;
    overflow-y: auto;
    max-height: min(70vh, 640px);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 12px;
    background: white;
    scrollbar-gutter: stable;
}

table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead { background: var(--bg-light, #f8fafc); position: sticky; top: 0; z-index: 2; }
th {
    text-align: left;
    padding: 0.875rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-light, #6b7280);
    border-bottom: 1px solid var(--border, #e5e7eb);
    white-space: nowrap;
}
td {
    padding: 0.875rem 1rem;
    border-bottom: 1px solid var(--border, #e5e7eb);
    vertical-align: top;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f8fbff; }

.atlas-links { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.atlas-links a {
    font-size: 0.8125rem;
    padding: 0.375rem 0.75rem;
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 20px;
    color: var(--primary, #0068f8);
    text-decoration: none;
}
.atlas-links a:hover { border-color: var(--primary, #0068f8); }

mark { background: #fef08a; padding: 0 0.125rem; border-radius: 2px; }

.lab-cell { min-width: 120px; }
.lab-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; align-items: center; }
.lab-none { color: var(--text-light, #9ca3af); font-size: 0.8125rem; }

.trial-cell { min-width: 140px; }
.trial-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.trial-chip {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    font-family: ui-monospace, monospace;
    border: 1px solid transparent;
}
.trial-chip.trial-primary { background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe; }
.trial-chip.trial-secondary { background: #f0fdf4; color: #15803d; border-color: #bbf7d0; }
.trial-chip:hover { text-decoration: underline; }
.trial-none { color: var(--text-light, #9ca3af); font-size: 0.8125rem; }
.trial-more { font-size: 0.6875rem; color: var(--text-light, #6b7280); }

.intervention-cell { min-width: 160px; }
.intervention-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; align-items: center; }
.intervention-chip {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid #ddd6fe;
    background: #f5f3ff;
    color: #5b21b6;
}
a.intervention-chip:hover { text-decoration: underline; }
.intervention-none { color: var(--text-light, #9ca3af); font-size: 0.8125rem; }
.intervention-more { font-size: 0.6875rem; color: var(--text-light, #6b7280); }
.db-interventions { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.35rem; }

.filter-trials {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8125rem;
    color: var(--text-light, #6b7280);
    white-space: nowrap;
}
.filter-trials input { accent-color: var(--primary, #0068f8); }

.lab-links { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.5rem; align-items: center; }

.scroll-panel-sm {
    max-height: 7rem;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-gutter: stable;
    padding-right: 0.25rem;
}
.scroll-panel,
.database-results {
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}
.scroll-panel-sm::-webkit-scrollbar,
.database-results::-webkit-scrollbar,
.table-wrapper::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
.scroll-panel-sm::-webkit-scrollbar-track,
.database-results::-webkit-scrollbar-track,
.table-wrapper::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 4px;
}
.scroll-panel-sm::-webkit-scrollbar-thumb,
.database-results::-webkit-scrollbar-thumb,
.table-wrapper::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 4px;
}
.scroll-panel-sm::-webkit-scrollbar-thumb:hover,
.database-results::-webkit-scrollbar-thumb:hover,
.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}
.lab-chip {
    display: inline-block;
    font-size: 0.625rem;
    font-weight: 600;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    text-decoration: none;
    border: 1px solid transparent;
}
.lab-chip.lab-commercial { background: #ecfdf5; color: #047857; border-color: #a7f3d0; }
.lab-chip.lab-specialty { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.lab-chip.lab-reference { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.lab-chip:hover { text-decoration: underline; }
.lab-note { font-size: 0.625rem; color: var(--text-light, #9ca3af); width: 100%; margin-top: 0.25rem; line-height: 1.4; }

.consumable-chip {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    padding: 0.15rem 0.45rem;
    border-radius: 4px;
    background: #f5f3ff;
    color: #6d28d9;
    border: 1px solid #ddd6fe;
    vertical-align: middle;
}
.marker-name .consumable-chip { margin-left: 0.375rem; }
.db-name + .consumable-chip { margin-left: 0.375rem; vertical-align: middle; }

/* Hub cross-condition database */
.database-section { background: var(--bg-light, #f8fafc); padding: 3rem 1.5rem; }
.database-panel {
    background: white;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 16px;
    padding: 1.5rem;
    max-width: 1200px;
    margin: 0 auto;
}
.database-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    margin-bottom: 1.25rem;
}
.database-controls .search-box { flex: 1; min-width: 220px; }
.database-controls select {
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 8px;
    font-size: 0.875rem;
    font-family: inherit;
    background: white;
}
.database-count { font-size: 0.8125rem; color: var(--text-light, #6b7280); margin-bottom: 0.75rem; }
.database-results {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 520px;
    overflow-y: scroll;
    scrollbar-gutter: stable;
    padding-right: 0.25rem;
}
.db-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    padding: 1rem;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 10px;
    align-items: start;
}
.db-row:hover { border-color: var(--primary, #0068f8); background: #f8fbff; }
.db-name { font-weight: 600; color: var(--primary, #0068f8); text-decoration: none; font-size: 0.9375rem; }
.db-name:hover { text-decoration: underline; }
.db-alias { font-size: 0.8125rem; color: var(--text-light, #6b7280); margin-top: 0.125rem; }
.db-meta { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.db-meta span {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.2rem 0.5rem;
    border-radius: 20px;
    background: var(--bg-light, #f1f5f9);
    color: var(--text-light, #64748b);
}
.db-condition { background: #eff6ff !important; color: #1d4ed8 !important; }
.db-side { text-align: right; min-width: 200px; display: flex; flex-direction: column; gap: 0.5rem; }
.db-side-section { display: flex; flex-direction: column; gap: 0.25rem; }
.db-side-label {
    font-size: 0.625rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-light, #9ca3af);
}
.db-trials,
.db-labs,
.db-interventions { display: flex; flex-wrap: wrap; gap: 0.25rem; justify-content: flex-end; }
.db-interventions .intervention-chip-consumable {
    text-decoration: none;
    background: #f5f3ff;
    color: #6d28d9;
    border-color: #ddd6fe;
}
.db-interventions .intervention-chip-consumable:hover { text-decoration: underline; }
.db-view { font-size: 0.75rem; color: var(--primary, #0068f8); text-decoration: none; }
.db-view:hover { text-decoration: underline; }
.database-empty, .database-more {
    font-size: 0.875rem;
    color: var(--text-light, #6b7280);
    padding: 1rem 0;
}
@media (max-width: 768px) {
    .db-row { grid-template-columns: 1fr; }
    .db-side { text-align: left; }
    .db-trials,
    .db-labs,
    .db-interventions { justify-content: flex-start; }
}