/* Biomarker lookup tool — matches long-covid-biomarkers.html brand styling */
:root {
  --brand-blue: #0068f8;
  --brand-blue-dark: #0052c7;
  --brand-orange: #ff9800;
  --primary: #0068f8;
  --success: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --text-dark: #1f2937;
  --text-light: #6b7280;
  --bg-light: #f8fafc;
  --bg-white: #ffffff;
  --border: #e5e7eb;
  --up-bg: #fef2f2;
  --up-text: #dc2626;
  --down-bg: #eff6ff;
  --down-text: #2563eb;
  --mixed-bg: #fffbeb;
  --mixed-text: #d97706;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif; line-height: 1.6; color: var(--text-dark); background: var(--bg-white); }
a { color: var(--primary); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Nav */
.nav-minimal { background: var(--primary); padding: 0.75rem 0; position: sticky; top: 0; z-index: 100; }
.nav-container { max-width: 1200px; margin: 0 auto; padding: 0 1rem; display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-brand { color: #fff; text-decoration: none; font-weight: 700; font-size: 1.05rem; white-space: nowrap; }
.nav-brand span { opacity: 0.8; font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.nav-links a { color: rgba(255,255,255,0.85); text-decoration: none; font-size: 0.9rem; font-weight: 500; }
.nav-links a:hover, .nav-links a.active { color: #fff; }

/* Hero */
.hero { background: linear-gradient(135deg, #0068f8 0%, #0052c7 100%); color: #fff; padding: 2.5rem 1rem 3rem; }
.hero-container { max-width: 900px; margin: 0 auto; text-align: center; }
.hero-badge { display: inline-flex; align-items: center; gap: 0.5rem; background: rgba(255,255,255,0.15); padding: 0.4rem 0.9rem; border-radius: 50px; font-size: 0.8rem; margin-bottom: 1rem; }
.hero h1 { font-size: 1.85rem; font-weight: 700; margin-bottom: 0.75rem; line-height: 1.2; }
.hero p { font-size: 1.05rem; opacity: 0.92; max-width: 720px; margin: 0 auto; line-height: 1.6; }
@media (min-width: 720px) { .hero h1 { font-size: 2.5rem; } .hero p { font-size: 1.125rem; } .hero { padding: 3.5rem 1.5rem 4rem; } }

/* Layout */
section { padding: 2rem 1rem; }
.container { max-width: 1100px; margin: 0 auto; }
.section-header { margin-bottom: 1.25rem; }
.section-header h2 { font-size: 1.4rem; margin-bottom: 0.25rem; }
.section-header h2 .highlight { color: var(--primary); }
.section-header p { color: var(--text-light); font-size: 0.95rem; }
.grid-2 { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .grid-2 { grid-template-columns: 1fr 1fr; align-items: start; } }

/* Disclaimer */
.disclaimer-big { background: #fff7ed; border: 2px solid var(--brand-orange); border-radius: 12px; padding: 1rem 1.25rem; margin: 1.25rem auto 0; max-width: 1100px; font-size: 0.95rem; }
.disclaimer-big strong { color: #9a3412; }
.disclaimer-small { background: var(--bg-light); border: 1px solid var(--border); border-radius: 8px; padding: 0.75rem 1rem; font-size: 0.85rem; color: var(--text-light); margin-top: 1rem; }

/* Card */
.card { background: var(--bg-white); border: 1px solid var(--border); border-radius: 12px; padding: 1.25rem; box-shadow: 0 1px 3px rgba(0,0,0,0.04); }
.card h2 { font-size: 1.2rem; margin-bottom: 0.5rem; }
.card h2 .step { display: inline-block; background: var(--primary); color: #fff; border-radius: 50%; width: 1.6rem; height: 1.6rem; line-height: 1.6rem; text-align: center; font-size: 0.85rem; margin-right: 0.5rem; }
.help { color: var(--text-light); font-size: 0.9rem; margin-bottom: 0.75rem; }
.load-status { font-size: 0.8rem; color: var(--text-light); margin-top: 0.5rem; }
.load-status.ok { color: #047857; }
.load-status.err { color: var(--danger); font-weight: 600; }

/* Search */
.search-wrap { position: relative; }
#markerSearch { width: 100%; font: inherit; font-size: 1rem; padding: 0.8rem 1rem; border: 2px solid var(--border); border-radius: 10px; outline: none; transition: border-color 0.15s; }
#markerSearch:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,104,248,0.15); }
#markerSearch:disabled { background: var(--bg-light); }
#suggestions { list-style: none; position: absolute; left: 0; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--border); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,0.12); z-index: 50; max-height: 320px; overflow-y: auto; }
#suggestions li { padding: 0.6rem 0.9rem; cursor: pointer; border-bottom: 1px solid #f1f5f9; display: flex; flex-direction: column; gap: 0.1rem; }
#suggestions li:last-child { border-bottom: 0; }
#suggestions li:hover, #suggestions li.active { background: var(--down-bg); }
#suggestions li.in-panel { opacity: 0.6; }
.sug-name { font-weight: 600; font-size: 0.95rem; }
.sug-alias { font-size: 0.8rem; color: var(--text-light); }
.sug-meta { font-size: 0.75rem; color: var(--primary); }
.quick-add { margin-top: 0.75rem; font-size: 0.85rem; color: var(--text-light); display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.quick-add a { display: inline-block; padding: 0.2rem 0.6rem; border: 1px solid var(--border); border-radius: 50px; text-decoration: none; font-size: 0.8rem; color: var(--text-dark); background: var(--bg-light); }
.quick-add a:hover { border-color: var(--primary); color: var(--primary); }

/* Panel */
.panel-list { list-style: none; display: flex; flex-direction: column; gap: 0.75rem; margin-top: 0.75rem; }
.panel-row { border: 1px solid var(--border); border-radius: 10px; padding: 0.75rem 0.9rem; background: var(--bg-light); }
.panel-row.just-added { animation: pop 0.5s ease-out; }
@keyframes pop { from { background: #dbeafe; } to { background: var(--bg-light); } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.5rem; }
.panel-name { font-size: 0.95rem; }
.panel-conds { font-size: 0.75rem; color: var(--text-light); }
.btn-remove { background: none; border: 1px solid var(--border); border-radius: 50%; width: 1.8rem; height: 1.8rem; font-size: 1.1rem; line-height: 1; cursor: pointer; color: var(--text-light); flex: none; }
.btn-remove:hover { color: var(--danger); border-color: var(--danger); }
.panel-controls { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.6rem; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: #fff; }
.seg-btn { font: inherit; font-size: 0.8rem; font-weight: 600; padding: 0.4rem 0.7rem; border: 0; background: transparent; cursor: pointer; color: var(--text-light); }
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn.seg-high.on { background: var(--up-bg); color: var(--up-text); }
.seg-btn.seg-low.on { background: var(--down-bg); color: var(--down-text); }
.seg-btn.seg-normal.on { background: #ecfdf5; color: #047857; }
.val-input, .unit-input { font: inherit; font-size: 0.85rem; padding: 0.4rem 0.5rem; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.val-input { width: 7.5rem; }
.unit-input { width: 5.5rem; }
.panel-empty { color: var(--text-light); font-size: 0.9rem; padding: 1rem; border: 1px dashed var(--border); border-radius: 10px; text-align: center; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 1rem; }
.btn { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 0.55rem 0.9rem; border-radius: 8px; border: 1px solid var(--primary); background: var(--primary); color: #fff; cursor: pointer; }
.btn:hover { background: var(--brand-blue-dark); }
.btn.secondary { background: #fff; color: var(--primary); }
.btn.secondary:hover { background: var(--down-bg); }
.btn.ghost { background: transparent; border-color: var(--border); color: var(--text-light); }
#flash { position: fixed; bottom: 1.25rem; left: 50%; transform: translateX(-50%); background: #111827; color: #fff; padding: 0.6rem 1rem; border-radius: 8px; font-size: 0.85rem; z-index: 200; max-width: 90vw; }
.share-row { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.share-row input { flex: 1; font: inherit; font-size: 0.8rem; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 6px; color: var(--text-light); min-width: 0; }

/* Results */
.results-section { background: var(--bg-light); }
.results-summary { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 0.9rem 1rem; font-size: 0.9rem; margin-bottom: 1rem; }
.results-empty { color: var(--text-light); font-size: 0.95rem; }
.rank-list { list-style: none; display: flex; flex-direction: column; gap: 1rem; }
.rank-card { background: #fff; border: 1px solid var(--border); border-radius: 12px; padding: 1rem; }
.rank-card.muted { opacity: 0.7; }
.rank-head { display: flex; align-items: flex-start; gap: 0.75rem; }
.rank-n { flex: none; width: 2rem; height: 2rem; border-radius: 50%; background: var(--primary); color: #fff; font-weight: 700; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; }
.rank-card.muted .rank-n { background: #9ca3af; }
.rank-title { flex: 1; min-width: 0; }
.rank-title h3 { font-size: 1.05rem; line-height: 1.3; }
.rank-title h3 a { text-decoration: none; color: var(--text-dark); }
.rank-title h3 a:hover { color: var(--primary); }
.rank-sub { font-size: 0.78rem; color: var(--text-light); }
.rank-score { text-align: center; flex: none; }
.rank-score span { display: block; font-size: 1.5rem; font-weight: 700; color: var(--primary); line-height: 1; }
.rank-score small { font-size: 0.7rem; color: var(--text-light); }
.match-group { margin-top: 0.75rem; border-left: 3px solid var(--border); padding-left: 0.75rem; }
.match-ok { border-color: var(--success); }
.match-bad { border-color: var(--danger); }
.match-neutral { border-color: #9ca3af; }
.match-label { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); margin-bottom: 0.25rem; }
.match-ok .match-label { color: #047857; }
.match-bad .match-label { color: var(--up-text); }
.match-group ul { list-style: none; font-size: 0.85rem; display: flex; flex-direction: column; gap: 0.25rem; }
.m-link { font-weight: 600; text-decoration: none; }
.m-link:hover { text-decoration: underline; }
.dir { display: inline-block; padding: 0.05rem 0.45rem; border-radius: 50px; font-size: 0.72rem; font-weight: 600; }
.dir-up { background: var(--up-bg); color: var(--up-text); }
.dir-down { background: var(--down-bg); color: var(--down-text); }
.dir-mixed { background: var(--mixed-bg); color: var(--mixed-text); }
.yours, .cmp, .ref { color: var(--text-light); font-size: 0.78rem; }
.rank-links { margin-top: 0.75rem; font-size: 0.85rem; }
.rank-links a { text-decoration: none; font-weight: 600; }
.results-note { font-size: 0.8rem; color: var(--text-light); margin-top: 1rem; }

/* Reference table */
details.ref-ranges summary { cursor: pointer; font-weight: 600; color: var(--primary); padding: 0.5rem 0; }
.table-wrap { overflow-x: auto; margin-top: 0.5rem; }
table.ref-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.ref-table th, .ref-table td { text-align: left; padding: 0.5rem 0.6rem; border-bottom: 1px solid var(--border); vertical-align: top; }
.ref-table th { background: var(--bg-light); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light); }

/* FAQ */
.faq { display: grid; gap: 1rem; }
.faq h3 { font-size: 1rem; margin-bottom: 0.25rem; }
.faq p { font-size: 0.92rem; color: #374151; }

footer { background: #111827; color: #9ca3af; padding: 2rem 1rem; text-align: center; font-size: 0.85rem; }
footer a { color: #d1d5db; }
footer .footer-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem 1.25rem; margin-bottom: 0.75rem; }

/* Print */
@media print {
  .nav-minimal, .hero, .search-card, .panel-actions, .share-row, .quick-add, #flash, footer, .faq-section, details.ref-ranges, .btn-remove, .no-print { display: none !important; }
  body { font-size: 11pt; color: #000; }
  section { padding: 0.5rem 0; }
  .card, .rank-card, .results-summary { border: 1px solid #999; box-shadow: none; break-inside: avoid; }
  .seg-btn:not(.on) { display: none; }
  .seg { border: 0; }
  .val-input, .unit-input { border: 0; border-bottom: 1px solid #999; border-radius: 0; }
  .print-only { display: block !important; }
  .results-section { background: #fff; }
  a { color: #000; text-decoration: none; }
  .m-link::after { content: ''; }
}
.print-only { display: none; }
