/* Dark is the default (night sky); light via <html data-theme="light"> */
:root {
  color-scheme: dark;
  --bg: #0b0d14; --panel: #141826; --text: #e6e8ef; --muted: #959aab; --line: #262b3d;
  --accent: #8fb0ff; --badge: #1f2436;
  --element: #8fb0ff; --event: #fb923c; --document: #4ade80; --claim: #c084fc;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f7f7f5; --panel: #ffffff; --text: #1d1d1f; --muted: #6b6b70; --line: #e2e2e0;
  --accent: #2f5bd3; --badge: #eeeeec;
  --element: #2f5bd3; --event: #c2410c; --document: #15803d; --claim: #7e22ce;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; } /* also for elements that get display:flex/grid in this file */
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
main { max-width: 1000px; margin: 0 auto; padding: 1rem 16px 3rem; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); background: var(--panel); padding: .6rem 16px; }
.brand { font-weight: 700; color: var(--text); }
.nav { display: flex; flex-wrap: nowrap; gap: .25rem; min-width: 0; } /* the three tabs always on one row */
.nav-link { font-weight: 650; color: var(--muted); padding: .35rem .7rem; border-radius: 8px; }
.nav-link:hover { color: var(--text); background: var(--badge); text-decoration: none; }
.nav-link.active { color: var(--text); background: var(--badge); }

/* UAP Research Map page: the map fills the window under the top bar */
main.main-map { max-width: none; padding: 0; }
.map-page { position: relative; height: calc(100vh - 57px); height: calc(100dvh - 57px); }
#world-map { position: absolute; inset: 0; background: var(--bg); }
.map-legend {
  position: absolute; left: 12px; bottom: 24px; z-index: 500; max-width: calc(100% - 24px);
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  padding: .4rem .7rem; font-size: .85rem;
}
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; border: 2px solid #fff; vertical-align: -1px; }
.dot-event { background: var(--event); }
.dot-element { background: var(--element); }
.map-tip-list { margin: .3rem 0 .2rem; padding-left: 1.1rem; font-size: .85rem; line-height: 1.35; }
.map-tip-list li { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* one line each, so the list height is predictable */
.map-tip-list li::marker { color: var(--k); }
.leaflet-tooltip.map-tooltip {
  background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,.35); padding: .5rem .65rem; white-space: normal; width: 280px;
}
.leaflet-tooltip.map-tooltip::before { border-top-color: var(--panel); }
.map-tip strong { display: block; font-size: .95rem; line-height: 1.25; }
.map-tip-meta { color: var(--muted); font-size: .8rem; margin: .15rem 0 .3rem; }
.map-tip-text { font-size: .85rem; line-height: 1.35; }
.leaflet-container { font: inherit; }
/* dark theme: darken the OpenStreetMap tiles (only the tiles, not the markers) */
:root:not([data-theme="light"]) :is(#world-map, .mini-map) .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.85) contrast(.9) saturate(.6); }
.leaflet-marker-icon.map-cluster {
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
  background: color-mix(in srgb, var(--k, var(--event)) 85%, transparent); color: #111; font-weight: 700; font-size: .85rem;
  border: 2px solid #fff; box-shadow: 0 0 0 5px color-mix(in srgb, var(--k, var(--event)) 30%, transparent);
}
.leaflet-interactive { cursor: pointer; }
.theme-toggle {
  font: inherit; font-size: .85rem; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .7rem; border: 1px solid var(--line); border-radius: 999px; background: var(--badge); color: var(--text);
}
.theme-toggle:hover { border-color: var(--accent); }
.theme-toggle svg { width: 16px; height: 16px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
.muted, .count { color: var(--muted); }

.filters { display: flex; flex-wrap: wrap; gap: .5rem; position: sticky; top: 0; background: var(--bg); padding: .75rem 0; z-index: 1; }
.filters input, .filters select {
  font: inherit; padding: .5rem .65rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--panel); color: var(--text);
}
.filters input { flex: 1 1 260px; min-width: 0; }
.filters select { flex: 0 1 auto; }
.count { margin: .25rem 0 .75rem; font-size: .9rem; }

/* kind on/off buttons, in the kind's colour */
.kind-toggle { display: inline-flex; flex-wrap: wrap; gap: .35rem; align-items: center; }
.kind-toggle button {
  font: inherit; font-size: .9rem; font-weight: 600; cursor: pointer;
  padding: .45rem .8rem; border-radius: 999px; border: 1.5px solid var(--k); background: transparent; color: var(--k);
}
.kind-toggle button[aria-pressed="true"] { background: var(--k); color: var(--bg); }
.kind-toggle button[aria-pressed="false"] { opacity: .55; border-style: dashed; }
.kind-toggle button:hover:not(:disabled) { opacity: 1; }
.kind-toggle button:disabled { opacity: .25; cursor: default; border-style: dashed; }
.kind-toggle button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }

