/* ── FONTS ──────────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-200.woff2') format('woff2');
  font-weight: 200;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-300.woff2') format('woff2');
  font-weight: 300;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-400.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-500.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-600.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'TWK Lausanne';
  src: url('../fonts/TWKLausanne-700.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

/* ── DESIGN TOKENS ─────────────────────────────────────────────────────── */
:root, [data-theme="light"] {
  --bg: #f2f2f2;
  --surface: #ffffff;
  --surface-2: #f7f7f5;
  --surface-3: #eeeeed;
  --text: #111111;
  --muted: #6a6a66;
  --faint: #9a9a94;
  --border: #ddddda;
  --border-strong: #b9b9b3;
  --shadow: 0 20px 60px rgba(0,0,0,.05);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.04);
  --shadow-hover: 0 28px 72px rgba(0,0,0,.10);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 14px;
  --radius-pill: 999px;
  --nav-blur: rgba(243,243,241,0.88);
}
[data-theme="dark"] {
  --bg: #141413;
  --surface: #1c1c1a;
  --surface-2: #222220;
  --surface-3: #2a2a28;
  --text: #e8e8e4;
  --muted: #888884;
  --faint: #555553;
  --border: #2e2e2b;
  --border-strong: #484845;
  --shadow: 0 20px 60px rgba(0,0,0,.25);
  --shadow-sm: 0 4px 16px rgba(0,0,0,.2);
  --shadow-hover: 0 28px 72px rgba(0,0,0,.4);
  --nav-blur: rgba(20,20,19,0.88);
}

/* ── RESET ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
img { display: block; max-width: 100%; }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }

body {
  font-family: 'TWK Lausanne', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background .25s ease, color .25s ease;
}

/* Site-wide: isotope notation (¹⁸F) and registered-trademark marks
   (NeuraCeq®) render as <sup>. line-height: 0 keeps the raised glyph
   from expanding its own line box — without it, a line containing a
   <sup> can render taller than sibling lines with no <sup>, which is
   visible wherever such lines sit side by side in a flex or grid layout
   (e.g. the imaging viewer's details drawer). */
sup {
  vertical-align: super;
  font-size: 0.7em;
  line-height: 0;
}

/* ── NAV ────────────────────────────────────────────────────────────────── */
nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--nav-blur);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
  padding: 0 32px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-brand {
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.nav-logo {
  height: 26px;
  width: auto;
}
/* swap logo based on theme */
.nav-logo-light { display: block; }
.nav-logo-dark  { display: none;  }
[data-theme="dark"] .nav-logo-light { display: none; }
[data-theme="dark"] .nav-logo-dark  { display: block; }
.nav-brand-text { font-size: 1.08rem; font-weight: 600; color: var(--text); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 16px;
}
.nav-zro-logo {
  height: 22px;
  width: auto;
}
.nav-zro-light { display: block; }
.nav-zro-dark  { display: none; }
[data-theme="dark"] .nav-zro-light { display: none; }
[data-theme="dark"] .nav-zro-dark  { display: block; }

.theme-toggle {
  width: 52px;
  height: 32px;
  border: none;
  border-radius: 999px;
  background: #d1d1d6;
  position: relative;
  padding: 2px;
  transition: .25s;
}
.theme-toggle::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 28px;
  height: 28px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.25);
  transition: .25s;
}
[data-theme="dark"] .theme-toggle { background: #34c759; }
[data-theme="dark"] .theme-toggle::after { transform: translateX(20px); }
.theme-toggle:hover { filter: brightness(.98); }

/* ── TEXT SIZE CONTROL (science article pages only) ────────────────────── */
.sci-text-size-control {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 1px;
}
.sci-text-size-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 27px;
  height: 27px;
  border-radius: var(--radius-pill);
  border: none;
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
  transition: color .15s, background .15s;
}
.sci-text-size-btn:hover { color: var(--text); background: var(--surface); }
.sci-text-size-btn[data-text-action="decrease"] { font-size: .66rem; }
.sci-text-size-btn[data-text-action="reset"] { font-size: .78rem; }
.sci-text-size-btn[data-text-action="increase"] { font-size: .96rem; }

/* ── BRAND HEADER ───────────────────────────────────────────────────────── */
.brand-oasis {
  font-weight: 600;
}
.brand-sub {
  font-weight: 300;
  color: var(--muted);
}

/* ── HERO ───────────────────────────────────────────────────────────────── */
.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 32px 48px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.hero-eyebrow {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-logo-wrap {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
}
.hero-oasis-logo {
  height: clamp(52px, 9vw, 96px);
  width: auto;
}
.hero-oasis-light { display: block; }
.hero-oasis-dark  { display: none; }
[data-theme="dark"] .hero-oasis-light { display: none; }
[data-theme="dark"] .hero-oasis-dark  { display: block; }

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: .78rem;
  color: var(--muted);
  white-space: nowrap;
  align-self: flex-start;
  margin-bottom: 6px;
}
.hero-badge .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fa96a;
  box-shadow: 0 0 0 2px rgba(63,169,106,.25);
  animation: dotpulse 2.4s ease infinite;
}
@keyframes dotpulse {
  0%, 100% { box-shadow: 0 0 0 2px rgba(63,169,106,.25); }
  50%       { box-shadow: 0 0 0 5px rgba(63,169,106,.1); }
}
.hero p {
  max-width: 56ch;
  color: var(--muted);
  font-size: 1.08rem;
  margin-top: 4px;
}

.hero-art {
  position: absolute;
  left: 32px;
  top: 42px;
  width: 58%;
  height: 230px;
  pointer-events: none;
  opacity: 1;
  z-index: 0;
}
.hero-logo-wrap,
.hero p {
  position: relative;
  z-index: 1;
}

/* ── SECTION LABELS ─────────────────────────────────────────────────────── */
.section-divider {
  max-width: 1200px;
  margin: 8px auto 0;
  padding: 0 32px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
}
.section-divider span {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  white-space: nowrap;
  font-weight: 600;
}
.section-divider hr {
  flex: 1;
  border: none;
  border-top: 1px solid var(--border);
}

/* ── GRID ───────────────────────────────────────────────────────────────── */
.grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px 24px;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

