/* ==========================================================================
   HealthSignal design system — v3 "Formation" redesign
   Warm editorial aesthetic: cream ground, ink text, hairline rules,
   mono micro-labels, dark buttons, ruled data rows. Blue accent.
   Shared across all public templates. Page-specific CSS stays inline
   in each template.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design tokens
   -------------------------------------------------------------------------- */
:root {
    /* Core palette */
    --bg: #faf4ee;                          /* warm cream page ground */
    --ink: #1f1f1f;                         /* near-black text */
    --ink-rgb: 31, 31, 31;
    --text-secondary: rgba(31, 31, 31, 0.66);
    --text-muted: rgba(31, 31, 31, 0.45);
    --hairline: rgba(31, 31, 31, 0.15);     /* signature thin rules */
    --hairline-soft: rgba(31, 31, 31, 0.08);
    --surface: #f2eae1;                     /* warm light-grey panels */
    --surface-raised: #fffdfa;              /* warm white (inputs, dropdowns) */

    /* Accents — HealthSignal blue replaces Formation green */
    --blue: #74b4f5;                        /* soft brand blue: dots, bars, motifs */
    --blue-deep: #2563eb;                   /* links, active nav underline */

    /* Impact — semantic, warmed to sit on cream */
    --impact-high: #d6452e;
    --impact-medium: #d9820f;
    --impact-low: #2f9e6e;

    /* Category dot colors */
    --cat-pharma: #d9820f;
    --cat-devices: #b56a9f;
    --cat-digital: #74b4f5;
    --cat-clinical: #7f7ac7;
    --cat-data: #4d9db5;
    --cat-market: #2f9e6e;
    --cat-general: #8b8378;

    /* Typography */
    --font-sans: 'Instrument Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, ui-sans-serif, system-ui, sans-serif;
    --font-mono: 'Geist Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

    --text-display: clamp(38px, 5vw, 58px); /* page hero headlines */
    --text-title: 32px;                     /* section headlines */
    --text-subtitle: 21px;
    --text-body: 16px;
    --text-small: 14px;
    --text-label: 11.5px;                   /* mono micro-labels */

    /* Rhythm & shape */
    --gutter: 20px;
    --rhythm: 120px;                        /* section vertical spacing */
    --rhythm-half: 60px;
    --radius: 10px;                         /* media, panels */
    --radius-btn: 5px;
    --header-h: 60px;
    --btn-h: 40px;
    --site-max: 1280px;

    --speed: 0.2s;
    --speed-slow: 0.35s;

    --z-dropdown: 1000;
    --z-header: 1010;
    --z-modal: 1020;

    --row-hover: rgba(31, 31, 31, 0.025);  /* shared list-row hover tint */
}

/* --------------------------------------------------------------------------
   2. Reset + base
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    scroll-padding-top: var(--header-h);
}

html,
body {
    margin: 0;
    padding: 0;
    /* clip (not hidden) blocks horizontal overflow WITHOUT creating a scroll
       container, so the sticky header keeps working */
    overflow-x: clip;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-body);
    line-height: 1.5;
    color: var(--ink);
    background-color: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

img,
svg {
    max-width: 100%;
    display: block;
}