/* compact variant above the link column */
.filters.compact { position: static; padding: 0 0 .75rem; gap: .4rem; }
.filters.compact input, .filters.compact select { flex: 1 1 100%; font-size: 1.1em; padding: .4rem .55rem; }
.filters.compact .kind-toggle { flex: 1 1 100%; }
.filters.compact .kind-toggle button { font-size: 1em; padding: .3rem .65rem; }

.list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: .5rem; } /* minmax: items never wider than the screen */
.item a { display: block; padding: .75rem 1rem; background: var(--panel); border: 1px solid var(--line); border-left: 4px solid var(--k, var(--line)); border-radius: 8px; color: var(--text); }
.item a:hover { text-decoration: none; border-color: var(--k); }
.item.central a { box-shadow: 0 0 0 2px var(--k) inset; }
.kind-element { --k: var(--element); }
.kind-event { --k: var(--event); }
.kind-document { --k: var(--document); }
.kind-claim { --k: var(--claim); }
.item .name { font-weight: 650; font-size: 1.05rem; margin-right: .5rem; overflow-wrap: anywhere; }
.item a { overflow-wrap: anywhere; }
.item .full { color: var(--muted); margin-right: .5rem; }
.item .badges { display: inline-flex; flex-wrap: wrap; gap: .25rem; vertical-align: middle; }
.item .desc { display: block; color: var(--muted); font-size: .92rem; margin-top: .25rem; }

.badge { display: inline-block; font-size: .75rem; padding: .1rem .45rem; border-radius: 999px; background: var(--badge); color: var(--muted); white-space: nowrap; }
.badge.kind { color: var(--k); font-weight: 600; }
.status-researched { color: var(--document); }
.status-in_progress { color: var(--event); }

.back { margin: 0 0 .75rem; }
.card { background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--k); border-radius: 10px; padding: 1.25rem; }
.card .badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.card h1 { margin: .4rem 0 .25rem; font-size: 1.9rem; line-height: 1.2; }
.type-desc { color: var(--muted); margin: 0 0 .5rem; }
.uap-desc { margin: .5rem 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: .25rem 1rem; margin: .75rem 0 0; font-size: .95rem; }
.facts-wrap { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.25rem; align-items: start; margin-top: .75rem; }
.facts-wrap .facts { margin-top: 0; }
@media (max-width: 760px) { .facts-wrap { grid-template-columns: minmax(0, 1fr); } }
/* isolation: Leaflet's own z-index layers (400–1000) stay inside the small map, so hover boxes can go over it */
.map { position: relative; isolation: isolate; z-index: 0; display: block; height: 190px; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--badge); }
.map .mini-map { position: absolute; inset: 0; pointer-events: none; } /* clicks go to the link */
.map-label { z-index: 1000; }
.map-label { position: absolute; right: 6px; top: 6px; font-size: .75rem; padding: .15rem .45rem; border-radius: 999px; background: var(--panel); color: var(--text); opacity: .9; }
.map:hover { border-color: var(--accent); text-decoration: none; }
.map:hover .map-label { color: var(--accent); }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

