/* UroCorpus v4 — Phase B Editorial Clinical Reader (Maqueta B + Light Default + Dark Mode) */

:root,
[data-theme="light"] {
  --bg: #F4F7FB;
  --bg-subtle: #EBF0F7;
  --bg-elev: rgba(255, 255, 255, 0.96);
  --bg-panel: #FFFFFF;
  --bg-card: #FFFFFF;
  --bg-card-hover: #FAFBFD;
  --border: #E2E9F2;
  --border-strong: #C8D4E4;
  --text: #142033;
  --text-soft: #3E5168;
  --text-muted: #5C6F88;
  --teal: #0E7C78;
  --teal-hover: #0A6360;
  --teal-soft: rgba(14, 124, 120, 0.09);
  --teal-line: rgba(14, 124, 120, 0.28);
  --cyan: #0369A1;
  --cyan-strong: #075985;
  --cyan-soft: rgba(3, 105, 161, 0.09);
  --emerald: #047857;
  --emerald-soft: #ECFDF5;
  --emerald-line: #A7F3D0;
  --violet: #6D28D9;
  --violet-soft: #F5F3FF;
  --amber: #925E00;
  --amber-soft: #FEF8E8;
  --amber-line: #E8C97A;
  --coi: #9A3412;
  --coi-soft: #FFF3EC;
  --coi-line: #F1B395;
  --danger: #B91C1C;
  --danger-soft: #FEF2F2;
  --danger-line: #FECACA;
  --shadow: 0 12px 30px rgba(20, 32, 51, 0.10), 0 2px 6px rgba(20, 32, 51, 0.05);
  --radius: 10px;
  --radius-sm: 7px;
  --topbar-h: 54px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Inter", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, Cambria, serif;
  --font-mono: "SF Mono", "JetBrains Mono", ui-monospace, Menlo, monospace;
}

[data-theme="dark"] {
  --bg: #0C1220;
  --bg-subtle: #131C2D;
  --bg-elev: rgba(15, 23, 42, 0.94);
  --bg-panel: #141E30;
  --bg-card: #182232;
  --bg-card-hover: #1E2A3E;
  --border: #263449;
  --border-strong: #374A66;
  --text: #EFF4FA;
  --text-soft: #B4C2D4;
  --text-muted: #8397B0;
  --teal: #2BB8B2;
  --teal-hover: #3CD1CA;
  --teal-soft: rgba(43, 184, 178, 0.14);
  --teal-line: rgba(43, 184, 178, 0.36);
  --cyan: #38BDF8;
  --cyan-strong: #0284C7;
  --cyan-soft: rgba(56, 189, 248, 0.13);
  --emerald: #34D399;
  --emerald-soft: rgba(52, 211, 153, 0.12);
  --emerald-line: rgba(52, 211, 153, 0.34);
  --violet: #C084FC;
  --violet-soft: rgba(168, 85, 247, 0.15);
  --amber: #E9B949;
  --amber-soft: rgba(233, 185, 73, 0.12);
  --amber-line: rgba(233, 185, 73, 0.36);
  --coi: #FDBA74;
  --coi-soft: rgba(234, 88, 12, 0.18);
  --coi-line: rgba(251, 146, 60, 0.42);
  --danger: #FCA5A5;
  --danger-soft: rgba(220, 38, 38, 0.16);
  --danger-line: rgba(248, 113, 113, 0.36);
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.50);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 15px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

.wrap {
  max-width: 1480px;
  margin: 0 auto;
  padding: 0 24px;
}

.hidden { display: none !important; }
.num { font-variant-numeric: tabular-nums; }

/* Uniform Disclosure Chevrons & Pills */
.uc-chev {
  display: inline-block;
  flex-shrink: 0;
  transition: transform 0.18s ease;
}
details[open] > summary .uc-chev,
[aria-expanded="true"] .uc-chev {
  transform: rotate(180deg);
}
.uc-drawer-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text-soft);
  font-size: 0.74rem;
  font-weight: 600;
  line-height: 1.25;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.uc-drawer-pill:hover,
details > summary:hover .uc-drawer-pill {
  border-color: var(--teal);
  background: var(--teal-soft);
  color: var(--teal);
}
details[open] > summary .uc-lbl-closed { display: none; }
details:not([open]) > summary .uc-lbl-open { display: none; }

/* =========================================================
   ROW 1: STICKY TOPBAR (54px — Official Codex Lumen + Flags)
   ========================================================= */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  height: var(--topbar-h);
  background: var(--bg-elev);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: nowrap;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 0;
  flex-wrap: nowrap;
}

.urocorpus-lockup {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  padding: 2px 4px 2px 0;
  border-radius: 8px;
  flex-shrink: 0;
  transition: opacity 0.15s ease;
}
.urocorpus-lockup:hover { opacity: 0.86; }

.brand-mark {
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  display: block;
}

.urocorpus-wm {
  display: flex;
  flex-direction: column;
  line-height: 1.06;
}
.urocorpus-name {
  font-size: 0.9rem;
  letter-spacing: 0.09em;
}
.urocorpus-name .wm-uro { font-weight: 500; color: var(--text); }
.urocorpus-name .wm-corpus {
  font-weight: 800;
  color: var(--teal);
}
.urocorpus-vol {
  font-family: var(--font-mono);
  font-size: 0.61rem;
  letter-spacing: 0.05em;
  color: var(--text-muted);
}

.brand-divider {
  width: 1px;
  height: 22px;
  background: var(--border-strong);
  flex-shrink: 0;
}

.brand-wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
  min-width: 0;
  overflow: hidden;
}

.brand-title {
  font-size: 0.94rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-controls {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  flex-wrap: nowrap;
}

.uc-wn-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--teal-line);
  background: var(--teal-soft);
  color: var(--teal);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.uc-wn-btn:hover {
  background: var(--teal);
  border-color: var(--teal);
  color: #FFFFFF;
}
.uc-wn-btn:hover .pulse-dot { background: #FFFFFF; box-shadow: none; }

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.50);
  animation: pulse 2.4s infinite;
  flex-shrink: 0;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0.50); }
  70% { box-shadow: 0 0 0 6px rgba(4, 120, 87, 0); }
  100% { box-shadow: 0 0 0 0 rgba(4, 120, 87, 0); }
}

/* Mobile / Tablet Context Drawer Trigger (< 1060px only) */
.mobile-ctx-btn {
  display: none;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.mobile-ctx-btn:hover,
.mobile-ctx-btn[aria-expanded="true"] {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

/* Segmented Language Switcher with Crisp Flags */
.seg-btn {
  display: inline-flex;
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  padding: 2px;
  background: var(--bg-card);
}
.seg-btn button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 8px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.seg-btn button:hover { color: var(--text); }
.seg-btn button.active {
  background: var(--teal);
  color: #FFFFFF;
}
[data-theme="dark"] .seg-btn button.active {
  color: #081426;
}
.lang-flag {
  display: inline-block;
  width: 16px;
  height: 11px;
  border-radius: 2px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(20, 32, 51, 0.18);
}

/* Tools Popover Menu */
.tools-menu { position: relative; }
.tools-menu-btn {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-soft);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 0.76rem;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
.tools-menu-btn::-webkit-details-marker { display: none; }
.tools-menu-btn::marker { content: ""; }
.tools-menu-btn:hover,
.tools-menu[open] > .tools-menu-btn {
  border-color: var(--teal);
  color: var(--text);
  background: var(--bg-subtle);
}
.tools-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 7px);
  min-width: 232px;
  max-width: calc(100vw - 24px);
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  padding: 6px;
  box-shadow: var(--shadow);
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.tools-menu-panel > button,
.tools-menu-panel > a {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: left;
  border-radius: 8px;
  padding: 8px 11px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.81rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.tools-menu-panel > button:hover,
.tools-menu-panel > a:hover {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text);
}

/* =========================================================
   SLIM EDITORIAL TITLE STRIP + ROW 2 UNDERLINED TABS
   ========================================================= */
.vol-chrome-sub {
  background: var(--bg);
}

.vol-title-strip {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding-top: 10px;
  padding-bottom: 6px;
}
.vol-title-main {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  min-width: 0;
  flex: 1 1 420px;
}
.atlas-h1 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(1.22rem, 1.8vw, 1.48rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--text);
}
.atlas-sub {
  margin: 0;
  font-size: 0.84rem;
  color: var(--text-muted);
  line-height: 1.35;
}
.cutoff-note {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cutoff-note strong {
  color: var(--text-soft);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}
.cutoff-sep { opacity: 0.45; }
.ok-txt { color: var(--emerald) !important; }

.tabs-bar {
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.tabs-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 38px;
}
.nav-tabs {
  display: flex;
  align-items: center;
  gap: 20px;
  min-height: 38px;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav-tabs::-webkit-scrollbar { display: none; }
.tab-with-q {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 38px;
  flex-shrink: 0;
}
.tab-btn {
  position: relative;
  height: 38px;
  background: transparent;
  color: var(--text-soft);
  border: 0;
  padding: 0 2px;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: color 0.15s ease;
  flex-shrink: 0;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--text);
  font-weight: 650;
}
.tab-btn.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: var(--teal);
  border-radius: 2px 2px 0 0;
}
.tab-count {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-subtle);
  padding: 1px 6px;
  border-radius: 999px;
}
.tab-btn.active .tab-count {
  background: var(--teal-soft);
  color: var(--teal);
}
.tabs-right-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.tabs-scope-tag {
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  white-space: nowrap;
}