/* ── CARD ───────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  cursor: pointer;
  text-decoration: none;
  color: #111111;
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.card canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  border-radius: inherit;
  opacity: .9;
}
.card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 9px;
  flex: 1;
}
.card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  flex-shrink: 0;
  color: var(--accent-col, var(--muted));
  transition: background .25s, border-color .25s;
}
.card-icon svg { width: 18px; height: 18px; }
.card-eyebrow {
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
}
.card h2 {
  font-size: 1.45rem;
  letter-spacing: -.04em;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text);
}
.card p {
  font-size: 1.08rem;
  color: var(--muted);
  line-height: 1.6;
  max-width: 44ch;
}
.card-arrow {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .86rem;
  color: var(--faint);
  letter-spacing: .06em;
  text-transform: uppercase;
}
.card-arrow svg { transition: transform .2s ease; flex-shrink: 0; }
.card:hover .card-arrow svg { transform: translateX(3px); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface-2);
}
.tags { display: flex; gap: 6px; flex-wrap: wrap; }

/* ── ACCENT COLOUR SETS ─────────────────────────────────────────────────── */
.card.a-blue   { --accent-col: #1d6feb; --accent-rgb: 29,111,235; }
.card.a-green  { --accent-col: #1a8a50; --accent-rgb: 26,138,80; }
.card.a-violet { --accent-col: #7c3aed; --accent-rgb: 124,58,237; }
.card.a-amber  { --accent-col: #b45309; --accent-rgb: 180,83,9; }
.card.a-teal   { --accent-col: #0d7070; --accent-rgb: 13,112,112; }
.card.a-rose   { --accent-col: #b02845; --accent-rgb: 176,40,69; }
.card.a-slate  { --accent-col: #374151; --accent-rgb: 55,65,81; }
[data-theme="dark"] .card.a-blue   { --accent-col: #5ca3ff; --accent-rgb: 92,163,255; }
[data-theme="dark"] .card.a-green  { --accent-col: #4cbb7f; --accent-rgb: 76,187,127; }
[data-theme="dark"] .card.a-violet { --accent-col: #a78bfa; --accent-rgb: 167,139,250; }
[data-theme="dark"] .card.a-amber  { --accent-col: #f59e0b; --accent-rgb: 245,158,11; }
[data-theme="dark"] .card.a-teal   { --accent-col: #2dd4bf; --accent-rgb: 45,212,191; }
[data-theme="dark"] .card.a-rose   { --accent-col: #fb7185; --accent-rgb: 251,113,133; }
[data-theme="dark"] .card.a-slate  { --accent-col: #9ca3af; --accent-rgb: 156,163,175; }

.card-icon.col {
  background: rgba(var(--accent-rgb), .08);
  border-color: rgba(var(--accent-rgb), .18);
  color: var(--accent-col);
}

/* ── GRID SPANS ─────────────────────────────────────────────────────────── */
.s-8  { grid-column: span 8; }
.s-7  { grid-column: span 7; }
.s-6  { grid-column: span 6; }
.s-5  { grid-column: span 5; }
.s-4  { grid-column: span 4; }
.s-3  { grid-column: span 3; }

/* ── FOOTER ─────────────────────────────────────────────────────────────── */
footer {
  margin-top: 32px;
  border-top: 1px solid var(--border);
}
.footer-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 22px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--faint);
  font-size: .8rem;
}
.footer-inner a {
  color: inherit;
  text-decoration: none;
}
.footer-inner span,
.footer-inner a {
  margin: 0;
  line-height: 1.2;
}

/* ── DARK MODE TEXT OVERRIDES ───────────────────────────────────────────── */
[data-theme="dark"] .card h2,
[data-theme="dark"] .card,
[data-theme="dark"] .hero p,
[data-theme="dark"] .nav-brand-text {
  color: var(--text) !important;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 960px) {
  .s-8, .s-7, .s-5, .s-4, .s-3 { grid-column: span 6; }
  .s-6 { grid-column: span 6; }
}
@media (max-width: 680px) {
  .s-8, .s-7, .s-6, .s-5, .s-4, .s-3 { grid-column: span 12; }
  .hero { padding: 96px 20px 32px; }
  .grid, .section-divider { padding-left: 20px; padding-right: 20px; }
  nav { padding: 0 20px; }

  /* Hero art: contained backdrop band, not an overlapping absolute block */
  .hero-art {
    left: 0;
    top: 0;
    width: 100%;
    height: 130px;
    opacity: .5;
  }
  .hero-logo-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }
  .hero-logo-wrap > div:last-child {
    align-items: flex-start !important;
    width: 100%;
  }
  .hero-oasis-logo { height: 44px; }
  .hero p { max-width: 100%; }

  /* Footer: stack and centre cleanly, avoid overflow */
  footer {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 18px 20px;
  }
  .footer-inner {
    flex-direction: column;
    gap: 8px;
    text-align: center;
    padding: 18px 20px;
  }
  .footer-inner span {
    max-width: 100%;
    line-height: 1.5;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   VPN / SECURE NETWORK ONBOARDING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PAGE SHELL ─────────────────────────────────────────────────────────── */
.page-shell {
  width: 100%;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── PAGE HERO ──────────────────────────────────────────────────────────── */
.page-hero {
  margin-bottom: 48px;
}
.page-hero small {
  display: block;
  font-size: 11px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.page-hero h1 {
  font-size: clamp(2.4rem, 5vw, 4.6rem);
  line-height: .92;
  letter-spacing: -.06em;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 20px;
}
.page-hero p {
  color: var(--muted);
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  max-width: 58ch;
  line-height: 1.6;
}

/* ── OS SWITCHER ────────────────────────────────────────────────────────── */
.os-switcher {
  display: flex;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 4px;
  margin-bottom: 36px;
  width: fit-content;
}
.os-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px;
  border-radius: var(--radius-pill);
  font-size: .9rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid transparent;
  transition: all .2s cubic-bezier(.16,1,.3,1);
  white-space: nowrap;
  background: none;
  cursor: pointer;
}
.os-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.os-btn:not(.active):hover { color: var(--text); }

/* ── SECTION STEP LABEL ─────────────────────────────────────────────────── */
.step-section-label {
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 16px;
}
.step-section-label + .phase { margin-top: 0; }

/* ── PHASE ACCORDION CARD ───────────────────────────────────────────────── */
.phase {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
  margin-bottom: 16px;
}
.phase-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  gap: 16px;
  user-select: none;
  /* Reset button element styles */
  width: 100%;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  text-align: left;
}
.phase-title-row { display: flex; align-items: center; gap: 14px; }
.phase-icon {
  width: 40px;
  height: 40px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.phase h2 {
  font-size: clamp(1.05rem, 1.25vw, 1.28rem);
  font-weight: 600;
  letter-spacing: -.025em;
  color: var(--text);
}
.phase-meta {
  font-size: clamp(.86rem, .95vw, .95rem);
  color: var(--muted);
  margin-top: 3px;
}
.phase-meta code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .9em;
}
.phase-chevron {
  color: var(--faint);
  transition: transform .25s cubic-bezier(.16,1,.3,1);
  flex-shrink: 0;
  pointer-events: none;
}
.phase.open .phase-chevron { transform: rotate(180deg); }

.phase-body {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transition: max-height .4s cubic-bezier(.16,1,.3,1), opacity .3s ease;
}
.phase.open .phase-body {
  max-height: 3600px;
  opacity: 1;
  pointer-events: auto;
}
.phase-divider {
  height: 1px;
  background: var(--border);
  margin: 22px 0;
}

/* ── OS PANELS ──────────────────────────────────────────────────────────── */
.os-panel { display: none; }
.os-panel.active { display: block; }
@keyframes panelIn {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.os-panel.active { animation: panelIn .3s cubic-bezier(.16,1,.3,1) both; }

/* ── DISTRO SUB-LABEL ───────────────────────────────────────────────────── */
.distro-label {
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 14px;
}

/* ── STEPS ──────────────────────────────────────────────────────────────── */
.steps { display: flex; flex-direction: column; gap: 20px; }
.step { display: flex; gap: 16px; align-items: flex-start; }
.step-num {
  width: 28px;
  height: 28px;
  background: var(--text);
  color: var(--bg);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .76rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}
[data-theme="dark"] .step-num {
  background: var(--text);
  color: var(--bg);
}
.step-content { flex: 1; min-width: 0; }
.step-content h3 {
  font-size: clamp(1rem, 1.1vw, 1.1rem);
  font-weight: 600;
  letter-spacing: -.02em;
  margin-bottom: 5px;
  color: var(--text);
}
.step-content p {
  font-size: clamp(.94rem, 1vw, 1rem);
  color: var(--muted);
  line-height: 1.6;
}
.step-content p + p { margin-top: 6px; }

/* ── CODE BLOCK ─────────────────────────────────────────────────────────── */
.code-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 10px;
  position: relative;
  overflow-x: auto;
}
.code-block code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
  color: var(--text);
  line-height: 1.6;
  white-space: pre;
  display: block;
}
.copy-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: .75rem;
  color: var(--muted);
  transition: all .15s ease;
  opacity: 0;
  cursor: pointer;
}
.code-block:hover .copy-btn { opacity: 1; }
.copy-btn:hover { color: var(--text); border-color: var(--border-strong); }
.copy-btn.copied { color: #2d7a3a; border-color: #2d7a3a; }
[data-theme="dark"] .copy-btn.copied { color: #4caf63; border-color: #4caf63; }

/* Inline code (outside code blocks) */
.step-content code,
.phase-meta code,
.note code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .87em;
  background: var(--surface-3);
  border-radius: 4px;
  padding: 1px 5px;
}

/* ── NOTE / CALLOUT ─────────────────────────────────────────────────────── */
.note {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .87rem;
  color: var(--muted);
  margin-top: 12px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  line-height: 1.55;
}
.note svg { flex-shrink: 0; margin-top: 1px; }

/* ── INFO GRID ──────────────────────────────────────────────────────────── */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 12px;
  margin-top: 12px;
}
.info-card {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.info-card .label {
  font-size: .75rem;
  color: var(--faint);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 4px;
}
.info-card .val {
  font-size: .93rem;
  font-weight: 600;
  color: var(--text);
}
.info-card .val.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .83rem;
}

/* ── KBD ────────────────────────────────────────────────────────────────── */
kbd {
  background: var(--surface-3);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: .82em;
  font-family: inherit;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .page-hero h1 { letter-spacing: -.05em; }
}
@media (max-width: 680px) {
  .page-shell { padding: 24px 16px 64px; }
  .os-switcher { flex-wrap: wrap; width: 100%; }
  .os-btn { flex: 1 1 auto; justify-content: center; padding: 8px 12px; font-size: .88rem; }
  .phase { padding: 20px; }
  .step { gap: 12px; }
  .step-num { width: 26px; height: 26px; font-size: .72rem; }
  .info-grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1200px) {
  .phase { padding: 32px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   FILE NAMING ASSISTANT PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── APP LAYOUT ─────────────────────────────────────────────────────────── */
.fn-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
  display: grid;
  gap: 24px;
}

/* ── LOGIN SCREEN ───────────────────────────────────────────────────────── */
.fn-login-wrap {
  min-height: calc(100vh - 61px);
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.fn-login-card {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
}
.fn-login-card .page-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.fn-login-card h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: .96;
  letter-spacing: -.06em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.fn-login-form {
  margin-top: 24px;
}
.fn-login-form form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fn-login-form .fn-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fn-login-form label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.fn-error {
  color: #8a1f1f;
  font-size: .92rem;
  margin-top: 10px;
}
[data-theme="dark"] .fn-error { color: #f87171; }
.fn-login-meta {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.55;
}

/* ── SHARED FORM CONTROLS ───────────────────────────────────────────────── */
.fn-control {
  width: 100%;
  min-height: 52px;
  height: 52px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 15px;
  border-radius: var(--radius-sm);
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  transition: border-color .16s ease, box-shadow .16s ease;
  appearance: none;
  -webkit-appearance: none;
  line-height: 1.2;
}
.fn-control:focus {
  border-color: var(--border-strong);
  box-shadow: 0 0 0 4px rgba(17,17,17,.05);
}
[data-theme="dark"] .fn-control:focus {
  box-shadow: 0 0 0 4px rgba(255,255,255,.06);
}
select.fn-control {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 20px) calc(50% - 3px),
    calc(100% - 14px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
  padding-right: 40px;
}
input[type="date"].fn-control {
  appearance: auto;
  -webkit-appearance: auto;
  padding-right: 12px;
}

/* ── BUTTONS ────────────────────────────────────────────────────────────── */
.fn-btn {
  min-height: 52px;
  border: 1px solid var(--text);
  background: var(--text);
  color: var(--bg);
  padding: 0 22px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: .95rem;
  font-weight: 500;
  transition: opacity .15s ease;
}
.fn-btn:hover { opacity: .88; }
.fn-btn.secondary {
  background: var(--surface);
  color: var(--text);
  border-color: var(--border-strong);
}
.fn-btn.secondary:hover { border-color: var(--text); }

/* ── SECTION CARD ───────────────────────────────────────────────────────── */
.fn-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 28px;
}
.fn-card-head {
  margin-bottom: 22px;
}
.fn-card-head h2 {
  font-size: 1.25rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 4px;
}
.fn-card-head p {
  color: var(--muted);
  font-size: .95rem;
}

/* ── FORM GRID ──────────────────────────────────────────────────────────── */
.fn-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.fn-field {
  display: grid;
  gap: 7px;
  align-content: start;
}
.fn-field.full { grid-column: 1 / -1; }
.fn-field label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.fn-hint {
  font-size: 11.5px;
  color: var(--faint);
  min-height: 16px;
}

/* ── ACTION ROW ─────────────────────────────────────────────────────────── */
.fn-action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

/* ── OUTPUT PANEL ───────────────────────────────────────────────────────── */
.fn-output {
  margin-top: 24px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
}
.fn-output-label {
  font-size: 11px;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--faint);
  font-weight: 600;
  margin-bottom: 10px;
}
.fn-filename {
  font-size: clamp(1rem, 1.8vw, 1.35rem);
  font-weight: 600;
  letter-spacing: -.03em;
  word-break: break-all;
  margin-bottom: 8px;
  color: var(--text);
}
.fn-pattern {
  font-size: .82rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-bottom: 14px;
}
.fn-validation {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--muted);
  font-size: .88rem;
  min-height: 48px;
  white-space: pre-line;
  line-height: 1.6;
}
.fn-validation.pass { color: #2d7a3a; }
[data-theme="dark"] .fn-validation.pass { color: #4caf63; }

/* ── LOGOUT LINK ────────────────────────────────────────────────────────── */
.fn-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  transition: color .15s, border-color .15s;
}
.fn-logout:hover { color: var(--text); border-color: var(--text); }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 840px) {
  .fn-form-grid { grid-template-columns: 1fr; }
  .fn-field.full { grid-column: 1; }
}
@media (max-width: 680px) {
  .fn-app { padding: 20px 16px 64px; }
  .fn-card { padding: 20px; }
  .fn-login-card { padding: 24px; }
  .fn-action-row { display: grid; grid-template-columns: 1fr; }
  .fn-btn { width: 100%; }
}

/* ── UTILITY ────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* ═══════════════════════════════════════════════════════════════════════════
   FILE SHARING / DROPBOX BROWSER PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── LOGIN ──────────────────────────────────────────────────────────────── */
.fs-login-wrap {
  min-height: calc(100vh - 61px);
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.fs-login-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px;
}
.fs-login-card .page-eyebrow {
  display: block;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.fs-login-card h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: .96;
  letter-spacing: -.06em;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}
.fs-login-form {
  margin-top: 24px;
}
.fs-login-form form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.fs-login-form .fs-field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.fs-login-form label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: var(--text);
}
.fs-error {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: .88rem;
  color: #8a1f1f;
  margin-top: 16px;
}
[data-theme="dark"] .fs-error { color: #f87171; }
.fs-login-meta {
  margin-top: 18px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--muted);
  font-size: .87rem;
  line-height: 1.55;
}

/* ── BROWSER SHELL ──────────────────────────────────────────────────────── */
.fs-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── BREADCRUMB ─────────────────────────────────────────────────────────── */
.fs-breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .86rem;
  color: var(--muted);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.fs-breadcrumb a {
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}
.fs-breadcrumb a:hover { text-decoration: underline; }
.fs-breadcrumb svg { color: var(--faint); flex-shrink: 0; }

/* ── FILE / FOLDER GRID ─────────────────────────────────────────────────── */
.fs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(240px, 26vw, 320px), 1fr));
  gap: 14px;
}

/* ── ITEM CARD ──────────────────────────────────────────────────────────── */
.fs-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .25s ease, border-color .25s ease, transform .25s ease;
}
.fs-item:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.fs-item-top {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}
.fs-item-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.fs-item-icon svg { width: 18px; height: 18px; }
.fs-item-name {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.3;
  color: var(--text);
  word-break: break-word;
}
.fs-item-meta {
  font-size: .78rem;
  color: var(--faint);
  margin-top: 3px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}
.fs-item-action {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: .03em;
}
.fs-item.is-file .fs-item-action { color: var(--text); }
.fs-item-action svg { transition: transform .2s ease; flex-shrink: 0; }
.fs-item:hover .fs-item-action svg { transform: translateX(3px); }

/* ── EMPTY STATE ────────────────────────────────────────────────────────── */
.fs-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

/* ── SYNC BADGE ─────────────────────────────────────────────────────────── */
.fs-sync-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: .75rem;
  color: var(--muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  font-weight: 600;
}
.fs-sync-badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #3fa96a;
  box-shadow: 0 0 0 2px rgba(63,169,106,.25);
  animation: dotpulse 2.4s ease infinite;
}

/* ── LOGOUT ─────────────────────────────────────────────────────────────── */
.fs-logout {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  color: var(--muted);
  text-decoration: none;
  font-size: .86rem;
  transition: color .15s, border-color .15s;
}
.fs-logout:hover { color: var(--text); border-color: var(--text); }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .fs-app { padding: 20px 16px 64px; }
  .fs-login-card { padding: 24px; }
  .fs-grid { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   LANDING PAGE — PLATFORM UNDER DEVELOPMENT STAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.dev-stage-wrap {
  position: relative;
  max-width: 1200px;
  margin: 32px auto 56px;
  padding: 0 32px;
}
#dev-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: var(--radius-lg);
  pointer-events: none;
  z-index: 0;
}
.dev-stage-content {
  position: relative;
  z-index: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: clamp(36px, 5vw, 64px) clamp(28px, 5vw, 56px);
  min-height: 400px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  overflow: hidden;
}
.dev-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .74rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 5px 13px;
  width: fit-content;
}
.dev-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f5a623;
  box-shadow: 0 0 0 3px rgba(245,166,35,.18);
  animation: pulse-dev 2.2s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes pulse-dev {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245,166,35,.18); }
  50%       { box-shadow: 0 0 0 8px rgba(245,166,35,.05); }
}
.dev-heading {
  font-size: clamp(2rem, 4vw, 3.4rem);
  letter-spacing: -.05em;
  line-height: 1.02;
  color: var(--text);
  max-width: 18ch;
  font-weight: 600;
}
.dev-sub {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
  max-width: 60ch;
}
.dev-modules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.dev-mod-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface-2);
  font-size: .78rem;
  color: var(--muted);
  opacity: 0;
  transform: translateY(6px);
  transition: opacity .4s ease, transform .4s ease;
}
.dev-mod-chip.visible {
  opacity: 1;
  transform: translateY(0);
}
.dev-mod-chip::before {
  content: '';
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-strong);
  flex-shrink: 0;
}
@media (max-width: 680px) {
  .dev-stage-wrap { padding: 0 20px; }
  .dev-stage-content { padding: 28px 24px; min-height: 320px; }
}