/* card page: left = card + research + sources, right = links (smaller) */
.card-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 1.75rem; align-items: start; }
@media (max-width: 760px) { .card-layout { grid-template-columns: minmax(0, 1fr); } }
.research { margin-top: 1.5rem; }
.research > h2, .sources > h2 { font-size: 1.1rem; margin: 0 0 .5rem; }
.side-col { font-size: 75%; }
.side-col h2 { font-size: 1.35em; margin: 0 0 .4em; }
.side-col .badge { font-size: .85em; }
.side-col .link-desc { font-size: 1em; }
.side-col .links .n { font-size: .8em; }
.md h2 { font-size: 1.05rem; margin: 1.4rem 0 .4rem; }
.md h3 { font-size: 1rem; }
a.auto { color: inherit; text-decoration: underline dotted var(--accent); text-underline-offset: 3px; }
a.auto:hover { color: var(--accent); text-decoration-style: solid; }
.links { margin-bottom: 1.25rem; }
.links .n { color: var(--muted); font-weight: 400; font-size: .9rem; }
.links ul { list-style: none; margin: 0; padding: 0; }
.links li { padding: .5rem 0; border-bottom: 1px solid var(--line); }
.links li > a { font-weight: 600; margin-right: .3rem; }
.link-desc { color: var(--muted); font-size: .9rem; margin-top: .15rem; }

.sources { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.sources ol { margin: 0; padding-left: 1.4rem; }
.sources li { margin-bottom: .8rem; overflow-wrap: anywhere; }
.sources li > a { font-weight: 600; }
.src-meta { display: flex; flex-wrap: wrap; gap: .2rem .6rem; align-items: center; color: var(--muted); font-size: .88rem; }
.src-desc { font-size: .92rem; margin-top: .15rem; }
.src-note { font-size: .88rem; color: var(--muted); font-style: italic; margin-top: .1rem; }

.md { overflow-wrap: anywhere; }
.md pre { background: var(--badge); padding: .75rem; border-radius: 6px; overflow-x: auto; }
.md blockquote { margin: 0; padding-left: 1rem; border-left: 3px solid var(--line); color: var(--muted); }
.md table { border-collapse: collapse; }
.md th, .md td { border: 1px solid var(--line); padding: .3rem .5rem; }

/* ---------- UAP Research Calendar ---------- */
.cal-range { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .9rem 1.1rem .6rem; margin-bottom: 1rem; }
.cal-range-labels, .cal-range-ends { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.cal-range-ends { font-size: .8rem; margin-top: .2rem; align-items: center; }
.cal-presets { display: inline-flex; align-items: center; gap: .8rem; }
.cal-presets select { font: inherit; font-size: .85rem; padding: .2rem .4rem; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); }
.cal-lists { margin-top: 1.2rem; }
.ev-month h2 { font-size: 1.1rem; }
.cal-count { color: var(--event); font-weight: 650; }
.link-btn { font: inherit; background: none; border: 0; color: var(--accent); cursor: pointer; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* two range inputs on top of one track: a line with two circles */
.dual-range { position: relative; height: 34px; margin: .4rem 9px 0; }
.dual-track { position: absolute; left: 0; right: 0; top: 50%; height: 4px; margin-top: -2px; border-radius: 2px; background: var(--line); }
.dual-fill { position: absolute; top: 0; bottom: 0; background: var(--event); border-radius: 2px; }
.dual-range input[type=range] {
  position: absolute; left: -9px; width: calc(100% + 18px); top: 0; height: 34px; margin: 0;
  background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.dual-range input[type=range]::-webkit-slider-runnable-track { background: none; height: 34px; }
.dual-range input[type=range]::-moz-range-track { background: none; }
.dual-range input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; pointer-events: auto; width: 18px; height: 18px; margin-top: 8px; border-radius: 50%;
  background: var(--panel); border: 3px solid var(--event); cursor: grab;
}
.dual-range input[type=range]::-moz-range-thumb {
  pointer-events: auto; width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 3px solid var(--event); cursor: grab;
}
.dual-range input[type=range]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--text); outline-offset: 2px; }