/* =========================================================
   MAQUETA B 2-COLUMN EDITORIAL WORKSPACE
   Spacious Collapsible Left Context Rail (380px) + Wide Reading Column
   ========================================================= */
.vol-workspace {
  padding-top: 14px;
  padding-bottom: 56px;
  display: grid;
  grid-template-columns: 380px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
}
.vol-workspace.rail-collapsed {
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
}
.reading-col {
  min-width: 0;
}

@media (max-width: 1279px) and (min-width: 1060px) {
  .vol-workspace {
    grid-template-columns: 344px minmax(0, 1fr);
    gap: 22px;
  }
  .vol-workspace.rail-collapsed {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 14px;
  }
}

/* COI Active Banner */
.coi-banner {
  background: var(--coi-soft);
  border: 1px solid var(--coi-line);
  color: var(--coi);
  border-radius: var(--radius);
  padding: 8px 13px;
  font-size: 0.81rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.btn-inline {
  border: 1px solid currentColor;
  background: transparent;
  color: inherit;
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.74rem;
  font-weight: 700;
  cursor: pointer;
  margin-left: auto;
}
.btn-inline:hover {
  background: var(--coi);
  color: #FFFFFF;
}

/* =========================================================
   SINGLE-LINE CALM COMMAND / FILTER BAR
   ========================================================= */
.filter-panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 12px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.cmd-row-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.cmd-search-wrap {
  position: relative;
  flex: 1 1 220px;
  min-width: 170px;
}
.cmd-search-ico {
  position: absolute;
  left: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}
.cmd-search-wrap input[type="search"] {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 31px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg);
  color: var(--text);
  font-size: 0.84rem;
  font-family: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.cmd-search-wrap input[type="search"]:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--bg-panel);
  box-shadow: 0 0 0 3px var(--teal-soft);
}
.cmd-search-clear {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.72rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.cmd-search-clear:hover { background: var(--bg-subtle); color: var(--text); }

.quick-pills {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 2px;
  max-width: 100%;
}
.pill-toggle {
  border: 0;
  background: transparent;
  color: var(--text-soft);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.76rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease, box-shadow 0.14s ease;
}
.pill-toggle:hover { color: var(--text); }
.pill-toggle.active {
  background: var(--bg-card);
  color: var(--teal);
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(20, 32, 51, 0.08);
}

/* Calm COI Checkbox — muted when OFF, warm orange ONLY when ON */
.cmd-coi-group {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.coi-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 9px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-soft);
  font-size: 0.77rem;
  font-weight: 550;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.coi-toggle:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.coi-toggle.active {
  background: var(--coi-soft);
  color: var(--coi);
  border-color: var(--coi-line);
  font-weight: 700;
}
.coi-box {
  width: 14px;
  height: 14px;
  border-radius: 3.5px;
  border: 1.5px solid var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  line-height: 1;
  flex-shrink: 0;
}
.coi-toggle.active .coi-box {
  background: var(--coi);
  border-color: var(--coi);
  color: #FFFFFF;
}
.coi-toggle.active .coi-box::after {
  content: "✓";
  font-weight: 800;
}
.coi-count-inline {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-muted);
}
.coi-toggle.active .coi-count-inline { color: var(--coi); }

.cmd-right-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}

.adv-filters-btn {
  white-space: nowrap;
  gap: 5px;
}
.adv-filters-btn.open,
.adv-filters-btn.has-active {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}
.adv-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--teal);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 800;
}

.adv-filters-drawer {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
@media (max-width: 960px) {
  .adv-filters-drawer {
    grid-template-columns: repeat(auto-fit, minmax(min(170px, 100%), 1fr));
  }
}
.adv-field {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.adv-field-lbl {
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.filter-panel select,
.compact-select,
.compact-input {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 6px 9px;
  font-size: 0.8rem;
  font-family: inherit;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}
.filter-panel select:focus,
.compact-select:focus,
.compact-input:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--bg-panel);
}

/* 1-Line Dismissible Didactic Capsule */
.didactic-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 5px 11px;
  margin-bottom: 8px;
  border-radius: 8px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
  font-size: 0.78rem;
  color: var(--text);
  line-height: 1.35;
}
.didactic-capsule-txt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 8px;
  min-width: 0;
}
.didactic-tag {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--teal);
  flex-shrink: 0;
}
.didactic-dismiss {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.82rem;
  padding: 2px 5px;
  border-radius: 5px;
  cursor: pointer;
  flex-shrink: 0;
}
.didactic-dismiss:hover { background: var(--teal-soft); color: var(--text); }

/* Slim List Status & Active Chips */
.list-status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
  min-height: 28px;
}
.list-status-left {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  min-width: 0;
}
.result-counter {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.active-extra-filters {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}
.active-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  cursor: pointer;
}
.active-filter-chip:hover {
  background: var(--teal);
  color: #FFFFFF;
}
.filter-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

/* =========================================================
   FEATURED ARTICLE CALLOUT BOX (HIGH-CONTRAST WARM EDITORIAL AMBER)
   ========================================================= */