a {
    color: var(--blue-deep);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

h1, h2, h3, h4 {
    margin: 0;
    font-weight: 500;
    letter-spacing: -0.015em;
    line-height: 1.12;
}

p {
    margin: 0 0 1em;
}

button {
    font-family: inherit;
}

::selection {
    background: rgba(116, 180, 245, 0.35);
}

:focus-visible {
    outline: 2px solid var(--blue-deep);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Layout primitives
   -------------------------------------------------------------------------- */
.container {
    max-width: var(--site-max);
    margin-left: auto;
    margin-right: auto;
    padding-left: var(--gutter);
    padding-right: var(--gutter);
    width: 100%;
}

.section {
    padding-top: var(--rhythm-half);
    padding-bottom: var(--rhythm-half);
}

.rule-top {
    border-top: 1px solid var(--hairline);
}

/* --------------------------------------------------------------------------
   4. Typography helpers
   -------------------------------------------------------------------------- */
.eyebrow {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.display {
    font-size: var(--text-display);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.05;
    color: var(--ink);
    text-wrap: balance;
}

.section-title {
    font-size: var(--text-title);
    font-weight: 500;
    letter-spacing: -0.015em;
}

.lede {
    font-size: var(--text-subtitle);
    line-height: 1.45;
    color: var(--text-secondary);
    font-weight: 400;
}

.mono {
    font-family: var(--font-mono);
    font-variant-numeric: tabular-nums;
}

/* --------------------------------------------------------------------------
   5. Header
   -------------------------------------------------------------------------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    height: var(--header-h);
    background: var(--bg);
    border-bottom: 1px solid var(--ink);
    transition: background-color var(--speed), box-shadow var(--speed),
        border-color var(--speed), backdrop-filter var(--speed);
}

/* Frosted-glass state once the page is scrolled off the top */
.site-header.is-scrolled {
    background: rgba(250, 244, 238, 0.80);   /* --bg #faf4ee at 80% */
    -webkit-backdrop-filter: blur(12px) saturate(140%);
    backdrop-filter: blur(12px) saturate(140%);
    border-bottom-color: var(--hairline);
    box-shadow: 0 6px 24px rgba(31, 31, 31, 0.06);
}

/* Fallback when backdrop-filter is unsupported: stay near-opaque for legibility */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .site-header.is-scrolled {
        background: rgba(250, 244, 238, 0.96);
    }
}

.site-header__inner {
    max-width: var(--site-max);
    margin: 0 auto;
    padding: 0 var(--gutter);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-weight: 600;
    font-size: 20px;
    line-height: 1;
    letter-spacing: -0.01em;
    text-decoration: none;
}

/* Optically center the wordmark against the square logo mark: the font's
   line box sits slightly low next to the glyph, so nudge the text up a hair. */
.brand-text {
    display: inline-block;
    transform: translateY(-1px);
}

.brand:hover {
    text-decoration: none;
    color: var(--ink);
}

.brand svg {
    color: var(--ink);
}

/* Signal-matrix brand mark (deep blue on cream, header + footer) */
.brand svg.brand-mark {
    width: 22px;
    height: 22px;
    flex: 0 0 auto;
    color: var(--blue-deep);
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 28px;
}

.site-nav .nav-link {
    position: relative;
    color: var(--ink);
    font-size: 15px;
    font-weight: 450;
    text-decoration: none;
    padding: 4px 0;
}

.site-nav .nav-link:hover {
    color: var(--blue-deep);
    text-decoration: none;
}

.site-nav .nav-link.active {
    color: var(--ink);
}

.site-nav .nav-link.active::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: -2px;
    height: 2px;
    background: var(--blue-deep);
}

/* API link: compact mono badge-button, visually set off from the text links */
.site-nav .nav-link--api {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-btn);
    padding: 5px 10px;
    transition: background var(--speed), color var(--speed), border-color var(--speed);
}

.site-nav .nav-link--api:hover {
    background: var(--ink);
    border-color: var(--ink);
    color: var(--bg);
}

.site-nav .nav-link--api.active {
    border-color: var(--ink);
}

.site-nav .nav-link--api.active::after {
    display: none;
}

/* Burger (mobile) */
.nav-burger {
    display: none;
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--ink);
}

.nav-burger span {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    margin: 4px 0;
    transition: transform var(--speed), opacity var(--speed);
}

@media (max-width: 720px) {
    .nav-burger {
        display: block;
    }

    .site-nav {
        position: absolute;
        top: var(--header-h);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        background: var(--bg);
        border-bottom: 1px solid var(--ink);
        padding: 8px var(--gutter) 16px;
        display: none;
    }

    .site-header.nav-open .site-nav {
        display: flex;
    }

    .site-header.nav-open .nav-burger span:nth-child(1) {
        transform: translateY(6px) rotate(45deg);
    }

    .site-header.nav-open .nav-burger span:nth-child(2) {
        opacity: 0;
    }

    .site-header.nav-open .nav-burger span:nth-child(3) {
        transform: translateY(-6px) rotate(-45deg);
    }

    .site-nav .nav-link {
        padding: 12px 0;
        font-size: 17px;
        width: 100%;
    }

    .site-nav .nav-link.active::after {
        display: none;
    }

    .site-nav .nav-link.active {
        color: var(--blue-deep);
    }

    /* Keep the API badge self-sized in the stacked menu */
    .site-nav .nav-link--api {
        width: auto;
        align-self: flex-start;
        font-size: 12px;
        padding: 6px 12px;
        margin-top: 10px;
    }
}

