/* Gut Microbiome Treatment Research Hub — site styles.
   Clinical / institutional theme. Colors are tokens on :root;
   the dark-mode block below swaps them automatically. */

:root {
	--bg: #ffffff;
	--bg-alt: #f1f4f7;
	--banner: #e8eef5;
	--surface: #ffffff;
	--text: #1b1b1b;
	--text-muted: #565c65;
	--border: #d4d9df;
	--border-strong: #a9aeb1;

	--navy: #112e51;
	--navy-deep: #0b1f38;
	--primary: #005ea2;
	--primary-dark: #1a4480;
	--primary-soft: #e1f0fb;
	--link: #005ea2;
	--link-visited: #54278f;
	--on-dark: #ffffff;
	--on-dark-muted: #c9d3df;

	--established: #216e1f;
	--established-bg: #e8f3e7;
	--emerging: #7a4d00;
	--emerging-bg: #fbf1d4;
	--preliminary: #5c2e91;
	--preliminary-bg: #efe8f8;
	--draft: #4a4f55;
	--draft-bg: #eceef0;
	--error: #b50909;

	--map-treatment: #005ea2;
	--map-condition: #c05600;
	--map-mechanism: #00687d;
	--map-other: #71767a;

	--radius: 3px;
	--font-sans: "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--font-serif: "Source Serif 4", Georgia, "Times New Roman", serif;
	--max-width: 75rem;
	--prose-width: 44rem;
}

@media (prefers-color-scheme: dark) {
	:root {
		--bg: #0f1722;
		--bg-alt: #142030;
		--banner: #16263a;
		--surface: #182636;
		--text: #e6eaef;
		--text-muted: #a7b2bf;
		--border: #2c3d52;
		--border-strong: #4a5d74;

		--navy: #0b1f38;
		--navy-deep: #07162a;
		--primary: #73b3e7;
		--primary-dark: #a8d0f2;
		--primary-soft: #1b3450;
		--link: #8cc2ee;
		--link-visited: #c4a8ef;
		--on-dark: #ffffff;
		--on-dark-muted: #a7b6c8;

		--established: #8fd48b;
		--established-bg: #1b3320;
		--emerging: #f0c962;
		--emerging-bg: #3a2f12;
		--preliminary: #c9aef0;
		--preliminary-bg: #2d2242;
		--draft: #c3c9d0;
		--draft-bg: #2a3440;
		--error: #ff8f8f;

		--map-treatment: #73b3e7;
		--map-condition: #f09860;
		--map-mechanism: #4fc3d5;
		--map-other: #a9aeb1;
	}
}

/* Base */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--font-sans);
	font-size: 1.0625rem;
	line-height: 1.6;
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 2.5vw + 1.1rem, 2.6rem); letter-spacing: -0.01em; }
h2 { font-size: 1.5rem; margin-top: 2em; }
h3 { font-size: 1.15rem; }
p { margin: 0 0 1em; }

a { color: var(--link); text-underline-offset: 0.15em; }
a:hover { color: var(--primary-dark); text-decoration-thickness: 2px; }

