/* ══ Stats Page — Scientific Reference Layout ════════════════════════════════ */
/* DM Sans + JetBrains Mono are loaded globally by layout.html               */

/* ── Custom Properties ──────────────────────────────────────────────── */
.stats-page {
    --nrd-font: 'DM Sans', 'Helvetica Neue', system-ui, sans-serif;
    --nrd-mono: var(--font-mono);
    --nrd-radius: var(--radius-md);
    --nrd-radius-lg: var(--radius-lg);
    --nrd-shadow: none;
    --nrd-shadow-hover: none;
    --nrd-data-primary: #4f46e5;
    --nrd-data-secondary: #0ea5e9;
    /* Soft-border alias — deliberately softer than var(--border); the nerd
       page hairlines would double in contrast if pointed at the global. */
    --nrd-border: rgba(128,128,128,0.12);
    --nrd-rule: rgba(128,128,128,0.18);
    --nrd-surface: var(--bg-alt);
    --nrd-surface-raised: var(--bg-elevated, var(--bg-alt));
    --nrd-section-gap: var(--section-gap);
    --nrd-table-stripe: rgba(128,128,128,0.025);
    /* Card-grid minimum width — shared across all auto-fit card grids on
       the nerd page so cards in different sections wrap at the same
       breakpoint. Used by _toxicity_stats.html, _drugs_wiki.html, and
       _extracted_effects.html. */
    --nrd-card-min: var(--card-min);
}
body.dark .stats-page {
    --nrd-data-primary: #818cf8;
    --nrd-data-secondary: #38bdf8;
    --nrd-border: rgba(255,255,255,0.08);
    --nrd-rule: rgba(255,255,255,0.12);
}
body.light .stats-page {
    --nrd-surface: #ffffff;
    --nrd-surface-raised: #ffffff;
    --nrd-border: rgba(0,0,0,0.08);
    --nrd-rule: rgba(0,0,0,0.14);
    --nrd-table-stripe: rgba(0,0,0,0.02);
}

/* ── Page Container ─────────────────────────────────────────────────── */
.stats-page {
    max-width: 1080px;
    margin: 0 auto;
    padding: 0.75rem 1.5rem 4rem;
    font-family: var(--nrd-font);
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
}

/* ── Navigation ─────────────────────────────────────────────────────── */
.stats-page .rpt-nav { margin-bottom: 1.25rem; }
.stats-page .rpt-back-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    font-weight: 500;
    letter-spacing: 0.01em;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}
.stats-page .rpt-back-link:hover { color: var(--accent); text-decoration: none; }

/* ── Hero — Clean Title Block ───────────────────────────────────────── */
.nrd-hero {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1.5rem 0;
    border-bottom: 1px solid var(--nrd-rule);
}
.nrd-hero-info { flex: 1; min-width: 0; }
.nrd-title {
    font-family: var(--nrd-font);
    font-size: 1.75rem;
    font-weight: 700;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.15;
}
.nrd-title-sub {
    display: block;
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    color: var(--text-muted);
    margin-top: 0.35rem;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}
.nrd-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.75rem;
}
.nrd-hero-aliases {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.5rem;
}
.nrd-hero-alias {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 0.1rem 0.4rem;
    border: 1px solid var(--nrd-border);
    border-radius: 3px;
    font-family: var(--nrd-mono);
}
.nrd-hero-ids {
    margin-top: 0.55rem;
}
.nrd-cid-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-family: var(--nrd-mono);
    text-decoration: none;
    padding: 0.2rem 0.55rem;
    border: 1px solid var(--nrd-border);
    border-radius: 4px;
    color: var(--text-muted);
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.nrd-cid-chip:hover {
    color: var(--text);
    border-color: var(--nrd-data-primary, var(--accent));
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}
.nrd-cid-chip-label {
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--nrd-data-primary, var(--accent));
}
.nrd-cid-chip-value {
    font-weight: 600;
    color: var(--text);
}
.nrd-cid-chip-arrow {
    font-size: 0.65rem;
    opacity: 0.6;
}
.nrd-hero-structure {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 130px;
    height: 120px;
}
.nrd-hero-structure img {
    max-width: 120px;
    max-height: 110px;
    width: auto;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
}
body.dark .nrd-hero-structure img:not(.structure-webp) {
    filter: invert(0.88) hue-rotate(180deg);
}
.nrd-hero-structure .structure-webp { filter: none; }
body.dark .nrd-hero-structure .structure-webp { filter: invert(1); }