/* --------------------------------------------------------------------------
   6. Buttons
   -------------------------------------------------------------------------- */
.btn-dark,
.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: var(--btn-h);
    padding: 0 16px;
    border-radius: var(--radius-btn);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 450;
    line-height: 1;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--speed), color var(--speed), border-color var(--speed);
    white-space: nowrap;
}

.btn-dark {
    background: var(--ink);
    color: var(--bg);
    border: 1px solid var(--ink);
}

.btn-dark:hover {
    background: #3a3a3a;
    color: var(--bg);
    text-decoration: none;
}

.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1px solid var(--ink);
}

.btn-ghost:hover {
    background: var(--ink);
    color: var(--bg);
    text-decoration: none;
}

.btn-arrow {
    font-family: var(--font-sans);
    transition: transform var(--speed);
}

.btn-dark:hover .btn-arrow,
.btn-ghost:hover .btn-arrow {
    transform: translateX(3px);
}

/* --------------------------------------------------------------------------
   7. Chips (category pills with colored dots)
   -------------------------------------------------------------------------- */
.chip {
    display: inline-flex;
    align-items: flex-start;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: var(--text-label);
    line-height: 1.35;
    letter-spacing: 0.03em;
    color: var(--text-secondary);
    white-space: normal;
    background: transparent;
}

.chip::before {
    content: '';
    width: 7px;
    height: 7px;
    margin-top: 4px;
    border-radius: 50%;
    background: var(--cat-general);
    flex: none;
}

.chip--pharmaceuticals::before { background: var(--cat-pharma); }
.chip--medical-devices::before { background: var(--cat-devices); }
.chip--digital-health-ai::before { background: var(--cat-digital); }
.chip--clinical-trials::before { background: var(--cat-clinical); }
.chip--health-data-privacy::before { background: var(--cat-data); }
.chip--market-access-reimbursement::before { background: var(--cat-market); }
.chip--general-regulatory::before { background: var(--cat-general); }

/* --------------------------------------------------------------------------
   8. Impact indicator
   -------------------------------------------------------------------------- */
.impact-flag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-secondary);
    white-space: nowrap;
}

.impact-flag::before {
    content: '';
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex: none;
    background: var(--text-muted);
}

.impact-flag--high::before { background: var(--impact-high); }
.impact-flag--medium::before { background: var(--impact-medium); }
.impact-flag--low::before { background: var(--impact-low); }

/* --------------------------------------------------------------------------
   9. Ruled feed table (regulation rows)
   -------------------------------------------------------------------------- */
.feed-head {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px 130px 118px 96px;
    gap: 20px;
    align-items: center;
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--hairline);
}

.feed-head span {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.feed-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 230px 130px 118px 96px;
    gap: 20px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--hairline);
    transition: background var(--speed);
}

.feed-row:hover {
    background: var(--row-hover);
}

.feed-row__main {
    min-width: 0;
}

.feed-row__title {
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1.3;
    color: var(--ink);
    margin: 0 0 4px;
}

.feed-row__title a {
    color: inherit;
    text-decoration: none;
}

.feed-row__title a:hover {
    color: var(--blue-deep);
}

.feed-row__sub {
    font-size: var(--text-small);
    line-height: 1.45;
    color: var(--text-secondary);
    margin: 0 0 6px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.feed-row__source {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.feed-row__date {
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-secondary);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.feed-row__actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
}

.row-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: none;
    border-radius: var(--radius-btn);
    color: var(--text-muted);
    font-size: 15px;
    opacity: 0.55;
    cursor: pointer;
    transition: color var(--speed), background var(--speed), opacity var(--speed);
    text-decoration: none;
}

.row-action svg {
    display: block;
}

.feed-row:hover .row-action {
    opacity: 1;
}

.row-action:hover {
    color: var(--ink);
    background: rgba(31, 31, 31, 0.06);
    text-decoration: none;
}

.row-action.is-saved {
    color: var(--blue-deep);
    opacity: 1;
}

.row-action--open {
    color: var(--ink);
}