.editor-spotlight {
  margin: 0 0 14px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1.5px solid #F59E0B;
  border-left: 5px solid #D97706;
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.14), 0 1px 3px rgba(20, 32, 51, 0.06);
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 0;
}
[data-theme="dark"] .editor-spotlight {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.16) 0%, rgba(180, 83, 9, 0.11) 100%);
  border: 1.5px solid rgba(251, 191, 36, 0.52);
  border-left: 5px solid #F59E0B;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.sp-compact-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px 16px;
  flex-wrap: wrap;
}
.sp-compact-main {
  flex: 1 1 340px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sp-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
.sp-compact-actions {
  flex-shrink: 0;
  padding-top: 2px;
}
.sp-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 999px;
  background: #B45309;
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(180, 83, 9, 0.24);
}
.sp-dot {
  display: none;
}
.sp-date {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 600;
  color: #78350F;
}
[data-theme="dark"] .sp-date {
  color: #FDE68A;
}
.sp-stat-pill {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  font-weight: 750;
  padding: 2px 9px;
  border-radius: 999px;
  background: #FFFFFF;
  color: #92400E;
  border: 1px solid #F59E0B;
}
[data-theme="dark"] .sp-stat-pill {
  background: rgba(15, 23, 42, 0.72);
  color: #FDE68A;
  border-color: rgba(251, 191, 36, 0.5);
}
.sp-headline {
  font-family: var(--font-serif);
  font-size: 1.12rem;
  font-weight: 700;
  line-height: 1.32;
  color: #0F172A;
  overflow-wrap: anywhere;
  text-decoration: none;
}
[data-theme="dark"] .sp-headline {
  color: #F8FAFC;
}
a.sp-headline:hover {
  color: #B45309;
  text-decoration: underline;
}
[data-theme="dark"] a.sp-headline:hover {
  color: #FCD34D;
}
.sp-details {
  border-top: 1px solid rgba(217, 119, 6, 0.26);
  padding-top: 7px;
  margin-top: 2px;
}
[data-theme="dark"] .sp-details {
  border-top-color: rgba(251, 191, 36, 0.24);
}
.sp-details-toggle {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  cursor: pointer;
  user-select: none;
}
.sp-details-toggle::-webkit-details-marker { display: none; }
.sp-details-toggle::marker { content: ""; }
.sp-details-body {
  margin-top: 7px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sp-summary {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.48;
  color: #1E293B;
}
[data-theme="dark"] .sp-summary {
  color: #E2E8F0;
}
.sp-quote {
  margin: 0;
  padding: 8px 12px;
  border-left: 3px solid #D97706;
  background: rgba(255, 255, 255, 0.78);
  border-radius: 0 7px 7px 0;
  font-family: var(--font-serif);
  font-size: 0.88rem;
  font-style: italic;
  color: #1E293B;
  line-height: 1.46;
}
[data-theme="dark"] .sp-quote {
  background: rgba(15, 23, 42, 0.55);
  color: #F1F5F9;
}
.sp-cite {
  font-size: 0.77rem;
  color: #78350F;
  font-weight: 650;
}
[data-theme="dark"] .sp-cite {
  color: #FDE68A;
}
.sp-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.sp-btn-primary {
  font-size: 0.79rem;
  font-weight: 750;
  padding: 6px 13px;
  border-radius: 8px;
  background: #B45309;
  border: 1px solid #92400E;
  color: #FFFFFF;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 2px 6px rgba(146, 64, 14, 0.22);
  transition: background 0.14s ease;
}
.sp-btn-primary:hover { background: #92400E; }
[data-theme="dark"] .sp-btn-primary {
  background: #F59E0B;
  border-color: #D97706;
  color: #0F172A;
}
[data-theme="dark"] .sp-btn-primary:hover { background: #FBBF24; }
.sp-btn-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: #92400E;
  white-space: nowrap;
}
[data-theme="dark"] .sp-btn-link { color: #FCD34D; }
.sp-btn-link:hover { text-decoration: underline; }

/* =========================================================
   CHRONOLOGICAL YEAR GROUPS & STICKY EXPANDED-YEAR BAR
   ========================================================= */
.study-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.compact-study-list { gap: 7px; }

.year-group {
  margin-bottom: 12px;
}
.year-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 5px;
  margin-bottom: 7px;
  border-bottom: 1px solid var(--border);
}
.year-head-left {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.year-label {
  font-family: var(--font-mono);
  font-size: 0.94rem;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.01em;
}
.year-meta {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.year-head-actions {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
}
.year-action-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-soft);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: border-color 0.14s ease, color 0.14s ease, background 0.14s ease;
}
.year-action-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}

.year-cards-stack {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

/* Sticky Expanded-Year Control Bar */
.year-expanded-sticky {
  position: sticky;
  top: calc(var(--topbar-h) + 6px);
  z-index: 25;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 7px 12px;
  margin-bottom: 8px;
  border-radius: 9px;
  border: 1px solid var(--teal-line);
  border-left: 3px solid var(--teal);
  background: var(--bg-elev);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 6px 18px rgba(20, 32, 51, 0.09);
  font-size: 0.79rem;
}
[data-theme="dark"] .year-expanded-sticky {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.42);
}
.year-sticky-left,
.year-sticky-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}
.year-sticky-left strong {
  font-family: var(--font-mono);
  color: var(--teal);
}
.year-sort-wrap {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--text-muted);
  font-size: 0.76rem;
}
.year-sort-select {
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  font-size: 0.76rem;
  font-family: inherit;
  cursor: pointer;
}

/* Dashed Expand / Collapse Year Row */
.expand-year-row {
  width: 100%;
  min-height: 36px;
  margin-top: 7px;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px dashed var(--border-strong);
  background: transparent;
  color: var(--teal);
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.expand-year-row:hover {
  background: var(--teal-soft);
  border-color: var(--teal);
}

/* =========================================================
   DIDACTIC EDITORIAL STUDY ROWS (Single White Card on #F4F7FB)
   ========================================================= */
.study-row {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 11px 14px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: start;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  min-width: 0;
  max-width: 100%;
}
.study-row:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
}
.study-row.is-landmark {
  border-left: 3px solid var(--amber);
}
.study-row.in-basket {
  border-color: var(--teal);
  box-shadow: 0 0 0 1px var(--teal-line);
}
.study-row.is-retracted {
  background: var(--danger-soft);
  border-color: var(--danger-line);
  border-left: 3px solid var(--danger);
}

.sr-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding-top: 1px;
  min-width: 0;
}
.sr-year-n {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--text-soft);
  line-height: 1.32;
  font-variant-numeric: tabular-nums;
}
.sr-year-n strong { color: var(--text); font-weight: 700; }

.sr-center {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sr-kicker-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}
.sr-title,
.paper-title {
  margin: 0;
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.35;
  color: var(--text);
  overflow-wrap: anywhere;
}
.study-row.is-retracted .sr-title {
  text-decoration: line-through;
  color: var(--danger);
}

/* THE KILLER FEATURE: Source-verified clinical finding in Editorial Serif (15.5px) */
.sr-finding-btn {
  appearance: none;
  border: 0;
  background: transparent;
  text-align: left;
  font-family: var(--font-serif);
  font-size: 15.5px;
  line-height: 1.38;
  color: var(--text);
  padding: 2px 7px;
  margin: 1px -7px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-block;
  max-width: calc(100% + 14px);
  overflow-wrap: anywhere;
  transition: background 0.14s ease, color 0.14s ease;
}
.sr-finding-btn:hover {
  background: var(--teal-soft);
  color: var(--teal-hover);
}
.sr-finding-lead {
  color: var(--teal);
  font-family: var(--font-sans);
  font-size: 0.76rem;
  font-weight: 800;
  margin-right: 4px;
}

.sr-meta,
.paper-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  font-size: 0.77rem;
  color: var(--text-muted);
  overflow-wrap: anywhere;
}
.sr-meta em { color: var(--text-soft); }
.sr-sep { color: var(--border-strong); }
.sr-cites {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.vel-hot { color: var(--emerald); font-weight: 700; }

.sr-right {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding-top: 1px;
}

.ft-pill {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted);
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  padding: 2px 6px;
  border-radius: 5px;
}

.quote-ok {
  border: 0;
  background: transparent;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--emerald);
  padding: 3px 7px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease;
}
.quote-ok:hover { background: var(--emerald-soft); }

.basket-add-btn {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-soft);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all 0.14s ease;
}
.basket-add-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}
.basket-add-btn.added {
  background: var(--teal);
  border-color: var(--teal);
  color: #FFFFFF;
  font-size: 13px;
}
[data-theme="dark"] .basket-add-btn.added { color: #081426; }

/* Phase 8 conditional social count micro-badge on study cards */
.sr-social-badge {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  color: var(--cyan);
  background: var(--cyan-soft);
  border: 1px solid rgba(3, 105, 161, 0.24);
  padding: 1px 6px;
  border-radius: 999px;
}

/* Badges */
.badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  align-items: center;
}
.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 5px;
  letter-spacing: 0.02em;
  white-space: nowrap;
  line-height: 1.3;
}
.badge-year {
  background: var(--bg-subtle);
  color: var(--text);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
}
.badge-d-rct { background: var(--emerald-soft); color: var(--emerald); border: 1px solid var(--emerald-line); }
.badge-d-sr_ma { background: var(--violet-soft); color: var(--violet); border: 1px solid rgba(109, 40, 217, 0.28); }
.badge-d-guideline { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line); }
.badge-d-comparative { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(3, 105, 161, 0.28); }
.badge-d-observational { background: var(--bg-subtle); color: var(--text-soft); border: 1px solid var(--border); }
.badge-d-narrative_review { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }
.badge-d-editorial_letter { background: var(--bg-subtle); color: var(--text-muted); border: 1px solid var(--border); }

.badge-verified {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald-line);
}
.badge-cohort {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-line);
  border-radius: 999px;
  font-size: 0.69rem;
}
.badge-coi {
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
  font-size: 0.68rem;
}
.badge-lm {
  background: var(--amber-soft);
  color: var(--amber);
  border: 1px solid var(--amber-line);
}
.badge-ret {
  background: var(--danger);
  color: #FFFFFF;
  border: 1px solid var(--danger);
}
.badge-axis {
  font-size: 0.7rem;
  font-weight: 600;
  padding: 1.5px 7px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text-soft);
}
.badge-oa {
  background: var(--cyan-soft);
  color: var(--cyan);
  border: 1px solid rgba(3, 105, 161, 0.28);
  font-family: var(--font-mono);
}
.badge-oa-pdf {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px 3px 5px;
  border-radius: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-line);
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.badge-oa-pdf:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}
.pdf-doc-ico { display: inline-block; flex-shrink: 0; vertical-align: middle; }
.oa-ext-arrow { font-size: 0.68rem; opacity: 0.85; line-height: 1; }