/* ── Chemical Identity Table (in hero) ──────────────────────────────── */
.nrd-hero-chem {
    margin-top: 0.85rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--nrd-border);
}
.nrd-hero-chem-head {
    margin-bottom: 0.4rem;
}
.nrd-hero-chem-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.5rem;
}
.sub-chem-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.5rem;
    background: var(--nrd-surface);
    border: 1px solid var(--nrd-border);
    border-radius: 4px;
    font-size: 0.78rem;
}
.sub-chem-key {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}
.sub-chem-val {
    font-weight: 500;
    color: var(--text);
    font-family: var(--nrd-mono);
    font-size: 0.78rem;
}
.sub-chem-iupac {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    font-size: 0.78rem;
}
.sub-chem-iupac-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.sub-chem-iupac-value {
    color: var(--text-dim);
    word-break: break-word;
}
.sub-chem-mono {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.2rem;
    font-size: 0.75rem;
}
.sub-chem-mono-label {
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    flex-shrink: 0;
}
.sub-chem-mono-value {
    font-family: var(--nrd-mono);
    font-size: 0.72rem;
    color: var(--text-dim);
    word-break: break-all;
    background: none;
    padding: 0;
}
.sub-chem-hazard {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}
.sub-chem-hazard-codes { display: flex; gap: 0.25rem; flex-wrap: wrap; }
.sub-chem-hazard-code {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    background: var(--warning-tint);
    color: var(--warning-text);
}
.sub-chem-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin-top: 0.3rem;
}
.sub-chem-tag {
    font-size: 0.68rem;
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    background: var(--nrd-surface);
    border: 1px solid var(--nrd-border);
    color: var(--text-muted);
}

/* ── Metadata Bar (Classification Strip) ────────────────────────────── */
.nrd-metadata-bar {
    display: flex;
    border: 1px solid var(--nrd-border);
    border-radius: var(--nrd-radius);
    overflow: hidden;
    margin-bottom: var(--nrd-section-gap);
}
.nrd-metadata-bar .nrd-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.85rem;
    background: var(--nrd-surface);
    border-right: 1px solid var(--nrd-border);
    min-width: 0;
}
.nrd-metadata-bar .nrd-metric:last-child { border-right: none; }
/* Legacy grid fallback */
.nrd-card-grid-4 {
    display: flex;
    border: 1px solid var(--nrd-border);
    border-radius: var(--nrd-radius);
    overflow: hidden;
    margin-bottom: var(--nrd-section-gap);
}
.nrd-metric {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 0.85rem;
    background: var(--nrd-surface);
    border-right: 1px solid var(--nrd-border);
    min-width: 0;
}
.nrd-metric:last-child { border-right: none; }
.nrd-metric-value {
    font-family: var(--nrd-mono);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.3;
    font-variant-numeric: tabular-nums;
    overflow-wrap: break-word;
    word-break: break-word;
    text-align: center;
}
.nrd-metric-label {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    margin-top: 0.1rem;
    text-align: center;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
body.light .nrd-metric {
    background: var(--bg-elevated);
}

/* ── Zone / Grid Layout ─────────────────────────────────────────────── */
.nrd-zone { margin-bottom: var(--nrd-section-gap); }
.nrd-card-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.nrd-content-card {
    padding: 1.25rem;
    background: var(--nrd-surface);
    border-radius: var(--nrd-radius);
    border: 1px solid var(--nrd-border);
}
body.light .nrd-content-card {
    background: var(--bg-elevated);
    border-color: rgba(0,0,0,0.07);
}
.nrd-content-card > .nrd-section { margin-bottom: 0; }
.nrd-card-stack {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* ── Section Blocks ─────────────────────────────────────────────────── */
.nrd-section {
    margin-bottom: var(--nrd-section-gap);
    animation: nrdFadeUp 0.3s ease-out both;
}
.nrd-section-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 0.35rem 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.45rem;
    border-bottom: 2px solid var(--nrd-rule);
}
.nrd-section-head h2 {
    font-family: var(--nrd-font);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
    color: var(--text);
    letter-spacing: -0.01em;
}
.nrd-section-badge {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    white-space: nowrap;
    opacity: 0.7;
}
a.nrd-section-badge {
    text-decoration: none;
    transition: color 0.2s;
}
a.nrd-section-badge:hover {
    color: var(--accent);
    opacity: 1;
}

/* ── Source citation links (inline after section headings) ───────── */
.nrd-section-sources {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.2rem;
    margin-left: 0.5rem;
    vertical-align: baseline;
}
.nrd-source-link {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    opacity: 0.65;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.2s, opacity 0.2s;
}
.nrd-source-link:hover {
    color: var(--accent);
    opacity: 1;
    text-decoration: underline;
}

/* ── References section ──────────────────────────────────────────── */
.nrd-references-section {
    border-top: 2px solid var(--nrd-rule);
    padding-top: var(--nrd-section-gap);
}
.nrd-ref-group {
    margin-bottom: 1.25rem;
}
.nrd-ref-group-title {
    font-family: var(--nrd-mono);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin: 0 0 0.5rem 0;
}
.nrd-ref-list {
    list-style: none;
    margin: 0;
    padding: 0;
    columns: 2;
    column-gap: 2rem;
}
.nrd-ref-list li {
    font-size: 0.78rem;
    line-height: 1.7;
    break-inside: avoid;
    padding-left: 0.8rem;
    position: relative;
    color: var(--text-muted);
}
.nrd-ref-list li::before {
    content: "\2022";
    position: absolute;
    left: 0;
    color: var(--text-muted);
    opacity: 0.4;
}
.nrd-ref-list a {
    color: var(--text);
    text-decoration: none;
    opacity: 0.8;
    transition: color 0.2s, opacity 0.2s;
}
.nrd-ref-list a:hover {
    color: var(--accent);
    opacity: 1;
    text-decoration: underline;
}
@media (max-width: 768px) {
    .nrd-ref-list { columns: 1; }
}
.nrd-source-sep {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    opacity: 0.4;
    margin: 0 0.1rem;
}

/* ── Subtitle ───────────────────────────────────────────────────────── */
.nrd-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: -0.5rem 0 1rem 0;
    line-height: 1.5;
    font-weight: 400;
}

