/* discover pages. Owned by the discover surface group; shared components live in ../app.css.
   Publications search, publication analysis (/summary/<id>), paper detail. */

/* ---- Publications: search field ---- */
.pub-search {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    height: 2.875rem;
    padding: 0 0.75rem 0 2.75rem;
    border: 1px solid var(--c-line);
    border-radius: 0.375rem;
    background: var(--c-raised);
}
/* Searches sit full width at the top of the results, as on the Wits site
   (publications, directory, institutions, insights). */
.list-search,
.list-search-wrap { margin-bottom: 1.5rem; }
.list-search-shell { height: 2.875rem; border-radius: 0.375rem; }
.pub-search:has(.app-autocomplete-open) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.pub-search-icon {
    position: absolute;
    left: 1rem;
    font-size: 1.15rem;
    color: var(--c-ink-3);
    pointer-events: none;
}
.pub-search input {
    flex: 1;
    min-width: 0;
    height: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    font-size: 1rem;
    color: var(--c-ink);
}
.pub-search input::placeholder { color: var(--c-ink-3); }
html.dark .pub-search input[type='text'] { background: transparent; }
.pub-search .app-autocomplete-menu {
    left: -1px;
    right: -1px;
    width: auto;
    border-bottom-left-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}
@media (max-width: 480px) {
    .pub-search { padding-left: 2.5rem; }
    .pub-search-icon { left: 0.875rem; }
}

/* ---- Discover lists: toolbar card, count chip, result cards ----
   Shared by publications, directory and institutions. */
.list-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 3.75rem;
    padding: 0.625rem 0.75rem 0.625rem 1rem;
    border: 1px solid var(--c-line);
    border-radius: 0.75rem;
    background: var(--c-raised);
    font-size: 0.875rem;
    color: var(--c-ink-2);
}
.list-bar.rounded-t-xl { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
.list-bar-label { display: inline-flex; align-items: center; gap: 0.5rem; min-width: 0; }
.list-bar-label i { font-size: 1rem; color: var(--c-ink-3); }
.list-count {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    height: 2.25rem;
    padding: 0 0.75rem;
    border: 1px solid var(--c-line);
    border-radius: 0.5rem;
    background: var(--c-surface);
    font-size: 0.875rem;
    color: var(--c-ink-2);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.list-count i { font-size: 1rem; color: var(--c-ink-3); }
.list-count b { font-weight: 600; color: var(--c-ink); }
@media (max-width: 479px) {
    .list-bar { padding-left: 0.75rem; }
    .list-count { padding: 0 0.625rem; }
    .list-count i { display: none; }
}
.list-card {
    border: 1px solid var(--c-line);
    border-radius: 0.75rem;
    background: var(--c-raised);
    transition: border-color 0.15s ease, box-shadow 0.2s ease, background-color 0.15s ease;
}
a.list-card:hover,
.list-card:has(a:hover) {
    border-color: var(--c-line-strong);
    box-shadow: 0 1px 2px 0 rgba(20, 26, 22, 0.05), 0 6px 16px -10px rgba(20, 26, 22, 0.22);
}
html.dark a.list-card:hover,
html.dark .list-card:has(a:hover) { box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.6); }

/* ---- Publications: toolbar + filter panel ---- */
.pub-tool-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    height: 2.25rem;
    min-width: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid var(--c-line);
    border-radius: 0.5rem;
    background: var(--c-raised);
    color: var(--c-ink-2);
    font-size: 0.8125rem;
    font-weight: 500;
    white-space: nowrap;
}
.pub-tool-btn i { font-size: 1rem; color: var(--c-ink-3); }
.pub-tool-icon { width: 2.25rem; padding: 0; }
.pub-tool-btn i.is-csv { color: #d4762c; }
.pub-tool-btn i.is-xlsx { color: #21895d; }
.pub-tool-btn:hover { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.pub-tool-btn:hover i { color: var(--c-ink-2); }
.pub-tool-btn.is-open { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary); }
.pub-tool-btn.is-open i { color: var(--c-primary); }
.pub-tool-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.375rem;
    border: 1px solid rgb(0 0 0 / 0.18);
    border-radius: 999px;
    background: var(--c-primary);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 650;
    font-variant-numeric: tabular-nums;
}
html.dark .pub-tool-badge { color: #101512; }
#filter-count:hover { background: #a5421c; color: #fff; }

.pub-filter-label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-ink);
}
.pub-filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0;
    font-size: 0.875rem;
    color: var(--c-ink-2);
    cursor: pointer;
}
.pub-filter-option:hover { color: var(--c-ink); }
.pub-filter-option input { accent-color: var(--c-primary); }
.pub-filter-count {
    flex: none;
    font-size: 0.75rem;
    color: var(--c-ink-3);
    font-variant-numeric: tabular-nums;
}
.pub-text-btn {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--c-primary);
}
.pub-text-btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }
.pub-text-btn-muted { color: var(--c-ink-3); font-weight: 500; }
.pub-text-btn-muted:hover { color: var(--c-ink); }