.qv-preview {
  font-size: 0.83rem;
  color: var(--text-soft);
  background: var(--teal-soft);
  border-left: 3px solid var(--teal);
  padding: 7px 10px;
  border-radius: 0 7px 7px 0;
  line-height: 1.44;
  font-family: var(--font-serif);
}
.qv-preview strong {
  color: var(--teal);
  font-family: var(--font-sans);
  font-size: 0.69rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  display: block;
  margin-bottom: 2px;
}

/* =========================================================
   LEFT SPACIOUS COLLAPSIBLE CONTEXT RAIL (380px / 344px / 46px)
   ========================================================= */
.context-rail {
  order: -1;
  border-right: 1px solid var(--border);
  padding-right: 24px;
  position: sticky;
  top: calc(var(--topbar-h) + 12px);
  max-height: calc(100vh - var(--topbar-h) - 24px);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.context-rail::-webkit-scrollbar { width: 5px; }
.context-rail::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }

.vol-workspace.rail-collapsed .context-rail {
  padding-right: 8px;
  align-items: center;
  overflow: visible;
}
.rail-expanded-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.vol-workspace.rail-collapsed .rail-expanded-body { display: none; }

.rail-collapsed-strip {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}
.vol-workspace.rail-collapsed .rail-collapsed-strip { display: flex; }

.rail-strip-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  cursor: pointer;
  position: relative;
  transition: all 0.14s ease;
}
.rail-strip-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
  background: var(--teal-soft);
}
.rail-strip-dot {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--teal);
}

.rail-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: -4px;
}
.rail-kicker {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.rail-top-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.rail-collapse-btn {
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.74rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}
.rail-collapse-btn:hover {
  background: var(--bg-subtle);
  color: var(--text);
}
.rail-close-mobile {
  display: none;
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text);
  width: 30px;
  height: 30px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.rail-sec {
  padding-top: 12px;
  border-top: 1px solid var(--border);
  min-width: 0;
}
.rail-sec:first-of-type {
  padding-top: 2px;
  border-top: none;
}
.rail-sec-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.rail-sec-title {
  margin: 0;
  font-size: 0.74rem;
  font-weight: 750;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-soft);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.rail-icua-dir {
  font-size: 0.73rem;
  font-weight: 650;
  color: var(--teal);
  white-space: nowrap;
}
.rail-icua-dir:hover { text-decoration: underline; }

/* Session 3-Step Guide in Rail (?mode=session) */
.session-rail-guide {
  padding: 10px 12px;
  border-radius: 9px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
  font-size: 0.79rem;
}
.session-rail-guide h4 {
  margin: 0 0 7px;
  font-size: 0.8rem;
  color: var(--teal);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.session-step {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  padding: 3px 0;
  color: var(--text-soft);
  font-size: 0.78rem;
}
.session-step.done { color: var(--emerald); font-weight: 600; }
.session-step-num {
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 1.5px solid var(--teal);
  color: var(--teal);
  font-size: 0.67rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.session-step.done .session-step-num {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #FFFFFF;
}

/* Section Editors in Rail (Real 46x46 Photos, ALL visible, Zero +1) */
.rail-editors-stack {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.rail-editor-row {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-width: 0;
}
.rail-editor-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--bg-card);
  box-shadow: 0 0 0 1px var(--border-strong);
  background: var(--bg-subtle);
  flex-shrink: 0;
}
.rail-editor-info {
  min-width: 0;
  flex: 1 1 auto;
}
.rail-editor-name {
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.24;
}
.rail-editor-aff {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.3;
  margin-top: 1px;
}
.rail-editor-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.ed-link-icua {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--teal);
}
.ed-link-icua:hover { text-decoration: underline; }
.ed-link-orcid {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 750;
  color: #4D7C0F;
  background: rgba(166, 206, 57, 0.18);
  border: 1px solid rgba(77, 124, 15, 0.30);
  border-radius: 999px;
  padding: 1px 7px;
}
[data-theme="dark"] .ed-link-orcid {
  color: #BEF264;
  background: rgba(166, 206, 57, 0.14);
  border-color: rgba(190, 242, 100, 0.36);
}
.ed-link-orcid:hover { background: rgba(166, 206, 57, 0.30); }

.rail-clinical-bridge {
  margin-top: 11px;
  padding-top: 9px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.rail-clinical-kicker {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-style: italic;
}
.rail-clinical-link {
  font-size: 0.77rem;
  font-weight: 600;
  color: var(--cyan);
  line-height: 1.35;
}
.rail-clinical-link:hover { color: var(--teal); text-decoration: underline; }

/* Annual Chart in Rail */
.rail-chart-cue {
  font-size: 0.74rem;
  color: var(--text-muted);
  margin-bottom: 6px;
  line-height: 1.3;
}
.rail-chart-wrap {
  width: 100%;
  overflow: hidden;
}
.rail-chart-readout {
  min-height: 18px;
  margin-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.71rem;
  color: var(--text-soft);
  font-variant-numeric: tabular-nums;
}
.rail-legend-row {
  margin-top: 6px;
  gap: 5px 9px;
  font-size: 0.7rem;
}
.rail-year-pill {
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid var(--teal-line);
  background: var(--teal-soft);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.69rem;
  font-weight: 700;
  cursor: pointer;
}
.rail-year-pill:hover {
  background: var(--teal);
  color: #FFFFFF;
}
.yr-bar-g:hover .yr-col-hover {
  fill: var(--teal-soft);
}

/* Rail Alerts Fallback (hidden automatically once #uc-daily-strip-slot renders) */
#uc-daily-strip-slot:not(:empty) + .rail-alerts-fallback {
  display: none;
}
.rail-alerts-fallback-txt {
  margin: 0 0 8px;
  font-size: 0.77rem;
  color: var(--text-muted);
  line-height: 1.42;
}
.rail-alerts-fallback-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

/* Compact 2x2 KPI Grid & Methodology Accordion in Rail */
.kpi-strip {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kpi-grid-2x2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.kpi-chip {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.14s ease, background 0.14s ease;
}
.kpi-chip:hover {
  border-color: var(--teal);
  background: var(--bg-card-hover);
}
.kpi-chip.active {
  border-color: var(--teal);
  background: var(--teal-soft);
}
.kpi-chip-val {
  font-family: var(--font-mono);
  font-size: 0.96rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.15;
}
.kpi-chip-rct .kpi-chip-val { color: var(--emerald); }
.kpi-chip-ver .kpi-chip-val { color: var(--teal); }
.kpi-chip-oa .kpi-chip-val { color: var(--cyan); }
.kpi-chip-lbl {
  font-size: 0.71rem;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.25;
}

.rail-how-fold {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-card);
  overflow: hidden;
}
.rail-how-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 10px;
  font-size: 0.79rem;
  font-weight: 650;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.rail-how-summary::-webkit-details-marker { display: none; }
.rail-how-summary::marker { content: ""; }
.rail-how-summary:hover { color: var(--teal); }
.rail-how-body {
  padding: 9px 11px 11px;
  border-top: 1px solid var(--border);
  font-size: 0.77rem;
  line-height: 1.48;
  color: var(--text-soft);
}
.rail-how-body p { margin: 0 0 8px; }
.rail-how-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}
.rail-how-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 8px;
}
.rail-how-stat strong {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text);
}
.rail-how-stat span {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.25;
  display: block;
}

/* Rail Citation & Zenodo DOI Box */
.rail-cite-card {
  margin-top: 10px;
  padding: 10px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-card);
}
.rail-cite-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 5px;
}
.rail-cite-kicker {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--teal);
}
.rail-doi-link {
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--cyan);
}
.rail-doi-link:hover { text-decoration: underline; }
.rail-cite-text {
  margin: 0 0 8px;
  font-size: 0.73rem;
  line-height: 1.44;
  color: var(--text-soft);
  overflow-wrap: anywhere;
}
.rail-cite-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rail-highlight {
  animation: railFlash 1.2s ease;
}
@keyframes railFlash {
  0% { background: var(--teal-soft); border-radius: 8px; }
  100% { background: transparent; }
}

.rail-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 51, 0.45);
  backdrop-filter: blur(3px);
  z-index: 84;
  display: none;
}
.rail-backdrop.open { display: block; }

/* =========================================================
   BUTTONS
   ========================================================= */