.cal-bar { display: flex; align-items: center; justify-content: space-between; gap: .75rem; flex-wrap: wrap; margin-bottom: .9rem; }
.view-btn { --k: var(--accent); }
.cal-nav { display: grid; grid-template-columns: auto 19rem auto; align-items: center; gap: .6rem; } /* fixed middle: the buttons do not move */
.cal-title { font-weight: 650; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 600px) { .cal-nav { grid-template-columns: auto minmax(0, 1fr) auto; } }
.nav-btn { font: inherit; font-size: .9rem; cursor: pointer; padding: .4rem .8rem; border-radius: 8px; border: 1px solid var(--line); background: var(--panel); color: var(--text); }
.nav-btn:hover { border-color: var(--accent); }

.cal-months { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; }
@media (max-width: 900px) { .cal-months { grid-template-columns: minmax(0, 1fr); } }
.cal-month { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .7rem; }
.cal-month h2 { font-size: 1rem; margin: 0 0 .5rem; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
.cal-wd { font-size: .7rem; color: var(--muted); text-align: center; }
.cal-day { min-height: 3.2rem; border-radius: 5px; background: var(--bg); padding: 2px 3px; overflow: hidden; font-size: .7rem; }
.cal-day.empty { background: none; }
.cal-day.out { opacity: .35; }
.cal-day.today { outline: 1px solid var(--accent); }
.cal-num { display: block; color: var(--muted); font-size: .7rem; }
.cal-day.has .cal-num { color: var(--text); font-weight: 650; }
.cal-chip {
  display: block; margin-top: 2px; padding: 1px 4px; border-radius: 4px; font-size: .68rem; line-height: 1.3;
  background: color-mix(in srgb, var(--event) 25%, transparent); color: var(--text); border-left: 3px solid var(--event);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.cal-chip:hover { background: color-mix(in srgb, var(--event) 45%, transparent); text-decoration: none; }
.cal-month-list { margin-top: .5rem; font-size: .8rem; }
.cal-month-list .cal-chip { display: inline-block; max-width: 100%; margin-right: 4px; font-size: .75rem; }
.cal-note { font-size: .85rem; margin-top: .8rem; }

.ev-year { margin-bottom: 1.2rem; }
.ev-year h2 { font-size: 1.3rem; margin: 0 0 .4rem; padding-bottom: .2rem; border-bottom: 1px solid var(--line); }
.ev-year h2 .n { color: var(--muted); font-weight: 400; font-size: .85rem; }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.ev-item { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: .8rem; padding: .5rem .7rem; border-radius: 8px; background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--event); color: var(--text); }
.ev-item:hover { border-color: var(--event); text-decoration: none; }
.ev-date { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }
.ev-name { font-weight: 650; margin-right: .35rem; }
.ev-loc { font-size: .85rem; }
.ev-text { display: block; color: var(--muted); font-size: .88rem; margin-top: .15rem; }
@media (max-width: 600px) { .ev-item { grid-template-columns: minmax(0, 1fr); gap: .1rem; } }

/* ---------- Chosen select boxes, in the site's colours (dark and light) ---------- */
.chosen-container { font: inherit; font-size: 1rem; color: var(--text); }
.chosen-container-single .chosen-single {
  height: auto; line-height: 1.5; padding: .45rem 2rem .45rem .7rem; border-radius: 8px;
  border: 1px solid var(--line); background: var(--panel); box-shadow: none; color: var(--text);
}
.chosen-container-single .chosen-single span { margin-right: 0; }
.chosen-container-single .chosen-single div { right: .5rem; width: 1rem; }
.chosen-container-single .chosen-single div b {
  background: none !important; position: relative;
}
.chosen-container-single .chosen-single div b::after {
  content: ""; position: absolute; left: 3px; top: 50%; width: 7px; height: 7px; margin-top: -6px;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg);
}
.chosen-container-active.chosen-with-drop .chosen-single div b::after { margin-top: -2px; transform: rotate(-135deg); }
.chosen-container-active .chosen-single, .chosen-container-single .chosen-single:hover { border-color: var(--accent); }
.chosen-container-active.chosen-with-drop .chosen-single { background: var(--panel); border-color: var(--accent); border-radius: 8px 8px 0 0; }
.chosen-container .chosen-drop {
  background: var(--panel); border: 1px solid var(--accent); border-top: 0; border-radius: 0 0 8px 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,.35); color: var(--text); z-index: 1100;
}
.chosen-container .chosen-results { color: var(--text); max-height: 320px; margin: 0; padding: .25rem 0; }
.chosen-container .chosen-results li { padding: .35rem .7rem; line-height: 1.3; }
.chosen-container .chosen-results li.group-result { color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; padding-top: .6rem; }
.chosen-container .chosen-results li.group-option { padding-left: 1.2rem; }
.chosen-container .chosen-results li.highlighted { background: var(--accent); color: var(--bg); }
.chosen-container .chosen-results li.result-selected { font-weight: 650; }
.chosen-container .chosen-results li.no-results { background: none; color: var(--muted); }
.chosen-container-single .chosen-search { padding: .4rem .5rem; }
.chosen-container-single .chosen-search input[type=text] {
  font: inherit; font-size: .9rem; padding: .35rem .5rem; border-radius: 6px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text);
}
/* compact sizes: link-column filter and the calendar's year preset */
.filters.compact .chosen-container { font-size: 1.1em; }
.filters.compact .chosen-container-single .chosen-single { padding: .35rem 2rem .35rem .55rem; }
.cal-presets .chosen-container { font-size: .85rem; }
.cal-presets .chosen-container-single .chosen-single { padding: .2rem 1.8rem .2rem .5rem; }
.filters .chosen-container { flex: 0 1 auto; min-width: 11rem; }
.filters.compact .chosen-container { flex: 1 1 100%; }

