:root {
  --ink: #102a43;
  --ink-soft: #34516b;
  --navy: #0d263e;
  --navy-deep: #071a2b;
  --paper: #f5f8fb;
  --surface: #ffffff;
  --surface-muted: #eef4f8;
  --line: #d5e1ea;
  --line-strong: #b7c9d7;
  --blue: #176b9b;
  --blue-dark: #10557e;
  --mint: #19b58b;
  --mint-light: #d8f5eb;
  --gold: #e8a33c;
  --danger: #ae3d3d;
  --shadow: 0 18px 44px rgba(25, 56, 80, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

html { background: var(--paper); }

body {
  min-width: 320px;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: 16px;
  line-height: 1.55;
}

button, textarea { font: inherit; }

button:focus-visible, textarea:focus-visible, a:focus-visible, input:focus-visible {
  outline: 3px solid #56b8ed;
  outline-offset: 3px;
}

.site-header {
  min-height: 76px;
  padding: 0 max(24px, calc((100vw - 1280px) / 2));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  background: var(--navy);
  color: #ffffff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  font-size: 1.04rem;
  font-weight: 760;
  letter-spacing: -0.018em;
  text-decoration: none;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  overflow: visible;
}

.brand-mark path {
  fill: none;
  stroke: #f3b44c;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.brand-mark circle {
  fill: var(--mint);
  stroke: var(--navy);
  stroke-width: 2;
}

.header-label {
  color: #bed0df;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.workspace {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 38px 0 48px;
  display: grid;
  grid-template-columns: minmax(270px, 308px) minmax(0, 1fr);
  gap: 30px;
  align-items: start;
}

.sidebar { display: grid; gap: 18px; }

.side-card, .search-card, .results-panel, .history-panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.side-card { padding: 24px; }

.filter-card {
  border-color: var(--navy);
  background: var(--navy);
  color: #ffffff;
  box-shadow: 0 18px 42px rgba(13, 38, 62, 0.16);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 24px;
}

.compact-heading { margin-bottom: 6px; }

.section-kicker {
  margin: 0 0 4px;
  color: var(--blue);
  font-size: 0.72rem;
  font-weight: 780;
  letter-spacing: 0.095em;
  text-transform: uppercase;
}

.filter-card .section-kicker { color: #75dcc4; }

h1, h2, h3, p { margin-top: 0; }

h1 {
  margin-bottom: 8px;
  font-size: clamp(2.1rem, 5vw, 3.35rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

h2 {
  margin-bottom: 0;
  font-size: 1.26rem;
  line-height: 1.2;
  letter-spacing: -0.027em;
}

h3 {
  margin-bottom: 12px;
  font-size: 1.1rem;
  line-height: 1.4;
  letter-spacing: -0.012em;
}

.quiet-button {
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 7px;
  padding: 0.28rem 0.55rem;
  background: transparent;
  color: #ffffff;
  font-size: 0.79rem;
  font-weight: 700;
  cursor: pointer;
}

.quiet-button:hover { background: rgba(255, 255, 255, 0.12); }

fieldset { min-width: 0; margin: 0 0 26px; padding: 0; border: 0; }
fieldset:last-child { margin-bottom: 0; }

legend {
  margin-bottom: 11px;
  color: #c9d9e5;
  font-size: 0.84rem;
  font-weight: 760;
}

.filter-options { display: grid; gap: 7px; }

.filter-option {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  column-gap: 10px;
  align-items: start;
  min-height: 24px;
  color: #edf5fa;
  cursor: pointer;
  font-size: 0.91rem;
  line-height: 1.38;
}

.filter-option input {
  appearance: none;
  inline-size: 18px;
  block-size: 18px;
  margin: 0.17rem 0 0;
  flex: 0 0 18px;
  border: 1.5px solid #8ea9bc;
  border-radius: 4px;
  background: #0a1d30;
  cursor: pointer;
}

.filter-option input:checked {
  border-color: var(--mint);
  background-color: var(--mint);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3 8.5 6.4 12 13 4.8' fill='none' stroke='%230d263e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2.25'/%3E%3C/svg%3E");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 13px 13px;
}

.filter-option:hover span { color: #ffffff; }

.overview-card { background: #f9fcfe; }
.overview-total {
  min-width: 2.5rem;
  border-radius: 999px;
  padding: 0.18rem 0.5rem;
  background: var(--mint-light);
  color: #0b6d55;
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}
.overview-caption { margin: 0 0 17px; color: var(--ink-soft); font-size: 0.84rem; }
.framework-chart { display: grid; gap: 15px; }
.chart-row { display: grid; gap: 6px; }
.chart-label { display: flex; justify-content: space-between; gap: 12px; color: var(--ink-soft); font-size: 0.78rem; font-weight: 700; }
.chart-label span:last-child { color: var(--ink); font-variant-numeric: tabular-nums; }
.chart-track { height: 8px; overflow: hidden; border-radius: 999px; background: #dfe9f0; }
.chart-fill { width: var(--chart-width); height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--blue), #47a5c9); }
.chart-row:nth-child(2) .chart-fill { background: linear-gradient(90deg, #1e8b70, #55caa7); }
.chart-row:nth-child(3) .chart-fill { background: linear-gradient(90deg, #c98528, #efbb63); }
.chart-empty { margin: 0; color: var(--ink-soft); font-size: 0.86rem; }

.content-column { min-width: 0; display: grid; gap: 24px; }

.search-card {
  padding: clamp(26px, 4vw, 38px);
  background: linear-gradient(130deg, #ffffff 0%, #ffffff 60%, #edf7fa 100%);
}

.search-copy > p:last-child {
  max-width: 680px;
  margin-bottom: 25px;
  color: var(--ink-soft);
  font-size: 1.02rem;
}

.search-form { display: grid; gap: 9px; }

.search-form label { color: var(--ink); font-size: 0.91rem; font-weight: 780; }

textarea {
  width: 100%;
  min-height: 108px;
  resize: vertical;
  border: 1px solid var(--line-strong);
  border-radius: 11px;
  padding: 14px 15px;
  background: #ffffff;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1.55;
}

textarea::placeholder { color: #71879a; }
textarea:hover { border-color: #8ca8bb; }
textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 4px rgba(23, 107, 155, 0.12); }

.search-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 15px; margin-top: 3px; }

.primary-button, .source-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 43px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 0.62rem 0.95rem;
  background: var(--blue);
  color: #ffffff;
  font-size: 0.91rem;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: background 150ms ease, transform 150ms ease, box-shadow 150ms ease;
}

.primary-button:hover { background: var(--blue-dark); transform: translateY(-1px); box-shadow: 0 7px 16px rgba(16, 85, 126, 0.21); }
.primary-button:disabled { cursor: wait; opacity: 0.67; transform: none; }

.status { min-height: 1.5em; margin: 0; color: var(--ink-soft); font-size: 0.88rem; }
.status.is-error { color: var(--danger); }
.status.is-ready { color: #16785d; }

.results-panel { padding: clamp(24px, 3vw, 34px); }

.results-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 21px;
}

.results-heading .section-kicker { margin-bottom: 4px; }
.result-count { margin-bottom: 1px; color: var(--ink-soft); font-size: 0.88rem; text-align: right; }

.results-list { display: grid; gap: 12px; }

.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 21px;
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.result-card:hover { border-color: #a8c4d4; box-shadow: 0 9px 19px rgba(23, 61, 87, 0.07); }

.result-topline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-bottom: 13px; }
.code-badge {
  border-radius: 999px;
  padding: 0.19rem 0.55rem;
  background: #e2f1f8;
  color: #0e5f8b;
  font-size: 0.77rem;
  font-weight: 820;
  letter-spacing: 0.02em;
}
.framework-name { color: var(--ink-soft); font-size: 0.82rem; font-weight: 680; }
.result-topic { margin: 0 0 17px; color: var(--ink-soft); font-size: 0.86rem; }
.result-topic strong { color: var(--ink); font-weight: 700; }

.source-link {
  min-height: 39px;
  border-color: #8eb6cb;
  background: #ffffff;
  color: var(--blue-dark);
  font-size: 0.86rem;
}
.source-link::after { content: "\2197"; margin-left: 0.48rem; font-size: 1.02em; }
.source-link:hover { border-color: var(--blue); background: #edf7fb; transform: translateY(-1px); }

.empty-state {
  min-height: 210px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 15px;
  border: 1px dashed var(--line-strong);
  border-radius: 12px;
  padding: 22px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-state[hidden] { display: none; }
.empty-state svg { width: 50px; height: 50px; fill: none; stroke: #76a8c2; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; }
.empty-state p { max-width: 340px; margin: 0; }

.history-panel { padding: clamp(22px, 3vw, 28px); }

.history-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.history-heading .section-kicker { margin-bottom: 4px; }
.history-clear { border-color: var(--line-strong); background: #ffffff; color: var(--blue-dark); }
.history-clear:hover { background: #edf7fb; }
.history-note { margin: 5px 0 15px; color: var(--ink-soft); font-size: 0.86rem; }
.history-list { display: grid; gap: 8px; }
.history-empty { margin: 0; padding: 4px 0; color: var(--ink-soft); font-size: 0.91rem; }

.history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #ffffff;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.history-item:hover { border-color: #9fc2d5; box-shadow: 0 7px 16px rgba(23, 61, 87, 0.06); }

.history-query {
  min-width: 0;
  border: 0;
  border-radius: 9px;
  padding: 0.73rem 0.82rem;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
  font-size: 0.92rem;
  font-weight: 680;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-query:hover { color: var(--blue-dark); }
.history-item time { padding-right: 0.82rem; color: var(--ink-soft); font-size: 0.78rem; white-space: nowrap; }

.site-footer {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
  padding: 0 0 34px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px 19px;
  color: var(--ink-soft);
  font-size: 0.79rem;
}

@media (max-width: 980px) {
  .workspace { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr); }
  .filter-options { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 13px; }
}

@media (max-width: 660px) {
  .site-header { min-height: 68px; padding: 0 18px; }
  .brand { font-size: 0.91rem; line-height: 1.18; }
  .brand-mark { width: 34px; height: 34px; flex-basis: 34px; }
  .header-label { display: none; }
  .workspace, .site-footer { width: min(100% - 28px, 1280px); }
  .workspace { padding: 22px 0 33px; gap: 17px; }
  .sidebar { grid-template-columns: 1fr; gap: 14px; }
  .side-card { padding: 21px; }
  .filter-options { grid-template-columns: 1fr; }
  .search-card, .results-panel, .history-panel { border-radius: 13px; }
  .search-card { padding: 25px 21px; }
  .results-panel { padding: 23px 20px; }
  .results-heading { align-items: flex-start; flex-direction: column; gap: 7px; }
  .result-count { text-align: left; }
  .result-card { padding: 18px; }
  .source-link { width: 100%; }
  .history-panel { padding: 21px 20px; }
  .history-item { gap: 7px; }
  .history-item time { padding-right: 0.7rem; font-size: 0.72rem; }
}
.header-nav {
  display: inline-flex;
  align-items: center;
  gap: 18px;
  color: #bed0df;
  font-size: 0.84rem;
  font-weight: 700;
}

.header-nav a {
  color: #f4b64e;
  text-decoration-color: rgba(244, 182, 78, 0.55);
  text-underline-offset: 0.22em;
}

.header-nav a:hover { color: #ffffff; }

.scope-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0 20px;
}

.scope-chip {
  min-width: 0;
  border: 1px solid #d5e1ea;
  border-radius: 10px;
  padding: 10px 9px;
  background: #ffffff;
  color: var(--ink-soft);
  font-size: 0.72rem;
  line-height: 1.25;
}

.scope-chip strong {
  display: block;
  margin-top: 3px;
  color: var(--ink);
  font-size: 1.08rem;
  font-variant-numeric: tabular-nums;
}

.scope-chip-africa { border-color: #84c9b8; background: #effaf6; }
.scope-chip-africa strong { color: #08775e; }

.chart-row:nth-child(3) .chart-fill { background: linear-gradient(90deg, #c98528, #efbb63); }
.chart-row:nth-child(4) .chart-fill { background: linear-gradient(90deg, #6854a8, #9f8cdb); }

.scope-badge {
  border-radius: 999px;
  padding: 0.19rem 0.52rem;
  border: 1px solid #bfd0dc;
  background: #f4f8fa;
  color: #537085;
  font-size: 0.72rem;
  font-weight: 770;
  line-height: 1.2;
}

.scope-badge.is-africa { border-color: #8ccdbc; background: #e6f8f1; color: #087459; }

.about-page {
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: 62px 0 48px;
}

.about-intro { max-width: 825px; margin-bottom: 38px; }
.about-intro h1 { max-width: 740px; }
.about-intro > p:last-child { max-width: 740px; margin: 18px 0 0; color: var(--ink-soft); font-size: 1.05rem; }

.about-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 32px;
}

.about-card, .complement-card {
  border: 1px solid var(--line);
  border-radius: 15px;
  padding: 25px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(25, 56, 80, 0.07);
}

.about-card-emphasis { border-color: #164864; background: linear-gradient(145deg, #0b3048, #135b75); color: #ffffff; }
.about-card-emphasis .section-kicker { color: #83ddc8; }
.about-card-emphasis h2 { color: #ffffff; }
.about-card p:last-child, .complement-card p { margin-bottom: 0; color: var(--ink-soft); }

.fact-list { display: grid; gap: 16px; margin: 24px 0 0; }
.fact-list div { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: baseline; }
.fact-list dt { color: #f4b64e; font-size: 1.45rem; font-weight: 820; line-height: 1; }
.fact-list dd { margin: 0; color: #d9ecf3; font-size: 0.86rem; line-height: 1.4; }

.source-section { margin-top: 38px; }
.source-section-heading { margin-bottom: 16px; }
.source-section-heading h2 { max-width: 620px; font-size: clamp(1.4rem, 3vw, 1.9rem); }
.source-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: #ffffff; box-shadow: 0 12px 30px rgba(25, 56, 80, 0.06); }
.source-table { width: 100%; min-width: 740px; border-collapse: collapse; text-align: left; }
.source-table th, .source-table td { padding: 16px 19px; vertical-align: top; border-bottom: 1px solid var(--line); }
.source-table th { background: #edf4f8; color: var(--ink-soft); font-size: 0.74rem; letter-spacing: 0.06em; text-transform: uppercase; }
.source-table td { color: var(--ink-soft); font-size: 0.9rem; line-height: 1.45; }
.source-table tr:last-child td { border-bottom: 0; }
.source-table a, .complement-card a, .site-footer a { color: var(--blue-dark); font-weight: 750; text-decoration-color: rgba(16, 85, 126, 0.45); text-underline-offset: 0.2em; }
.source-table a:hover, .complement-card a:hover, .site-footer a:hover { color: var(--mint); }

.complement-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.complement-card h3 { margin-bottom: 10px; font-size: 1rem; }
.about-footer { padding-top: 0; }

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; }
  .complement-grid { grid-template-columns: 1fr; }
}

@media (max-width: 660px) {
  .header-nav { gap: 10px; }
  .header-nav .header-label { display: none; }
  .about-page { width: min(100% - 28px, 1120px); padding: 37px 0 30px; }
  .about-card, .complement-card { padding: 21px; }
  .scope-summary { gap: 7px; }
  .scope-chip { padding: 9px 8px; }
}