.btn-accent, .btn-secondary, .btn-teal, .btn-ghost {
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.79rem;
  font-weight: 650;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.14s ease;
  font-family: inherit;
  white-space: nowrap;
}
.btn-sm { padding: 5px 10px; font-size: 0.75rem; }
.btn-accent {
  background: var(--teal);
  color: #FFFFFF;
  border: 1px solid transparent;
}
.btn-accent:hover { background: var(--teal-hover); }
[data-theme="dark"] .btn-accent { color: #081426; }
.btn-teal {
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid var(--teal-line);
}
.btn-teal:hover { background: var(--teal); color: #FFFFFF; }
.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-secondary:hover { border-color: var(--teal); color: var(--teal); }
.btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-ghost {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--border-strong); background: var(--bg-subtle); }

.btn-oa-pdf {
  border-radius: 8px;
  padding: 5px 11px 5px 8px;
  font-size: 0.77rem;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid var(--danger-line);
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}
.btn-oa-pdf:hover {
  background: #DC2626;
  border-color: #DC2626;
  color: #FFFFFF;
}

/* =========================================================
   PANELS, CHARTS, TABLES & ANALYTICAL TABS (Tabs 2–5)
   ========================================================= */
.panel {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 15px 17px;
  margin-bottom: 14px;
  min-width: 0;
}
.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}
.panel-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 750;
  line-height: 1.25;
  color: var(--text);
}
.panel-sub {
  margin: 3px 0 0;
  font-size: 0.79rem;
  color: var(--text-muted);
}

.two-col-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}
@media (max-width: 920px) {
  .two-col-grid { grid-template-columns: 1fr; }
}

.svg-chart-wrap {
  width: 100%;
  overflow-x: auto;
  position: relative;
}
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.73rem;
  color: var(--text-muted);
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.legend-item:hover { color: var(--text); }
.dot { width: 8px; height: 8px; border-radius: 2px; display: inline-block; flex-shrink: 0; }

.chart-tooltip {
  position: fixed;
  z-index: 160;
  pointer-events: none;
  background: #142033;
  color: #F8FAFC;
  border: 1px solid var(--teal);
  border-radius: 8px;
  padding: 7px 10px;
  font-size: 0.75rem;
  font-family: var(--font-mono);
  box-shadow: 0 12px 26px rgba(0, 0, 0, 0.36);
  max-width: 280px;
}

/* Pagination */
.pagination-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
  font-size: 0.79rem;
  color: var(--text-muted);
}
.page-btns { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.page-btn {
  border: 1px solid var(--border-strong);
  background: var(--bg-card);
  color: var(--text-soft);
  border-radius: 7px;
  padding: 4px 10px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.page-btn:hover:not(:disabled) { border-color: var(--teal); color: var(--teal); }
.page-btn.active { background: var(--teal); color: #FFFFFF; border-color: var(--teal); }
.page-btn:disabled { opacity: 0.38; cursor: not-allowed; }

/* Meta-Epidemiology Tab */
.crossover-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--violet-soft);
  border: 1px solid rgba(109, 40, 217, 0.30);
  color: var(--violet);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
}
.inflation-summary-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 9px;
  margin-top: 12px;
}
.mini-stat {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 11px;
}
.mini-stat-val { font-family: var(--font-mono); font-size: 1.08rem; font-weight: 800; color: var(--text); }
.mini-stat-lbl { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.audit-models { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 11px; }
.model-chip {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  padding: 3px 9px;
  border-radius: 7px;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  color: var(--cyan);
}
.audit-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 11px;
}
@media (max-width: 600px) { .audit-kpi-grid { grid-template-columns: 1fr; } }
.stacked-bar {
  display: flex;
  height: 11px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  margin: 10px 0;
}
.audit-summary-note {
  font-size: 0.78rem;
  color: var(--text-soft);
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  border-left: 3px solid var(--amber);
  border-radius: 0 7px 7px 0;
  padding: 7px 10px;
  margin-bottom: 10px;
  line-height: 1.44;
}

.hbar-list { display: flex; flex-direction: column; gap: 7px; }
.hbar-row {
  display: grid;
  grid-template-columns: minmax(110px, 1.35fr) 2fr 54px;
  gap: 9px;
  align-items: center;
  font-size: 0.79rem;
  cursor: pointer;
  padding: 3px 5px;
  border-radius: 6px;
}
.hbar-row:hover { background: var(--bg-subtle); }
.hbar-name {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text-soft);
  font-weight: 600;
}
.hbar-track {
  height: 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  overflow: hidden;
}
.hbar-fill {
  height: 100%;
  border-radius: 999px;
  background: var(--teal);
}
.hbar-num {
  text-align: right;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text);
}

/* Tables & Evidence Gap Heatmaps */
.table-scroll { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
table.data-table th,
table.data-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
table.data-table th {
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--bg-subtle);
  white-space: nowrap;
}
table.data-table tr.clickable-row { cursor: pointer; }
table.data-table tr.clickable-row:hover { background: var(--bg-card-hover); }

.heatmap-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 5px;
  font-size: 0.76rem;
}
.heatmap-table th {
  padding: 6px 8px;
  color: var(--text-muted);
  font-weight: 700;
  text-align: left;
  font-size: 0.72rem;
}
.heatmap-table th.hm-col-head {
  text-align: center;
  max-width: 135px;
  line-height: 1.25;
}
.hm-cell {
  border-radius: 7px;
  padding: 8px 7px;
  text-align: center;
  cursor: pointer;
  font-family: var(--font-mono);
  transition: transform 0.12s ease, border-color 0.12s ease;
  border: 1px solid transparent;
  min-width: 68px;
}
.hm-cell:hover { transform: scale(1.03); border-color: var(--text); }
.hm-cell.active-cell { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-line); }
.hm-n { font-size: 0.92rem; font-weight: 800; display: block; }
.hm-rct { font-size: 0.65rem; opacity: 0.9; display: block; margin-top: 2px; }