.row-action--open:hover {
    color: var(--blue-deep);
}

@media (max-width: 980px) {
    .feed-head {
        display: none;
    }

    .feed-row {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-areas:
            "main actions"
            "meta actions";
        row-gap: 10px;
    }

    .feed-row__main { grid-area: main; }
    .feed-row__actions { grid-area: actions; align-self: start; }

    .feed-row__meta-mobile {
        grid-area: meta;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px 14px;
    }
}

@media (min-width: 981px) {
    .feed-row__meta-mobile {
        display: contents;
    }
}

/* --------------------------------------------------------------------------
   10. Filter bar (canonical, shared: feed / deadlines / sources)
       NOTE: IDs and .multi-select-* / *-checkbox class names are a frozen
       JS API — style them, never rename them.
   -------------------------------------------------------------------------- */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 14px;
    padding: 18px 0;
}

.filter-search {
    position: relative;
    width: 100%;
}

.filter-search input {
    width: 100%;
    height: var(--btn-h);
    padding: 0 14px 0 38px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-btn);
    background: var(--surface-raised);
    font-family: var(--font-sans);
    font-size: 15px;
    color: var(--ink);
    transition: border-color var(--speed);
}

.filter-search input::placeholder {
    color: var(--text-muted);
}

.filter-search input:focus {
    outline: none;
    border-color: var(--ink);
}

.filter-search .search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    width: 16px;
    height: 16px;
}

.filter-group {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1 1 0;
    min-width: 150px;
}

/* Search sits full-width on its own row; dropdowns share the row below it. */
.filter-group--search {
    flex: 1 1 100%;
    width: 100%;
}

.filter-label {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

.multi-select-wrapper {
    position: relative;
}

.multi-select-input {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: var(--btn-h);
    padding: 0 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-btn);
    background: var(--surface-raised);
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    user-select: none;
    transition: border-color var(--speed);
    white-space: nowrap;
    overflow: hidden;
}

.multi-select-input:hover {
    border-color: var(--ink);
}

.multi-select-wrapper.active .multi-select-input {
    border-color: var(--ink);
}

.multi-select-input .caret {
    flex: none;
    width: 12px;
    height: 12px;
    color: var(--text-muted);
    transition: transform var(--speed);
}

.multi-select-wrapper.active .caret {
    transform: rotate(180deg);
}

.multi-select-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    min-width: 100%;
    max-height: 280px;
    overflow-y: auto;
    background: var(--surface-raised);
    border: 1px solid var(--ink);
    border-radius: var(--radius-btn);
    padding: 6px;
    z-index: var(--z-dropdown);
    display: none;
}

.multi-select-dropdown.active {
    display: block;
}

.multi-select-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 4px;
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}

.multi-select-option:hover {
    background: var(--surface);
}

.multi-select-option input[type="checkbox"] {
    accent-color: var(--ink);
    width: 15px;
    height: 15px;
    margin: 0;
    flex: none;
}

.filter-select {
    height: var(--btn-h);
    padding: 0 34px 0 12px;
    border: 1px solid var(--hairline);
    border-radius: var(--radius-btn);
    background: var(--surface-raised) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%231f1f1f' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    font-family: var(--font-sans);
    font-size: 14px;
    color: var(--ink);
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    transition: border-color var(--speed);
}

.filter-select:hover,
.filter-select:focus {
    outline: none;
    border-color: var(--ink);
}

.clear-filters-btn {
    flex: 0 0 auto;
    height: var(--btn-h);
    padding: 0 14px;
    border: none;
    background: none;
    border-radius: var(--radius-btn);
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--speed);
    white-space: nowrap;
}

.clear-filters-btn:hover {
    color: var(--impact-high);
}

/* --------------------------------------------------------------------------
   11. Stat strip (KPIs between hairlines)
   -------------------------------------------------------------------------- */
.stat-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    border-top: 1px solid var(--hairline);
    border-bottom: 1px solid var(--hairline);
}

.stat-cell {
    padding: 22px 24px 22px 0;
    border-right: 1px solid var(--hairline);
}

.stat-cell:not(:first-child) {
    padding-left: 24px;
}

.stat-cell:last-child {
    border-right: none;
}