/* Switches: the on state is set by JS through bg-forest. */
.pub-switch.bg-forest { background-color: var(--c-primary); }
html.dark .pub-switch.bg-ink-200 { background-color: #3d4943; }

/* ---- Publications: result list ---- */
.pub-section-head {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-ink);
}
#papers-list { display: grid; gap: 0.75rem; }
.paper-row { padding: 1rem 1.125rem 0; }
@media (min-width: 640px) { .paper-row { padding: 1.125rem 1.25rem 0; } }
.paper-row > :last-child:not(.paper-row-foot) { margin-bottom: 1rem; }
@media (min-width: 640px) { .paper-row > :last-child:not(.paper-row-foot) { margin-bottom: 1.125rem; } }
.paper-row.is-selected {
    border-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-line));
    background: color-mix(in srgb, var(--c-primary-soft) 45%, var(--c-raised));
}
.paper-row-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--c-ink);
    text-wrap: pretty;
}
.paper-row-title a { text-decoration: none; }
.paper-row-title a:hover { color: var(--c-primary); }
.paper-row-excerpt {
    margin-top: 0.5rem;
    font-size: 0.875rem;
    line-height: 1.55;
    color: var(--c-ink-2);
}
.paper-row-excerpt.is-empty { color: var(--c-ink-3); font-style: italic; }
.paper-row-meta {
    margin-top: 0.5rem;
    font-size: 0.75rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--c-ink-3);
    font-variant-numeric: tabular-nums;
}
/* The footer rule is dotted so it reads as part of the card, not a divider
   between cards; on a selected card it takes the selection colour. */
.paper-row-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    height: 2.5rem;
    margin-top: 0.875rem;
    border-top: 1px dotted var(--c-line-strong);
}
.paper-row.is-selected .paper-row-foot { border-top-color: color-mix(in srgb, var(--c-primary) 45%, var(--c-line)); }
.paper-row-doi {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--c-ink-3);
}
a.paper-row-doi:hover { color: var(--c-primary); }
.analysis-toggle {
    display: inline-flex;
    flex: none;
    align-items: center;
    gap: 0.375rem;
    height: 1.75rem;
    padding: 0 0.5rem;
    margin-right: -0.5rem;
    border-radius: 0.4375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-ink-2);
}
.analysis-toggle i { font-size: 1rem; color: var(--c-ink-3); }
.analysis-toggle:hover { background: var(--c-surface); color: var(--c-ink); }
.analysis-toggle[aria-pressed="true"] { color: var(--c-primary); font-weight: 600; }
.analysis-toggle[aria-pressed="true"] i { color: var(--c-primary); }
.analysis-toggle[aria-pressed="true"]:hover { background: transparent; text-decoration: underline; text-underline-offset: 0.2em; }

/* Matching researchers: one card per person, like the publication cards. */
.pub-people { display: grid; gap: 0.75rem; }
.pub-people:empty { display: none; }
.pub-person {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
}
.pub-person.hidden { display: none; }
a.pub-person:hover .pub-person-name { color: var(--c-primary); }
.pub-person-name {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-ink);
}
.pub-person-papers {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.75rem;
    color: var(--c-ink-3);
    font-variant-numeric: tabular-nums;
}
.pub-person-arrow { margin-left: auto; color: var(--c-ink-3); }