.hm-solid { background: #DCFCE7; color: #065F46; }
.hm-moderate { background: #E0F2FE; color: #0369A1; }
.hm-redundant { background: #FFEDD5; color: #9A3412; }
.hm-weak { background: #FEF9C3; color: #854D0E; }
.hm-gap { background: #FEE2E2; color: #991B1B; }
[data-theme="dark"] .hm-solid { background: rgba(16, 185, 129, 0.24); color: #6EE7B7; }
[data-theme="dark"] .hm-moderate { background: rgba(56, 189, 248, 0.22); color: #7DD3FC; }
[data-theme="dark"] .hm-redundant { background: rgba(249, 115, 22, 0.22); color: #FDBA74; }
[data-theme="dark"] .hm-weak { background: rgba(234, 179, 8, 0.16); color: #FDE047; }
[data-theme="dark"] .hm-gap { background: rgba(239, 68, 68, 0.14); color: #FCA5A5; }

.hm-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.72rem;
  color: var(--text-muted);
}
.hm-legend span { display: inline-flex; align-items: center; gap: 4px; }

/* Controversies & Inherited Premises */
.count-pill {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal);
  border: 1px solid var(--teal-line);
}
.warn-pill {
  background: var(--amber-soft);
  color: var(--amber);
  border-color: var(--amber-line);
}
.premise-controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.premise-controls .compact-select { width: auto; min-width: 170px; }
.premise-controls .compact-input { width: 185px; }
.premise-stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
}

.controversies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(400px, 100%), 1fr));
  gap: 13px;
}
.contro-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.contro-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.contro-head h3 { margin: 0; font-size: 0.98rem; line-height: 1.28; color: var(--text); }
.contro-bar { display: flex; height: 7px; border-radius: 999px; overflow: hidden; background: var(--bg-subtle); }
.contro-seg-rep { background: #D97706; }
.contro-seg-nua { background: #0284C7; }
.contro-seg-cha { background: #059669; }
.contro-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
@media (max-width: 680px) { .contro-cols { grid-template-columns: 1fr; } }
.contro-box {
  border-radius: 8px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  font-size: 0.79rem;
  line-height: 1.44;
  background: var(--bg-card);
}
.contro-box-rep { border-left: 3px solid var(--amber); }
.contro-box-cha { border-left: 3px solid var(--emerald); }
.contro-box-lbl {
  font-family: var(--font-mono);
  font-size: 0.67rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 4px;
}
.contro-box-rep .contro-box-lbl { color: var(--amber); }
.contro-box-cha .contro-box-lbl { color: var(--emerald); }
.contro-foot {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.premises-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
  gap: 11px;
}
.premise-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 13px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.stance-badge {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  text-transform: uppercase;
}
.st-repeats_as_fact { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-line); }
.st-challenges_or_refutes { background: var(--emerald-soft); color: var(--emerald); border: 1px solid var(--emerald-line); }
.st-nuances { background: var(--cyan-soft); color: var(--cyan); border: 1px solid rgba(3, 105, 161, 0.28); }

.verbatim-quote {
  margin: 0;
  padding: 8px 11px;
  border-left: 3px solid var(--teal);
  background: var(--teal-soft);
  border-radius: 0 7px 7px 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.88rem;
  color: var(--text);
  line-height: 1.48;
  overflow-wrap: anywhere;
}
.verbatim-quote.quote-flash {
  animation: quotePulse 1.5s ease;
}
@keyframes quotePulse {
  0% { box-shadow: 0 0 0 3px var(--teal); background: var(--amber-soft); }
  100% { box-shadow: none; background: var(--teal-soft); }
}

.premise-source {
  margin-top: auto;
  padding-top: 6px;
  border-top: 1px solid var(--border);
  font-size: 0.75rem;
  color: var(--teal);
  cursor: pointer;
  font-weight: 600;
}
.premise-source:hover { text-decoration: underline; }

/* Canonical Landmarks Timeline */
.landmarks-timeline {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  padding-left: 22px;
}
.landmarks-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--border-strong);
}
.landmark-card {
  position: relative;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.landmark-card::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 20px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--amber);
  border: 2px solid var(--bg-panel);
  box-shadow: 0 0 0 2px var(--amber-line);
}
.landmark-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
.landmark-year { font-family: var(--font-mono); font-size: 1rem; font-weight: 800; color: var(--amber); }
.landmark-note { font-size: 0.85rem; color: var(--text-soft); margin: 0; }
.metrics-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  padding-top: 7px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-muted);
  align-items: center;
}
.metrics-strip strong { color: var(--text); }

/* =========================================================
   VISIBLE SERVER-RENDERED GEO OVERVIEW & BILINGUAL FAQ
   ========================================================= */
.uc-geo-faq {
  margin-top: 22px;
  padding: 16px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.geo-faq-head { margin-bottom: 8px; }
.geo-faq-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.uc-geo-summary {
  margin: 0 0 12px;
  font-size: 0.83rem;
  line-height: 1.55;
  color: var(--text-soft);
}
.geo-faq-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.geo-faq-item {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg);
  overflow: hidden;
}
.geo-faq-q {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 12px;
  font-size: 0.83rem;
  font-weight: 650;
  color: var(--text);
  cursor: pointer;
  user-select: none;
}
.geo-faq-q::-webkit-details-marker { display: none; }
.geo-faq-q::marker { content: ""; }
.geo-faq-q:hover { color: var(--teal); }
.geo-faq-a {
  margin: 0;
  padding: 0 12px 11px;
  font-size: 0.81rem;
  line-height: 1.52;
  color: var(--text-soft);
}

/* =========================================================
   CENTERED EDITORIAL PAPER INSPECTOR MODAL + PHASE 8 ANCHOR
   ========================================================= */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 51, 0.42);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 95;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  cursor: pointer;
  transition: opacity 0.18s ease, visibility 0.18s ease;
}
[data-theme="dark"] .drawer-backdrop {
  background: rgba(2, 6, 23, 0.72);
}
.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

body.drawer-open {
  overflow: hidden;
}

.drawer {
  position: fixed;
  top: 50%;
  left: 50%;
  right: auto;
  width: min(1080px, calc(100vw - 96px));
  max-height: calc(100vh - 76px);
  max-height: calc(100dvh - 76px);
  height: auto;
  background: var(--bg-panel);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 16px;
  z-index: 105;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 28px 26px;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(-50%, -48%) scale(0.975);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  box-shadow: 0 28px 72px rgba(20, 32, 51, 0.24), 0 6px 20px rgba(20, 32, 51, 0.10);
}
[data-theme="dark"] .drawer {
  box-shadow: 0 32px 84px rgba(0, 0, 0, 0.68), 0 0 0 1px var(--border-strong);
}
.drawer.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translate(-50%, -50%) scale(1);
}

.drawer-topbar {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--bg-panel);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 0 -28px 14px;
  padding: 12px 28px 10px;
  border-bottom: 1px solid var(--border);
}
.drawer-topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.drawer-dismiss-hint {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.drawer-kicker {
  font-family: var(--font-mono);
  font-size: 0.71rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--teal);
  text-transform: uppercase;
}
.drawer-close {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border-strong);
  border-radius: 7px;
  padding: 5px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.drawer-close:hover { border-color: var(--teal); color: var(--teal); }

.drawer-title {
  margin: 6px 0 5px;
  font-family: var(--font-serif);
  font-size: 1.24rem;
  line-height: 1.28;
  color: var(--text);
}
.drawer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 9px 11px;
  margin: 10px 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  align-items: center;
}

.drawer-reading-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  margin-top: 8px;
  align-items: start;
}
.drawer-reading-grid.has-two-cols {
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
}
.drawer-reading-primary,
.drawer-reading-secondary,
.drawer-network-col {
  min-width: 0;
}
.drawer .badge,
.drawer .badge-axis {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}
.drawer-reading-grid .qv-box {
  margin: 0;
}
.drawer-reading-grid .drawer-sec-title:first-child {
  margin-top: 0;
}
.drawer-reading-grid .abstract-box {
  margin: 0;
}
.drawer-network-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 14px;
  align-items: start;
}
.drawer-network-col .drawer-sec-title {
  margin-top: 0;
}

@media (max-width: 860px) {
  .drawer {
    width: calc(100vw - 36px);
    max-height: calc(100vh - 44px);
    max-height: calc(100dvh - 44px);
    padding: 0 20px 22px;
  }
  .drawer-topbar {
    margin: 0 -20px 12px;
    padding: 11px 20px 9px;
  }
  .drawer-reading-grid.has-two-cols,
  .drawer-network-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}

.qv-box {
  background: var(--bg);
  border: 1px solid var(--teal-line);
  border-radius: 10px;
  padding: 13px 15px;
  margin: 13px 0;
}
.qv-box-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}
.qv-box-title {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--teal);
}
.qv-meta-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(135px, 1fr));
  gap: 7px;
  margin: 10px 0;
}
.qv-meta-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 0.78rem;
}
.qv-meta-item label {
  display: block;
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.outcome-item {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 11px;
  margin-top: 8px;
}
.outcome-summary { font-size: 0.84rem; font-weight: 600; margin: 5px 0 6px; color: var(--text); }

.abstract-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 12px 14px;
  font-size: 0.84rem;
  color: var(--text-soft);
  line-height: 1.56;
  margin: 10px 0;
  overflow-wrap: anywhere;
}
.drawer-sec-title {
  margin: 15px 0 7px;
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-family: var(--font-mono);
  color: var(--text-muted);
}
.mini-link-list { display: flex; flex-direction: column; gap: 6px; }
.mini-paper-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 0.79rem;
  cursor: pointer;
}
.mini-paper-item:hover { border-color: var(--teal); }

.alert-box { border-radius: 9px; padding: 9px 12px; font-size: 0.8rem; margin: 9px 0; }
.alert-coi { background: var(--coi-soft); border: 1px solid var(--coi-line); color: var(--coi); }
.alert-ret { background: var(--danger-soft); border: 1px solid var(--danger-line); color: var(--danger); }