.stat-cell .stat-label {
    display: block;
    font-family: var(--font-mono);
    font-size: var(--text-label);
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-cell .stat-value {
    font-size: 19px;
    font-weight: 500;
    letter-spacing: -0.01em;
    color: var(--ink);
}

@media (max-width: 720px) {
    .stat-strip {
        grid-template-columns: 1fr 1fr;
    }

    .stat-cell,
    .stat-cell:not(:first-child) {
        padding: 16px;
        border-right: none;
        border-bottom: 1px solid var(--hairline-soft);
    }
}

/* --------------------------------------------------------------------------
   13. Empty state
   -------------------------------------------------------------------------- */
.empty-state {
    padding: var(--rhythm-half) 0;
    text-align: center;
    color: var(--text-secondary);
}

.empty-state h3 {
    font-size: 20px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--ink);
}

.empty-state p {
    font-size: var(--text-small);
    color: var(--text-muted);
}

/* --------------------------------------------------------------------------
   14. Notifications (share/save feedback)
   -------------------------------------------------------------------------- */
.notification {
    position: fixed;
    top: calc(var(--header-h) + 16px);
    right: 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    max-width: 380px;
    padding: 13px 16px;
    background: var(--ink);
    color: var(--bg);
    border-radius: var(--radius-btn);
    font-size: 14px;
    z-index: var(--z-modal);
    animation: hs-slide-in 0.25s ease-out;
}

.notification-error {
    background: var(--impact-high);
}

.notification .notification-close {
    background: none;
    border: none;
    color: inherit;
    opacity: 0.7;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    padding: 2px;
}

.notification .notification-close:hover {
    opacity: 1;
}

@keyframes hs-slide-in {
    from {
        transform: translateX(24px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* --------------------------------------------------------------------------
   15. Footer
   -------------------------------------------------------------------------- */
.site-footer {
    margin-top: var(--rhythm);
    border-top: 1px solid var(--ink);
    background: var(--bg);
}

.footer-cta__text {
    max-width: 520px;
}

.footer-cta__text .eyebrow {
    display: block;
    line-height: 1.4;
    margin: 0 0 18px;
}

.footer-cta__headline {
    font-size: clamp(24px, 2.6vw, 32px);
    font-weight: 500;
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 24px;
}

.footer-columns {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    gap: 64px;
    padding: var(--rhythm-half) 0;
}

.footer-nav {
    display: flex;
    gap: 80px;
}

.footer-col {
    min-width: 150px;
}

.from-heal {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    color: var(--text-muted);
}

.meta-divider {
    width: 1px;
    height: 18px;
    background: currentColor;
    opacity: 0.35;
    flex: none;
}

.from-heal img {
    height: 34px;
    width: auto;
    display: block;
    /* white logo on cream: invert to ink */
    filter: invert(1) brightness(0.25);
    transition: opacity var(--speed);
}

.from-heal a:hover img {
    opacity: 0.7;
}

.footer-col h4 {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1.4;
    margin: 0 0 18px;
}

.footer-col ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.footer-col li {
    margin-bottom: 12px;
}

.footer-col a {
    color: var(--ink);
    font-size: 15px;
    text-decoration: none;
}

.footer-col a:hover {
    color: var(--blue-deep);
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* Meta band spans the viewport so its rule runs edge-to-edge like the footer's top rule */
.footer-meta-band {
    border-top: 1px solid var(--hairline);
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 24px;
    padding: 24px 0;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.footer-meta .footer-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 20px;
}

.footer-meta strong {
    color: var(--text-secondary);
    font-weight: 500;
}

.footer-identity {
    display: flex;
    align-items: center;
    gap: 14px;
}

.footer-identity .brand {
    font-size: 16px;
}

.footer-meta__end {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 24px;
}

@media (max-width: 860px) {
    .footer-columns {
        grid-template-columns: 1fr;
        gap: 44px;
    }

    .footer-nav {
        gap: 48px;
    }
}

/* --------------------------------------------------------------------------
   16. Prose (legal pages)
   -------------------------------------------------------------------------- */
.prose {
    max-width: 880px;
    margin: 0 auto;
    padding: var(--rhythm-half) var(--gutter) 0;
}

.prose h1 {
    font-size: clamp(30px, 4vw, 42px);
    margin-bottom: 12px;
}

.prose .prose-updated {
    font-family: var(--font-mono);
    font-size: 12.5px;
    color: var(--text-muted);
    margin-bottom: 40px;
}

.prose h2 {
    font-size: 21px;
    font-weight: 500;
    margin: 40px 0 12px;
    padding-top: 28px;
    border-top: 1px solid var(--hairline);
}

.prose h3 {
    font-size: 17px;
    font-weight: 500;
    margin: 24px 0 8px;
}

.prose p,
.prose li {
    font-size: 15.5px;
    line-height: 1.65;
    color: var(--text-secondary);
}

.prose ul {
    padding-left: 22px;
}

.prose strong {
    color: var(--ink);
}

/* --------------------------------------------------------------------------
   17. Page hero (shared pattern)
   -------------------------------------------------------------------------- */
.page-hero {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 20px;
    padding: var(--rhythm-half) 0 40px;
}

.page-hero__text .eyebrow {
    display: block;
    margin-bottom: 18px;
}

.page-hero__aside {
    max-width: 620px;
    font-size: 17px;
    line-height: 1.55;
    color: var(--text-secondary);
}

/* --------------------------------------------------------------------------
   18. Utilities
   -------------------------------------------------------------------------- */
.text-center { text-align: center; }
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

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

/* --------------------------------------------------------------------------
   19. Shared feed/deadlines components (filter tags, legend, loading, foot)
   -------------------------------------------------------------------------- */
.impact-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-right: 8px;
    vertical-align: baseline;
}

.impact-dot.high { background: var(--impact-high); }
.impact-dot.medium { background: var(--impact-medium); }
.impact-dot.low { background: var(--impact-low); }

.multi-select-tags {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
}

.selected-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 2px 8px;
    background: var(--surface);
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--ink);
    white-space: nowrap;
}

.selected-tag .tag-x {
    cursor: pointer;
    opacity: 0.5;
    font-size: 13px;
    line-height: 1;
}

.selected-tag .tag-x:hover {
    opacity: 1;
}

/* List toolbar: slim ruled bar under the filters — result count on the left,
   a docked control (e.g. impact-legend toggle) on the right.
   Gives each list a defined top edge; mirrors .feed-head rhythm. */
.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 16px;
    padding: 14px 0 10px;
    border-bottom: 1px solid var(--hairline);
}

