/*
 * Final compatibility layer for public templates that still carry historical
 * inline Bootstrap styling. This file is deliberately loaded after <main> so
 * the CAIR–Nepal editorial system wins on every routed subpage.
 */

main { background: var(--ivory); color: var(--ink); }

main .page-hero-section,
main .donate-hero-section,
main > section.bg-gradient-primary,
main > .bg-gradient-primary {
    min-height: auto !important;
    padding: 92px var(--pad) 74px !important;
    background: var(--forest) !important;
    color: var(--white) !important;
    display: block !important;
    text-align: left !important;
    position: relative;
    overflow: hidden;
}

/* Editorial impact download flow */
.impact-download-layout{display:grid;grid-template-columns:minmax(0,.8fr) minmax(0,1.2fr);gap:clamp(48px,8vw,110px);align-items:start}
.impact-download-intro h2,.editorial-form-panel h2{font:400 clamp(2.2rem,4vw,4rem)/1.04 var(--display);margin:0 0 22px}
.impact-download-intro>p:not(.eyebrow){color:var(--muted);max-width:580px}
.compact-facts{margin:34px 0}.compact-facts div{padding:18px 0}
.editorial-form-panel{border-left:1px solid var(--line);padding-left:clamp(30px,5vw,70px)}
.form-field-grid{display:grid;grid-template-columns:1fr 1fr;gap:24px 20px;margin:32px 0}
.form-field{display:grid;gap:8px}.form-field.field-wide{grid-column:1/-1}
.form-field label{font-size:.67rem;text-transform:uppercase;letter-spacing:.13em;font-weight:600}
.form-field input,.form-field textarea,.form-field select{width:100%;border:1px solid var(--line);border-radius:0;background:var(--white);color:var(--ink);padding:13px 14px;font:inherit}
.form-field input:focus,.form-field textarea:focus,.form-field select:focus{outline:2px solid var(--gold);outline-offset:1px}
.form-field small{color:var(--muted)}.form-errors,.field-error{display:block;color:#8d2f25;font-size:.8rem;font-weight:500}
.searchable-select{position:relative}.searchable-select-native{position:absolute!important;width:1px!important;height:1px!important;opacity:0!important;pointer-events:none!important}
.searchable-select-input{padding-right:42px!important;background-image:linear-gradient(45deg,transparent 50%,var(--ink) 50%),linear-gradient(135deg,var(--ink) 50%,transparent 50%)!important;background-position:calc(100% - 19px) 50%,calc(100% - 14px) 50%!important;background-size:5px 5px,5px 5px!important;background-repeat:no-repeat!important}
.searchable-select-list{position:absolute;z-index:20;inset:calc(100% + 4px) 0 auto;max-height:250px;overflow-y:auto;background:var(--white);border:1px solid var(--line);box-shadow:0 14px 30px rgba(9,35,32,.14)}
.searchable-select-list button{display:block;width:100%;padding:10px 14px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);text-align:left;font:inherit;cursor:pointer}
.searchable-select-list button:hover,.searchable-select-list button.active{background:var(--cream)}
.searchable-select-list p{margin:0;padding:13px 14px;color:var(--muted);font-size:.88rem}
.team-directory-results{transition:opacity .18s ease}.team-directory.is-loading .team-directory-results{opacity:.42;pointer-events:none}.team-directory.is-loading .role-filter,.team-directory.is-loading .people-search{pointer-events:none}

/* Up to three admin-selected homepage project spotlights */
.project-spotlights{margin-top:52px}
.project-spotlights>div{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr));border-top:1px solid rgba(255,255,255,.18);border-left:1px solid rgba(255,255,255,.18)}
.project-spotlights a{min-height:260px;padding:28px;display:flex;flex-direction:column;text-decoration:none;border-right:1px solid rgba(255,255,255,.18);border-bottom:1px solid rgba(255,255,255,.18)}
.project-spotlights span,.project-spotlights b{color:var(--gold-light);font-size:.65rem;text-transform:uppercase;letter-spacing:.12em}
.project-spotlights h3{font:400 1.55rem/1.2 var(--display);margin:38px 0 10px}
.project-spotlights p{color:rgba(255,255,255,.6);font-size:.84rem;margin:0 0 22px}
.project-spotlights b{margin-top:auto;font-weight:600}