/* ── VIEW TOGGLE ────────────────────────────────────────────────────────── */
.fs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  gap: 12px;
  flex-wrap: wrap;
}
.fs-view-toggle {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}
.fs-view-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 28px;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  background: none;
  color: var(--faint);
  cursor: pointer;
  transition: all .18s ease;
}
.fs-view-btn:hover { color: var(--text); }
.fs-view-btn.active {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text);
  box-shadow: var(--shadow-sm);
}
.fs-view-btn svg { width: 15px; height: 15px; flex-shrink: 0; }

.fs-item-count {
  font-size: .8rem;
  color: var(--faint);
}

/* ── LIST VIEW ──────────────────────────────────────────────────────────── */
.fs-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.fs-grid.view-list .fs-item {
  flex-direction: row;
  align-items: center;
  padding: 14px 20px;
  gap: 0;
  border-radius: 0;
  border: none;
  border-bottom: 1px solid var(--border);
  box-shadow: none;
  transform: none !important;
}
.fs-grid.view-list .fs-item:last-child {
  border-bottom: none;
}
.fs-grid.view-list .fs-item:hover {
  background: var(--surface-2);
  box-shadow: none;
  border-color: var(--border);
  transform: none;
}
.fs-grid.view-list .fs-item-top {
  flex: 1;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.fs-grid.view-list .fs-item-icon {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
}
.fs-grid.view-list .fs-item-icon svg {
  width: 15px;
  height: 15px;
}
.fs-grid.view-list .fs-item-name {
  font-size: .93rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fs-grid.view-list .fs-item-meta {
  display: none;
}
.fs-grid.view-list .fs-item-meta-inline {
  display: block;
  font-size: .75rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: nowrap;
  margin-left: auto;
  padding: 0 20px;
  flex-shrink: 0;
}
.fs-grid.view-list .fs-item-action {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
  flex-shrink: 0;
  gap: 6px;
  min-width: 110px;
  justify-content: flex-end;
}
.fs-grid.view-list .fs-item-action span {
  display: none;
}
.fs-grid.view-list .fs-item-action svg {
  display: block;
}

/* hide inline meta in grid view */
.fs-grid.view-grid .fs-item-meta-inline { display: none; }

@media (max-width: 680px) {
  .fs-grid.view-list .fs-item-meta-inline { display: none; }
  .fs-grid.view-list .fs-item { padding: 12px 16px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   NETWORK MAP PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── PAGE SHELL ─────────────────────────────────────────────────────────── */
.nw-app {
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── FILTER BAR ─────────────────────────────────────────────────────────── */
.nw-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  align-items: center;
}
.nw-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 180px;
  min-width: 160px;
}
.nw-filter-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.nw-select {
  height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  padding: 0 36px 0 13px;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  appearance: none;
  -webkit-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 16px) calc(50% - 2px),
    calc(100% - 10px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  outline: none;
  transition: border-color .15s;
  cursor: pointer;
}
.nw-select:focus { border-color: var(--border-strong); }
.nw-reset-btn {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .86rem;
  cursor: pointer;
  align-self: flex-end;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.nw-reset-btn:hover { color: var(--text); border-color: var(--text); }

/* ── RESULTS COUNT ──────────────────────────────────────────────────────── */
.nw-results-count {
  font-size: .8rem;
  color: var(--faint);
  margin-bottom: 12px;
}

/* ── MAP CONTAINER ──────────────────────────────────────────────────────── */
.nw-map-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
#nw-map {
  height: clamp(520px, 70vh, 780px);
  width: 100%;
  z-index: 1;
}

/* ── LEAFLET OVERRIDES ──────────────────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--surface) !important;
  border: 1px solid var(--border) !important;
  border-radius: var(--radius-md) !important;
  box-shadow: var(--shadow-hover) !important;
  padding: 0 !important;
  min-width: 260px;
  max-width: 320px;
}
.leaflet-popup-content {
  margin: 0 !important;
  width: auto !important;
}
.leaflet-popup-tip-container { display: none; }
.leaflet-popup-close-button {
  color: var(--muted) !important;
  font-size: 18px !important;
  top: 10px !important;
  right: 12px !important;
}
.leaflet-popup-close-button:hover { color: var(--text) !important; }
.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}
.leaflet-control-zoom a:hover { background: var(--surface-2) !important; }
.leaflet-control-attribution {
  background: var(--nav-blur) !important;
  color: var(--faint) !important;
  font-size: 10px !important;
}
.leaflet-control-attribution a { color: var(--muted) !important; }
/* Map tile theming — overlay approach so pins are not affected */
#nw-map { position: relative; }
.leaflet-tile-pane { transition: filter .3s ease; }
.leaflet-tile-pane { filter: saturate(.12) brightness(1.04) contrast(.96); }
#nw-map.nw-map-dark .leaflet-tile-pane { filter: invert(1) saturate(0) brightness(.85) contrast(1.1); }

/* ── CUSTOM PIN — dot style ──────────────────────────────────────────────── */
.nw-pin {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.7);
  box-shadow: 0 1px 5px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease;
}
.nw-pin:hover {
  transform: scale(1.35);
  box-shadow: 0 2px 10px rgba(0,0,0,.22);
}
.nw-pin.status-active     { background: #7bbf9e; }
.nw-pin.status-recruiting { background: #89aed4; }
.nw-pin.status-pipeline   { background: #d4aa7d; }

/* ── POPUP CONTENT ──────────────────────────────────────────────────────── */
.nw-popup {
  padding: 18px 20px 16px;
  font-family: 'TWK Lausanne', 'Inter', -apple-system, sans-serif;
}
.nw-popup-header {
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.nw-popup-name {
  font-size: .97rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.3;
  margin-bottom: 6px;
}
.nw-popup-city {
  font-size: .75rem;
  color: var(--muted);
  margin-bottom: 6px;
}
.nw-popup-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.nw-popup-tag {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.nw-popup-tag.tag-active     { color: #3a7a5a; border-color: rgba(123,191,158,.4); background: rgba(123,191,158,.12); }
.nw-popup-tag.tag-recruiting { color: #3a6090; border-color: rgba(137,174,212,.4); background: rgba(137,174,212,.12); }
.nw-popup-tag.tag-pipeline   { color: #8a6030; border-color: rgba(212,170,125,.4); background: rgba(212,170,125,.12); }

.nw-popup-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.nw-popup-meta-item .lbl {
  font-size: .67rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  margin-bottom: 1px;
}
.nw-popup-meta-item .val {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}

.nw-popup-diseases {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.nw-popup-disease-row {
  display: grid;
  grid-template-columns: 72px 1fr 48px;
  align-items: center;
  gap: 8px;
  font-size: .78rem;
}
.nw-popup-disease-row .dname {
  color: var(--muted);
  font-weight: 500;
}
.nw-popup-disease-bar {
  height: 4px;
  background: var(--surface-3);
  border-radius: 2px;
  overflow: hidden;
}
.nw-popup-disease-bar-fill {
  height: 100%;
  border-radius: 2px;
  background: var(--text);
  opacity: .35;
}
.nw-popup-disease-row .dtotal {
  color: var(--text);
  font-weight: 600;
  text-align: right;
}

/* ── SITE LIST PANEL ────────────────────────────────────────────────────── */
.nw-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 16px;
  align-items: start;
}
.nw-site-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  max-height: clamp(520px, 70vh, 780px);
  display: flex;
  flex-direction: column;
}
.nw-site-list-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  flex-shrink: 0;
}
.nw-site-list-body {
  overflow-y: auto;
  flex: 1;
}
.nw-site-list-body::-webkit-scrollbar { width: 4px; }
.nw-site-list-body::-webkit-scrollbar-track { background: transparent; }
.nw-site-list-body::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }
.nw-site-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.nw-site-item:last-child { border-bottom: none; }
.nw-site-item:hover { background: var(--surface-2); }
.nw-site-item.active { background: var(--surface-2); }
.nw-site-item-name {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}
.nw-site-item-city {
  font-size: .72rem;
  color: var(--faint);
  margin-top: 2px;
}
.nw-site-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 4px;
}
.nw-site-status-dot.status-active     { background: #7bbf9e; }
.nw-site-status-dot.status-recruiting { background: #89aed4; }
.nw-site-status-dot.status-pipeline   { background: #d4aa7d; }

/* ── LEGEND ─────────────────────────────────────────────────────────────── */
.nw-legend {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 14px;
}
.nw-legend-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: .78rem;
  color: var(--muted);
}
.nw-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .nw-layout { grid-template-columns: 1fr; }
  .nw-site-list { max-height: 260px; }
}
@media (max-width: 680px) {
  .nw-app { padding: 20px 16px 64px; }
  .nw-filter-group { flex: 1 1 140px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDY TRACKER PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── APP SHELL ──────────────────────────────────────────────────────────── */
.st-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── REPORT META BAR ────────────────────────────────────────────────────── */
.st-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.st-meta-item { font-size: .82rem; color: var(--muted); }
.st-meta-item strong { color: var(--text); font-weight: 600; }
.st-confidential {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #8a6030;
  background: rgba(212,170,125,.12);
  border: 1px solid rgba(212,170,125,.3);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}

/* ── ACTIONS ROW ────────────────────────────────────────────────────────── */
.st-actions {
  display: flex;
  gap: 10px;
  margin: 20px 0 4px;
  flex-wrap: wrap;
}
.st-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .84rem;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.st-action-btn:hover { background: var(--surface-2); }
.st-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }

/* Inverted variant — solid fill rather than outline, for the one action
   on this page that leaves it (Explore Scans), so it reads as a distinct
   destination rather than another report control. Built from --text/--bg
   rather than fixed black/white so it still inverts correctly in dark
   mode: dark text-on-light becomes light text-on-dark automatically. */
.st-action-btn--invert {
  background: var(--text);
  border-color: var(--text);
  color: var(--bg);
  margin-left: auto;
}
.st-action-btn--invert:hover { opacity: .85; }
.st-print-closing { display: none; }
.st-show-print { display: none; }

/* ── TIMEPOINT TABS (Baseline / 6-month / 12-month) ────────────────────────
   Same pill-tab language as .qms-status-tab, so the two "pick a view of
   the same data" controls on the site read as one pattern rather than two. */
.st-timepoint-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.st-timepoint-tab {
  display: inline-flex;
  align-items: center;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: .84rem;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.st-timepoint-tab:hover { border-color: var(--border-strong); color: var(--text); }
.st-timepoint-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* ── TIMEPOINT PLACEHOLDER (e.g. 12-month before the study reaches it) ───── */
.st-timepoint-placeholder { margin-top: 0; }

/* ── COHORT FILTER (Baseline PET reads, 6-month subject follow-up) ────────
   Same pill language as the timepoint tabs, one size down, since this is
   a filter within a section rather than a switch between whole tabs. */
.st-cohort-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 14px 0 12px;
}
.st-cohort-tab {
  display: inline-flex;
  align-items: center;
  height: 32px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: all .15s;
}
.st-cohort-tab:hover { border-color: var(--border-strong); color: var(--text); }
.st-cohort-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}

/* Small on-screen-only note marking an auto-generated paragraph, so
   whoever reviews the report before sending can see at a glance which
   sections came from narrative.md and which were plugged in from the
   CSVs. .st-hide-print already exists site-wide and keeps it out of the
   printed/exported report. */
.st-auto-note {
  font-size: .74rem;
  color: var(--faint);
  font-style: italic;
  margin-top: 4px;
}

/* ── SUBJECT FOLLOW-UP TABLE (6-month tab) ─────────────────────────────────
   Reuses .st-read-table's look; "Not acquired" needs to read clearly as a
   genuine absence rather than a dash that could be mistaken for zero. */
.st-not-acquired {
  color: var(--faint);
  font-style: italic;
  font-size: .82rem;
}
.st-subject-table td { text-align: center; }
.st-subject-table td.subject-id { text-align: left; }

/* ── SECTION ────────────────────────────────────────────────────────────── */
.st-section {
  margin-top: 44px;
}
.st-section-num {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--faint);
  margin-bottom: 6px;
}
.st-section h2 {
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--text);
  margin-bottom: 14px;
}
.st-section > p {
  color: var(--muted);
  font-size: .95rem;
  line-height: 1.7;
  max-width: 72ch;
  margin-bottom: 22px;
}

/* ── OVERVIEW STAT CARDS ────────────────────────────────────────────────── */
.st-overview-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.st-stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 20px 18px;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .5s cubic-bezier(.16,1,.3,1), transform .5s cubic-bezier(.16,1,.3,1);
}
.st-stat-card.visible { opacity: 1; transform: translateY(0); }
.st-stat-value {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text);
  line-height: 1;
  margin-bottom: 8px;
  font-variant-numeric: tabular-nums;
}
.st-stat-label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.st-stat-sublabel {
  font-size: .74rem;
  color: var(--faint);
}

/* ── COHORT PROGRESS TABLE ──────────────────────────────────────────────── */
.st-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.st-table-wrap::-webkit-scrollbar { height: 6px; }
.st-table-wrap::-webkit-scrollbar-track { background: transparent; }
.st-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.st-table {
  width: 100%;
  min-width: 640px;
  border-collapse: collapse;
}
.st-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.st-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .88rem;
  color: var(--text);
  vertical-align: middle;
}
.st-table tr:last-child td { border-bottom: none; }
.st-table .cohort-name { font-weight: 600; }
.st-table .cohort-target { font-size: .74rem; color: var(--faint); font-weight: 400; display: block; margin-top: 1px; }
.st-table .num-cell { font-weight: 600; font-variant-numeric: tabular-nums; text-align: center; width: 56px; }
.st-table .na-cell, .st-read-table .na-cell { color: var(--faint); text-align: center; font-size: .82rem; }

/* ── PROGRESS BAR ───────────────────────────────────────────────────────── */
.st-progress-cell { min-width: 140px; }
.st-progress-track {
  height: 8px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}
.st-progress-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--text);
  opacity: .55;
  width: 0%;
  transition: width 1s cubic-bezier(.16,1,.3,1);
}
.st-progress-fill.psp   { background: #89aed4; opacity: .85; }
.st-progress-fill.cbs   { background: #d4aa7d; opacity: .85; }
.st-progress-fill.bvftd { background: #c99bd6; opacity: .85; }
.st-progress-fill.controls { background: #7bbf9e; opacity: .85; }

/* ── IMAGING ACTIVITY CARDS ─────────────────────────────────────────────── */
.st-imaging-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.st-imaging-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px;
}
.st-imaging-card-title {
  font-size: .82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 6px;
}
.st-imaging-card-total {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text);
  margin-bottom: 14px;
  font-variant-numeric: tabular-nums;
}
.st-imaging-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.st-imaging-tag {
  font-size: .76rem;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.st-imaging-tag strong { color: var(--text); }

/* ── BIOMARKER MINI BARS ────────────────────────────────────────────────── */
.st-biomarker-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.st-biomarker-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 22px 24px;
}
.st-biomarker-name {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
}
.st-biomarker-track {
  height: 7px;
  background: var(--surface-3);
  border-radius: 4px;
  overflow: hidden;
  margin-bottom: 12px;
}
.st-biomarker-fill {
  height: 100%;
  border-radius: 4px;
  background: var(--text);
  opacity: .5;
  width: 0%;
  transition: width 1s cubic-bezier(.16,1,.3,1);
}
.st-biomarker-stats {
  display: flex;
  justify-content: space-between;
  font-size: .8rem;
  color: var(--muted);
}
.st-biomarker-stats strong { color: var(--text); font-weight: 600; }

/* ── SCREEN FAILURE LIST ────────────────────────────────────────────────── */
.st-failure-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.st-failure-row {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.st-failure-cohort {
  font-size: .85rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  min-width: 110px;
}
.st-failure-reasons {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── TAU PET READ TABLE ─────────────────────────────────────────────────── */
.st-read-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: auto;
  max-height: 600px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.st-read-table-wrap::-webkit-scrollbar { width: 6px; height: 6px; }
.st-read-table-wrap::-webkit-scrollbar-track { background: transparent; }
.st-read-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.st-read-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}
.st-read-table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
  position: sticky;
  top: 0;
}
.st-read-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--text);
  vertical-align: top;
}
.st-read-table tr:last-child td { border-bottom: none; }
.st-read-table .notes-cell { color: var(--muted); line-height: 1.55; max-width: 420px; }
.st-read-table .subject-id { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .8rem; }