/* ---- Paper + analysis: header ---- */
.paper-head h1 {
    font-size: clamp(1.625rem, 1.25rem + 1.2vw, 2.25rem);
    line-height: 1.15;
    color: var(--c-ink);
}
.paper-meta {
    margin-top: 0.875rem;
    font-size: 0.9375rem;
    line-height: 1.5;
    color: var(--c-ink-2);
    font-variant-numeric: tabular-nums;
}

/* Tab bar: matches the header nav (forest 2px underline on the current tab). */
.discover-tabs {
    position: relative;
    display: flex;
    gap: 1.75rem;
    margin-bottom: -1px;
}
.discover-tab {
    position: relative;
    display: inline-flex;
    align-items: baseline;
    gap: 0.2rem;
    padding: 0 0 0.875rem;
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--c-ink-2);
    white-space: nowrap;
    cursor: pointer;
}
.discover-tab:hover { color: var(--c-ink); }
.discover-tab.is-active { color: var(--c-ink); font-weight: 600; }
.discover-tab.is-active::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    border-radius: 2px 2px 0 0;
    background: var(--c-primary);
}
.discover-tab.is-disabled { color: var(--c-ink-3); opacity: 0.6; cursor: not-allowed; }
.discover-tab.is-disabled.is-active::after { background: var(--c-line-strong); }
.discover-tab sup { top: -0.55em; }

/* Share menu */
.share-menu-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    color: var(--c-ink);
}
.share-menu-item i { font-size: 1rem; color: var(--c-ink-3); }
.share-menu-item:hover { background: var(--c-surface); }

/* ---- Paper: reading column ---- */
.paper-layout {
    display: grid;
    gap: 2.5rem;
    margin-top: 2rem;
}
@media (min-width: 1024px) {
    .paper-layout { grid-template-columns: minmax(0, 1fr) 19rem; gap: 4rem; }
}
.paper-section + .paper-section { margin-top: 2.5rem; }
.paper-section-title {
    display: flex;
    align-items: baseline;
    gap: 0.2rem;
    font-family: var(--font-display);
    font-optical-sizing: auto;
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    letter-spacing: -0.01em;
    color: var(--c-ink);
}
.paper-section-body {
    margin-top: 0.875rem;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-ink-2);
}
.paper-section-body .prose p:first-child { margin-top: 0; }
.paper-section-body .prose strong,
.paper-section-body .prose b { color: var(--c-ink); font-weight: 600; }
.paper-section-body .prose h2,
.paper-section-body .prose h3,
.paper-section-body .prose h4 {
    margin: 1.5rem 0 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--c-ink);
}
.paper-section-body .prose table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: 0.875rem; }
.paper-section-body .prose th,
.paper-section-body .prose td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
.paper-section-body .prose th { font-weight: 600; color: var(--c-ink); background: var(--c-surface); }
.paper-section-body .prose a { color: var(--c-primary); text-decoration: underline; text-underline-offset: 0.2em; }
.paper-placeholder { color: var(--c-ink-3); font-style: italic; }
.paper-more-btn {
    margin-left: 0.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--c-primary);
}
.paper-more-btn:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* Classification + keywords: label / chip rows. */
.paper-terms > div {
    display: grid;
    gap: 0.5rem;
    padding: 0.875rem 0;
    border-top: 1px solid var(--c-line);
}
.paper-terms > div:first-child { border-top: 0; padding-top: 0; }
@media (min-width: 640px) {
    .paper-terms > div { grid-template-columns: 9.5rem minmax(0, 1fr); gap: 1.5rem; }
}
.paper-terms dt { padding-top: 0.125rem; font-size: 0.8125rem; font-weight: 600; color: var(--c-ink-3); }
.paper-terms dd { display: flex; flex-wrap: wrap; gap: 0.375rem; min-width: 0; }
.paper-chips { display: flex; flex-wrap: wrap; gap: 0.375rem; }
.paper-terms .chip,
.paper-chips .chip {
    height: auto;
    min-height: 1.625rem;
    padding: 0.25rem 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.25;
    white-space: normal;
}