/* calendar view: one year, 12 small months, 6 per row; days with events only coloured */
.mini-year { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .7rem; }
@media (max-width: 1000px) { .mini-year { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 640px) { .mini-year { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.mini-month { background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .45rem .5rem .5rem; }
.mini-month.has { border-color: color-mix(in srgb, var(--event) 45%, var(--line)); }
.mini-month h3 { margin: 0 0 .3rem; font-size: .8rem; display: flex; justify-content: space-between; }
.mini-month h3 .n { color: var(--event); }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-day { aspect-ratio: 1; border-radius: 2px; background: var(--bg); }
.mini-day.empty { background: none; }
.mini-day.has { background: color-mix(in srgb, var(--event) 55%, transparent); cursor: help; }
.mini-day.has.n2 { background: color-mix(in srgb, var(--event) 80%, transparent); }
.mini-day.has.n3 { background: var(--event); }
.mini-day.out { opacity: .3; }
.mini-day.today { outline: 1px solid var(--accent); }
.mini-note { margin-top: .3rem; font-size: .7rem; color: var(--event); cursor: help; }
.cal-presets { flex-wrap: wrap; justify-content: center; }

/* filters floating over the UAP Research Map */
.map-filters {
  position: absolute; top: 12px; left: 0; right: 0; margin-inline: auto; width: max-content; z-index: 1000; /* centred without left:50% (that halves the width it may use) */
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; max-width: calc(100% - 100px);
  background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: .5rem .6rem;
  box-shadow: 0 4px 16px rgba(0,0,0,.35);
}
.map-filters .kind-toggle button { font-size: .85rem; padding: .35rem .7rem; }
@media (max-width: 700px) { .map-filters { left: 56px; right: 8px; width: auto; margin: 0; max-width: none; } }


/* trust (research/TRUST.md): 5 gray stars, filled up to the score; gray low, orange middle, gold high */
:root { --star-empty: #3a3f52; --star-low: #9ca3af; --star-mid: #fb923c; --star-high: #fbbf24; }
:root[data-theme="light"] { --star-empty: #d6d6d2; --star-low: #8a8f99; --star-mid: #ea7a1e; --star-high: #d9a404; }
.trust { display: inline-flex; align-items: center; gap: .3rem; cursor: help; white-space: nowrap; font-size: .8rem; color: var(--muted); }
.stars { position: relative; display: inline-block; font-size: .95rem; line-height: 1; letter-spacing: 1px; }
.stars::before { content: "★★★★★"; color: var(--star-empty); }
.stars::after { content: "★★★★★"; position: absolute; left: 0; top: 0; width: var(--p); overflow: hidden; white-space: nowrap; color: var(--star-fill, var(--star-low)); }
.tl-low { --star-fill: var(--star-low); }
.tl-mid { --star-fill: var(--star-mid); }
.tl-high { --star-fill: var(--star-high); }
.trust-n { font-variant-numeric: tabular-nums; }
.trust-label { color: var(--muted); }

/* 650px and narrower (also what phones get): compact tabs on one row, theme switch as icon only */
@media (max-width: 650.98px) { /* .98: some screens report 650 as 650.x (display scaling) */
  .top { padding: .45rem 10px; gap: .5rem; }
  .nav { flex-wrap: nowrap; gap: .1rem; }
  .nav-link { padding: .3rem .45rem; font-size: .92rem; white-space: nowrap; }
  .theme-toggle { padding: .35rem .5rem; }
  .theme-toggle .label { display: none; }
}

/* claims (research/TRUST.md section 7): who said what, grouped by stance, each with trust and its rationale */
.claim-statements { margin-top: 1.5rem; }
.stance-title { font-size: 1rem; margin: 1.1rem 0 .4rem; }
.stance-title.stance-asserts { color: var(--document); }
.stance-title.stance-doubts { color: var(--event); }
.stance-title.stance-denies { color: #f87171; }
.claim-by-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .6rem; }
.claim-by { background: var(--panel); border: 1px solid var(--line); border-left: 3px solid var(--line); border-radius: 8px; padding: .6rem .8rem; }
.claim-by.stance-asserts { border-left-color: var(--document); }
.claim-by.stance-doubts { border-left-color: var(--event); }
.claim-by.stance-denies { border-left-color: #f87171; }
.claim-by.low-trust { opacity: .5; }
.claim-by.low-trust:hover { opacity: .85; }
.cb-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cb-who { font-weight: 650; }
.cb-statement { margin: .3rem 0; }
.cb-source { font-size: .85rem; margin-top: .3rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.badge.oath { color: var(--text); background: color-mix(in srgb, var(--claim) 30%, transparent); }
.rationale { margin-top: .5rem; font-size: .88rem; }
.rationale summary { cursor: pointer; color: var(--muted); }
.rationale .md { padding: .3rem 0 0 .8rem; border-left: 2px solid var(--line); margin-top: .3rem; }
.status-corroborated, .status-confirmed { color: var(--document); }
.status-disputed { color: var(--event); }
.status-refuted { color: #f87171; }
.cb-who-trust { font-size: .8rem; }
.trust-extras { font-size: .88rem; margin-top: .4rem; display: grid; gap: .2rem; }
.tl-neg { color: #f87171; } .tl-pos { color: var(--document); }

/* floating rationale box on the trust stars (hover, focus or tap): summary + factors with their influence */
.trust { position: relative; }
.trust:hover, .trust:focus, .trust:focus-within { z-index: 2000; } /* above later cards, maps and lists */
.trust[tabindex] { outline: none; }
.trust-tip { display: none; position: absolute; z-index: 2000; top: calc(100% + 6px); left: 0; width: min(24rem, 80vw);
  white-space: normal; cursor: auto; text-align: left; font-size: .82rem; line-height: 1.4; color: var(--text);
  background: var(--panel); border: 1px solid var(--line); border-radius: 8px; padding: .6rem .75rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.trust-tip.tip-left { left: auto; right: 0; }
.trust:hover > .trust-tip, .trust:focus > .trust-tip, .trust:focus-within > .trust-tip { display: block; }
.trust-tip strong { display: block; margin-bottom: .25rem; }
.tip-summary { display: block; color: var(--muted); margin-bottom: .4rem; }
.trust-tip ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .15rem; }
.trust-tip li { display: flex; justify-content: space-between; gap: .8rem; }
.trust-tip li .eff { font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 600; }
.trust-tip li .eff.pos { color: var(--document); }
.trust-tip li .eff.neg { color: #f87171; }
.trust-tip li.base .eff { color: var(--text); }
.trust-tip li.result { border-top: 1px solid var(--line); margin-top: .2rem; padding-top: .2rem; font-weight: 650; }
.topic-delta { cursor: help; }