/* Up to four admin-selected publication highlights in a balanced two-by-two grid. */
.research-highlight-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}
.research-highlight-card{min-height:500px;padding:34px;display:flex;flex-direction:column;position:relative;overflow:hidden;border:1px solid rgba(221,196,147,.28);background:linear-gradient(145deg,rgba(255,255,255,.055),rgba(255,255,255,.012));transition:transform .25s ease,border-color .25s ease,background .25s ease}
.research-highlight-card:hover{transform:translateY(-5px);border-color:rgba(221,196,147,.58);background:linear-gradient(145deg,rgba(255,255,255,.085),rgba(255,255,255,.018))}
.research-highlight-media{height:clamp(190px,22vw,280px);box-sizing:border-box;margin:-34px -34px 28px;position:relative;overflow:hidden;background:#163f3a;color:var(--gold-light)}
.research-highlight-media.has-image{display:flex;align-items:center;justify-content:center;padding:14px;background:#eef1f2}
.research-highlight-media.has-image:after{content:"";position:absolute;inset:0;pointer-events:none;box-shadow:inset 0 0 0 1px rgba(8,39,36,.12)}
.research-highlight-media img{width:100%;height:100%;min-width:0;min-height:0;object-fit:contain;object-position:center;display:block}
.research-highlight-media.is-placeholder{display:grid;grid-template-columns:1fr auto;align-items:center;padding:28px 32px;background:radial-gradient(circle at 82% 40%,rgba(191,148,81,.18),transparent 34%),linear-gradient(135deg,#184a43,#103a35)}
.research-highlight-media.is-placeholder:after{content:"";position:absolute;width:180px;height:180px;right:-55px;top:-82px;border:1px solid rgba(221,196,147,.24);border-radius:50%;box-shadow:0 0 0 38px rgba(221,196,147,.035)}
.research-highlight-media.is-placeholder span{align-self:start;max-width:150px;font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.16em;line-height:1.5}
.research-highlight-media.is-placeholder i{position:relative;z-index:1;font-size:2.4rem;margin-right:58px}
.research-highlight-media.is-placeholder b{position:absolute;right:24px;bottom:-12px;color:rgba(255,255,255,.08);font:400 5.8rem/1 var(--display)}
.research-highlight-meta{display:flex;justify-content:space-between;gap:18px;padding-bottom:14px;border-bottom:1px solid rgba(255,255,255,.14);color:var(--gold-light);font-size:.62rem;font-weight:600;text-transform:uppercase;letter-spacing:.14em}
.research-highlight-meta span:last-child{text-align:right}
.research-highlight-card h3{font:400 clamp(1.65rem,2.4vw,2.45rem)/1.1 var(--display);margin:25px 0 16px;max-width:740px}
.research-highlight-summary{color:rgba(255,255,255,.66);font-size:.9rem;line-height:1.65;margin:0 0 28px}
.research-highlight-card .text-link{margin-top:auto;align-self:flex-start}

.collaboration-partners{margin-top:54px;padding-top:34px;border-top:1px solid var(--line)}
.collaboration-partners>div{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));border-top:1px solid var(--line);border-left:1px solid var(--line)}
.collaboration-partners article{min-height:210px;padding:24px;display:flex;flex-direction:column;align-items:flex-start;border-right:1px solid var(--line);border-bottom:1px solid var(--line)}
.collaboration-partners img{width:88px;height:64px;object-fit:contain;margin-bottom:20px}
.collaboration-partners h3{font:400 1.35rem var(--display);margin:18px 0}
.collaboration-partners .text-link{margin-top:auto}

/* Data-driven collaboration footprint in the directory hero. */
.collaboration-hero{display:grid;grid-template-columns:minmax(0,.88fr) minmax(420px,.72fr);gap:clamp(56px,7vw,118px);align-items:center;padding-top:72px;padding-bottom:68px}
.collaboration-hero:after{display:none}
.collaboration-hero-copy{position:relative;z-index:2}
.collaboration-hero-copy .breadcrumbs{margin-bottom:36px}
.collaboration-hero-copy>.eyebrow{margin:0 0 18px;color:var(--gold-light)}
.collaboration-hero-copy>p:last-child{max-width:670px;margin:26px 0 0;color:rgba(255,255,255,.68);font-size:1.08rem;line-height:1.65}
.collaboration-map-panel{position:relative;z-index:2;padding:20px 22px 17px;border:1px solid rgba(221,196,147,.28);background:rgba(255,255,255,.025)}
.collaboration-map-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:12px}
.collaboration-map-heading .eyebrow{margin:0;color:var(--gold-light)}
.collaboration-map-heading>span{color:rgba(255,255,255,.58);font-size:.7rem;text-transform:uppercase;letter-spacing:.12em}
.collaboration-map-canvas{position:relative;min-height:215px;display:grid;place-items:center;color:rgba(255,255,255,.48);font-size:.78rem}
.collaboration-map-canvas svg{display:block;width:100%;height:auto;max-height:270px;overflow:visible}
.collaboration-map-canvas path{fill:rgba(255,255,255,.095);stroke:rgba(255,255,255,.16);stroke-width:.32;transition:fill .2s ease}
.collaboration-map-canvas path.is-partner-country{fill:rgba(221,196,147,.48)}
.collaboration-map-canvas .collaboration-map-link{fill:none;stroke:rgba(228,189,120,.78);stroke-width:1.35;stroke-dasharray:6 4;vector-effect:non-scaling-stroke;animation:collaboration-route-flow 4.5s linear infinite;animation-delay:calc(var(--route-index) * -.65s)}
.collaboration-map-canvas .collaboration-map-arrowhead{fill:#e4bd78;stroke:none}
.collaboration-map-pulse{fill:none;stroke:rgba(221,196,147,.5);stroke-width:1;vector-effect:non-scaling-stroke}
.collaboration-map-dot{fill:#e4bd78;stroke:var(--forest);stroke-width:1.5;vector-effect:non-scaling-stroke}
.collaboration-map-marker{cursor:help;outline:none}
.collaboration-map-marker:is(:hover,:focus) .collaboration-map-pulse{stroke:rgba(255,255,255,.9);stroke-width:1.5}
.collaboration-map-marker:is(:hover,:focus) .collaboration-map-dot{fill:#fff}
.collaboration-map-tooltip{position:absolute;z-index:3;transform:translate(-50%,-100%);padding:7px 10px;background:var(--cream);color:var(--forest);font-size:.68rem;font-weight:600;letter-spacing:.06em;line-height:1;text-transform:uppercase;white-space:nowrap;box-shadow:0 7px 18px rgba(0,0,0,.2);opacity:0;visibility:hidden;pointer-events:none;transition:opacity .12s ease,visibility .12s ease}
.collaboration-map-tooltip:after{content:"";position:absolute;top:100%;left:50%;transform:translateX(-50%);border:5px solid transparent;border-top-color:var(--cream)}
.collaboration-map-tooltip.is-visible{opacity:1;visibility:visible}
.map-attribution{margin:11px 0 0;color:rgba(255,255,255,.35);font-size:.58rem;line-height:1.4}
.collaboration-detail-map{margin:0 0 34px;padding:15px 16px;background:var(--forest);border-color:rgba(12,52,47,.18)}
.collaboration-detail-map .collaboration-map-heading{margin-bottom:6px}
.collaboration-detail-map .collaboration-map-canvas{min-height:145px}
.collaboration-detail-map .collaboration-map-canvas svg{max-height:175px}
@keyframes collaboration-route-flow{to{stroke-dashoffset:-90}}
@media(prefers-reduced-motion:reduce){.collaboration-map-canvas .collaboration-map-link{animation:none}}
main.is-filtering{cursor:progress}
main.is-filtering>section:not(.inner-hero){opacity:.48;pointer-events:none;transition:opacity .16s ease}

/* Optional editorial imagery for news */
.news-catalog-image{display:block;aspect-ratio:16/10;overflow:hidden}
.news-catalog-image img,.article-lead-image img{width:100%;height:100%;object-fit:cover}
.article-lead-image{margin:0;background:var(--forest);max-height:660px;overflow:hidden}
.article-lead-image img{max-height:660px;display:block}

/* Catalogs that reuse the homepage opportunity grid must keep ivory-page text dark. */
.catalog-section .catalog-grid.opportunity-grid article{color:var(--ink)}
.catalog-section .catalog-grid.opportunity-grid h3,
.catalog-section .catalog-grid.opportunity-grid h3 a{color:var(--ink)!important}
.catalog-section .catalog-grid.opportunity-grid p{color:var(--muted)!important}
.catalog-section .catalog-grid.opportunity-grid .meta{color:#96703c!important}
.catalog-section .catalog-filter .button.primary{background:var(--forest)!important;color:var(--white)!important}
.button.primary{background:var(--forest)!important;color:var(--white)!important;border-color:var(--forest)!important}

.member-editorial-hero{display:grid;grid-template-columns:minmax(0,1fr) 230px;gap:60px;align-items:center}
.member-hero-portrait{width:210px;height:210px;object-fit:cover;border-radius:50%;border:1px solid rgba(221,196,147,.45)}
.member-initials.member-hero-portrait{display:grid;place-items:center;background:var(--forest-mid);color:var(--gold-light);font:400 3.2rem var(--display)}

@media(max-width:760px){
  .impact-download-layout{grid-template-columns:1fr}.editorial-form-panel{border-left:0;border-top:1px solid var(--line);padding:36px 0 0}
  .form-field-grid{grid-template-columns:1fr}.form-field.field-wide{grid-column:auto}
  .project-spotlights>div{grid-template-columns:1fr}
  .research-highlight-grid{grid-template-columns:1fr}
  .collaboration-partners>div{grid-template-columns:1fr}
  .collaboration-hero{grid-template-columns:1fr;gap:42px;padding:64px 24px 52px}.collaboration-map-panel{padding:16px}.collaboration-map-canvas{min-height:170px}.collaboration-map-canvas svg{max-height:210px}
  .member-editorial-hero{grid-template-columns:1fr}.member-hero-portrait{width:150px;height:150px}
}
main .page-hero-section::before,
main .donate-hero-section::before,
main > section.bg-gradient-primary::before {
    content: "" !important;
    position: absolute !important;
    width: 420px !important;
    height: 420px !important;
    inset: -170px -110px auto auto !important;
    border: 1px solid rgba(221,196,147,.25) !important;
    border-radius: 50% !important;
    background: transparent !important;
    box-shadow: 0 0 0 70px rgba(221,196,147,.035), 0 0 0 140px rgba(221,196,147,.02) !important;
    opacity: 1 !important;
}
main .page-hero-section .container,
main .donate-hero-section .container,
main > section.bg-gradient-primary .container {
    width: 100% !important;
    max-width: 1280px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    position: relative;
    z-index: 1;
}
main .page-hero-section .row,
main .donate-hero-section .row,
main > section.bg-gradient-primary .row { display: block !important; margin: 0 !important; }
main .page-hero-section [class*="col-"],
main .donate-hero-section [class*="col-"],
main > section.bg-gradient-primary [class*="col-"] {
    padding: 0 !important;
    text-align: left !important;
}
main .page-hero-section .row > [class*="col-"]:only-child,
main .donate-hero-section .row > [class*="col-"]:only-child,
main > section.bg-gradient-primary .row > [class*="col-"]:only-child,
main .page-hero-section .row > .mx-auto,
main .donate-hero-section .row > .mx-auto,
main > section.bg-gradient-primary .row > .mx-auto {
    width: min(100%, 960px) !important;
    max-width: 960px !important;
    margin: 0 !important;
}
main .page-hero-section h1,
main .donate-hero-section h1,
main > section.bg-gradient-primary h1 {
    font: 400 clamp(3.45rem, 6.8vw, 6.8rem)/.98 var(--display) !important;
    letter-spacing: -.045em !important;
    color: var(--white) !important;
    text-shadow: none !important;
    margin: 0 0 26px !important;
}
main .page-hero-section .lead,
main .donate-hero-section .lead,
main > section.bg-gradient-primary .lead {
    max-width: 720px !important;
    color: rgba(255,253,248,.68) !important;
    font: 400 1.05rem/1.7 var(--sans) !important;
    text-shadow: none !important;
    margin: 0 !important;
}

main section.py-5:not(.page-hero-section):not(.donate-hero-section):not(.bg-gradient-primary):not(.cta-section):not(.apply-cta-section),
main .news-content-section,
main .events-section,
main .resources-section,
main .templates-section,
main .media-gallery-section,
main .projects-section,
main .impact-stories-section,
main .testimonials-section,
main .documents-section {
    padding: 76px var(--pad) !important;
    background: var(--ivory) !important;
}
main section.py-4,
main .search-section,
main .search-filter-section,
main .stats-section,
main .statistics-section {
    padding: 30px var(--pad) !important;
    background: var(--cream) !important;
    border: 0 !important;
    border-bottom: 1px solid var(--line) !important;
}
main section:not(.inner-hero):not(.inner-section):not(.section):not(.page-cta) > .container {
    max-width: 1280px;
    padding-left: 0;
    padding-right: 0;
}

main .card,
main .news-card,
main .event-card,
main .resource-card,
main .template-card,
main .media-card,
main .impact-card,
main .project-card,
main .scholarship-card,
main .vacancy-card,
main .startup-card,
main .donation-card,
main .related-news-card,
main .quick-links-card {
    border: 1px solid var(--line) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: rgba(255,253,248,.52) !important;
    color: var(--ink) !important;
    overflow: hidden;
}
main .card:hover,
main .news-card:hover,
main .event-card:hover,
main .resource-card:hover,
main .media-card:hover,
main .project-card:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 16px 45px rgba(9,35,32,.08) !important;
}
main .card-body,
main .card-content { padding: 26px !important; }
main .card-title,
main .card h3,
main .card h4,
main .card h5,
main .card h6 {
    font-family: var(--display) !important;
    font-weight: 400 !important;
    color: var(--ink) !important;
}
main .card-title { font-size: 1.45rem !important; line-height: 1.3 !important; }
main .card-description,
main .card p,
main .text-muted { color: var(--muted) !important; }
main .rounded,
main .rounded-3,
main .rounded-circle:not(img) { border-radius: 0 !important; }
main .shadow,
main .shadow-sm,
main .shadow-lg { box-shadow: none !important; }

main .card-image-wrapper,
main .card-image-placeholder,
main .media-placeholder,
main .project-image-placeholder {
    border-radius: 0 !important;
    background: var(--forest-mid) !important;
}
main .card-image-placeholder,
main .placeholder-icon { color: var(--gold-light) !important; }

main .btn,
main button[type="submit"] {
    border-radius: 0 !important;
    box-shadow: none !important;
    text-transform: uppercase;
    letter-spacing: .09em;
    font-size: .7rem;
    font-weight: 600;
    padding: 12px 18px;
}
main .btn-primary,
main .btn-success,
main .btn-info,
main button[type="submit"] {
    background: var(--forest) !important;
    border-color: var(--forest) !important;
    color: var(--white) !important;
}
main .btn-outline-primary,
main .btn-outline-secondary {
    background: transparent !important;
    border-color: var(--line) !important;
    color: var(--ink) !important;
}
main .form-control,
main .form-select,
main .input-group-text,
main textarea,
main select,
main input {
    border-radius: 0 !important;
    border-color: var(--line) !important;
    box-shadow: none !important;
}
main .input-group-text { background: var(--forest) !important; color: var(--white) !important; }

main .stat-card,
main .stat-item {
    border: 0 !important;
    border-right: 1px solid var(--line) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}
main .stat-number,
main .stat-item h3 { font: 400 2.2rem var(--display) !important; color: var(--ink) !important; }
main .stat-label { color: var(--muted) !important; text-transform: uppercase; letter-spacing: .1em; font-size: .65rem; }

main .pagination { gap: 4px; }
main .pagination .page-link {
    border-radius: 0 !important;
    border: 1px solid var(--line) !important;
    color: var(--ink) !important;
    background: transparent !important;
}
main .pagination .active .page-link { background: var(--forest) !important; color: var(--white) !important; }

main .accordion-item { border: 0 !important; border-bottom: 1px solid var(--line) !important; background: transparent !important; }
main .accordion-button { background: transparent !important; box-shadow: none !important; font: 400 1.35rem var(--display); color: var(--ink) !important; }
main .accordion-body { color: var(--muted); }

/* Reference-style catalogs: quiet metadata, flat cells, useful actions. */
.catalog-section > h2 { max-width: 900px; }
.catalog-filter {
    display: grid;
    grid-template-columns: minmax(260px, 1.5fr) repeat(3, minmax(150px, .75fr)) auto auto;
    align-items: stretch;
    margin: 42px 0 48px;
}
.page-datasets .catalog-filter,
.page-software .catalog-filter { grid-template-columns: minmax(260px, 1.5fr) repeat(2, minmax(170px, .8fr)) auto auto; }
.page-media_gallery .catalog-filter { grid-template-columns: minmax(300px, 1.5fr) minmax(180px, .6fr) auto auto; }
.publication-filter {
    grid-template-columns: minmax(440px, 2fr) repeat(2, minmax(180px, .65fr)) auto auto;
}
.catalog-filter input,
.catalog-filter select { min-width: 0; width: 100%; background: rgba(255,253,248,.58); }
.catalog-filter .button { min-height: 48px; }
.catalog-grid { grid-template-columns: repeat(3, 1fr); }
.catalog-grid .content-card { display: flex; flex-direction: column; min-height: 260px; }
.catalog-grid .content-card h3 { margin-top: 32px; }
.catalog-grid .content-card h3 a { color: inherit; text-decoration: none; }
.catalog-grid .content-card > p { line-height: 1.65; }
.catalog-byline { margin-top: auto !important; padding-top: 20px; border-top: 1px solid var(--line); font-size: .75rem !important; }
.catalog-actions { display: flex; flex-wrap: wrap; gap: 12px 22px; margin-top: auto; padding-top: 22px; }
.catalog-heading { margin-top: 74px; }
.evidence-strip { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.evidence-strip div { padding: 26px; border-right: 1px solid var(--line); }
.evidence-strip div:last-child { border-right: 0; }
.evidence-strip strong { display: block; color: var(--ink); font: 400 2.6rem/1 var(--display); }
.evidence-strip span { display: block; margin-top: 10px; color: var(--muted); font-size: .63rem; letter-spacing: .12em; text-transform: uppercase; }
.partner-catalog article { grid-template-columns: 110px 1fr; }
.partner-mark { display: grid; width: 74px; height: 74px; place-items: center; border: 1px solid var(--line); border-radius: 50%; color: #9b7440; font: 400 1.35rem var(--display); text-transform: uppercase; }
.partner-catalog h3 a { color: inherit; text-decoration: none; }
.media-editorial-grid { display: grid; grid-template-columns: repeat(3, 1fr); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.media-editorial-grid article { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.media-frame { aspect-ratio: 16/9; overflow: hidden; background: var(--forest); display: grid; place-items: center; color: var(--gold-light); text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; }
.media-frame img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.72) contrast(.94); transition: transform .45s ease, filter .45s ease; }
.media-editorial-grid article:hover .media-frame img { transform: scale(1.025); filter: saturate(1) contrast(1); }
.media-copy { padding: 26px; }
.media-copy h3 { margin: 24px 0 12px; font: 400 1.45rem/1.28 var(--display); }
.media-copy p { color: var(--muted); font-size: .84rem; line-height: 1.6; }
.page-news_list .editorial-search { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; width: 100%; }
.page-news_list .editorial-search input { width: 100%; min-width: 0; }

/* -------------------------------------------------------------------------
   Database-driven detail pages

   These selectors deliberately key off resolver names added to <body>. That
   lets older templates keep their data bindings while presenting one shared
   editorial system across research, publications, people and opportunities.
   ------------------------------------------------------------------------- */

body[class*="_detail"] main {
    --detail-rule: rgba(15, 53, 48, .18);
    background: var(--ivory);
}

body[class*="_detail"] main > section:not(.page-hero-section):not(.bg-gradient-primary):not(.impact-detail-hero):not(.article-hero):not(.inner-hero) {
    background: var(--ivory) !important;
}

body[class*="_detail"] main h2,
body[class*="_detail"] main h3,
body[class*="_detail"] main h4 {
    color: var(--ink);
    font-family: var(--display);
    font-weight: 400;
    letter-spacing: -.018em;
}

body[class*="_detail"] main h3 { font-size: clamp(1.65rem, 2.6vw, 2.35rem); }
body[class*="_detail"] main h4 { font-size: 1.35rem; }

body[class*="_detail"] main .content,
body[class*="_detail"] main .course-content,
body[class*="_detail"] main .job-content,
body[class*="_detail"] main .scholarship-content,
body[class*="_detail"] main .content-body,
body[class*="_detail"] main .card-text {
    color: var(--muted);
    font-size: .98rem;
    line-height: 1.78;
}

body[class*="_detail"] main .content p,
body[class*="_detail"] main .course-content p,
body[class*="_detail"] main .job-content p,
body[class*="_detail"] main .scholarship-content p,
body[class*="_detail"] main .content-body p { margin-bottom: 1.25em; }

body[class*="_detail"] main .card-header {
    padding: 21px 26px !important;
    border: 0 !important;
    border-bottom: 1px solid var(--detail-rule) !important;
    background: transparent !important;
    color: var(--ink) !important;
}

body[class*="_detail"] main .card-header i,
body[class*="_detail"] main .card-title i { color: #a77b3f !important; }

body[class*="_detail"] main .list-group-item {
    padding: 18px 0 !important;
    border-bottom: 1px solid var(--detail-rule) !important;
    background: transparent !important;
    color: var(--ink) !important;
}

body[class*="_detail"] main .badge {
    border: 1px solid rgba(178, 133, 70, .42) !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #8c6633 !important;
    font-size: .62rem !important;
    font-weight: 600 !important;
    letter-spacing: .09em;
    padding: 7px 10px !important;
    text-transform: uppercase;
}

body[class*="_detail"] main .alert {
    border: 1px solid var(--detail-rule) !important;
    border-radius: 0 !important;
    background: var(--cream) !important;
    color: var(--ink) !important;
}

body[class*="_detail"] main .sidebar-card,
body[class*="_detail"] main .content-section,
body[class*="_detail"] main .output-item,
body[class*="_detail"] main .problem-solution-card {
    border: 1px solid var(--detail-rule) !important;
    border-radius: 0 !important;
    background: rgba(255, 253, 248, .5) !important;
    box-shadow: none !important;
    padding: 26px !important;
}

body[class*="_detail"] main .output-item { margin-bottom: -1px; }

body[class*="_detail"] main pre {
    max-width: 100%;
    padding: 24px !important;
    overflow-x: auto;
    border-radius: 0 !important;
    background: #092c29 !important;
    color: #e8ddc8 !important;
    font-size: .78rem;
    line-height: 1.65;
}

/* Publication, dataset and software templates historically put the header and
   body in one section. Turn their first row into the same full-bleed hero used
   elsewhere without changing their database-backed template logic. */
.page-publication_detail main > section:first-child,
.page-dataset_detail main > section:first-child,
.page-software_detail main > section:first-child {
    padding: 0 var(--pad) 76px !important;
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type,
.page-software_detail main > section:first-child > .container > .row:first-of-type {
    position: relative;
    z-index: 0;
    align-items: center;
    padding: 86px 0 72px;
    margin-bottom: 72px !important;
    color: var(--white);
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type::before,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type::before,
.page-software_detail main > section:first-child > .container > .row:first-of-type::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 0 -100vmax;
    clip-path: inset(0 -100vmax);
    background: var(--forest);
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type::after,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type::after,
.page-software_detail main > section:first-child > .container > .row:first-of-type::after {
    content: "";
    position: absolute;
    z-index: -1;
    width: 360px;
    height: 360px;
    right: -40px;
    top: -150px;
    border: 1px solid rgba(221, 196, 147, .24);
    border-radius: 50%;
    box-shadow: 0 0 0 62px rgba(221,196,147,.035), 0 0 0 124px rgba(221,196,147,.02);
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type h1,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type h1,
.page-software_detail main > section:first-child > .container > .row:first-of-type h1 {
    max-width: 930px;
    margin-bottom: 24px !important;
    color: var(--white) !important;
    font: 400 clamp(3rem, 5.6vw, 5.8rem)/1.02 var(--display) !important;
    letter-spacing: -.04em;
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type .lead,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type .lead,
.page-software_detail main > section:first-child > .container > .row:first-of-type .lead,
.page-publication_detail main > section:first-child > .container > .row:first-of-type .text-muted,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type .text-muted,
.page-software_detail main > section:first-child > .container > .row:first-of-type .text-muted {
    color: rgba(255,253,248,.68) !important;
}

.page-publication_detail main > section:first-child > .container > .row:first-of-type .btn,
.page-dataset_detail main > section:first-child > .container > .row:first-of-type .btn,
.page-software_detail main > section:first-child > .container > .row:first-of-type .btn {
    border-color: var(--gold) !important;
    background: var(--gold) !important;
    color: var(--forest) !important;
}

/* Research-area pages are long-form institutional content, not generic cards. */
.page-area_detail .research-area-detail .research-area-content > .card {
    border-width: 1px 0 !important;
    background: transparent !important;
}

.page-area_detail .research-area-detail .research-area-content .card-body {
    max-width: 1040px;
    padding: clamp(38px, 6vw, 76px) 0 !important;
}

.page-area_detail .research-area-detail .research-area-content h3 {
    margin-bottom: 30px !important;
    font-size: clamp(2.25rem, 4vw, 4rem);
}

.page-area_detail .research-area-detail .research-area-content .content {
    font-size: 1.05rem;
    line-height: 1.86;
}

.page-project_detail main .project-meta,
.page-project_detail main .project-abstract,
.page-project_detail main .project-description,
.page-project_detail main .project-objectives,
.page-project_detail main .project-methodology,
.page-project_detail main .project-outcomes,
.page-project_detail main .research-outputs-section {
    margin-bottom: -1px !important;
    padding: clamp(25px, 3.5vw, 42px) !important;
    border: 1px solid var(--detail-rule) !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.page-project_detail main .project-meta { margin-bottom: 32px !important; padding: 20px 24px !important; }
.page-project_detail main .project-abstract h3,
.page-project_detail main .project-description h3,
.page-project_detail main .project-objectives h3,
.page-project_detail main .project-methodology h3,
.page-project_detail main .project-outcomes h3 { border-bottom: 1px solid var(--detail-rule); padding-bottom: 18px; }
.page-project_detail main .status-badge {
    display: inline-block;
    border: 1px solid rgba(178,133,70,.48) !important;
    border-radius: 999px !important;
    background: transparent !important;
    color: #8c6633 !important;
    font-size: .65rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.page-project_detail main .stats-grid { gap: 1px; background: var(--detail-rule); }
.page-project_detail main .stat-item { border: 0 !important; background: var(--ivory) !important; }

.page-member_detail main .member-initials {
    border: 1px solid rgba(221,196,147,.52);
    border-radius: 50%;
    background: rgba(221,196,147,.08);
    color: var(--gold-light);
    font: 400 3rem var(--display);
    letter-spacing: -.04em;
}

body[class*="_detail"] main .cta-section,
body[class*="_detail"] main section.bg-light:last-child {
    padding: 62px var(--pad) !important;
    border: 0 !important;
    background: var(--gold) !important;
    color: var(--forest) !important;
}

body[class*="_detail"] main .cta-section h3,
body[class*="_detail"] main section.bg-light:last-child h3 {
    color: var(--forest) !important;
    font-size: clamp(2rem, 3.7vw, 3.8rem);
}

body[class*="_detail"] main .cta-section .lead,
body[class*="_detail"] main section.bg-light:last-child .lead { color: rgba(9, 45, 41, .72) !important; }

body[class*="_detail"] main .cta-section .btn-primary,
body[class*="_detail"] main section.bg-light:last-child .btn-primary {
    background: var(--forest) !important;
    border-color: var(--forest) !important;
    color: var(--white) !important;
}

@media (min-width: 768px) and (max-width: 1100px) {
    .publication-filter { grid-template-columns: 1fr 1fr auto; }
    .publication-filter input[type="search"] { grid-column: 1 / -1; }
}

@media (max-width: 767px) {
    .catalog-filter,
    .page-datasets .catalog-filter,
    .page-software .catalog-filter,
    .page-media_gallery .catalog-filter,
    .publication-filter { grid-template-columns: 1fr; }
    .catalog-grid,
    .media-editorial-grid { grid-template-columns: 1fr; }
    .evidence-strip { grid-template-columns: 1fr 1fr; }
    .evidence-strip div:nth-child(2) { border-right: 0; }
    .evidence-strip div:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
    .partner-catalog article { grid-template-columns: 1fr; }
    .page-news_list .editorial-search { grid-template-columns: 1fr; }
    .page-publication_detail main > section:first-child > .container > .row:first-of-type,
    .page-dataset_detail main > section:first-child > .container > .row:first-of-type,
    .page-software_detail main > section:first-child > .container > .row:first-of-type {
        padding: 62px 0 54px;
        margin-bottom: 52px !important;
    }

    .page-publication_detail main > section:first-child > .container > .row:first-of-type h1,
    .page-dataset_detail main > section:first-child > .container > .row:first-of-type h1,
    .page-software_detail main > section:first-child > .container > .row:first-of-type h1 {
        font-size: clamp(2.65rem, 12vw, 4rem) !important;
    }

    body[class*="_detail"] main .output-header,
    body[class*="_detail"] main .d-flex.justify-content-between { align-items: flex-start !important; flex-direction: column; }

    body[class*="_detail"] main .output-links { margin-top: 14px; }
}

/* Reference-aligned editorial utility layouts */
.editorial-section { padding: clamp(64px, 8vw, 128px) max(24px, calc((100% - 1280px) / 2)); background: var(--cream); }
.narrow-section { max-width: 1120px; margin: 0 auto; }
.legal-layout, .detail-layout, .donation-details { display: grid; grid-template-columns: minmax(260px, .72fr) minmax(0, 1.28fr); gap: clamp(48px, 8vw, 140px); }
.legal-layout h2, .detail-main h2, .donation-details h2, .donation-impact > h2 { font-family: var(--display); color: var(--forest); font-size: clamp(3rem, 5vw, 5.6rem); line-height: .98; font-weight: 400; }
.rich-copy { color: var(--slate); font-size: 1.05rem; line-height: 1.78; }
.rich-copy h2, .rich-copy h3 { color: var(--forest); margin-top: 2rem; }
.terms-layout .legal-copy h3 { font-family: var(--sans); font-size: 1.2rem; font-weight: 700; line-height: 1.35; margin: 0 0 1.35rem; }
.terms-layout .legal-copy h3:not(:first-child) { margin-top: 2.25rem; }
.terms-layout .legal-copy p { margin: 0; }
.terms-layout .legal-copy ul { margin: 1.25rem 0 0; padding-left: 1.7rem; }
.legal-meta { border-top: 1px solid var(--line); margin-top: 3rem; padding-top: 1.2rem; font-size: .86rem; }
.faq-list { border-top: 1px solid var(--line); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary { cursor: pointer; display: flex; justify-content: space-between; gap: 24px; padding: 25px 0; color: var(--forest); font-family: var(--display); font-size: clamp(1.2rem, 2vw, 1.55rem); list-style: none; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary span::before { content: '+'; color: var(--ochre); font-family: var(--sans); }
.faq-list details[open] summary span::before { content: '−'; }
.faq-list details .rich-copy { padding: 0 52px 28px 0; }
.detail-hero .hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.detail-main { min-width: 0; }
.detail-aside { border-left: 1px solid var(--line); padding-left: clamp(28px, 4vw, 58px); }
.detail-facts { margin: 0; }
.detail-facts div { border-bottom: 1px solid var(--line); padding: 18px 0; }
.detail-facts dt { color: var(--ochre-dark); font-size: .72rem; text-transform: uppercase; letter-spacing: .15em; }
.detail-facts dd { margin: 7px 0 0; color: var(--forest); }
.partner-logo { max-width: 230px; max-height: 120px; object-fit: contain; margin-bottom: 30px; }
.donor-list { border-top: 1px solid var(--line); }
.donor-list article { display: grid; grid-template-columns: 120px 1fr; gap: 30px; padding: 25px 0; border-bottom: 1px solid var(--line); }
.donor-list h3 { margin: 0 0 5px; }
.donor-list p { margin: 0; }
.donor-year { color: var(--ochre-dark); font-family: var(--display); font-size: 1.3rem; }
.donation-impact > .eyebrow, .donation-impact > h2 { max-width: var(--content); margin-left: auto; margin-right: auto; }
.donation-impact > h2 { margin-top: 16px; margin-bottom: 55px; }
.donation-qr { margin: 44px 0 0; max-width: 260px; }
.donation-qr img { display: block; width: 100%; padding: 12px; background: #fff; border: 1px solid var(--line); }
.donation-qr figcaption { color: var(--slate); font-size: .78rem; margin-top: 9px; }
.donation-facts dl { margin: 0; }
.donation-facts dl div { display: grid; grid-template-columns: 150px 1fr; gap: 20px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.donation-facts dt { font-weight: 700; color: var(--forest); }
.donation-facts dd { margin: 0; color: var(--slate); }
.editorial-empty { padding: clamp(42px, 7vw, 90px) 0; }
.span-all { grid-column: 1 / -1; }

/* Event detail and registration follow the shared editorial system. */
.compact-hero { min-height: 390px; }
.registration-page { max-width: 1180px; }
.registration-card { background: var(--white); border: 1px solid var(--line)!important; box-shadow: none!important; }
.registration-card > .card-header { background: var(--forest); color: var(--white); border: 0; border-radius: 0; padding: 24px 28px; }
.registration-card > .card-header h3 { margin: 0; color: var(--white)!important; font: 400 1.8rem/1.2 var(--display); }
.registration-card .card { border: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.registration-card .card-header.bg-info,
.registration-card .card-header.bg-primary { background: var(--cream)!important; color: var(--ink)!important; border-bottom: 1px solid var(--line); }
.registration-card input:not([type="checkbox"]):not([type="radio"]),
.registration-card select,
.registration-card textarea { border-radius: 0; border: 1px solid var(--line); background: var(--ivory); }
.registration-card .btn { border-radius: 0; }
.registration-card .btn-primary { background: var(--forest); border-color: var(--forest); }
.detail-feature-image.startup-logo-image { width: auto; max-width: min(320px, 100%); max-height: 150px; object-fit: contain; object-position: left center; }
.error-search-button { margin-bottom: 46px; }

/* Impact stories use the same image-led editorial system as the media archive. */
.impact-filter { grid-template-columns: minmax(280px, 1.5fr) repeat(2, minmax(170px, .8fr)) auto auto; }
.impact-editorial-grid { margin-top: 52px; }
.impact-frame { text-decoration: none; }
.impact-initials {
    display: grid;
    width: 88px;
    height: 88px;
    place-items: center;
    border: 1px solid rgba(221,196,147,.48);
    border-radius: 50%;
    color: var(--gold-light);
    font: 400 2rem var(--display);
}
.impact-editorial-grid h3 a { color: inherit; text-decoration: none; }
.impact-story-layout { grid-template-columns: minmax(0, 1.25fr) minmax(260px, .55fr); }
.impact-feature { margin: 0 0 48px; }
.impact-feature img { display: block; width: 100%; max-height: 620px; object-fit: cover; }
.detail-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 24px; margin-top: 42px; padding-top: 30px; border-top: 1px solid var(--line); }
.faq-quick-links a { color: #8f6731; text-underline-offset: 3px; }

/* Long partnership titles keep an editorial scale without becoming a wall. */
.collaboration-detail-layout { grid-template-columns: minmax(0, 1.35fr) minmax(260px, .65fr); }
.collaboration-title {
    max-width: 820px;
    font-size: clamp(2.5rem, 4.2vw, 4.9rem) !important;
    line-height: 1.02 !important;
    overflow-wrap: break-word;
}
.partner-mark-large { width: 104px; height: 104px; margin-bottom: 30px; font-size: 1.8rem; }
.partner-grid .partner-logo .partner-mark { width: 58px; height: 58px; font-size: 1.1rem; }

.bibtex-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.role-filter a {
    padding: 9px 13px;
    border: 1px solid var(--line);
    color: var(--muted);
    font: 500 .7rem var(--sans);
    letter-spacing: .08em;
    text-decoration: none;
    text-transform: uppercase;
}
.role-filter a.active { border-color: var(--forest); background: var(--forest); color: var(--white); }
.people-search { display: grid; grid-template-columns: minmax(260px, 1fr) auto auto; max-width: 860px; margin: 0 0 42px; }
.people-search input { min-height: 50px; padding: 0 16px; border: 1px solid var(--line); background: rgba(255,253,248,.55); }
.people-search .text-link { align-self: center; margin-left: 20px; }

/* Keep every editorial page on the same 1280px content rail as the landing page. */
.detail-layout,
.catalog-section {
  width: min(1280px, calc(100% - 48px));
  margin-left: auto;
  margin-right: auto;
}
.detail-layout { padding-top: clamp(64px, 7vw, 104px); padding-bottom: clamp(64px, 7vw, 104px); }
.catalog-section { padding-top: clamp(64px, 7vw, 104px); padding-bottom: clamp(64px, 7vw, 104px); }
.inner-hero.detail-hero { background: var(--forest) !important; color: var(--white) !important; }
.inner-hero.detail-hero h1 { color: var(--white) !important; }
.inner-hero.detail-hero > p { color: rgba(255,253,248,.68) !important; }

/* The reference uses these exact two typefaces throughout. */
html body { font-family: "DM Sans", system-ui, sans-serif !important; }
h1, h2, h3, h4, h5, h6,
.inner-hero h1, .page-cta h2, .resource-grid h3,
.publication-catalog h3 { font-family: "Libre Caslon Display", Georgia, serif; }

/* Incubator application: retain the complete Django form while bringing its
   presentation into the same restrained editorial system. */
.page-incubator_apply .application-form-section {
  padding: clamp(64px, 8vw, 112px) 24px !important;
  background: var(--ivory) !important;
}
.page-incubator_apply .application-form-section > .container { max-width: 980px; }
.page-incubator_apply .application-card {
  margin: 0 !important;
  padding: clamp(28px, 5vw, 64px) !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: rgba(255,253,248,.48) !important;
  box-shadow: none !important;
}
.page-incubator_apply .card-header { text-align: left !important; }
.page-incubator_apply .card-header h2,
.page-incubator_apply .benefits-section h2 {
  font: 400 clamp(2.4rem, 4vw, 4rem)/1.05 var(--display) !important;
  color: var(--forest) !important;
}
.page-incubator_apply .form-section { margin: 0; padding: 30px 0; border-top: 1px solid var(--line); }
.page-incubator_apply .section-title,
.page-incubator_apply .founder-title {
  margin-bottom: 24px !important;
  padding: 0 0 12px !important;
  border: 0 !important;
  color: var(--forest) !important;
  font: 400 1.5rem var(--display) !important;
}
.page-incubator_apply .form-label {
  color: var(--ink) !important;
  font-size: .68rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.page-incubator_apply .form-control,
.page-incubator_apply .form-select {
  padding: 13px 14px !important;
  border: 1px solid var(--line) !important;
  border-radius: 0 !important;
  background: var(--white) !important;
}
.page-incubator_apply .form-control:focus,
.page-incubator_apply .form-select:focus { border-color: var(--gold) !important; box-shadow: 0 0 0 2px rgba(191,148,81,.15) !important; }
.page-incubator_apply .founder-section { padding: 24px !important; border: 1px solid var(--line) !important; border-radius: 0 !important; background: var(--cream) !important; }
.page-incubator_apply .benefits-section { padding: 84px 24px !important; background: var(--cream) !important; }
.page-incubator_apply .benefits-section > .container { max-width: 1280px; }
.page-incubator_apply .benefit-card { padding: 30px !important; border: 1px solid var(--line) !important; border-radius: 0 !important; background: transparent !important; box-shadow: none !important; }
.page-incubator_apply .benefit-icon { width: auto !important; height: auto !important; margin: 0 0 28px !important; border-radius: 0 !important; background: none !important; justify-content: flex-start !important; }
.page-incubator_apply .benefit-icon i { color: var(--gold) !important; font-size: 1.4rem !important; }
.page-incubator_apply .benefit-card h5 { color: var(--forest) !important; font: 400 1.45rem var(--display) !important; }
.page-incubator_apply .benefit-card p { color: var(--muted) !important; }

/* Staff event analytics: an information-dense working surface in the site system. */
.analytics-page-hero { padding-top: 72px; padding-bottom: 62px; }
.analytics-page-hero .breadcrumbs { margin-bottom: 28px; }
.analytics-page-hero .eyebrow { margin-bottom: 16px; }
.analytics-page-hero h1 { font-size: clamp(3.5rem, 6vw, 6.2rem); }
.analytics-page-hero > p:not(.eyebrow) { margin-top: 18px; }
.analytics-hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin-top: 26px; position: relative; z-index: 2; }
.analytics-hero-meta span { color: var(--gold-light); font-size: .72rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.analytics-dashboard { display: block; }
.analytics-intro,
.analytics-section-heading { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 8vw, 130px); align-items: end; }
.analytics-intro h2,
.analytics-section-heading h2,
.analytics-registrations h2 { margin: 0; color: var(--forest); font: 400 clamp(2.4rem, 4vw, 4.2rem)/1.04 var(--display); }
.analytics-intro > p,
.analytics-section-heading > p { max-width: 560px; margin: 0 0 7px; color: var(--muted); font-size: 1rem; }
.analytics-stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); margin-top: 50px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.analytics-stat-grid article { min-height: 190px; padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analytics-stat-grid span,
.analytics-panel > header > span { color: #966f39; font-size: .68rem; font-weight: 600; letter-spacing: .13em; text-transform: uppercase; }
.analytics-stat-grid strong { display: block; margin: 25px 0 3px; color: var(--forest); font: 400 clamp(2.6rem, 4vw, 4.2rem)/1 var(--display); }
.analytics-stat-grid small { color: var(--muted); font-size: .78rem; }
.analytics-capacity { padding: 30px; background: var(--gold); }
.analytics-capacity > div:first-child { display: flex; justify-content: space-between; gap: 24px; margin-bottom: 12px; color: var(--forest); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
.analytics-capacity b { font-weight: 700; }
.analytics-track { height: 7px; overflow: hidden; background: rgba(11,47,43,.14); }
.analytics-track i { display: block; height: 100%; background: var(--forest); }
.analytics-section-heading { margin-top: 95px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.analytics-distribution-grid { display: grid; grid-template-columns: 1fr 1fr; border-left: 1px solid var(--line); }
.analytics-panel { padding: 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.analytics-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; margin-bottom: 28px; }
.analytics-panel h3 { margin: 0; color: var(--forest); font: 400 1.55rem/1.25 var(--display); }
.analytics-panel .eyebrow { margin-bottom: 9px; }
.analytics-bars { display: grid; gap: 21px; }
.analytics-bar-row > div:first-child { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; margin-bottom: 8px; }
.analytics-bar-row span { color: var(--slate); font-size: .9rem; }
.analytics-bar-row b { color: var(--forest); font-size: .75rem; font-weight: 600; white-space: nowrap; }
.analytics-empty { margin: 0; color: var(--muted); font-size: .9rem; }
.analytics-lower-grid { display: grid; grid-template-columns: 1.35fr .65fr; margin-top: 72px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.analytics-pipeline { margin: 0; }
.analytics-pipeline div { display: flex; justify-content: space-between; gap: 24px; padding: 13px 0; border-bottom: 1px solid var(--line); }
.analytics-pipeline div:last-child { border-bottom: 0; }
.analytics-pipeline dt { color: var(--muted); font-weight: 400; }
.analytics-pipeline dd { margin: 0; color: var(--forest); font: 400 1.25rem var(--display); }
.analytics-registrations { margin-top: 95px; }
.analytics-registrations > header { display: flex; align-items: end; justify-content: space-between; gap: 30px; padding-bottom: 24px; border-bottom: 1px solid var(--line); }
.analytics-table-wrap { overflow-x: auto; }
.analytics-table-wrap table { width: 100%; min-width: 760px; border-collapse: collapse; }
.analytics-table-wrap th { padding: 15px 12px; color: #966f39; font-size: .66rem; letter-spacing: .12em; text-align: left; text-transform: uppercase; }
.analytics-table-wrap td { padding: 17px 12px; border-top: 1px solid var(--line); color: var(--slate); font-size: .85rem; vertical-align: middle; }
.analytics-table-wrap td:first-child strong,
.analytics-table-wrap td:first-child span { display: block; }
.analytics-table-wrap td:first-child strong { color: var(--forest); font-size: .92rem; }
.analytics-table-wrap td:first-child span { margin-top: 2px; color: var(--muted); font-size: .76rem; }
.analytics-table-wrap td:last-child a { color: var(--forest); font-size: 1.2rem; text-decoration: none; }
.analytics-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 45px; }
.analytics-actions .button.outline { border: 1px solid var(--line); color: var(--forest); }

@media (max-width: 900px) {
    .analytics-stat-grid { grid-template-columns: 1fr 1fr; }
    .analytics-lower-grid { grid-template-columns: 1fr; }
}

@media (max-width: 767px) {
    .analytics-page-hero { padding-top: 58px; padding-bottom: 52px; }
    .analytics-intro,
    .analytics-section-heading { grid-template-columns: 1fr; gap: 20px; }
    .analytics-stat-grid,
    .analytics-distribution-grid { grid-template-columns: 1fr; }
    .analytics-stat-grid article { min-height: 150px; }
    .analytics-section-heading,
    .analytics-registrations { margin-top: 68px; }
    .analytics-panel { padding: 25px 20px; }
    .analytics-registrations > header { align-items: flex-start; flex-direction: column; }
}

/* FAQ matches the reference's quiet ivory field and left-aligned 980px rule. */
.page-faq .editorial-section { background: var(--ivory); }
.page-faq .narrow-section { max-width: 980px; margin-left: 0; margin-right: 0; }

@media (max-width: 767px) {
    .impact-filter { grid-template-columns: 1fr; }
    .impact-story-layout,
    .collaboration-detail-layout { grid-template-columns: 1fr; }
    .bibtex-toolbar { align-items: flex-start; flex-direction: column; }
    .people-search { grid-template-columns: 1fr; gap: 8px; }
    .people-search .text-link { justify-self: start; margin: 8px 0 0; }
  .legal-layout, .detail-layout, .donation-details { grid-template-columns: 1fr; gap: 40px; }
  .detail-aside { border-left: 0; border-top: 1px solid var(--line); padding: 30px 0 0; }
  .donor-list article { grid-template-columns: 70px 1fr; }
  .donation-facts dl div { grid-template-columns: 1fr; gap: 4px; }
}

@media (max-width: 767px) {
    main .page-hero-section,
    main .donate-hero-section,
    main > section.bg-gradient-primary { padding: 70px 24px 58px !important; }
    main .page-hero-section h1,
    main .donate-hero-section h1,
    main > section.bg-gradient-primary h1 { font-size: clamp(3rem, 14vw, 4.6rem) !important; }
    main section.py-5:not(.page-hero-section):not(.donate-hero-section),
    main .news-content-section,
    main .events-section,
    main .resources-section,
    main .templates-section,
    main .media-gallery-section,
    main .projects-section,
    main .impact-stories-section,
    main .testimonials-section,
    main .documents-section { padding: 55px 24px !important; }
    main section.py-4,
    main .search-section,
    main .search-filter-section,
    main .stats-section,
    main .statistics-section { padding: 24px !important; }
    main section:not(.inner-hero):not(.inner-section):not(.section):not(.page-cta) > .container { padding: 0 !important; }
    main .hero-stats { margin-top: 30px; }
}

/* Persistent public accessibility controls beside back-to-top. */
.page-tools{position:fixed;right:20px;bottom:20px;z-index:1100;display:flex;gap:8px;align-items:center}
.page-tool-button{display:grid;width:52px;height:52px;padding:0;place-items:center;border:1px solid rgba(255,255,255,.16);background:var(--forest);color:var(--white);font-size:1rem;cursor:pointer;box-shadow:0 10px 28px rgba(8,39,36,.18)}
.page-tool-button:hover,.page-tool-button:focus-visible{background:var(--gold);color:var(--forest);outline:3px solid rgba(191,148,81,.3);outline-offset:2px}
.back-to-top{display:none}
.accessibility-panel{position:fixed;right:20px;bottom:84px;z-index:1101;width:min(330px,calc(100vw - 40px));padding:22px;background:var(--white);color:var(--ink);border:1px solid var(--line);box-shadow:0 22px 65px rgba(8,39,36,.25)}
.accessibility-panel[hidden]{display:none}
.accessibility-panel-header{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:15px;border-bottom:1px solid var(--line)}
.accessibility-panel-header h2{margin:0;font:400 1.6rem var(--display);color:var(--forest)}
.accessibility-close{border:0;background:transparent;color:var(--forest);font-size:1.6rem;line-height:1;cursor:pointer}
.accessibility-setting{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:16px 0;border-bottom:1px solid var(--line);font-size:.86rem}
.accessibility-size-controls{display:flex;align-items:center;gap:8px}
.accessibility-size-controls button{width:38px;height:34px;border:1px solid var(--line);background:var(--ivory);color:var(--forest);font-weight:700;cursor:pointer}
.accessibility-size-controls output{min-width:44px;text-align:center;color:var(--muted);font-size:.76rem}
.accessibility-color-setting input{width:50px;height:34px;padding:2px;border:1px solid var(--line);background:var(--ivory);cursor:pointer}
.accessibility-switch-setting input{width:38px;height:20px;accent-color:var(--forest)}
.accessibility-reset{width:100%;margin-top:18px;padding:11px 14px;border:1px solid var(--forest);background:transparent;color:var(--forest);font-size:.72rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;cursor:pointer}
.accessibility-reset:hover,.accessibility-reset:focus-visible{background:var(--forest);color:var(--white)}
body.a11y-high-contrast{--ivory:#fff;--cream:#f0f0f0;--ink:#000;--muted:#242424;--forest:#001c18;--forest-mid:#002923;--forest-soft:#174c43;--gold:#9b6500;--gold-light:#ffd98b;--line:rgba(0,0,0,.42)}
body.a11y-custom-text :where(main,footer) :where(h1,h2,h3,h4,h5,h6,p,li,dt,dd,label,a,span){color:var(--a11y-text-color)!important}
@media(max-width:520px){.page-tools{right:14px;bottom:14px}.page-tool-button{width:48px;height:48px}.accessibility-panel{right:14px;bottom:74px;width:calc(100vw - 28px)}}

/* Keep native and legacy interaction states inside the CAIR-Nepal palette. */
html {
    accent-color: var(--forest);
    scrollbar-color: var(--forest-soft) var(--cream);
}

* {
    scrollbar-color: var(--forest-soft) var(--cream);
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: var(--cream);
}

::-webkit-scrollbar-thumb {
    border: 2px solid var(--cream);
    border-radius: 999px;
    background: var(--forest-soft);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gold-deep);
}

main :where(input[type="checkbox"], input[type="radio"], input[type="range"], progress) {
    accent-color: var(--forest);
}

main :where(.form-control, .form-select):focus {
    border-color: var(--gold) !important;
    box-shadow: 0 0 0 .2rem rgba(191, 148, 81, .2) !important;
}

main :where(.btn-primary, .button.primary):is(:hover, :focus-visible, :active),
main :where(.btn-outline-primary, .btn-outline-info):is(:hover, :focus-visible, :active) {
    border-color: var(--gold) !important;
    background: var(--gold) !important;
    color: var(--forest) !important;
}

main :where(.page-link, .dropdown-item, .list-group-item-action):is(:hover, :focus-visible, :active) {
    border-color: var(--gold) !important;
    background-color: var(--cream) !important;
    color: var(--forest) !important;
}

main :where(.nav-link, .text-link, .detail-link, .card-link):is(:hover, :focus-visible) {
    color: var(--gold-deep) !important;
}

main :where(.btn, .button, a, input, select, textarea, summary):focus-visible {
    outline: 3px solid rgba(191, 148, 81, .45);
    outline-offset: 3px;
}

/* Expand the homepage proof strip only when incubated startups are available. */
.proof.proof-with-incubated {
    grid-template-columns: 1.4fr repeat(6, minmax(0, 1fr));
}

@media (min-width: 1001px) and (max-width: 1300px) {
    .proof.proof-with-incubated > div {
        padding-inline: 16px;
    }
}

@media (max-width: 1000px) {
    .proof.proof-with-incubated {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 760px) {
    .proof.proof-with-incubated {
        grid-template-columns: 1fr 1fr;
    }
}