/* ── Metrics row (inside sections) ──────────────────────────────────── */
.nrd-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 0.65rem;
    margin: 0.75rem 0 1.25rem;
}
.nrd-metrics--flush { margin: 0; }

/* ── Chart Containers ───────────────────────────────────────────────── */
.nrd-chart-wrap {
    position: relative;
    max-height: 320px;
    margin: 0.5rem 0;
}
.nrd-chart-wrap-sm { max-height: 230px; }
.nrd-chart-wrap-lg { max-height: none; }
/* The margin shorthand above outranks ui.css utilities in the cascade
   (page CSS loads last); re-assert ss-mt-4 where the markup opts in. */
.nrd-chart-wrap.ss-mt-4 { margin-top: var(--space-4); }
.nrd-chart-title {
    font-family: var(--nrd-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 0.5rem;
    letter-spacing: 0.01em;
}
.nrd-charts-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 0.75rem 0;
}
.nrd-chart-card {
    padding: 1rem;
    border-top: 1px solid var(--nrd-border);
    border-bottom: 1px solid var(--nrd-border);
    background: transparent;
}

/* ── Effect Profile ─────────────────────────────────────────────────── */
.nrd-ep-class {
    margin-bottom: 1.5rem;
    padding: 1.25rem 0;
    border-top: 1px solid var(--nrd-rule);
}
/* The section heading already draws a rule below itself; skip the
   redundant top border on the first ep-class card so we don't end up
   with two stacked lines. */
.nrd-ep-class:first-of-type {
    border-top: none;
    padding-top: 0.5rem;
}
.nrd-ep-class:last-child { margin-bottom: 0; }
.nrd-ep-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.85rem;
}
.nrd-ep-name {
    font-family: var(--nrd-font);
    font-weight: 600;
    font-size: 1rem;
    color: var(--text);
}
.nrd-ep-intensity-label {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    padding: 0.1rem 0.45rem;
    border-radius: 3px;
    border: 1px solid var(--nrd-border);
    color: var(--text-muted);
    letter-spacing: 0.02em;
}
.nrd-ep-score-badge {
    font-family: var(--nrd-mono);
    font-weight: 700;
    font-size: 1rem;
    color: var(--accent);
    margin-left: auto;
    letter-spacing: -0.02em;
}
.nrd-ep-desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0 0 0.85rem;
    line-height: 1.6;
    font-style: italic;
    padding-left: 0.75rem;
    border-left: 2px solid var(--nrd-border);
}
.nrd-ep-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    align-items: start;
}
.nrd-ep-radar-wrap {
    position: relative;
    max-height: 300px;
}

/* Dimension bars */
.nrd-ep-dims { }
.nrd-ep-dim {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.2rem 0;
}
.nrd-ep-dim-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    min-width: 125px;
    text-align: right;
    white-space: nowrap;
    font-weight: 400;
}
.nrd-ep-dim-weight {
    display: inline-block;
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    margin-left: 0.1rem;
    padding: 1px 3px;
    border-radius: 2px;
    vertical-align: middle;
    line-height: 1;
}
.nrd-w-core { color: var(--accent); background: rgba(255,0,139,0.08); }
.nrd-w-major { color: var(--text-muted); background: rgba(128,128,128,0.07); }
.nrd-w-minor { color: var(--text-muted); background: rgba(128,128,128,0.04); opacity: 0.5; }
.nrd-ep-dim-track {
    flex: 1;
    height: 4px;
    background: var(--bg);
    border-radius: 2px;
    overflow: visible;
    position: relative;
}
.nrd-ep-dim-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.6s linear;
}
.nrd-ep-dim-marker {
    position: absolute;
    top: -3px;
    width: 2px;
    height: 10px;
    background: color-mix(in srgb, var(--warning) 80%, transparent);
    border-radius: 1px;
    transform: translateX(-1px);
}
.nrd-ep-dim-score {
    font-family: var(--nrd-mono);
    font-weight: 600;
    font-size: 0.72rem;
    min-width: 22px;
    text-align: right;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.nrd-ep-dim-er {
    font-size: var(--fs-micro);
    font-weight: 500;
    color: color-mix(in srgb, var(--warning) 75%, transparent);
    margin-left: 1px;
}
.nrd-ep-dim-er::before { content: '/'; color: var(--nrd-border); }
.nrd-ep-legend {
    display: flex;
    gap: 1rem;
    margin-top: 0.5rem;
    font-size: 0.65rem;
    color: var(--text-muted);
}
.nrd-ep-legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}
.nrd-ep-legend-bar {
    display: inline-block;
    width: 16px;
    height: 3px;
    border-radius: 1px;
}
.nrd-ep-legend-dot {
    display: inline-block;
    width: 2px;
    height: 10px;
    background: color-mix(in srgb, var(--warning) 80%, transparent);
    border-radius: 1px;
}
.nrd-ep-legend-dot-bl {
    background: rgba(80,160,255,0.8);
}
.nrd-ep-dim-ev {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    padding: 1px 5px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--success) 8%, transparent);
    color: var(--text-muted);
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    border: 1px solid color-mix(in srgb, var(--success) 12%, transparent);
}