:focus-visible { outline: 3px solid #2491ff; outline-offset: 2px; }

img { max-width: 100%; height: auto; }

[hidden] { display: none !important; }

.visually-hidden {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap;
}

.skip-link {
	position: absolute; left: 1rem; top: -3rem; z-index: 10;
	background: var(--primary); color: #fff; padding: 0.5rem 1rem;
}
.skip-link:focus { top: 0.5rem; color: #fff; }

.container {
	width: 100%;
	max-width: var(--max-width);
	margin: 0 auto;
	padding: 0 1rem;
}

@media (min-width: 48rem) {
	.container { padding: 0 2rem; }
}

/* Buttons & inputs */

.button, .header-search button {
	display: inline-block;
	padding: 0.7rem 1.25rem;
	border: 0; border-radius: var(--radius);
	background: var(--primary); color: #fff;
	font: inherit; font-weight: 700; line-height: 1.2;
	text-decoration: none; cursor: pointer;
}
.button:hover, .header-search button:hover { background: var(--primary-dark); color: #fff; }
.button:disabled { opacity: 0.6; cursor: wait; }

@media (prefers-color-scheme: dark) {
	.button, .header-search button { color: var(--navy-deep); }
	.button:hover, .header-search button:hover { color: var(--navy-deep); }
}

input[type="search"], input[type="text"], input[type="email"], textarea {
	width: 100%;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--border-strong); border-radius: 0;
	background: var(--surface); color: var(--text);
	font: inherit;
}
input:focus, textarea:focus { outline: 3px solid #2491ff; outline-offset: 0; }

label { font-weight: 600; }

/* Header */

.utility-bar {
	background: var(--navy-deep); color: var(--on-dark-muted);
	font-size: 0.8rem;
}
.utility-inner { display: flex; justify-content: space-between; gap: 1rem; padding-top: 0.35rem; padding-bottom: 0.35rem; }
.utility-note { font-weight: 700; color: var(--on-dark); white-space: nowrap; }

@media (max-width: 40rem) {
	.utility-inner > span:first-child { display: none; }
}

.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }

.header-inner {
	display: flex; align-items: center; justify-content: space-between;
	gap: 1.5rem; padding-top: 1rem; padding-bottom: 1rem;
}

.brand {
	display: inline-flex; align-items: center; gap: 0.75rem;
	color: var(--navy); text-decoration: none;
}
.brand:hover { color: var(--navy); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-line1 { font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.brand-line2 { font-size: 1.3rem; font-weight: 800; color: var(--navy); }

@media (prefers-color-scheme: dark) {
	.brand-line2 { color: var(--text); }
}

.header-search { display: flex; width: 100%; max-width: 22rem; }
.header-search input { border-right: 0; }
.header-search button { border-radius: 0 var(--radius) var(--radius) 0; padding: 0.6rem 1rem; }

.site-nav { background: var(--navy); }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; }
.site-nav a {
	display: block; padding: 0.85rem 1.1rem;
	color: var(--on-dark); text-decoration: none; font-weight: 600;
	border-bottom: 4px solid transparent;
}
.site-nav a:hover { background: rgba(255, 255, 255, 0.08); color: var(--on-dark); }
.site-nav a[aria-current="page"] { border-bottom-color: #73b3e7; }
.site-nav li:first-child a { margin-left: -1.1rem; }

.nav-toggle {
	display: none; align-items: center; gap: 0.5rem;
	padding: 0.5rem 0.75rem;
	border: 1px solid var(--border-strong); border-radius: var(--radius);
	background: transparent; color: var(--text); font: inherit; font-weight: 600;
	cursor: pointer;
}
.nav-toggle-bar, .nav-toggle-bar::before, .nav-toggle-bar::after {
	display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative;
}
.nav-toggle-bar::before, .nav-toggle-bar::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bar::before { top: -5px; }
.nav-toggle-bar::after { top: 5px; }

@media (max-width: 55.99rem) {
	.header-search { display: none; }
	.nav-toggle { display: inline-flex; }
	.site-nav { display: none; }
	.site-nav.is-open { display: block; }
	.site-nav ul { flex-direction: column; padding: 0.5rem 0; }
	.site-nav li:first-child a { margin-left: 0; }
	.site-nav a { border-bottom: 0; border-left: 4px solid transparent; }
	.site-nav a[aria-current="page"] { border-left-color: #73b3e7; }
}

@media (max-width: 30rem) {
	.brand img { width: 36px; height: 36px; }
	.brand-line1 { font-size: 0.7rem; }
	.brand-line2 { font-size: 1.05rem; }
}

/* Home */

.hero {
	background: var(--banner);
	border-bottom: 1px solid var(--border);
	padding: clamp(2.5rem, 6vw, 4.5rem) 0;
}
.hero-grid { display: grid; gap: 2rem; align-items: start; }
@media (min-width: 56rem) {
	.hero-grid { grid-template-columns: minmax(0, 1fr) 20rem; gap: 3rem; }
}
.hero h1 { color: var(--navy); max-width: 22ch; }
@media (prefers-color-scheme: dark) {
	.hero h1 { color: var(--text); }
}
.lede { font-size: 1.2rem; color: var(--text-muted); max-width: 42rem; }

.hero-search { margin-top: 1.75rem; max-width: 36rem; }
.hero-search label { display: block; margin-bottom: 0.4rem; }
.search-group { display: flex; }
.search-group input { border-right: 0; font-size: 1.05rem; padding: 0.75rem 0.9rem; }
.search-group .button { border-radius: 0 var(--radius) var(--radius) 0; }

.hero-panel {
	background: var(--surface);
	border-top: 4px solid var(--navy);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
	padding: 1.25rem 1.5rem;
}
.hero-panel h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin: 0 0 0.5rem; }
.hero-panel ul { list-style: none; margin: 0; padding: 0; }
.hero-panel li + li { border-top: 1px solid var(--border); }
.hero-panel a {
	display: flex; justify-content: space-between; gap: 1rem;
	padding: 0.65rem 0; font-weight: 600; text-decoration: none;
}
.hero-panel a:hover { text-decoration: underline; }

.count {
	flex: none; align-self: center;
	display: inline-block; min-width: 1.6rem; padding: 0 0.4rem;
	border-radius: 999px; background: var(--bg-alt); color: var(--text-muted);
	font-size: 0.8rem; font-weight: 700; text-align: center; line-height: 1.6;
}

.section { padding: 3.5rem 0; }
.section-alt { background: var(--bg-alt); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { margin-top: 0; padding-bottom: 0.5rem; border-bottom: 3px solid var(--navy); display: inline-block; }
@media (prefers-color-scheme: dark) {
	.section-title { border-bottom-color: var(--primary); }
}
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.section-head a { font-weight: 600; }

.topic-grid, .entry-list, .resource-list { list-style: none; margin: 0; padding: 0; }

.topic-grid {
	display: grid; gap: 1.25rem; margin-top: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
}
.topic-card {
	padding: 1.25rem 1.25rem 1.5rem;
	background: var(--surface);
	border: 1px solid var(--border); border-top: 4px solid var(--primary);
}
.topic-card h3 a { text-decoration: none; }
.topic-card h3 a:hover { text-decoration: underline; }
.topic-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }

.principles {
	display: grid; gap: 2rem; margin-top: 1rem;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.principles h3 { padding-left: 0.75rem; border-left: 4px solid var(--primary); }
.principles p { margin: 0; color: var(--text-muted); }

/* Entry rows (Knowledge Base, home page) */

.entry-list { border-top: 1px solid var(--border); }
.entry-row { padding: 1.25rem 0; border-bottom: 1px solid var(--border); }
.entry-row h3 { margin: 0 0 0.35rem; font-size: 1.2rem; }
.entry-row h3 a { text-decoration: none; }
.entry-row h3 a:hover { text-decoration: underline; }
.entry-row p { margin: 0 0 0.5rem; color: var(--text-muted); max-width: var(--prose-width); }

.row-meta, .tag-list {
	list-style: none; margin: 0; padding: 0;
	display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; align-items: center;
	font-size: 0.85rem; color: var(--text-muted);
}

.badge {
	display: inline-block; padding: 0.1rem 0.5rem;
	border-radius: var(--radius);
	font-size: 0.78rem; font-weight: 700; line-height: 1.6;
	text-transform: uppercase; letter-spacing: 0.03em;
}
.badge-draft { color: var(--draft); background: var(--draft-bg); }
.badge-evidence-established { color: var(--established); background: var(--established-bg); }
.badge-evidence-emerging { color: var(--emerging); background: var(--emerging-bg); }
.badge-evidence-preliminary { color: var(--preliminary); background: var(--preliminary-bg); }

.tag-list li {
	padding: 0.1rem 0.5rem; border: 1px solid var(--border); border-radius: var(--radius);
	background: var(--surface);
}

/* Interior pages */

.page-banner {
	background: var(--banner);
	border-bottom: 1px solid var(--border);
	padding: 1.5rem 0 2rem;
}
.page-banner h1 { color: var(--navy); margin-bottom: 0.4rem; max-width: 30ch; }
.page-banner .lede { margin: 0; }
@media (prefers-color-scheme: dark) {
	.page-banner h1 { color: var(--text); }
}

.breadcrumb {
	display: flex; flex-wrap: wrap; gap: 0.5rem;
	margin-bottom: 1rem; font-size: 0.9rem; color: var(--text-muted);
}

.page-body { padding-top: 2.5rem; padding-bottom: 4rem; }

.prose > * { max-width: var(--prose-width); }
.prose h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose li { margin-bottom: 0.35em; }
.prose p, .prose li { font-family: var(--font-serif); font-size: 1.125rem; line-height: 1.7; }
.prose .row-meta li, .prose .tag-list li, .prose .resource-list li, .prose .resource-list p,
.prose .notice p, .prose .at-a-glance li, .prose .sources li,
.prose .contact-form p { font-family: var(--font-sans); }
.prose .entry-list, .prose .resource-list, .prose .row-meta, .prose .tag-list { padding-left: 0; }
.prose blockquote {
	margin: 1.5rem 0; padding: 0.75rem 1.25rem;
	border-left: 6px solid var(--primary); background: var(--primary-soft);
}
.prose blockquote p { font-family: var(--font-sans); font-size: 1rem; }
.prose blockquote p:last-child { margin-bottom: 0; }

.notice {
	margin: 2.5rem 0 0; padding: 1rem 1.25rem;
	border-left: 6px solid #e5a000; background: var(--emerging-bg);
}
.notice p { margin: 0; font-size: 0.95rem; }

.empty { color: var(--text-muted); font-style: italic; }

/* Entry page */

.entry-layout { display: grid; gap: 2.5rem; padding-top: 2.5rem; padding-bottom: 4rem; }
@media (min-width: 60rem) {
	.entry-layout { grid-template-columns: minmax(0, 1fr) 18rem; gap: 4rem; }
}

.at-a-glance {
	margin-bottom: 2rem; padding: 1.25rem 1.5rem;
	background: var(--primary-soft); border-left: 6px solid var(--primary);
}
.at-a-glance h2 { margin: 0 0 0.5rem; font-size: 1.1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--primary-dark); }
.at-a-glance ul { margin: 0; }
.at-a-glance li { font-size: 1.05rem; }

.entry-sidebar { display: flex; flex-direction: column; gap: 1.5rem; }
@media (min-width: 60rem) {
	.entry-sidebar { position: sticky; top: 1.5rem; align-self: start; }
}
.sidebar-panel { border-top: 4px solid var(--navy); background: var(--bg-alt); padding: 1rem 1.25rem 1.25rem; font-size: 0.92rem; }
@media (prefers-color-scheme: dark) {
	.sidebar-panel { border-top-color: var(--primary); }
}
.sidebar-panel h2 { margin: 0 0 0.75rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.sidebar-panel h3 { margin: 1rem 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.sidebar-panel dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.5rem 1rem; }
.sidebar-panel dt { font-weight: 700; }
.sidebar-panel dd { margin: 0; }
.sidebar-evidence p { margin: 0 0 0.5rem; color: var(--text-muted); }
.sidebar-evidence p:last-child { margin: 0; }

.sources { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.sources h2 { margin-top: 0; font-size: 1.25rem; }
.sources li { font-size: 0.95rem; }
.source-note { display: block; color: var(--text-muted); font-size: 0.9rem; }

/* Knowledge Base */

.kb-layout { display: grid; gap: 2rem; }
@media (min-width: 56rem) {
	.kb-layout { grid-template-columns: 16rem minmax(0, 1fr); gap: 3rem; }
	.kb-sidebar { position: sticky; top: 1.5rem; align-self: start; }
}

.kb-search label { display: block; margin-bottom: 0.4rem; }
.kb-filters { margin-top: 1.5rem; display: flex; flex-direction: column; }
.filter-label { font-weight: 600; margin-bottom: 0.4rem; }
.filter {
	display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
	padding: 0.6rem 0.75rem;
	border: 0; border-left: 4px solid transparent; border-bottom: 1px solid var(--border);
	background: transparent; color: var(--link);
	font: inherit; font-size: 0.95rem; text-align: left; cursor: pointer;
}
.filter:hover { background: var(--bg-alt); }
.filter[aria-pressed="true"] { border-left-color: var(--primary); background: var(--primary-soft); color: var(--text); font-weight: 700; }

@media (max-width: 55.99rem) {
	.kb-filters { flex-direction: row; flex-wrap: wrap; gap: 0.5rem; }
	.filter-label { width: 100%; margin: 0; }
	.filter { border: 1px solid var(--border); border-radius: var(--radius); padding: 0.4rem 0.7rem; }
	.filter[aria-pressed="true"] { border-color: var(--primary); }
}

.kb-status { margin: 0 0 1rem; font-weight: 600; }
.kb-status:empty { display: none; }
.kb-section { margin-bottom: 2.5rem; scroll-margin-top: 1.5rem; }
.kb-section h2 { margin: 0 0 0.25rem; }
.section-description { color: var(--text-muted); margin-bottom: 0.75rem; }

/* Resources */

.resource-group { margin-bottom: 2.5rem; }
.resource-group h2 { margin-bottom: 0.25rem; }
.resource-list { border-top: 1px solid var(--border); }
.resource-list li { padding: 1rem 0; border-bottom: 1px solid var(--border); margin: 0; }
.resource-list a { font-weight: 700; }
.resource-list a::after { content: " ↗"; font-weight: 400; text-decoration: none; display: inline-block; margin-left: 0.15rem; }
.resource-list p { margin: 0.25rem 0 0; color: var(--text-muted); font-size: 0.95rem; }

/* Contact form */

.contact-form { display: grid; gap: 1.1rem; margin-top: 1rem; max-width: 34rem; }
.form-row label { display: block; margin-bottom: 0.3rem; }
.contact-form .button { justify-self: start; }
.contact-form-honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.contact-form-status { margin: 0; min-height: 1.5em; font-weight: 600; }
.contact-form-status.success { color: var(--established); }
.contact-form-status.error { color: var(--error); }

/* Footer */

.site-footer { margin-top: auto; background: var(--navy); color: var(--on-dark-muted); font-size: 0.92rem; }
.site-footer a { color: var(--on-dark); }
.site-footer a:hover { color: var(--on-dark); }
.footer-grid {
	display: grid; gap: 2rem; padding-top: 2.5rem; padding-bottom: 2.5rem;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}
.footer-title { color: var(--on-dark); font-weight: 800; font-size: 1.05rem; }
.footer-heading { color: var(--on-dark); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.8rem; }
.footer-links { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.footer-bottom { background: var(--navy-deep); padding: 0.9rem 0; font-size: 0.85rem; }

/* Evidence Map */

.map-page { padding-top: 1.5rem; padding-bottom: 4rem; }
.map-notice { margin: 0 0 1rem; }
.map-warnings { padding: 0.75rem 1rem; border-left: 6px solid var(--error); background: var(--bg-alt); font-size: 0.95rem; }

.map-toolbar {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 1rem 2rem;
	padding: 1rem 0; border-bottom: 1px solid var(--border); margin-bottom: 1rem;
}
.map-search { flex: 1 1 16rem; max-width: 22rem; }
.map-search label { display: block; margin-bottom: 0.3rem; }
.map-types { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; align-items: center; }
.map-types legend { float: left; font-weight: 600; margin-right: 0.5rem; padding: 0; }
.type-toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 400; cursor: pointer; }
.type-toggle input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--primary); }
.type-key { display: inline-block; width: 0.9rem; height: 0.9rem; }
.type-treatment .type-key { background: var(--map-treatment); border-radius: 3px; }
.type-condition .type-key { background: var(--map-condition); border-radius: 50%; }
.type-mechanism .type-key { background: var(--map-mechanism); transform: rotate(45deg) scale(0.85); }

.map-view { display: inline-flex; margin-left: auto; }
.view-button {
	padding: 0.5rem 1rem; border: 1px solid var(--primary); background: var(--surface); color: var(--primary);
	font: inherit; font-weight: 700; cursor: pointer;
}
.view-button:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.view-button:last-child { border-radius: 0 var(--radius) var(--radius) 0; border-left: 0; }
.view-button[aria-pressed="true"] { background: var(--primary); color: #fff; }
@media (prefers-color-scheme: dark) {
	.view-button[aria-pressed="true"] { color: var(--navy-deep); }
}

.map-layout { display: grid; gap: 1.5rem; }
@media (min-width: 60rem) {
	.map-layout { grid-template-columns: minmax(0, 1fr) 24rem; }
}

.map-canvas-wrap { position: relative; }
.map-canvas {
	height: min(72vh, 44rem); min-height: 24rem;
	border: 1px solid var(--border); background: var(--surface);
}
.map-controls { position: absolute; top: 0.75rem; right: 0.75rem; }
.map-controls button {
	padding: 0.35rem 0.75rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
	background: var(--surface); color: var(--text); font: inherit; font-size: 0.85rem; cursor: pointer;
}
.map-hint { margin: 0.5rem 0 0; font-size: 0.85rem; color: var(--text-muted); }

.map-panel {
	align-self: start;
	border-top: 4px solid var(--navy); background: var(--bg-alt);
	padding: 1.25rem 1.25rem 1.5rem;
}
@media (prefers-color-scheme: dark) {
	.map-panel { border-top-color: var(--primary); }
}
@media (min-width: 60rem) {
	.map-panel { position: sticky; top: 1rem; max-height: calc(100vh - 2rem); overflow-y: auto; }
}
.map-panel h2 { margin: 0 0 0.5rem; font-size: 1.35rem; }
.map-panel h3 { margin: 1.5rem 0 0.5rem; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.map-panel ul { padding-left: 1.2rem; }
.panel-type { margin: 0 0 0.25rem; font-size: 0.8rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.panel-type.type-treatment { color: var(--map-treatment); }
.panel-type.type-condition { color: var(--map-condition); }
.panel-type.type-mechanism { color: var(--map-mechanism); }
.panel-link { font-weight: 700; }
.edge-join { font-weight: 400; color: var(--text-muted); font-size: 1rem; }

.map-stats { display: grid; grid-template-columns: auto 1fr; gap: 0.25rem 1rem; margin: 1rem 0 0; }
.map-stats dt { font-weight: 700; }
.map-stats dd { margin: 0; }

.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.topic-chip {
	padding: 0.2rem 0.6rem; border: 1px solid var(--border-strong); border-left-width: 4px; border-radius: var(--radius);
	background: var(--surface); color: var(--link); font: inherit; font-size: 0.85rem; font-weight: 600;
	cursor: pointer; text-align: left;
}
.topic-chip:hover { text-decoration: underline; }
.topic-chip.type-treatment { border-left-color: var(--map-treatment); }
.topic-chip.type-condition { border-left-color: var(--map-condition); }
.topic-chip.type-mechanism { border-left-color: var(--map-mechanism); }
.map-panel h2 .topic-chip { font-size: 1rem; }

.link-button { padding: 0; border: 0; background: none; color: var(--link); font: inherit; font-weight: 600; cursor: pointer; text-decoration: underline; }

.study-list { list-style: none; margin: 0; padding: 0 !important; }
.study-card { padding: 0.9rem 1rem; margin-bottom: 0.75rem; background: var(--surface); border: 1px solid var(--border); font-size: 0.93rem; }
.study-card h4 { margin: 0 0 0.25rem; font-size: 1rem; line-height: 1.3; }
.study-card p { margin: 0 0 0.5rem; }
.study-card p:last-child { margin-bottom: 0; }
.study-meta { color: var(--text-muted); font-size: 0.85rem; }
.study-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.study-design { font-size: 0.85rem; color: var(--text-muted); }
.study-topics { display: flex; flex-wrap: wrap; gap: 0.35rem; align-items: center; font-size: 0.85rem; color: var(--text-muted); }

.finding-benefit { color: var(--established); background: var(--established-bg); }
.finding-mixed { color: var(--emerging); background: var(--emerging-bg); }
.finding-no-effect { color: var(--draft); background: var(--draft-bg); }
.finding-harm { color: var(--error); background: var(--draft-bg); }
.finding-na { color: var(--draft); background: var(--draft-bg); }

.list-view { min-width: 0; }
.list-group h2 { margin: 0 0 0.5rem; font-size: 1.25rem; }
.list-group + .list-group { margin-top: 2rem; }
.list-topics { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.list-topics > li { border-bottom: 1px solid var(--border); }
.list-topics summary {
	display: flex; justify-content: space-between; align-items: center; gap: 1rem;
	padding: 0.75rem 0.25rem; cursor: pointer; font-weight: 700; color: var(--link);
}
.list-topics details[open] { padding-bottom: 1rem; }
.list-topics details > p { margin: 0 0.25rem 0.75rem; }

/* Knowledge Base entry: studies from the Evidence Map */

.entry-studies { margin-top: 3rem; padding-top: 1.25rem; border-top: 1px solid var(--border); }
.entry-studies h2 { margin-top: 0; font-size: 1.25rem; }
.prose .entry-studies .study-card { font-family: var(--font-sans); }
.entry-studies .study-card p { font-family: var(--font-sans); font-size: 0.95rem; }
.entry-studies .study-list li { margin-bottom: 0.75rem; }

/* Home: Evidence Map callout */

.map-callout {
	display: grid; gap: 1.5rem; align-items: center;
	padding: 2rem; background: var(--navy); color: var(--on-dark-muted);
}
@media (min-width: 48rem) {
	.map-callout { grid-template-columns: minmax(0, 1fr) auto; }
}
.map-callout h2 { color: var(--on-dark); margin: 0 0 0.4rem; }
.map-callout p { margin: 0; max-width: 40rem; }
.map-callout .button { background: #73b3e7; color: var(--navy-deep); white-space: nowrap; }
.map-callout .button:hover { background: #a8d0f2; color: var(--navy-deep); }
.section-flush { padding-bottom: 0; }