/* Phase 8 Social Layer Paper Drawer Notice */
.uc-social-paper-slot {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 9px;
  border: 1px dashed var(--border-strong);
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.uc-social-paper-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
}
.uc-social-paper-title {
  font-size: 0.79rem;
  font-weight: 700;
  color: var(--text);
}
.uc-social-soon-pill {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-muted);
  border: 1px solid var(--border);
}
.uc-social-paper-note {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* =========================================================
   FLOATING CITATION BASKET DOCK + POPOVER
   ========================================================= */
.basket-dock {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  max-width: calc(100vw - 24px);
  background: #142033;
  color: #F8FAFC;
  border: 1.5px solid var(--teal);
  border-radius: 12px;
  padding: 9px 14px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  z-index: 80;
  box-shadow: 0 14px 36px rgba(20, 32, 51, 0.35);
}
.basket-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.81rem;
  font-weight: 650;
}
.basket-toggle-btn {
  background: rgba(14, 124, 120, 0.22);
  color: #F8FAFC;
  border: 1px solid rgba(43, 184, 178, 0.50);
  border-radius: 9px;
  padding: 5px 10px 5px 7px;
  cursor: pointer;
}
.basket-toggle-btn:hover { background: rgba(14, 124, 120, 0.36); }
.basket-caret {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.73rem;
  color: #5EEAD4;
  font-weight: 700;
  white-space: nowrap;
}
.basket-pill {
  background: var(--teal);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.8rem;
}
[data-theme="dark"] .basket-pill {
  color: #081426;
}
.basket-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.basket-dock .btn-secondary { background: #1E2D45; color: #F1F5F9; border-color: #334A6B; }
.basket-dock .btn-ghost { color: #CBD5E1; border-color: #334A6B; }
.basket-dock .btn-teal { background: rgba(43, 184, 178, 0.18); color: #5EEAD4; border-color: rgba(43, 184, 178, 0.45); }

.basket-popover {
  position: fixed;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  width: min(760px, calc(100vw - 24px));
  max-height: min(56vh, 420px);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  color: var(--text);
  border: 1.5px solid var(--teal);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 86;
  overflow: hidden;
}
.basket-popover-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
.basket-popover-sub { margin-left: 8px; font-size: 0.74rem; color: var(--text-muted); font-family: var(--font-mono); }
.basket-popover-list { overflow-y: auto; padding: 8px 10px; display: flex; flex-direction: column; gap: 6px; }
.basket-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
}
.basket-item-row:hover { border-color: var(--teal); }
.basket-item-main { min-width: 0; flex: 1; cursor: pointer; }
.basket-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 5px; margin-bottom: 3px; }
.basket-item-title { font-size: 0.83rem; font-weight: 650; line-height: 1.32; color: var(--text); }
.basket-item-meta { font-size: 0.73rem; color: var(--text-muted); margin-top: 2px; }
.basket-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.basket-rm-btn {
  border: 1px solid var(--border-strong);
  background: transparent;
  color: var(--text-muted);
  border-radius: 6px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 700;
  cursor: pointer;
}
.basket-rm-btn:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

/* Modal & Toast */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(20, 32, 51, 0.50);
  backdrop-filter: blur(4px);
  z-index: 130;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}
.modal-card {
  width: min(680px, 96vw);
  max-height: 88vh;
  overflow-y: auto;
  background: var(--bg-panel);
  border: 1px solid var(--border-strong);
  border-top: 3px solid var(--teal);
  border-radius: 13px;
  padding: 20px 22px;
  box-shadow: var(--shadow);
}
.cite-box {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 11px 13px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 7px 0 11px;
  color: var(--text);
}
.toast {
  position: fixed;
  bottom: 78px;
  right: 20px;
  background: var(--emerald);
  color: #FFFFFF;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: 0.81rem;
  font-weight: 700;
  z-index: 165;
  box-shadow: 0 10px 26px rgba(20, 32, 51, 0.25);
}
[data-theme="dark"] .toast,
[data-theme="dark"] .uc-wn-btn:hover,
[data-theme="dark"] .adv-badge,
[data-theme="dark"] .active-filter-chip:hover,
[data-theme="dark"] .session-step.done .session-step-num,
[data-theme="dark"] .rail-year-pill:hover,
[data-theme="dark"] .btn-teal:hover,
[data-theme="dark"] .page-btn.active,
[data-theme="dark"] .btn-inline:hover,
[data-theme="dark"] .coi-toggle.active .coi-box,
[data-theme="dark"] .badge-ret {
  color: #081426;
}
[data-theme="dark"] .uc-wn-btn:hover .pulse-dot {
  background: #081426;
}

/* Institutional Bridge Footer */
.footer-wrap { padding-bottom: 84px; }
.site-footer {
  padding: 18px 20px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-left: 3.5px solid var(--teal);
  border-radius: var(--radius);
  display: flex;
  flex-direction: column;
  gap: 12px;
  font-size: 0.79rem;
  color: var(--text-muted);
}
.footer-main-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.footer-title { font-weight: 700; color: var(--text); margin-bottom: 2px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.footer-links a,
.footer-btn-link {
  color: var(--teal);
  font-weight: 600;
  font-size: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.footer-links a:hover,
.footer-btn-link:hover { text-decoration: underline; }
.footer-links a.footer-tech-link {
  font-family: var(--font-mono);
  font-size: 0.73rem;
  color: var(--text-muted);
  font-weight: 500;
}
.footer-links a.footer-tech-link:hover { color: var(--teal); }
.footer-clinical-strip {
  padding-top: 10px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 14px;
  font-size: 0.76rem;
}
.footer-clinical-label { color: var(--text-muted); font-style: italic; }

.empty-state {
  padding: 26px 18px;
  text-align: center;
  color: var(--text-muted);
  background: var(--bg-card);
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 0.86rem;
}

/* Overflow Hardening */
.study-row,
.contro-card,
.premise-card,
.landmark-card,
.two-col-grid > *,
.svg-chart-wrap,
.table-scroll,
#uc-maude-slot,
#uc-trials-slot,
#uc-spin-slot,
#uc-endpoints-slot,
#uc-passports-slot,
#uc-daily-strip-slot {
  min-width: 0;
  max-width: 100%;
}
#uc-maude-slot,
#uc-trials-slot,
#uc-spin-slot,
#uc-endpoints-slot {
  overflow-x: auto;
}

/* =========================================================
   RESPONSIVE BREAKPOINTS (< 1060px Mobile/Tablet Slide-Over Rail + 390x844)
   ========================================================= */