/* User experience quotes */
.nrd-ep-quotes {
    margin-top: 0.85rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--nrd-border);
    grid-column: 1 / -1;
}
.nrd-ep-quotes-title {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.35rem;
}
.nrd-ep-quote-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.25rem 0;
    font-size: 0.78rem;
    line-height: 1.5;
}
.nrd-ep-quote-row + .nrd-ep-quote-row {
    border-top: 1px solid rgba(128,128,128,0.04);
}
.nrd-ep-quote-tag {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 3px;
    border: 1px solid var(--nrd-border);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
}
.nrd-ep-quote-text {
    font-style: italic;
    color: var(--text);
    font-weight: 400;
}
.nrd-ep-quote-meta {
    font-size: 0.65rem;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.nrd-ep-cite-link {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.7rem;
    transition: color 0.15s;
}
.nrd-ep-cite-link:hover { color: var(--accent); text-decoration: none; }

/* Source color tags */
.nrd-src-bluelight { color: var(--brand-bluelight); }
.nrd-src-nervewing-blog { color: var(--brand-nervewing); }
.nrd-src-shulgin { color: var(--brand-shulgin); }
.nrd-src-reddit { color: var(--brand-reddit); }
.nrd-src-psychonautwiki { color: var(--brand-pw); }
.nrd-src-effectindex { color: var(--brand-effectindex); }

/* Report sources */
.nrd-ep-sources {
    margin-top: 1rem;
    padding-top: 0.65rem;
    border-top: 1px solid var(--nrd-border);
}
.nrd-ep-sources-label {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 0.4rem;
    display: block;
}
.nrd-ep-sources-list { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.nrd-ep-src-link {
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    background: transparent;
    color: var(--text-muted);
    text-decoration: none;
    border: 1px solid var(--nrd-border);
    transition: border-color 0.2s, color 0.2s;
}
.nrd-ep-src-link:hover {
    border-color: var(--accent);
    color: var(--text);
    text-decoration: none;
}
.nrd-ep-src-name { font-weight: 600; white-space: nowrap; }
.nrd-ep-src-name::after { content: ':'; }
.nrd-ep-src-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.nrd-ep-src-author { opacity: 0.55; font-size: 0.66rem; }

/* Category fill colors — straight from the --category-* tokens (the old
   hardcoded fallbacks contradicted them, e.g. benzodiazepine blue vs tan) */
.nrd-fill-psychedelic { background: var(--category-psychedelic); }
.nrd-fill-empathogen { background: var(--category-empathogen); }
.nrd-fill-dissociative { background: var(--category-dissociative); }
.nrd-fill-stimulant { background: var(--category-stimulant); }
.nrd-fill-benzodiazepine { background: var(--category-benzodiazepine); }
.nrd-fill-opioid { background: var(--category-opioid); }
.nrd-fill-cannabinoid { background: var(--category-cannabinoid); }
.nrd-fill-deliriant { background: var(--category-deliriant); }
.nrd-fill-nootropic { background: var(--category-nootropic); }
.nrd-fill-depressant { background: var(--category-depressant); }

/* ── Pharmacology ───────────────────────────────────────────────────── */
.stats-page .nrd-pharm-quick { padding-left: 0; }
.stats-page .nrd-pharm-cols { padding-left: 0; }

/* ── Pharmacology subsections ───────────────────────────────────────── */
.pharm-subsection {
    margin-bottom: 1.25rem;
}
.pharm-subsection:last-child { margin-bottom: 0; }
.pharm-sub-title {
    font-family: var(--nrd-font);
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.5rem;
    letter-spacing: 0;
}

/* Mechanism of Action — grouped chips */
.pharm-moa-groups {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.pharm-moa-group {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.pharm-moa-group-label {
    font-family: var(--nrd-font);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding-left: 0.15rem;
}
.pharm-moa-group[data-action="agonist"] .pharm-moa-group-label    { color: #43a047; }
.pharm-moa-group[data-action="antagonist"] .pharm-moa-group-label { color: #e53935; }
.pharm-moa-group[data-action="inhibitor"] .pharm-moa-group-label  { color: #f57c00; }
.pharm-moa-group[data-action="modulator"] .pharm-moa-group-label  { color: #1e88e5; }
.pharm-moa-group:not([data-action]) .pharm-moa-group-label        { color: var(--text-muted); }
body.dark .pharm-moa-group[data-action="agonist"] .pharm-moa-group-label    { color: #66bb6a; }
body.dark .pharm-moa-group[data-action="antagonist"] .pharm-moa-group-label { color: #ef5350; }
body.dark .pharm-moa-group[data-action="inhibitor"] .pharm-moa-group-label  { color: #ffa726; }
body.dark .pharm-moa-group[data-action="modulator"] .pharm-moa-group-label  { color: #42a5f5; }
.pharm-moa-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.pharm-moa-item {
    display: inline-flex;
    align-items: center;
    padding: 0.35rem 0.65rem;
    background: transparent;
    border-radius: 4px;
    border: 1px solid var(--nrd-border);
    border-left: 3px solid var(--accent, #ff008b);
    font-family: var(--nrd-font);
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.35;
}
.pharm-moa-item[data-action="agonist"]    { border-left-color: #43a047; }
.pharm-moa-item[data-action="antagonist"] { border-left-color: #e53935; }
.pharm-moa-item[data-action="inhibitor"]  { border-left-color: #f57c00; }
.pharm-moa-item[data-action="modulator"]  { border-left-color: #1e88e5; }

/* Receptor Binding */
.pharm-rb-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem;
}
.pharm-rb-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.65rem;
    border-radius: 4px;
    border-left: 3px solid var(--nrd-border);
    font-family: var(--nrd-font);
    font-size: 0.82rem;
}
.pharm-rb-row:nth-child(odd) { background: var(--nrd-table-stripe); }
.pharm-rb-row[data-action="agonist"]    { border-left-color: #43a047; }
.pharm-rb-row[data-action="antagonist"] { border-left-color: #e53935; }
.pharm-rb-row[data-action="inhibitor"]  { border-left-color: #f57c00; }
.pharm-rb-row[data-action="modulator"]  { border-left-color: #1e88e5; }
body.dark .pharm-rb-row[data-action="agonist"]    { border-left-color: #66bb6a; }
body.dark .pharm-rb-row[data-action="antagonist"] { border-left-color: #ef5350; }
body.dark .pharm-rb-row[data-action="inhibitor"]  { border-left-color: #ffa726; }
body.dark .pharm-rb-row[data-action="modulator"]  { border-left-color: #42a5f5; }
.pharm-rb-receptor {
    color: var(--text);
    font-weight: 600;
    font-size: 0.8rem;
    white-space: nowrap;
}
.pharm-rb-affinity {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-family: var(--nrd-mono);
    text-align: right;
    white-space: nowrap;
}

/* Metabolism */
.pharm-metabolism-text {
    font-family: var(--nrd-font);
    font-size: 0.85rem;
    color: var(--text-dim);
    line-height: 1.65;
    margin: 0;
    padding: 0.65rem 0.85rem;
    border-left: 2px solid var(--nrd-rule);
    border-radius: 0;
}
/* Metabolites */
.pharm-metabolites-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
}
.pharm-metabolite-item {
    padding: 0.3rem 0.6rem;
    border: 1px solid var(--nrd-border);
    border-radius: 4px;
    font-family: var(--nrd-font);
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.4;
}

/* Single column inside card grid */
.nrd-content-card .pharm-rb-grid { grid-template-columns: 1fr; }
@media (max-width: 768px) {
    .pharm-rb-grid { grid-template-columns: 1fr; }
}

/* ── Interaction Tiers ──────────────────────────────────────────────── */
.nrd-si-tier {
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    border-radius: var(--nrd-radius);
    border: 1px solid var(--nrd-border);
}
.nrd-si-tier-label {
    font-family: var(--nrd-font);
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.45rem;
    padding-bottom: 0.35rem;
    border-bottom: 2px solid var(--nrd-border);
}
.nrd-si-tier-dangerous .nrd-si-tier-label { color: var(--combo-dangerous); border-bottom-color: color-mix(in srgb, var(--combo-dangerous) 30%, transparent); }
.nrd-si-tier-unsafe .nrd-si-tier-label    { color: var(--combo-unsafe); border-bottom-color: color-mix(in srgb, var(--combo-unsafe) 30%, transparent); }
.nrd-si-tier-caution .nrd-si-tier-label   { color: var(--combo-caution-text); border-bottom-color: color-mix(in srgb, var(--combo-caution-text) 20%, transparent); }
.nrd-si-tier-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.nrd-si-tier-list li {
    font-size: 0.78rem;
    color: var(--text);
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(128,128,128,0.04);
    line-height: 1.5;
}
.nrd-si-tier-list li:last-child { border-bottom: none; }

/* ── Harm Potential Cards ───────────────────────────────────────────── */
.nrd-si-harm-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
.nrd-si-harm-card {
    padding: 0.85rem 1rem;
    border: 1px solid var(--nrd-border);
    border-radius: var(--nrd-radius);
}
.nrd-si-harm-label {
    display: block;
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
}
.nrd-si-harm-value {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text);
    line-height: 1.5;
}
.nrd-si-harm-detail {
    font-size: 0.78rem;
    color: var(--text);
    margin: 0.2rem 0;
    line-height: 1.5;
}
.nrd-si-harm-detail strong {
    color: var(--text-muted);
    font-weight: 600;
    font-size: 0.72rem;
}

/* ── Chemical Identification ────────────────────────────────────────── */
.nrd-si-ident-grid {
    border: 1px solid var(--nrd-border);
    border-radius: var(--nrd-radius);
    overflow: hidden;
}
.nrd-si-ident-row {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    padding: 0.5rem 1rem;
    border-bottom: 1px solid rgba(128,128,128,0.04);
}
.nrd-si-ident-row:last-child { border-bottom: none; }
.nrd-si-ident-row:nth-child(even) { background: var(--nrd-table-stripe); }
.nrd-si-ident-key {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    min-width: 130px;
    flex-shrink: 0;
}
.nrd-si-ident-val {
    font-size: 0.8rem;
    color: var(--text);
    word-break: break-all;
}
.nrd-si-ident-mono {
    font-family: var(--nrd-mono);
    font-size: 0.75rem;
}
.nrd-si-ident-smiles {
    font-size: 0.68rem;
    opacity: 0.85;
}

/* ── Legal Status ───────────────────────────────────────────────────── */
.nrd-si-intl-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 0.85rem;
}
.nrd-si-intl-badge {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 3px;
    background: var(--danger-tint);
    color: var(--danger);
    border: 1px solid color-mix(in srgb, var(--danger) 20%, transparent);
    letter-spacing: 0.02em;
}
.nrd-si-legality-table td:first-child { font-weight: 500; }
.nrd-si-status-badge {
    font-family: var(--nrd-mono);
    font-size: 0.68rem;
    font-weight: 500;
    padding: 0.15rem 0.45rem;
    border-radius: 3px;
    border: 1px solid var(--nrd-border);
}
.nrd-si-legality-notes {
    font-size: 0.72rem;
    color: var(--text-muted);
    max-width: 300px;
}

/* ── History & Culture ──────────────────────────────────────────────── */
.hc-intro {
    font-size: 0.88rem;
    line-height: 1.7;
    color: var(--text);
    margin-bottom: 1rem;
    opacity: 0.92;
}
.hc-sections {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.hc-section {
    padding: 0;
    margin-bottom: 0.9rem;
}
.hc-section-title {
    font-size: 0.82rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
    color: var(--text);
}
.hc-date-range {
    font-size: 0.68rem;
    font-weight: 600;
    color: var(--accent, #ff008b);
    white-space: nowrap;
}
.hc-section-text {
    font-size: 0.85rem;
    line-height: 1.75;
    color: var(--text);
    margin: 0;
    opacity: 0.9;
}
/* Read-more button is .ss-btn ss-btn--ghost ss-btn--pill ss-btn--sm in the
   markup; only the chevron flip stays page-local. */
.hc-read-more-chevron {
    transition: transform 0.2s;
}
.hc-read-more-open .hc-read-more-chevron {
    transform: rotate(180deg);
}

/* Subjective Effect Notes */
/* Divider variant when notes follow History & Culture content (replaces the
   old conditional inline style in stats.html) */
.hc-subj-notes--divided {
    margin-top: 1.25rem;
    padding-top: 1rem;
    border-top: 1px solid var(--nrd-border);
}
/* Inline key inside an italic narrative paragraph (used with .ss-label) */
.effects-narrative-key {
    font-style: normal;
}
.effects-narrative {
    font-size: 0.84rem;
    line-height: 1.65;
    color: var(--text);
    opacity: 0.88;
    font-style: italic;
    margin: 0 0 0.65rem;
    padding: 0.55rem 0.85rem;
    border-left: 2px solid var(--accent, #ff008b);
}
body.dark .effects-narrative {
    background: rgba(255,255,255,0.015);
}
.effects-narrative-sub {
    margin: 0.3rem 0 0.6rem;
    font-size: 0.8rem;
    border-left-width: 2px;
    opacity: 0.82;
}

/* ── Subjective Effect Index breakdown (the "components" the notes name) ── */
.sei-cat {
    margin: 0.9rem 0 0;
}
.sei-cat-title {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--accent, #ff008b);
    margin: 0 0 0.2rem;
}
.sei-cat-note {
    margin-top: 0.2rem;
}
.sei-group {
    margin: 0.5rem 0 0.5rem 0.15rem;
    padding-left: 0.75rem;
    border-left: 2px solid var(--nrd-border);
}
.sei-group-label {
    font-family: var(--nrd-mono);
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    opacity: 0.7;
    margin-bottom: 0.3rem;
}
.sei-group-note {
    font-size: 0.78rem;
    line-height: 1.55;
    opacity: 0.8;
    font-style: italic;
    margin: 0 0 0.4rem;
}
/* Author credit for the subjective-effect write-ups (DoseWiki / Josie Kins) */
.sei-attribution {
    font-size: 0.76rem;
    line-height: 1.55;
    opacity: 0.75;
    margin: 0.9rem 0 0;
    padding-top: 0.6rem;
    border-top: 1px solid var(--border);
}
.sei-effects {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.sei-effect {
    font-size: 0.8rem;
    line-height: 1.55;
    color: var(--text);
}
.sei-effect-name {
    font-weight: 600;
}
.sei-effect-desc {
    opacity: 0.78;
}

/* ── Dose-Response Table ────────────────────────────────────────────── */
.nrd-drc-details { margin-top: 0.6rem; }
.nrd-drc-toggle {
    font-family: var(--nrd-mono);
    font-size: 0.7rem;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0;
    user-select: none;
    letter-spacing: 0.02em;
}
.nrd-drc-toggle:hover { color: var(--accent); }
.nrd-drc-table-wrap {
    overflow-x: auto;
    margin-top: 0.5rem;
    border-radius: var(--nrd-radius);
    border: 1px solid var(--nrd-border);
}
.nrd-drc-table {
    width: 100%;
    font-size: 0.75rem;
    border-collapse: collapse;
}
.nrd-drc-table th,
.nrd-drc-table td {
    padding: 0.4rem 0.55rem;
    text-align: center;
}
.nrd-drc-table thead th {
    font-family: var(--nrd-mono);
    font-weight: 600;
    color: var(--text-muted);
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 2px solid var(--nrd-rule);
    position: sticky;
    top: 0;
}
.nrd-drc-table tbody tr { border-bottom: 1px solid rgba(128,128,128,0.04); }
.nrd-drc-table tbody tr:nth-child(even) { background: var(--nrd-table-stripe); }
.nrd-drc-table td:first-child,
.nrd-drc-table th:first-child { text-align: left; font-weight: 500; }
.nrd-drc-table td {
    font-family: var(--nrd-mono);
    font-variant-numeric: tabular-nums;
    font-size: 0.72rem;
}
.nrd-drc-n {
    font-size: var(--fs-micro);
    color: var(--text-muted);
    opacity: 0.6;
}

/* ── Dose stats ─────────────────────────────────────────────────────── */
.nrd-dose-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 0.65rem;
    font-size: 0.78rem;
    color: var(--text-muted);
}
.nrd-dose-stats strong {
    font-family: var(--nrd-mono);
    color: var(--text);
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

/* ── Combination links ──────────────────────────────────────────────── */
.nrd-combo-link { color: var(--accent); text-decoration: none; }
.nrd-combo-link:hover { text-decoration: underline; }

/* ── External link ──────────────────────────────────────────────────── */
/* The Erowid link itself is .ss-btn ss-btn--outline in the markup. */
.nrd-ext-link { text-align: center; margin: 1.5rem 0 0.5rem; }

/* ── Card overrides ─────────────────────────────────────────────────── */
.stats-page .report-link-card { border-radius: var(--nrd-radius); }

/* ── Back card ──────────────────────────────────────────────────────── */
.nrd-back-card {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.25rem;
    margin-top: 2.5rem;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.82rem;
    font-weight: 500;
    border-radius: var(--nrd-radius);
    border: 1px solid var(--nrd-border);
    transition: color 0.2s, border-color 0.2s;
}
.nrd-back-card:hover {
    color: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
}

/* ── Citations ──────────────────────────────────────────────────────── */
.nrd-si-cite-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.4rem;
}

/* ── Animations ─────────────────────────────────────────────────────── */
@keyframes nrdFadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
}
.nrd-hero {
    animation: nrdFadeUp 0.3s ease-out both;
}
@media (prefers-reduced-motion: reduce) {
    .nrd-section,
    .nrd-hero {
        animation: none;
    }
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .nrd-card-grid-2 { grid-template-columns: 1fr; }
    .nrd-card-grid-4,
    .nrd-metadata-bar {
        flex-wrap: wrap;
    }
    .nrd-card-grid-4 .nrd-metric,
    .nrd-metadata-bar .nrd-metric {
        flex: 1 1 40%;
        border-right: none;
        border-bottom: 1px solid var(--nrd-border);
    }
    .nrd-hero {
        flex-direction: column;
        gap: 1rem;
        padding: 1rem 0;
    }
    .nrd-hero-structure {
        width: 100%;
        height: 100px;
        order: -1;
    }
    .nrd-title { font-size: 1.45rem; }
    .nrd-ep-body { grid-template-columns: 1fr; }
    .nrd-ep-dim-label { min-width: 95px; font-size: 0.7rem; }
    .nrd-ep-header { flex-wrap: wrap; }
    .nrd-ep-name { min-width: auto; }
    .nrd-charts-grid { grid-template-columns: 1fr; }
    .nrd-si-harm-grid { grid-template-columns: 1fr; }
    .nrd-si-ident-key { min-width: 100px; }
    .nrd-metrics { gap: 0.5rem; }
    .nrd-subtitle { margin-left: 0; }
}

/* ── BlueLight-specific styles ──────────────────────────────────────── */
.nrd-ep-dim-marker-bl {
    background: rgba(80,160,255,0.8);
}
.nrd-ep-dim-bl {
    font-size: var(--fs-micro);
    font-weight: 500;
    color: rgba(80,160,255,0.75);
    margin-left: 1px;
}
.nrd-ep-dim-bl::before { content: '/'; color: var(--nrd-border); }

.nrd-badge-bl {
    background: rgba(80,160,255,0.12) !important;
    color: rgba(80,160,255,0.9) !important;
    border: 1px solid rgba(80,160,255,0.2) !important;
}

.nrd-metric-positive { color: var(--success); }
.nrd-metric-negative { color: var(--danger); }
.nrd-metric-neutral  { color: rgba(156,163,175,0.7); }

/* Sentiment Grid */
.nrd-sentiment-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 1.25rem;
}
.nrd-sentiment-col {
    background: var(--tint-1);
    border: 1px solid var(--nrd-border);
    border-radius: var(--nrd-radius);
    padding: 1rem;
}
.nrd-sentiment-title {
    font-family: var(--nrd-font);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nrd-sent-count {
    font-family: var(--nrd-mono);
    font-size: 0.65rem;
    background: var(--tint-2);
    padding: 1px 6px;
    border-radius: 3px;
    color: var(--text-muted);
}
.nrd-sent-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.nrd-sent-dot-pos { background: color-mix(in srgb, var(--success) 70%, transparent); }
.nrd-sent-dot-neg { background: color-mix(in srgb, var(--danger) 70%, transparent); }

.nrd-sentiment-list {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.nrd-sent-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.72rem;
}
.nrd-sent-name {
    min-width: 120px;
    max-width: 160px;
    font-weight: 500;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.nrd-sent-bar-wrap {
    flex: 1;
    height: 4px;
    background: var(--tint-2);
    border-radius: 2px;
    overflow: hidden;
}
.nrd-sent-bar {
    display: block;
    height: 100%;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nrd-sent-bar-pos { background: color-mix(in srgb, var(--success) 60%, transparent); }
.nrd-sent-bar-neg { background: color-mix(in srgb, var(--danger) 60%, transparent); }

.nrd-sent-pct {
    font-family: var(--nrd-mono);
    font-size: 0.65rem;
    color: var(--text-muted);
    min-width: 32px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.nrd-sent-conf {
    font-family: var(--nrd-mono);
    font-size: var(--fs-micro);
    color: var(--text-muted);
    opacity: 0.6;
    min-width: 28px;
    text-align: right;
    cursor: help;
}

@media (max-width: 768px) {
    .nrd-sentiment-grid { grid-template-columns: 1fr; }
    .nrd-sent-name { min-width: 90px; max-width: 120px; }
}

@media (max-width: 480px) {
    .nrd-card-grid-4,
    .nrd-metadata-bar {
        flex-direction: column;
    }
    .nrd-card-grid-4 .nrd-metric,
    .nrd-metadata-bar .nrd-metric {
        flex: 1 1 100%;
        flex-direction: row;
        justify-content: space-between;
        padding: 0.5rem 0.75rem;
        border-bottom: 1px solid var(--nrd-border);
        border-right: none;
    }
    .nrd-metric-label { text-transform: none; text-align: right; }
    .nrd-content-card { padding: 0.85rem; }
    .stats-page { padding: 0.5rem 0.75rem 2.5rem; }
    .nrd-hero { padding: 0.75rem 0; }
    .nrd-title { font-size: 1.25rem; }
    .nrd-ep-dim-label { min-width: 75px; font-size: 0.66rem; }
    .nrd-ep-dim-weight { display: none; }
    .nrd-ep-class { padding: 0.85rem 0; }
    .nrd-metrics { flex-direction: column; }
    .nrd-dose-stats { flex-direction: column; gap: 0.2rem; }
    .nrd-section-head { padding-left: 0; }
    .nrd-si-ident-row { flex-direction: column; gap: 0.15rem; }
    .nrd-si-ident-key { min-width: unset; }
    .nrd-si-legality-notes { max-width: none; }
}

/* ── Measured affinities (GtoPdb) — nerd/stats page ──────────────────────────────────────
   Lives inside .nrd-section, so no container chrome of its own.
   A data table, not prose: tabular figures so the concentration column
   lines up, and its own horizontal scroller so seven columns never make
   the page body scroll sideways on a phone. */
.gtp-badge {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    background: rgba(var(--accent-rgb), 0.12);
    color: var(--accent);
    border: 1px solid rgba(var(--accent-rgb), 0.28);
    text-decoration: none;
    white-space: nowrap;
}
.gtp-badge:hover { background: rgba(var(--accent-rgb), 0.2); }
.gtp-intro {
    margin: 0 0 0.9rem;
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.55;
}
.gtp-table-wrap {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg-elevated);
}
.gtp-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.86rem;
    min-width: 46rem;
}
.gtp-table th {
    text-align: left;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    font-weight: 700;
    padding: 0.6rem 0.7rem;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}
.gtp-table td {
    padding: 0.55rem 0.7rem;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
}
.gtp-table tbody tr:last-child td { border-bottom: none; }
.gtp-table tbody tr:hover { background: rgba(var(--accent-rgb), 0.05); }
.gtp-num {
    text-align: right;
    font-variant-numeric: tabular-nums;
    font-family: var(--font-mono);
    white-space: nowrap;
}
.gtp-conc { font-weight: 600; color: var(--text); }
.gtp-target { font-weight: 600; color: var(--text); }
.gtp-gene {
    display: block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-dim);
}
.gtp-action {
    display: inline-block;
    font-size: 0.74rem;
    padding: 0.12rem 0.45rem;
    border-radius: 4px;
    background: rgba(var(--accent-rgb), 0.1);
    color: var(--text-muted);
    white-space: nowrap;
}
.gtp-measure, .gtp-species { color: var(--text-muted); white-space: nowrap; }
.gtp-note, .gtp-credit {
    margin: 0.85rem 0 0;
    font-size: 0.8rem;
    color: var(--text-dim);
    line-height: 1.55;
}
.gtp-credit { font-size: 0.75rem; }
@media (max-width: 640px) {
        .gtp-table { font-size: 0.8rem; }
}