/* Authors: ordered list in byline order. */
.paper-authors {
    display: grid;
    gap: 0;
    counter-reset: author;
}
@media (min-width: 640px) {
    .paper-authors { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; }
}
.paper-authors li {
    display: flex;
    align-items: baseline;
    gap: 0.625rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--c-line);
    font-size: 0.9375rem;
    color: var(--c-ink);
    counter-increment: author;
}
.paper-authors li::before {
    content: counter(author);
    flex: none;
    min-width: 1.5rem;
    font-size: 0.75rem;
    color: var(--c-ink-3);
    font-variant-numeric: tabular-nums;
}
.paper-authors a { color: var(--c-primary); font-weight: 600; }
.paper-authors a:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* AI disclaimer: a quiet note under the reading column. */
.paper-ai-note {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--c-line);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--c-ink-3);
}
.paper-ai-note i { margin-top: 0.1rem; font-size: 0.9375rem; }

/* ---- Paper: sidebar ---- */
.paper-aside > section + section {
    margin-top: 1.75rem;
    padding-top: 1.75rem;
    border-top: 1px solid var(--c-line);
}
@media (min-width: 1024px) {
    .paper-aside { padding-left: 2rem; border-left: 1px solid var(--c-line); }
}
@media (max-width: 1023px) {
    .paper-aside:not(.hidden) { padding-top: 2rem; border-top: 1px solid var(--c-line); }
}
.paper-aside-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--c-ink);
}
.paper-ids { margin-top: 0.75rem; }
.paper-ids > div {
    display: grid;
    grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: 0.75rem;
    padding: 0.5rem 0;
    border-top: 1px solid var(--c-line);
    font-size: 0.8125rem;
}
.paper-ids > div:first-child { border-top: 0; padding-top: 0; }
.paper-ids dt { color: var(--c-ink-3); }
.paper-ids dd { min-width: 0; }
.paper-ids a {
    display: block;
    font-family: var(--font-display);
    font-size: 0.75rem;
    line-height: 1.6;
    color: var(--c-ink);
    overflow-wrap: anywhere;
}
.paper-ids a.is-nowrap { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.paper-ids a:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 0.2em; }
.paper-aside-note {
    margin-top: 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--c-ink-3);
}
.paper-files { margin-top: 0.75rem; }
.paper-file-link {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--c-primary);
}
.paper-file-link:hover { text-decoration: underline; text-underline-offset: 0.2em; }

/* ---- Publication analysis (/summary/<id>) body ---- */
#summary-body,
#sources-body {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--c-ink-2);
}
#summary-body h2 {
    margin-top: 2.25rem;
    font-family: var(--font-display);
    font-size: 1.375rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--c-ink);
}
#summary-body > h2:first-child { margin-top: 0; }
#summary-body h3,
#summary-body h4 { margin-top: 1.5rem; font-size: 1rem; font-weight: 600; color: var(--c-ink); }
#summary-body p { margin: 0.75rem 0; }
#summary-body ul,
#summary-body ol { margin: 0.75rem 0; padding-left: 1.5rem; }
#summary-body ul { list-style-type: disc; }
#summary-body ol { list-style-type: decimal; }
#summary-body li { padding: 0.125rem 0; }
#summary-body li::marker { color: var(--c-ink-3); }
#summary-body strong { font-weight: 600; color: var(--c-ink); }
#summary-body a { color: var(--c-primary); text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 0.2em; }
#summary-body a:hover { text-decoration-color: currentColor; }
#summary-body blockquote { margin: 1rem 0; padding-left: 1rem; border-left: 1px solid var(--c-line-strong); color: var(--c-ink-3); font-style: italic; }
#summary-body hr { margin: 1.5rem 0; border: 0; border-top: 1px solid var(--c-line); }
#summary-body table { width: 100%; margin: 1rem 0; border-collapse: collapse; font-size: 0.875rem; font-variant-numeric: tabular-nums; }
#summary-body th,
#summary-body td { padding: 0.5rem 0.75rem; border-bottom: 1px solid var(--c-line); text-align: left; vertical-align: top; }
#summary-body th { background: var(--c-surface); font-weight: 600; color: var(--c-ink); }
#sources-body .source_label,
#summary-body .source_label { margin-bottom: 0.75rem; font-size: 0.875rem; font-weight: 600; color: var(--c-ink); font-variant-numeric: tabular-nums; }
#sources-body .source_list,
#summary-body .source_list { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--c-line); }
#sources-body .source_list li,
#summary-body .source_list li { padding: 0.75rem 0; border-bottom: 1px solid var(--c-line); }
#sources-body .source_list a,
#summary-body .source_list a { font-family: var(--font-display); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--c-ink); text-decoration: none; }
#sources-body .source_list a:hover,
#summary-body .source_list a:hover { color: var(--c-primary); text-decoration: underline; text-underline-offset: 0.18em; }
#sources-body .source-meta,
#summary-body .source-meta { margin-top: 0.25rem; font-size: 0.8125rem; color: var(--c-ink-3); font-variant-numeric: tabular-nums; }
#summary-body .disclaimer {
    margin-top: 2.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--c-line);
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--c-ink-3);
}