.list-toolbar__count {
    font-family: var(--font-mono);
    font-size: var(--text-label);
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
}

/* Small "?" affordance next to the Impact filter label — opens a legend popover. */
.impact-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 15px;
    height: 15px;
    margin-left: 5px;
    padding: 0;
    border: 1px solid var(--hairline);
    border-radius: 50%;
    background: none;
    font-family: var(--font-mono);
    font-size: 10px;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    vertical-align: middle;
    transition: color var(--speed), border-color var(--speed);
}

.impact-help:hover,
.impact-help[aria-expanded="true"] {
    color: var(--ink);
    border-color: var(--ink);
}

.impact-help__popover {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 6px;
    width: 300px;
    max-width: calc(100vw - 2 * var(--gutter));
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px 14px;
    background: var(--surface-raised);
    border: 1px solid var(--ink);
    border-radius: var(--radius-btn);
    box-shadow: 0 6px 24px rgba(31, 31, 31, 0.08);
    z-index: var(--z-dropdown);
}

.impact-help__popover[hidden] {
    display: none;
}

.impact-guide__item {
    display: flex;
    align-items: baseline;
    gap: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Fixed-width label column so HIGH / MEDIUM / LOW align and the descriptions
   share a common left edge (otherwise MEDIUM's wider label sticks out). */
.impact-help__popover .impact-flag {
    flex: 0 0 68px;
}

.feed-loading {
    padding: 40px 0;
    font-family: var(--font-mono);
    font-size: 13px;
    color: var(--text-muted);
    text-align: center;
}

.feed-foot {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    padding: 26px 0 0;
}

.feed-count {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--text-muted);
}

.badge-new {
    font-family: var(--font-mono);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--blue-deep);
    text-transform: uppercase;
    margin-left: 8px;
}

.load-more-fade-in {
    animation: rowFadeIn 0.3s ease-out;
}

@keyframes rowFadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: none; }
}