@media (max-width: 1059px) {
  .mobile-ctx-btn { display: inline-flex; }
  .vol-workspace,
  .vol-workspace.rail-collapsed {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .context-rail {
    position: fixed;
    top: 0;
    left: 0;
    right: auto;
    bottom: 0;
    width: min(380px, 92vw);
    max-height: 100vh;
    max-height: 100dvh;
    z-index: 88;
    background: var(--bg-panel);
    border-right: 1px solid var(--border-strong);
    padding: 16px 18px 40px;
    transform: translateX(-100%);
    visibility: hidden;
    pointer-events: none;
    box-shadow: none;
    transition: transform 0.22s ease, visibility 0.22s ease;
  }
  .context-rail.mobile-open {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    box-shadow: 14px 0 40px rgba(20, 32, 51, 0.22);
  }
  .vol-workspace.rail-collapsed .rail-expanded-body { display: flex; }
  .vol-workspace.rail-collapsed .rail-collapsed-strip { display: none; }
  .rail-collapse-btn { display: none; }
  .rail-close-mobile { display: inline-flex; }
}

@media (max-width: 720px) {
  .study-row {
    grid-template-columns: 1fr;
    gap: 7px;
    padding: 11px 12px;
  }
  .sr-left {
    flex-direction: row;
    align-items: center;
    flex-wrap: wrap;
    gap: 7px;
  }
  .sr-right {
    justify-content: flex-end;
    padding-top: 4px;
    border-top: 1px solid var(--border);
  }
  .tabs-right-meta { display: none; }
  .year-expanded-sticky {
    top: calc(var(--topbar-h) + 2px);
    padding: 7px 10px;
  }
}

@media (max-width: 640px) {
  .wrap { padding: 0 12px; }
  .topbar-inner { gap: 6px; }
  .brand-divider,
  .brand-wordmark { display: none; }
  .brand-mark { width: 26px; height: 26px; }
  .urocorpus-name { font-size: 0.82rem; letter-spacing: 0.07em; }
  .urocorpus-vol { font-size: 0.56rem; }
  .topbar-controls { gap: 5px; }
  .uc-wn-btn { padding: 4px 8px; font-size: 0.71rem; }
  .mobile-ctx-btn { padding: 4px 8px; font-size: 0.72rem; }
  .seg-btn button { padding: 3px 6px; font-size: 0.69rem; gap: 3px; }
  .tools-menu-btn { padding: 4px 8px; font-size: 0.72rem; }
  .tools-menu-label { display: none; }
  .vol-title-strip { padding-top: 8px; padding-bottom: 5px; gap: 4px 10px; }
  .atlas-h1 { font-size: 1.18rem; }
  .atlas-sub { font-size: 0.79rem; }
  .nav-tabs { gap: 14px; }
  .tab-btn { font-size: 0.81rem; }
  .panel { padding: 12px; }
  .filter-panel { padding: 9px 10px; }
  .adv-filters-drawer { grid-template-columns: 1fr; }
  .cmd-right-btns { margin-left: 0; }
  .premise-controls { width: 100%; }
  .premise-controls .compact-select,
  .premise-controls .compact-input { width: 100%; min-width: 0; }
  .hbar-row { grid-template-columns: minmax(88px, 1.2fr) 1.6fr 46px; gap: 6px; font-size: 0.75rem; }
  .drawer { width: calc(100vw - 16px); max-height: calc(100vh - 24px); max-height: calc(100dvh - 24px); border-radius: 14px; padding: 0 14px 20px; }
  .drawer-topbar { margin: 0 -14px 12px; padding: 11px 14px 9px; }
  .drawer-dismiss-hint { display: none; }
  .drawer-title { font-size: 1.06rem; }
  .basket-dock { left: 10px; right: 10px; transform: none; max-width: none; bottom: 10px; }
  .basket-popover { left: 10px; right: 10px; transform: none; width: auto; bottom: 112px; }
  .site-footer { padding: 14px; }
}

@media (max-width: 560px) {
  .uc-wn-btn { display: none !important; }
}

@media (max-width: 440px) {
  .topbar-inner { gap: 4px; }
  .brand-mark { width: 24px; height: 24px; }
  .urocorpus-name { font-size: 0.76rem; letter-spacing: 0.05em; }
  .urocorpus-vol { font-size: 0.52rem; }
  .uc-wn-btn #btn-whats-new-lbl { display: none; }
  .uc-wn-btn { padding: 5px 7px; }
  .mobile-ctx-btn { padding: 4px 7px; font-size: 0.7rem; }
  .lang-flag { width: 14px; height: 10px; }
  .seg-btn button { padding: 3px 5px; font-size: 0.67rem; gap: 3px; }
  .tools-menu-btn { padding: 4px 7px; }
}

/* ==========================================================================
   INSTITUTIONAL COHORT ACCORDION, CLICKABLE OVERLAP STAT & CLUSTER BANNER
   ========================================================================== */
.mini-stat-clickable {
  display: block;
  width: 100%;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.12s ease;
}

.mini-stat-clickable:hover {
  border-color: var(--teal);
  background: var(--teal-soft);
  transform: translateY(-1px);
}

.mini-stat-clickable .mini-stat-jump {
  display: inline-block;
  margin-left: 3px;
  color: var(--teal);
  font-weight: 800;
}

table.cohort-master-table tr.cohort-cluster-row.is-expanded {
  background: var(--teal-soft);
}

table.cohort-master-table tr.cohort-cluster-row.is-expanded td:first-child {
  box-shadow: inset 3px 0 0 var(--teal);
}

.cohort-col-id,
.cohort-col-span,
.cohort-col-rcts,
.cohort-col-ov {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.cohort-col-ov {
  white-space: normal;
  min-width: 170px;
}

.cohort-cty-inline {
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 500;
}

.cohort-ov-hot {
  color: var(--amber);
  font-weight: 750;
}

.cohort-win-sample {
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  line-height: 1.35;
}

.cohort-count-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  border: 1px solid var(--teal-line);
  background: var(--teal-soft);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.77rem;
  font-weight: 700;
  line-height: 1.25;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.12s ease;
}

.cohort-count-unit {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.74rem;
}

.cohort-count-btn:hover,
.cohort-count-btn[aria-expanded="true"] {
  background: var(--teal);
  border-color: var(--teal);
  color: #ffffff;
}

.cohort-chev {
  display: inline-block;
  font-size: 0.78rem;
  line-height: 1;
  transition: transform 0.2s ease;
}

.cohort-count-btn[aria-expanded="true"] .cohort-chev,
tr.cohort-cluster-row.is-expanded .cohort-chev {
  transform: rotate(180deg);
}

table.cohort-master-table tr.cohort-expand-row > td {
  padding: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
}

.cohort-expand-card {
  margin: 10px 12px 14px;
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--teal);
  border-radius: var(--radius);
  background: var(--bg-panel);
  overflow: hidden;
  max-width: 100%;
}

.cohort-expand-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border-bottom: 1px solid var(--border);
}

.cohort-expand-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.cohort-expand-title {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: 0.85rem;
  color: var(--text);
}

.cohort-expand-stats {
  font-size: 0.74rem;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.cohort-id-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--teal-soft);
  border: 1px solid var(--teal-line);
  color: var(--teal);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.cohort-cty-pill {
  display: inline-flex;
  align-items: center;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 0.71rem;
  font-weight: 600;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-soft);
}

.cohort-expand-actions {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}

.cohort-basket-btn.is-added {
  background: var(--emerald-soft) !important;
  border-color: var(--emerald-line) !important;
  color: var(--emerald) !important;
  font-weight: 700;
}

.cohort-subtable-wrap {
  overflow-x: auto;
  max-width: 100%;
  -webkit-overflow-scrolling: touch;
}

table.cohort-subtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

table.cohort-subtable th,
table.cohort-subtable td {
  padding: 7px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

table.cohort-subtable tr:last-child td {
  border-bottom: none;
}

table.cohort-subtable th {
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

table.cohort-subtable tbody tr:hover {
  background: var(--bg-card-hover);
}

.cohort-col-yr,
.cohort-col-n {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 650;
}

.cohort-col-win,
.cohort-col-des,
.cohort-col-pdf {
  white-space: nowrap;
}

.cohort-col-study {
  min-width: 240px;
}

.cohort-study-btn {
  appearance: none;
  border: none;
  background: transparent;
  padding: 0;
  margin: 0;
  text-align: left;
  font: inherit;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
  cursor: pointer;
}

.cohort-study-btn:hover {
  color: var(--teal);
  text-decoration: underline;
}

.cohort-study-meta {
  font-size: 0.73rem;
  color: var(--text-muted);
  margin-top: 2px;
  line-height: 1.35;
}

.cohort-win-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.25;
  white-space: nowrap;
}

.cohort-win-overlap {
  background: var(--amber-soft);
  border: 1px solid var(--amber-line);
  color: var(--amber);
}

.cohort-win-neutral {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  color: var(--text-soft);
  font-weight: 600;
}

.cohort-muted {
  color: var(--text-muted);
}

.cohort-show-more-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.cohort-cluster-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px 14px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--teal-line);
  border-left: 4px solid var(--teal);
  background: var(--teal-soft);
  color: var(--text);
  font-size: 0.83rem;
}

.cohort-cluster-banner-body {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.cohort-cluster-clear-btn {
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--teal-line);
  background: var(--bg-panel);
  color: var(--teal);
  font-size: 0.75rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease;
}

.cohort-cluster-clear-btn:hover {
  background: var(--teal);
  color: #ffffff;
}

[data-theme="dark"] .cohort-count-btn:hover,
[data-theme="dark"] .cohort-count-btn[aria-expanded="true"],
[data-theme="dark"] .cohort-cluster-clear-btn:hover {
  color: #08121f;
}

[data-theme="dark"] .cohort-expand-card {
  background: var(--bg-card);
}

@media (max-width: 640px) {
  .cohort-expand-card {
    margin: 8px 6px 10px;
  }

  .cohort-expand-head {
    padding: 9px 10px;
  }

  table.cohort-subtable th,
  table.cohort-subtable td {
    padding: 6px 7px;
  }

  .cohort-col-study {
    min-width: 200px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}


/* === UroCorpus Topbar BETA Pill (clickable feedback trigger) === */
.uc-beta-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono, ui-monospace, SFMono-Regular, Menlo, monospace);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  line-height: 1.3;
  padding: 2px 7px;
  border-radius: 999px;
  background: #FEF3C7;
  color: #92400E;
  border: 1px solid #F59E0B;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.uc-beta-pill:hover {
  background: #FDE68A;
  border-color: #D97706;
  transform: translateY(-0.5px);
}
.uc-beta-pill:focus-visible {
  outline: 2px solid #D97706;
  outline-offset: 2px;
}
[data-theme="dark"] .uc-beta-pill {
  background: rgba(245, 158, 11, 0.16);
  color: #FCD34D;
  border-color: rgba(245, 158, 11, 0.5);
}
[data-theme="dark"] .uc-beta-pill:hover {
  background: rgba(245, 158, 11, 0.28);
  border-color: #FBBF24;
}
@media (max-width: 520px) {
  .uc-beta-pill {
    font-size: 0.56rem;
    padding: 1.5px 5.5px;
    letter-spacing: 0.06em;
  }
}
