:root {
  --ink: #17243a;
  --muted: #617087;
  --line: #dfe6ef;
  --paper: #ffffff;
  --bg: #f5f8fc;
  --blue: #1f50c9;
  --blue-dark: #163b9c;
  --blue-soft: #edf3ff;
  --teal: #087d73;
  --green: #167a45;
  --amber: #996000;
  --red: #b42318;
  --shadow: 0 10px 28px rgba(24, 42, 70, .07);
  --radius: 18px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
}
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; }
button, .button, select { min-height: 46px; }
.wrap { width: min(1180px, 100%); margin: 0 auto; padding: 0 24px; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, .96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 4px 16px rgba(24, 42, 70, .04);
  backdrop-filter: blur(12px);
}
.nav-bar {
  min-height: 70px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}
.brand {
  display: inline-flex;
  align-items: center;
  color: var(--ink);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-logo { display: block; width: 164px; height: auto; }
.nav-bar nav {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
}
.nav-bar nav a {
  padding: 9px 12px;
  border-radius: 10px;
  color: #435169;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
}
.nav-bar nav a:hover,
.nav-bar nav a:focus-visible { background: var(--blue-soft); color: var(--blue); text-decoration: none; }

main.wrap { padding-top: 28px; padding-bottom: 52px; }
.site-footer {
  padding: 27px 0 32px;
  background: #fff;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.mobile-nav { display: none; }

.hero {
  max-width: 900px;
  margin: 7px 0 28px;
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid #d9e5fb;
  border-radius: 26px;
  background: linear-gradient(135deg, #eef4ff 0%, #f9fbff 62%, #eaf8f5 100%);
  box-shadow: var(--shadow);
}
.eyebrow {
  margin: 0 0 8px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 850;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.hero h1,
.page-heading h1 {
  margin: 0 0 14px;
  color: var(--ink);
  font-size: clamp(32px, 5vw, 54px);
  line-height: 1.06;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.page-heading { padding: 22px 0 24px; }
.page-heading h1 { font-size: clamp(30px, 4vw, 44px); }
.landing-intro { max-width: 920px; margin: 0 0 22px; border-color: #d5e0f2; }
.landing-intro h2 { font-size: 23px; }
.landing-intro p:last-child { margin-bottom: 0; }
.trust-section { margin: 0 0 40px; }
.trust-section .section-heading { margin-bottom: 9px; }
.section-lead { max-width: 850px; margin-bottom: 17px; color: var(--muted); }
.trust-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.trust-card { min-height: 207px; display: flex; flex-direction: column; }
.trust-card h3 { margin-top: 3px; }
.trust-card p:last-child { margin-bottom: 0; }
.trust-label { margin-bottom: 2px; color: var(--blue); font-size: 11px; font-weight: 850; letter-spacing: .11em; text-transform: uppercase; }
.trust-date { color: var(--ink); font-size: 25px; font-weight: 850; line-height: 1.2; letter-spacing: -.03em; }
.trust-note { margin: 17px 0 0; padding: 14px 16px; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; background: #f0faf8; color: #365d5a; font-size: 14px; }
.home-faq { max-width: 920px; }
.home-faq .faq-item h3 { margin: 0 0 5px; font-size: 17px; }
.segment-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 9px; margin: 22px 0 25px; }
.segment-facts > div { padding: 13px 14px; border: 1px solid #e0e8f2; border-radius: 12px; background: #f8fbff; }
.segment-facts strong { display: block; color: var(--blue); font-size: 25px; line-height: 1.15; }
.segment-facts span { color: var(--muted); font-size: 12px; }
.segment-faq { margin-top: 25px; padding-top: 22px; border-top: 1px solid #e7edf4; }
.segment-faq h3 { margin-top: 0; font-size: 21px; }
.faq-list { display: grid; gap: 12px; }
.faq-item { padding: 14px 15px; border: 1px solid #e3e9f0; border-radius: 12px; background: #fff; }
.faq-item h4 { margin: 0 0 5px; color: var(--ink); font-size: 16px; line-height: 1.35; }
.faq-item p { margin: 0; color: #536177; font-size: 14px; }
h2 { margin: 0 0 14px; font-size: 25px; line-height: 1.18; letter-spacing: -.025em; }
h3 { margin: 7px 0 8px; font-size: 18px; line-height: 1.3; }
p { margin: 0 0 13px; }
.sub { max-width: 760px; color: var(--muted); font-size: 18px; }
.hero .search-row {
  margin-top: 26px;
  padding: 7px;
  border: 1px solid #d5e0f2;
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(40, 74, 130, .08);
}
.search-row { display: flex; gap: 8px; margin: 22px 0 4px; }
.search-row input { flex: 1; min-width: 0; border: 0; box-shadow: none; }
.search-row input:focus { outline: 0; }

.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.kpi-grid { margin: 16px 0 40px; }
.card {
  min-width: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.kpi { margin-bottom: 3px; color: var(--ink); font-size: 32px; font-weight: 850; line-height: 1.1; letter-spacing: -.04em; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 14px;
  border: 1px solid #cbd5e2;
  border-radius: 10px;
  background: #fff;
  color: #293951;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease, transform .15s ease;
}
.button:hover { background: #f5f8fd; text-decoration: none; }
.button:active { transform: translateY(1px); }
.button.primary { border-color: var(--blue); background: var(--blue); color: #fff; }
.button.primary:hover { border-color: var(--blue-dark); background: var(--blue-dark); }
.button.saved { border-color: #acd8c3; background: #effaf4; color: var(--green); }
.button.full { width: 100%; margin-top: 9px; }
.section-block { margin-top: 42px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.section-heading h2 { margin-bottom: 0; }
.profile-card { min-height: 232px; display: flex; flex-direction: column; align-items: flex-start; }
.profile-card .button { margin-top: auto; }
.profile-count { color: var(--muted); font-size: 14px; }
.profile-count strong { color: var(--ink); font-size: 19px; }

.layout { display: grid; grid-template-columns: 276px minmax(0, 1fr); gap: 22px; align-items: start; }
.filters { position: sticky; top: 92px; }
.filters label { display: block; margin: 13px 0 4px; color: #33435c; font-size: 13px; font-weight: 800; }
input, select {
  width: 100%;
  min-height: 46px;
  padding: 10px 12px;
  border: 1px solid #cbd5e2;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
}
input:focus, select:focus { outline: 3px solid #dbe6ff; border-color: var(--blue); }
.filter-help { margin-top: 19px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.filter-help p { margin-top: 4px; }
.results-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 0 0 13px; }
.results-toolbar p { margin: 0; }
.results-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; }
.grant-card { display: flex; min-height: 0; flex-direction: column; }
.grant-card h3 { margin-top: 14px; font-size: 19px; }
.grant-card h3 a { color: var(--ink); }
.grant-card h3 a:hover { color: var(--blue); }
.grant-card > p:nth-of-type(1) {
  display: -webkit-box;
  margin-bottom: 3px;
  overflow: hidden;
  color: #58677c;
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 4;
}
.grant-meta { margin-top: auto; padding-top: 15px; border-top: 1px solid #edf0f4; color: #586478; font-size: 13px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  display: inline-block;
  max-width: 100%;
  padding: 5px 9px;
  overflow: hidden;
  border: 1px solid #e0e6ee;
  border-radius: 999px;
  background: #f4f6f9;
  color: #4d5a6e;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tag:hover { background: #e8eef9; text-decoration: none; }
.tag-kind { background: #f0f3f7; color: #3e4d62; }
.open { color: var(--green); font-weight: 800; }
.soon { color: var(--amber); font-weight: 800; }
.closed { color: var(--red); font-weight: 750; }
.status-line { font-weight: 800; }
.empty { padding: 38px; text-align: center; }
.pagination { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 24px; }
.pagination .button.active { border-color: var(--blue); background: var(--blue); color: #fff; }

.breadcrumb { margin-bottom: 17px; overflow: hidden; color: var(--muted); font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(270px, 1fr); gap: 22px; align-items: start; }
.detail > section { min-width: 0; }
.detail .card { margin-bottom: 17px; }
.detail-intro { border-color: #d5e0f2; }
.detail-intro h1 { margin: 20px 0 13px; color: var(--ink); font-size: clamp(29px, 4vw, 46px); line-height: 1.08; letter-spacing: -.045em; overflow-wrap: anywhere; }
.detail-intro .sub { font-size: 17px; }
.context-summary { margin: 18px 0 0; padding: 13px 15px; border-left: 3px solid var(--teal); border-radius: 0 10px 10px 0; background: #f0faf8; color: #365d5a; font-size: 14px; overflow-wrap: anywhere; }
.detail-intro .card-actions { padding-top: 15px; border-top: 1px solid #edf0f4; }
.alertbox { margin-bottom: 17px; padding: 20px; border: 1px solid #c9dbff; border-radius: var(--radius); background: var(--blue-soft); }
.info-card { border-color: #d8dee8; background: #fafbfd; }
.check { display: block; margin: 13px 0; font-size: 15px; }
.check input { width: auto; min-height: 0; margin-right: 8px; vertical-align: -2px; }
.detail-section { overflow: hidden; }
.detail-section > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}
.detail-section > summary::-webkit-details-marker { display: none; }
.detail-section > summary::after { content: "+"; color: var(--blue); font-size: 25px; font-weight: 400; line-height: 1; }
.detail-section[open] > summary::after { content: "−"; }
.detail-section > summary h2 { margin: 0; }
.detail-section > summary:focus-visible { outline: 3px solid #dbe6ff; outline-offset: 5px; }
.detail-section > summary + .section-content { margin-top: 16px; }
.section-hint { color: var(--muted); font-size: 13px; font-weight: 650; }
.clean-list { margin: 0; padding-left: 21px; }
.clean-list li { margin: 0 0 13px; overflow-wrap: anywhere; }
.clean-list.compact li { margin-bottom: 8px; }
.key-data p { margin-bottom: 0; padding: 11px 0; border-bottom: 1px solid #edf0f4; overflow-wrap: anywhere; }
.key-data p:last-child { border-bottom: 0; }
.trace { margin-top: 18px; padding: 14px; border-left: 3px solid #91b0fa; background: #f5f8ff; color: #55647c; font-size: 13px; overflow-wrap: anywhere; }
.trace p:last-child { margin-bottom: 0; }

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 15px;
  border-radius: 10px;
  background: #172033;
  color: #fff;
  box-shadow: 0 8px 20px rgba(0, 0, 0, .18);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity .2s, transform .2s;
}
.toast.visible { opacity: 1; transform: translateY(0); }

@media (max-width: 900px) {
  .layout, .detail { grid-template-columns: 1fr; }
  .filters { position: static; }
  .results-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .trust-grid { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  body { padding-bottom: 68px; }
  .wrap { padding-right: 16px; padding-left: 16px; }
  .site-header { position: sticky; }
  .nav-bar { min-height: 61px; gap: 10px; }
  .brand-logo { width: 137px; }
  .nav-bar nav { flex: 1; justify-content: flex-end; gap: 2px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: none; }
  .nav-bar nav::-webkit-scrollbar { display: none; }
  .nav-bar nav a { padding: 8px 9px; font-size: 12px; }
  main.wrap { padding-top: 19px; padding-bottom: 30px; }
  .hero { margin-top: 0; padding: 27px 20px 21px; border-radius: 21px; }
  .hero h1 { font-size: 35px; }
  .hero .sub, .sub { font-size: 16px; }
  .hero .search-row { margin-top: 21px; padding: 0; border: 0; background: transparent; box-shadow: none; }
  .search-row { flex-direction: column; gap: 9px; }
  .search-row input { border: 1px solid #cbd5e2; }
  .search-row .button { width: 100%; }
  .grid, .results-grid { grid-template-columns: 1fr; }
  .kpi-grid { gap: 9px; margin: 15px 0 32px; }
  .kpi-grid .card { display: flex; align-items: baseline; gap: 8px; padding: 14px 16px; }
  .kpi { font-size: 28px; }
  .segment-facts { grid-template-columns: 1fr 1fr 1fr; gap: 7px; }
  .segment-facts > div { padding: 11px 9px; }
  .segment-facts strong { font-size: 22px; }
  .segment-facts span { font-size: 11px; line-height: 1.25; }
  .card { padding: 17px; border-radius: 16px; }
  .section-block { margin-top: 34px; }
  .section-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .page-heading { padding: 13px 0 19px; }
  .page-heading h1 { font-size: 32px; }
  .filters { padding: 14px 16px; }
  .filters form { padding-top: 4px; }
  .grant-card h3 { font-size: 18px; }
  .grant-card > p:nth-of-type(1) { -webkit-line-clamp: 5; }
  .grant-meta { line-height: 1.8; }
  .detail-intro h1 { font-size: 32px; }
  .detail-intro .card-actions .button { flex: 1 1 145px; }
  .detail-section > summary { min-height: 30px; }
  .detail-section > summary h2 { font-size: 21px; }
  .section-hint { display: none; }
  .key-data p { padding: 10px 0; }
  .alertbox .button { width: 100%; }
  .mobile-nav {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 12;
    display: flex;
    justify-content: space-around;
    padding: 7px 8px calc(7px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    box-shadow: 0 -5px 18px rgba(24, 42, 70, .08);
    backdrop-filter: blur(12px);
  }
  .mobile-nav a { display: grid; min-width: 70px; justify-items: center; gap: 1px; padding: 2px 5px; color: #536177; font-size: 11px; font-weight: 750; }
  .mobile-nav a:hover { color: var(--blue); text-decoration: none; }
  .mobile-nav-icon { color: var(--blue); font-size: 18px; line-height: 1.1; }
  .toast { right: 15px; bottom: 82px; left: 15px; max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}

.analytics-consent {
  position: fixed;
  right: 18px;
  bottom: 18px;
  left: 18px;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  max-width: 760px;
  margin: auto;
  padding: 15px 17px;
  border: 1px solid #d9e1ec;
  border-radius: 16px;
  background: rgba(255, 255, 255, .98);
  box-shadow: 0 15px 45px rgba(24, 42, 70, .18);
}
.analytics-consent[hidden] { display: none; }
.analytics-consent p { margin: 4px 0 0; color: #536177; font-size: 12px; }
.analytics-consent-actions { display: flex; flex: 0 0 auto; gap: 8px; }
.analytics-consent-actions .button { white-space: nowrap; }
@media (max-width: 620px) {
  .analytics-consent { right: 12px; bottom: 74px; left: 12px; display: block; padding: 14px; }
  .analytics-consent-actions { margin-top: 12px; }
  .analytics-consent-actions .button { flex: 1; }
}