/* ---- Site pagination partial ---- */
.site-pager-item {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.5rem;
    border: 1px solid var(--c-line);
    border-radius: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--c-ink-2);
    font-variant-numeric: tabular-nums;
}
a.site-pager-item:hover { background: var(--c-surface); color: var(--c-ink); border-color: var(--c-line-strong); }
.site-pager-item[aria-current="page"] { background: var(--c-primary); border-color: var(--c-primary); color: #fff; font-weight: 600; }
html.dark .site-pager-item[aria-current="page"] { color: #101512; }
.site-pager-item.is-disabled { color: var(--c-line-strong); }
.site-pager-gap { border-color: transparent; color: var(--c-ink-3); }

/* Components above set display; JS-toggled .hidden must still win. */
:is(.pub-person, .pub-tool-btn, .pub-tool-badge, .pub-text-btn, .discover-tab, .chip, .paper-meta, .paper-ai-note, .paper-authors li, .pub-filter-option).hidden { display: none; }

/* Paper header: the domain chip sits beside the small Share button, so it
   takes the same box (height, padding, radius, type size). */
.chip.chip-btn-sm {
    height: 2rem;
    padding: 0 0.75rem;
    border-radius: 0.4375rem;
    font-size: 0.8125rem;
}

/* ---- Funding: filters as on Publications, and ruled rows like Wits ----
   The panel is open when [data-open] is set: joined under the toolbar on
   desktop, a full-screen sheet on phones (.is-sheet). */
@media (min-width: 768px) {
    #funding-filters[data-open] { display: block; }
    #funding-toolbar:has(+ #funding-filters[data-open]) { border-bottom-left-radius: 0; border-bottom-right-radius: 0; }
}
#funding-filters.is-sheet { display: block; }
#funding-filters-btn .funding-icon-open { display: none; }
#funding-filters-btn[aria-expanded="true"] { background: var(--c-primary-soft); border-color: var(--c-primary); color: var(--c-primary); }
#funding-filters-btn[aria-expanded="true"] i { color: var(--c-primary); }
#funding-filters-btn[aria-expanded="true"] .funding-icon-open { display: inline; }
#funding-filters-btn[aria-expanded="true"] .funding-icon-closed { display: none; }
.funding-match {
    width: 100%;
    height: 2.5rem;
    padding: 0 0.75rem;
    border: 1px solid var(--c-line);
    border-radius: 0.375rem;
    background: var(--c-raised);
    font-size: 0.875rem;
    color: var(--c-ink);
}
.funding-match:focus { border-color: var(--c-focus); outline: none; }
.funding-match::placeholder { color: var(--c-ink-3); }
.funding-filters-hint { margin-top: 0.375rem; font-size: 0.75rem; line-height: 1.25rem; color: var(--c-ink-3); }

.funding-list { border-top: 1px solid var(--c-line); }
.funding-row {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
    align-items: start;
    gap: 1.75rem;
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--c-line);
}
.funding-row.is-single { grid-template-columns: minmax(0, 1fr); }
.funding-row-title { font-size: 1.1875rem; font-weight: 600; line-height: 1.4; letter-spacing: -0.01em; color: var(--c-ink); overflow-wrap: anywhere; }
.funding-row-title a { transition: color 150ms ease-out; }
.funding-row:hover .funding-row-title a, .funding-row-title a:hover { color: var(--c-primary); }
.funding-row-line { display: flex; align-items: flex-start; gap: 0.4375rem; margin-top: 0.4375rem; font-size: 0.75rem; line-height: 1.6; color: var(--c-ink-3); }
.funding-row-line i { flex: none; font-size: 0.9375rem; }
.funding-row-desc { margin-top: 0.75rem; font-size: 0.875rem; line-height: 1.7; color: var(--c-ink-2); overflow-wrap: anywhere; }
.funding-row-matches { margin-top: 0.875rem; }
.funding-row-matches > p { font-size: 0.6875rem; font-weight: 600; color: var(--c-ink-3); }
.funding-row-matches > div { display: flex; flex-wrap: wrap; gap: 0.375rem; margin-top: 0.375rem; }
.funding-row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 1.5rem; margin-top: 0.75rem; }
.funding-row-source { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4375rem; font-size: 0.75rem; line-height: 1.5; color: var(--c-ink-3); }
.funding-row-source > i { font-size: 1rem; color: #946600; }
.funding-row-source a { font-weight: 600; color: var(--c-ink); }
.funding-row-source a:hover { color: var(--c-primary); }
.funding-row-details { display: inline-flex; min-height: 2.75rem; align-items: center; gap: 0.5rem; font-size: 0.8125rem; font-weight: 600; color: var(--c-primary); }
.funding-row-details:hover { color: var(--c-primary-hover, #0B5039); }
.funding-row-details i { font-size: 1rem; transition: transform 200ms ease-out; }
.funding-row-details:hover i { transform: translateX(3px); }
.funding-row-meta {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-content: start;
    gap: 1.125rem 1.5rem;
    padding-left: 1.75rem;
    border-left: 1px solid var(--c-line);
    font-size: 0.8125rem;
}
.funding-row-meta .is-wide { grid-column: 1 / -1; }
.funding-row-meta dt { display: flex; align-items: center; gap: 0.5rem; font-size: 0.75rem; font-weight: 600; line-height: 1.5; color: var(--c-ink); }
.funding-row-meta dt i { font-size: 1.0625rem; font-weight: 400; line-height: 1; color: var(--c-primary); }
.funding-row-meta dd { margin-top: 0.3125rem; padding-left: 1.5625rem; line-height: 1.65; color: var(--c-ink-2); overflow-wrap: anywhere; }
@media (max-width: 767px), (min-width: 1024px) and (max-width: 1199px) {
    .funding-row { grid-template-columns: minmax(0, 1fr); gap: 1.125rem; padding: 1.375rem 0; }
    .funding-row-meta { padding-top: 1.125rem; padding-left: 0; border-top: 1px solid var(--c-line); border-left: 0; }
}
@media (max-width: 479px) { .funding-row-meta { grid-template-columns: minmax(0, 1fr); } }
@media (prefers-reduced-motion: reduce) { .funding-row-details i { transition: none; } }

/* ---- Paper check: the "I am not a robot" step before a paper opens ---- */
.paper-check { display: flex; justify-content: center; }
.paper-check-card { display: grid; justify-items: start; gap: 1rem; width: 100%; max-width: 28rem; padding: 2rem; }
.paper-check-icon { display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem; border-radius: 0.75rem; background: var(--c-primary-soft); color: var(--c-primary); font-size: 1.35rem; }
.paper-check-card h1 { font-size: 1.375rem; font-weight: 600; line-height: 1.25; letter-spacing: -0.01em; color: var(--c-ink); }
.paper-check-card p { font-size: 0.9375rem; line-height: 1.6; color: var(--c-ink-2); }
.paper-check-card h1 + p { margin-top: -0.5rem; }
.paper-check-error { display: flex; gap: 0.5rem; width: 100%; padding: 0.625rem 0.75rem; border: 1px solid #f5c2bd; border-radius: 0.5rem; background: #fdecea; color: #b42318 !important; font-size: 0.875rem !important; }
html.dark .paper-check-error { border-color: #5a2626; background: #331616; color: #fca5a5 !important; }
.paper-check-widget { width: 100%; min-height: 65px; }