.st-tau-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.st-tau-badge.positive { color: #8a3a3a; background: rgba(212,140,140,.14); border: 1px solid rgba(212,140,140,.32); }
.st-tau-badge.negative { color: #3a7a5a; background: rgba(123,191,158,.14); border: 1px solid rgba(123,191,158,.32); }

/* ── FOOTNOTES ──────────────────────────────────────────────────────────── */
.st-footnotes {
  margin-top: 40px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}
.st-footnotes ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.st-footnotes li {
  font-size: .78rem;
  color: var(--faint);
  line-height: 1.6;
  padding-left: 14px;
  position: relative;
}
.st-footnotes li::before {
  content: '—';
  position: absolute;
  left: 0;
  color: var(--border-strong);
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .st-overview-grid { grid-template-columns: repeat(3, 1fr); }
  .st-imaging-grid, .st-biomarker-grid { grid-template-columns: 1fr; }
}
@media (max-width: 680px) {
  .st-app { padding: 20px 16px 64px; }
  .st-overview-grid { grid-template-columns: repeat(2, 1fr); }
  .st-meta-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .st-confidential { margin-left: 0; }
  .st-failure-row { flex-direction: column; gap: 4px; }
  .st-failure-cohort { min-width: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDIES LANDING PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.stl-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

.stl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 8px;
}

.stl-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.stl-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.stl-card.is-disabled {
  cursor: default;
  opacity: .6;
}
.stl-card.is-disabled:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
  transform: none;
}

.stl-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.stl-card-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--muted);
}
.stl-card-icon svg { width: 18px; height: 18px; }

.stl-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.stl-status.active     { color: #3a7a5a; background: rgba(123,191,158,.14); border: 1px solid rgba(123,191,158,.32); }
.stl-status.pipeline   { color: #8a6030; background: rgba(212,170,125,.14); border: 1px solid rgba(212,170,125,.32); }
.stl-status.closed     { color: var(--faint); background: var(--surface-2); border: 1px solid var(--border); }

.stl-card h2 {
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -.03em;
  color: var(--text);
  line-height: 1.2;
}
.stl-card-protocol {
  font-size: .78rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: -8px;
}
.stl-card p {
  font-size: .9rem;
  color: var(--muted);
  line-height: 1.55;
}

.stl-card-arrow {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .82rem;
  color: var(--faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.stl-card-arrow svg { transition: transform .2s ease; flex-shrink: 0; }
.stl-card:hover .stl-card-arrow svg { transform: translateX(3px); }

.stl-empty {
  grid-column: 1 / -1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 56px 32px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
}

@media (max-width: 680px) {
  .stl-app { padding: 20px 16px 64px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   QMS PAGES (EXTERNAL AND INTERNAL)
   ═══════════════════════════════════════════════════════════════════════════ */

.qms-app {
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── LANDER CARD GRID (external QMS index, internal QMS index) ───────────── */
.qms-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.qms-section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--faint);
  margin: 32px 0 12px;
}
.qms-section-label:first-of-type { margin-top: 8px; }

.qms-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.qms-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.qms-card-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
}
.qms-card-icon svg { width: 17px; height: 17px; }
.qms-card h2 {
  font-size: 1.12rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.qms-card p {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.5;
}
.qms-card-arrow {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: var(--faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.qms-card-arrow svg { transition: transform .2s ease; flex-shrink: 0; }
.qms-card:hover .qms-card-arrow svg { transform: translateX(3px); }
.qms-card.is-disabled {
  cursor: default;
  opacity: .6;
}
.qms-card.is-disabled:hover {
  box-shadow: var(--shadow);
  border-color: var(--border);
  transform: none;
}

/* ── ELEVATED ACCESS TRIGGER (sits beside theme toggle) ───────────────────── */
.qms-elevate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.qms-elevate-btn:hover { color: var(--text); border-color: var(--text); }
.qms-elevate-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.qms-elevate-btn.is-active {
  color: #3a7a5a;
  border-color: rgba(123,191,158,.5);
  background: rgba(123,191,158,.1);
}

/* ── ELEVATED ACCESS OVERLAY (in page, not a browser popup) ───────────────── */
.qms-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  backdrop-filter: blur(2px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.qms-overlay-backdrop.open { display: flex; }
.qms-overlay-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-hover);
  padding: 28px;
  animation: qmsOverlayIn .25s cubic-bezier(.16,1,.3,1);
}
@keyframes qmsOverlayIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
.qms-overlay-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 6px;
}
.qms-overlay-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
}
.qms-overlay-close {
  background: none;
  border: none;
  color: var(--faint);
  cursor: pointer;
  padding: 2px;
  line-height: 1;
}
.qms-overlay-close:hover { color: var(--text); }
.qms-overlay-sub {
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 20px;
  line-height: 1.5;
}
.qms-overlay-form { display: flex; flex-direction: column; gap: 16px; }
.qms-overlay-field { display: flex; flex-direction: column; gap: 7px; }
.qms-overlay-field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.qms-overlay-error {
  font-size: .83rem;
  color: #8a1f1f;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  display: none;
}
[data-theme="dark"] .qms-overlay-error { color: #f87171; }
.qms-overlay-error.visible { display: block; }
.qms-overlay-success {
  font-size: .83rem;
  color: #3a7a5a;
  background: rgba(123,191,158,.1);
  border: 1px solid rgba(123,191,158,.32);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  display: none;
}
.qms-overlay-success.visible { display: block; }

/* ── DOCUMENT META BAR (mirrors study tracker meta bar) ───────────────────── */
.qms-meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  margin-bottom: 8px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.qms-meta-item { font-size: .82rem; color: var(--muted); }
.qms-meta-item strong { color: var(--text); font-weight: 600; }

/* ── STATUS TABS (filter view within a card) ──────────────────────────────── */
.qms-status-tabs {
  display: flex;
  gap: 8px;
  margin: 20px 0 16px;
  flex-wrap: wrap;
}
.qms-status-tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 34px;
  padding: 0 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--muted);
  font-family: inherit;
  font-size: .82rem;
  cursor: pointer;
  transition: all .15s;
}
.qms-status-tab:hover { border-color: var(--border-strong); color: var(--text); }
.qms-status-tab.active {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.qms-status-tab .count {
  font-size: .74rem;
  opacity: .7;
}
.qms-status-tab[disabled] {
  opacity: .4;
  cursor: not-allowed;
}
.qms-status-tab[disabled]:hover { border-color: var(--border); color: var(--muted); }
.qms-status-tab .lock-icon { width: 11px; height: 11px; }

/* ── DOCUMENT TABLE ─────────────────────────────────────────────────────── */
.qms-table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.qms-table-wrap::-webkit-scrollbar { height: 6px; }
.qms-table-wrap::-webkit-scrollbar-track { background: transparent; }
.qms-table-wrap::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
.qms-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}
.qms-table th {
  text-align: left;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.qms-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .87rem;
  color: var(--text);
  vertical-align: middle;
}
.qms-table tr:last-child td { border-bottom: none; }
.qms-table tr.qms-row-na { color: var(--faint); }
.qms-doc-id {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: .82rem;
}
.qms-doc-title { font-weight: 500; }
.qms-na { color: var(--faint); font-style: italic; }

.qms-status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: .72rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.qms-status-badge.status-effective { color: #3a7a5a; background: rgba(123,191,158,.14); border: 1px solid rgba(123,191,158,.32); }
.qms-status-badge.status-draft     { color: #8a6030; background: rgba(212,170,125,.14); border: 1px solid rgba(212,170,125,.32); }
.qms-status-badge.status-archive   { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.qms-status-badge.status-archive.is-restricted { color: #7a4a8a; background: rgba(201,155,214,.14); border: 1px solid rgba(201,155,214,.32); }

.qms-actions { display: flex; gap: 6px; }
.qms-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .78rem;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.qms-action-btn:hover { background: var(--surface-2); }
.qms-action-btn.primary {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.qms-action-btn.primary:hover { opacity: .85; }
.qms-action-btn svg { width: 12px; height: 12px; flex-shrink: 0; }

.qms-empty-state {
  padding: 48px 24px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .qms-app { padding: 20px 16px 64px; }
  .qms-meta-bar { flex-direction: column; align-items: flex-start; gap: 8px; }
  .qms-status-tabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; }
  .qms-overlay-card { padding: 22px; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCIENCE AND PUBLICATIONS — INDEX PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.sci-app {
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 80px;
}

/* ── FILTER BAR (reuses nw-select pattern) ─────────────────────────────── */
.sci-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  align-items: flex-end;
}
.sci-filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  flex: 1 1 200px;
  min-width: 180px;
}
.sci-filter-group label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
}
.sci-reset-btn {
  height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: none;
  color: var(--muted);
  font-family: inherit;
  font-size: .86rem;
  cursor: pointer;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.sci-reset-btn:hover { color: var(--text); border-color: var(--text); }

.sci-results-count {
  font-size: .8rem;
  color: var(--faint);
  margin-bottom: 16px;
}

/* ── HORIZONTAL PAPER CARD ─────────────────────────────────────────────── */
.sci-card-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.sci-card {
  display: flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
  text-decoration: none;
  color: var(--text);
  transition: box-shadow .3s ease, border-color .3s ease, transform .3s ease;
}
.sci-card:hover {
  box-shadow: var(--shadow-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.sci-card-hero {
  flex: 0 0 220px;
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
}
.sci-card-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.sci-card-hero-placeholder {
  width: 100%;
  height: 100%;
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--border-strong);
}
.sci-card-hero-placeholder svg { width: 40px; height: 40px; opacity: .5; }
.sci-card-body {
  flex: 1;
  padding: 22px 26px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}
.sci-card-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sci-card-tag {
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  padding: 2px 9px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted);
}
.sci-card h2 {
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.3;
  color: var(--text);
}
.sci-card p {
  font-size: .89rem;
  color: var(--muted);
  line-height: 1.55;
}
.sci-card-arrow {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--faint);
  letter-spacing: .04em;
  text-transform: uppercase;
}
.sci-card-arrow svg { transition: transform .2s ease; flex-shrink: 0; }
.sci-card:hover .sci-card-arrow svg { transform: translateX(3px); }

.sci-empty-state {
  padding: 56px 24px;
  text-align: center;
  color: var(--muted);
  font-size: .95rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}

@media (max-width: 680px) {
  .sci-card { flex-direction: column; }
  .sci-card-hero { flex: 0 0 160px; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SCIENCE AND PUBLICATIONS — ARTICLE PAGE
   ═══════════════════════════════════════════════════════════════════════════ */

.sci-article-layout {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) clamp(20px, 3vw, 32px) 100px;
  display: grid;
  grid-template-columns: minmax(0, 720px) 220px;
  gap: 48px;
  align-items: start;
}
@media (max-width: 980px) {
  .sci-article-layout { grid-template-columns: 1fr; max-width: 720px; }
  .sci-article-toc { display: none; }
}

/* ── ARTICLE HEADER ─────────────────────────────────────────────────────── */
.sci-article-header { margin-bottom: 36px; }
.sci-article-tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.sci-article-header h1 {
  font-size: clamp(1.8rem, 3.4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -.04em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: 18px;
}
.sci-article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-size: .84rem;
  color: var(--muted);
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.sci-article-meta strong { color: var(--text); font-weight: 600; }
.sci-article-meta .sep { color: var(--border-strong); }

.sci-article-hero {
  margin: 24px 0 8px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--border);
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sci-article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sci-article-hero svg { width: 48px; height: 48px; color: var(--border-strong); opacity: .5; }

/* ── ARTICLE BODY TYPOGRAPHY ────────────────────────────────────────────── */
.sci-article-body { font-size: 1.02rem; line-height: 1.75; color: var(--text); }
.sci-article-body h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -.02em;
  margin: 44px 0 16px;
  scroll-margin-top: 90px;
}
.sci-article-body h2:first-child { margin-top: 0; }
.sci-article-body p { margin-bottom: 18px; color: var(--text); }
.sci-article-body a { color: var(--text); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 2px; }
.sci-article-body a:hover { text-decoration-color: var(--text); }
.sci-article-body strong { font-weight: 600; }
.sci-article-body em { font-style: italic; color: var(--muted); }
.sci-article-body ol {
  padding-left: 22px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sci-article-body ol li {
  font-size: .92rem;
  color: var(--muted);
  line-height: 1.6;
}

/* ── PULL QUOTE ─────────────────────────────────────────────────────────── */
.sci-pullquote {
  margin: 36px 0;
  padding: 4px 0 4px 24px;
  border-left: 3px solid var(--border-strong);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -.01em;
  line-height: 1.5;
  color: var(--text);
}

/* ── CHART CONTAINER ────────────────────────────────────────────────────── */
.sci-chart {
  margin: 32px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 24px 26px 20px;
}
.sci-chart-title {
  font-size: .92rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.sci-chart-caption {
  font-size: .78rem;
  color: var(--faint);
  margin-bottom: 18px;
}
.sci-chart-canvas-wrap { width: 100%; }
.sci-svg-chart { width: 100%; height: auto; display: block; font-family: inherit; }
.sci-donut-wrap { max-width: 240px; margin: 0 auto; }
.sci-chart-empty { padding: 40px 0; text-align: center; color: var(--faint); font-size: .85rem; }

.sci-bar {
  transform: scaleY(0);
  transition: transform 0.9s cubic-bezier(.16,1,.3,1);
}
.sci-chart.in-view .sci-bar { transform: scaleY(1); }

.sci-line {
  transition: stroke-dashoffset 1.2s cubic-bezier(.16,1,.3,1);
}
.sci-chart.in-view .sci-line { stroke-dashoffset: 0; }

.sci-line-dot {
  opacity: 0;
  transition: opacity .3s ease .9s;
}
.sci-chart.in-view .sci-line-dot { opacity: 1; }

.sci-donut-arc {
  transition: stroke-dashoffset 0.9s cubic-bezier(.16,1,.3,1);
}
.sci-chart.in-view .sci-donut-arc { stroke-dashoffset: 0; }

/* ── SCATTER / CORRELATION ──────────────────────────────────────────────── */
.sci-scatter-dot {
  opacity: 0;
  transform: scale(0.3);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity .4s ease, transform .4s cubic-bezier(.16,1,.3,1);
}
.sci-chart.in-view .sci-scatter-dot { opacity: .78; transform: scale(1); }

.sci-trend-line {
  opacity: 0;
  transition: opacity .6s ease .35s;
}
.sci-chart.in-view .sci-trend-line { opacity: 1; }

.sci-r-value {
  opacity: 0;
  transition: opacity .5s ease .5s;
}
.sci-chart.in-view .sci-r-value { opacity: 1; }

/* ── BOX AND WHISKER ────────────────────────────────────────────────────── */
.sci-box-whisker,
.sci-box-median {
  opacity: 0;
  transition: opacity .5s ease .3s;
}
.sci-chart.in-view .sci-box-whisker,
.sci-chart.in-view .sci-box-median { opacity: 1; }

.sci-box-body {
  transform: scaleY(0);
  transition: transform .7s cubic-bezier(.16,1,.3,1);
}
.sci-chart.in-view .sci-box-body { transform: scaleY(1); }

/* ── EMBEDDED DATA TABLE ────────────────────────────────────────────────── */
.sci-table-wrap {
  margin: 32px 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.sci-inline-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
}
.sci-inline-table th {
  text-align: left;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  white-space: nowrap;
}
.sci-inline-table td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  font-size: .87rem;
  color: var(--text);
}
.sci-inline-table tr:last-child td { border-bottom: none; }

/* ── EMBEDDED FIGURE ─────────────────────────────────────────────────────── */
.sci-figure {
  margin: 32px 0;
}
.sci-figure img {
  width: 100%;
  display: block;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
}
.sci-figure figcaption {
  font-size: .82rem;
  color: var(--faint);
  margin-top: 10px;
  line-height: 1.5;
  text-align: center;
}

.sci-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.sci-chart-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .78rem;
  color: var(--muted);
}
.sci-chart-legend-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }

/* Counter chart type */
.sci-chart-counters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 20px;
}
.sci-chart-counter-value {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 600;
  letter-spacing: -.04em;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin-bottom: 4px;
}
.sci-chart-counter-label { font-size: .82rem; color: var(--muted); }
.sci-chart-counter-sublabel { font-size: .74rem; color: var(--faint); margin-top: 2px; }

/* ── REFERENCES ─────────────────────────────────────────────────────────── */
.sci-references {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.sci-references h2 { font-size: 1.1rem; margin-bottom: 14px; }
.sci-references ol {
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sci-references li {
  font-size: .85rem;
  color: var(--muted);
  line-height: 1.6;
}
.sci-references a { color: var(--muted); text-decoration: underline; text-decoration-color: var(--border); }

/* ── COPY LINK + SOURCE LINK ROW ───────────────────────────────────────── */
.sci-article-actions {
  display: flex;
  gap: 10px;
  margin: 28px 0 4px;
  flex-wrap: wrap;
}
.sci-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 16px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text);
  font-family: inherit;
  font-size: .84rem;
  text-decoration: none;
  cursor: pointer;
  transition: all .15s;
}
.sci-action-btn:hover { background: var(--surface-2); }
.sci-action-btn svg { width: 14px; height: 14px; flex-shrink: 0; }
.sci-action-btn.copied { color: #3a7a5a; border-color: rgba(123,191,158,.5); }

/* ── RELATED PAPERS ─────────────────────────────────────────────────────── */
.sci-related {
  margin-top: 56px;
  padding-top: 28px;
  border-top: 1px solid var(--border);
}
.sci-related h2 { font-size: 1.1rem; margin-bottom: 16px; }
.sci-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.sci-related-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  text-decoration: none;
  color: var(--text);
  transition: border-color .2s, transform .2s;
}
.sci-related-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.sci-related-card h3 { font-size: .92rem; font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.sci-related-card span { font-size: .74rem; color: var(--faint); }

/* ── SECTION NAVIGATION (right sidebar, sticky) ─────────────────────────── */
.sci-article-toc {
  position: sticky;
  top: 90px;
}
.sci-toc-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--faint);
  margin-bottom: 12px;
}
.sci-toc-list {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 1px;
}
.sci-toc-thumb {
  position: absolute;
  left: 0;
  width: 2px;
  top: 0;
  height: 0;
  background: var(--text);
  opacity: 0;
  transition: opacity .2s ease;
}
.sci-toc-thumb.visible { opacity: 1; }
.sci-toc-link {
  position: relative;
  display: block;
  padding: 6px 0 6px 14px;
  font-size: .82rem;
  color: var(--faint);
  text-decoration: none;
  transition: color .15s;
  line-height: 1.4;
}
.sci-toc-link:hover { color: var(--text); }
.sci-toc-link:focus,
.sci-toc-link:focus-visible { outline: none; }
.sci-toc-link.active {
  color: var(--text);
  font-weight: 500;
}

/* ── READING PROGRESS BAR (pinned to bottom) ────────────────────────────── */
.sci-progress-wrap {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  z-index: 150;
}
.sci-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--text);
  opacity: .6;
  transition: width .1s linear;
}

@media (max-width: 680px) {
  .sci-article-layout { padding: 20px 16px 80px; }
  .sci-article-actions { flex-direction: column; }
  .sci-action-btn { justify-content: center; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   PRINT STYLES (STUDY TRACKER REPORT)
   ═══════════════════════════════════════════════════════════════════════════ */
@media print {
  nav, footer, .st-actions, #stDataError {
    display: none !important;
  }
  .page-hero small { display: none !important; }
  .st-hide-print { display: none !important; }
  .st-show-print { display: block !important; }

  :root, [data-theme="light"], [data-theme="dark"] {
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #f7f7f5;
    --surface-3: #eeeeed;
    --text: #111111;
    --muted: #4a4a46;
    --faint: #6a6a66;
    --border: #cccccc;
    --border-strong: #999999;
    --shadow: none;
    --shadow-sm: none;
    --shadow-hover: none;
  }
  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
    box-shadow: none !important;
  }
  @page {
    margin: 16mm 14mm;
  }

  .page-hero { margin-bottom: 18px !important; }
  .page-hero h1 {
    font-size: 1.6rem !important;
    line-height: 1.15 !important;
    margin-bottom: 8px !important;
  }
  .page-hero p {
    font-size: .82rem !important;
    max-width: none !important;
  }

  .st-app {
    max-width: none;
    padding: 0 3mm;
  }
  .st-confidential { margin-left: 0; }

  .st-section h2, .st-section-num {
    page-break-after: avoid;
    break-after: avoid-page;
  }

  .st-section-compact {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .st-section-tau {
    page-break-before: always !important;
    break-before: page !important;
  }

  .st-overview-grid {
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 8px !important;
  }
  .st-stat-card {
    padding: 12px 10px !important;
    border: 1px solid #cccccc;
    opacity: 1 !important;
    transform: none !important;
    page-break-inside: avoid;
    break-inside: avoid;
  }
  .st-stat-value { font-size: 1.4rem !important; margin-bottom: 4px; }
  .st-stat-label { font-size: .68rem !important; }
  .st-stat-sublabel { font-size: .6rem !important; }

  .st-imaging-grid, .st-biomarker-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 10px !important;
  }
  .st-imaging-card, .st-biomarker-card, .st-failure-row {
    border: 1px solid #cccccc;
    page-break-inside: avoid;
    break-inside: avoid;
  }

  .st-progress-cell, .st-progress-th {
    display: none !important;
  }

  .st-table-wrap, .st-read-table-wrap {
    border: 1px solid #cccccc;
    border-radius: 0 !important;
    max-height: none !important;
    overflow: visible !important;
  }
  .st-table, .st-read-table {
    min-width: 0 !important;
    width: 100% !important;
    font-size: .76rem;
  }
  .st-table th, .st-read-table th {
    white-space: normal;
    position: static !important;
    padding: 8px 8px;
    font-size: .62rem;
  }
  .st-table td, .st-read-table td {
    padding: 7px 8px;
  }
  .st-table thead, .st-read-table thead {
    display: table-header-group;
  }
  .st-table tr, .st-read-table tr {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }
  .st-read-table .notes-cell {
    line-height: 1.4;
    max-width: none;
  }

  .st-footnotes {
    page-break-inside: avoid;
  }

  .st-print-closing {
    display: block !important;
    margin-top: 28px;
    padding-top: 16px;
    border-top: 1px solid #cccccc;
    font-size: .78rem;
    font-weight: 600;
    line-height: 1.6;
    color: #4a4a46;
    text-align: left;
    page-break-inside: avoid;
  }
}

/* ═══════════════════════════════════════════════════════════════════════════
   COHORT TRACKER PAGE (portfolio demo)
   Reuses .st-app / .st-section / .st-overview-grid / .st-stat-card /
   .st-meta-bar / .st-actions / .st-table from the Study Tracker page, and
   .stl-status from the Studies landing page. Only genuinely new components
   are defined here.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DEMO INSTANCE BADGE (meta bar) ─────────────────────────────────────── */
.ct-demo-badge {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}

/* ── ADDITIONAL STATUS VARIANT (extends .stl-status) ────────────────────── */
.stl-status.available { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border); }
.stl-status.demo       { color: var(--muted); background: var(--surface-2); border: 1px solid var(--border-strong); }

/* ── STUDY PORTFOLIO CARDS ───────────────────────────────────────────────── */
.ct-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.ct-study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.ct-study-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}
.ct-study-card-head h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.25;
}
.ct-study-protocol {
  font-size: .76rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: -6px;
}
.ct-tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.ct-tag {
  font-size: .72rem;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border);
  padding: 3px 9px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.ct-study-stats {
  display: flex;
  gap: 18px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.ct-study-stat { font-size: .8rem; color: var(--muted); }
.ct-study-stat strong { display: block; font-size: 1.05rem; color: var(--text); font-weight: 600; }

/* ── REGIONAL SITE CARDS ─────────────────────────────────────────────────── */
.ct-region-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 8px;
}
.ct-region-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ct-region-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.ct-region-head h4 {
  font-size: .95rem;
  font-weight: 600;
  color: var(--text);
}
.ct-region-sites {
  font-size: .78rem;
  color: var(--faint);
  white-space: nowrap;
}

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .ct-study-grid, .ct-region-grid { grid-template-columns: 1fr; }
  .ct-demo-badge { margin-left: 0; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   STUDY PORTFOLIO DEMO PAGE (studies-demo)
   Reuses .st-app / .st-section / .st-overview-grid / .st-stat-card /
   .st-meta-bar / .st-actions from the Study Tracker page, and
   .st-biomarker-track / .st-biomarker-fill for the progress bars. Studies
   render as a compact card grid rather than a stacked accordion — with
   only three short bars per study there's little to gain from hiding
   them behind a click, and a grid reads as "portfolio at a glance"
   rather than a long, one-by-one scroll.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── DEMO INSTANCE BADGE (generic — usable on any page's meta bar) ───────── */
.badge-demo {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .7rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--border-strong);
  padding: 4px 11px;
  border-radius: var(--radius-pill);
}

/* ── STUDY CARD GRID ───────────────────────────────────────────────────── */
.sd-study-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 8px;
}
.sd-study-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sd-study-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.sd-study-title-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sd-study-card h3 {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  line-height: 1.3;
}
.sd-study-protocol {
  font-size: .76rem;
  color: var(--faint);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ── TRIAL PHASE PILL (colour-coded maturity gradient) ────────────────────
   Slate → blue → amber → green, reusing the same hex values as the
   existing .card accent sets (a-slate / a-blue / a-amber / a-green)
   elsewhere in this file, so the palette stays consistent site-wide. */
.sd-phase-pill {
  display: inline-flex;
  align-items: center;
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}
.sd-phase-pill.preclinical { color: #374151; background: rgba(55,65,81,.1);   border: 1px solid rgba(55,65,81,.22); }
.sd-phase-pill.phase-i     { color: #1d6feb; background: rgba(29,111,235,.1); border: 1px solid rgba(29,111,235,.22); }
.sd-phase-pill.phase-ii    { color: #b45309; background: rgba(180,83,9,.1);   border: 1px solid rgba(180,83,9,.22); }
.sd-phase-pill.phase-iii   { color: #1a8a50; background: rgba(26,138,80,.1);  border: 1px solid rgba(26,138,80,.22); }
[data-theme="dark"] .sd-phase-pill.preclinical { color: #9ca3af; background: rgba(156,163,175,.1); border-color: rgba(156,163,175,.22); }
[data-theme="dark"] .sd-phase-pill.phase-i     { color: #5ca3ff; background: rgba(92,163,255,.1);  border-color: rgba(92,163,255,.22); }
[data-theme="dark"] .sd-phase-pill.phase-ii    { color: #f59e0b; background: rgba(245,158,11,.1);  border-color: rgba(245,158,11,.22); }
[data-theme="dark"] .sd-phase-pill.phase-iii   { color: #4cbb7f; background: rgba(76,187,127,.1);  border-color: rgba(76,187,127,.22); }

.sd-disease-tag {
  font-size: .78rem;
  color: var(--faint);
  white-space: nowrap;
}

/* ── PROGRESS METRIC ROWS ─────────────────────────────────────────────────
   Three of these sit inside every card. */
.sd-metric-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.sd-metric-row-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 7px;
}
.sd-metric-name { font-size: .8rem; font-weight: 600; color: var(--text); }
.sd-metric-figures { font-size: .76rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.sd-metric-figures strong { color: var(--text); font-weight: 600; }

/* ── OVERVIEW STAT VALUE + SUFFIX (e.g. "68%") ────────────────────────────
   .st-stat-value already exists (Study Tracker page); the numeric span
   and static suffix inside it are new, so the count-up animation only
   touches the number and never clobbers a trailing "%". */
.st-stat-suffix { color: inherit; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────── */
@media (max-width: 680px) {
  .badge-demo { margin-left: 0; }
  .sd-study-grid { grid-template-columns: 1fr; }
}
