/* Africa Eyes dashboard -------------------------------------------------- */
:root {
  color-scheme: light;
  --page: #f9f9f7;
  --surface: #fcfcfb;
  --ink: #1d2421;
  --ink-2: #545a56;
  --muted: #6b716c;
  --hair: #e1e2dc;
  --base: #c3c2b7;
  --bar: #868c86;
  --wash: rgba(29, 36, 33, 0.05);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --font: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --w: 1180px;
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --page: #0f100f; --surface: #1a1a19;
    --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9f99;
    --hair: #2c2c2a; --base: #383835; --bar: #6e746e;
    --wash: rgba(240, 239, 236, 0.06);
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0f100f; --surface: #1a1a19;
  --ink: #f0efec; --ink-2: #c3c2b7; --muted: #9a9f99;
  --hair: #2c2c2a; --base: #383835; --bar: #6e746e;
  --wash: rgba(240, 239, 236, 0.06);
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 400 15px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; font-weight: 500; }
h2 { font-size: 24px; line-height: 1.25; letter-spacing: -0.01em; }
h3 { font-size: 17px; line-height: 1.3; }
.lede { margin: 6px 0 20px; color: var(--ink-2); max-width: 64ch; }
.hint { margin: 0; color: var(--muted); font-size: 13px; }
.scroll { overflow-x: auto; }
[hidden] { display: none !important; }

/* Header */
.top { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--page) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--hair); }
.top-in { max-width: var(--w); margin: 0 auto; padding: 12px 24px; display: flex; align-items: center; gap: 28px; }
.brand { font-weight: 600; font-size: 17px; text-decoration: none; letter-spacing: -0.01em; }
.top nav { display: flex; gap: 4px; flex-wrap: wrap; }
.top nav a { text-decoration: none; color: var(--ink-2); padding: 6px 10px; border-radius: 6px; font-size: 14px; white-space: nowrap; }
.top nav a:hover { background: var(--wash); color: var(--ink); }
.meta { margin: 0 0 0 auto; color: var(--muted); font-size: 13px; white-space: nowrap; }

/* Bands */
main { max-width: var(--w); margin: 0 auto; padding: 0 24px; }
.band { padding: 48px 0; border-bottom: 1px solid var(--hair); }
.band:last-child { border-bottom: 0; }

.headline { font-size: 34px; line-height: 1.22; letter-spacing: -0.015em; max-width: 30ch; margin-bottom: 28px; }

/* Controls */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; margin-bottom: 24px; }
.filters label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.filters label.grow { flex: 1 1 220px; }
.filters label.check { flex-direction: row; align-items: center; gap: 8px; padding-bottom: 8px; }
select, input[type="search"], input:not([type]), input[type="text"] {
  font: inherit; font-size: 14px; color: var(--ink); background: var(--surface);
  border: 1px solid var(--base); border-radius: 6px; padding: 7px 10px; min-height: 36px;
}
select { padding-right: 28px; }
input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--ink); }
button { font: inherit; font-size: 14px; cursor: pointer; color: var(--ink); }
.ghost { background: transparent; border: 1px solid var(--base); border-radius: 6px; padding: 7px 12px; min-height: 36px; }
.ghost:hover { background: var(--wash); }
.solid { background: var(--ink); color: var(--page); border: 1px solid var(--ink); border-radius: 6px; padding: 7px 14px; min-height: 36px; font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--base); border-radius: 6px; padding: 2px; gap: 2px; align-self: flex-end; }
.seg button { border: 0; background: transparent; padding: 5px 12px; border-radius: 4px; color: var(--ink-2); min-height: 30px; }
.seg button[aria-checked="true"] { background: var(--ink); color: var(--page); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 28px; border-top: 1px solid var(--hair); }
.stats div { padding: 14px 16px 0 0; }
.stats div + div { padding-left: 16px; border-left: 1px solid var(--hair); }
.stats dt { color: var(--muted); font-size: 13px; }
.stats dd { margin: 2px 0 0; font-size: 22px; font-weight: 500; line-height: 1.25; }
.stats dd small { display: block; font-size: 13px; font-weight: 400; color: var(--ink-2); }

/* Ranking bar list */
.rank { list-style: none; margin: 0; padding: 0; }
.rank li + li { margin-top: 2px; }
.row {
  display: grid; grid-template-columns: 28px minmax(120px, 190px) 1fr 88px; align-items: center; gap: 12px;
  width: 100%; text-align: left; background: transparent; border: 0; border-radius: 6px; padding: 3px 8px;
  min-height: 30px; font-variant-numeric: tabular-nums;
}
.row:hover { background: var(--wash); }
.row .rk { color: var(--muted); font-size: 13px; text-align: right; }
.row .nm { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row[aria-pressed="true"] .nm { font-weight: 600; }
.row .val { text-align: right; font-size: 14px; }
.track { position: relative; height: 14px; }
.track .zero { position: absolute; top: -4px; bottom: -4px; width: 1px; background: var(--base); }
.track .bar { position: absolute; top: 0; height: 14px; background: var(--c, var(--bar)); border-radius: 0 4px 4px 0; min-width: 2px; }
.track .bar.neg { border-radius: 4px 0 0 4px; }
.row .swatch { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--c); margin-right: 6px; vertical-align: 1px; }
.rank-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }
#rank-missing { margin-top: 8px; }

/* Compare */
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 40px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.chip { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--hair); background: var(--surface); border-radius: 999px; padding: 4px 6px 4px 10px; font-size: 14px; }
.chip i { width: 14px; height: 3px; border-radius: 2px; background: var(--c); }
.chip button { border: 0; background: transparent; width: 24px; height: 24px; border-radius: 50%; color: var(--muted); line-height: 1; }
.chip button:hover { background: var(--wash); color: var(--ink); }
.chips select { min-height: 32px; font-size: 13px; }
.chart { position: relative; background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; padding: 8px 4px 4px; min-height: 300px; }
.chart svg { display: block; width: 100%; height: 300px; overflow: visible; }
.chart .empty { padding: 120px 20px; text-align: center; color: var(--muted); }
.axis text { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.grid line { stroke: var(--hair); stroke-width: 1; }
.base-line { stroke: var(--base); stroke-width: 1; }
.series path { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.end-label { fill: var(--ink-2); font-size: 12px; }
.cross { stroke: var(--base); stroke-width: 1; }
.dot { stroke: var(--surface); stroke-width: 2; }
.table-view { margin-top: 12px; font-size: 14px; }
.table-view summary { cursor: pointer; color: var(--ink-2); padding: 4px 0; }

table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--hair); white-space: nowrap; }
th { color: var(--muted); font-weight: 500; font-size: 13px; }
td.num, th.num { text-align: right; }

/* Profile */
.profile { border-left: 1px solid var(--hair); padding-left: 28px; }
.profile h3 { font-size: 22px; font-weight: 500; }
.profile .region { color: var(--muted); font-size: 13px; margin: 2px 0 18px; }
.profile .ind { padding: 12px 0; border-top: 1px solid var(--hair); display: grid; grid-template-columns: 1fr 96px; gap: 2px 12px; align-items: center; }
.profile .ind .lbl { color: var(--ink-2); font-size: 13px; }
.profile .ind .v { font-size: 20px; font-weight: 500; line-height: 1.2; }
.profile .ind .sub { color: var(--muted); font-size: 12.5px; grid-column: 1 / 2; }
.profile .ind svg { grid-row: 1 / 4; grid-column: 2; width: 96px; height: 32px; }
.profile .ind svg path { fill: none; stroke: var(--bar); stroke-width: 1.5; }
.profile .ind svg circle { fill: var(--ink); }
.profile .mentions { margin: 18px 0 0; padding: 0; list-style: none; border-top: 1px solid var(--hair); }
.profile .mentions li { padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14px; line-height: 1.4; }
.profile .mentions small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.profile .mentions-h { margin-top: 22px; font-size: 15px; font-weight: 500; }
.profile .actions { margin-top: 14px; }

/* Prices */
.ins { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0 20px; margin: 0 0 22px; }
.ins > div { border-top: 2px solid var(--ink); padding: 12px 0 4px; }
.ins .k { color: var(--muted); font-size: 13px; }
.ins .v { font-size: 22px; font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ins small { display: block; font-size: 12.5px; color: var(--ink-2); }
.ins a { color: inherit; }
.ins-alerts { margin: -6px 0 26px; font-size: 14px; }
.ins-alerts ul { list-style: none; margin: 6px 0 0; padding: 0; border-top: 1px solid var(--hair); }
.ins-alerts li { padding: 7px 0; border-bottom: 1px solid var(--hair); display: flex; gap: 12px; justify-content: space-between; }
.ins-alerts li span:last-child { color: var(--muted); font-size: 13px; white-space: nowrap; }
.top nav a.out { color: var(--muted); }
.brand { white-space: nowrap; }
.p-top { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; }
.p-country { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
.fx { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 0 20px; margin: 0 0 32px; }
.fx div { border-top: 1px solid var(--hair); padding: 12px 0 4px; }
.fx dt, .fx .k { color: var(--muted); font-size: 13px; }
.fx .v { font-size: 22px; font-weight: 500; line-height: 1.25; font-variant-numeric: tabular-nums; }
.fx small { display: block; font-size: 12.5px; color: var(--ink-2); }
.p-head { font-size: 22px; line-height: 1.35; letter-spacing: -0.01em; max-width: 48ch; margin: 0 0 22px; }
.side h3 { margin-bottom: 10px; }
.chart.small { min-height: 220px; }
.chart.small svg { height: 220px; }
.chart.small .empty { padding: 80px 16px; }
.said { margin: 12px 0 0; color: var(--ink-2); font-size: 14px; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.legend i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; background: var(--c); vertical-align: 3px; margin-right: 6px; }
.legend i.pt { width: 8px; height: 8px; border-radius: 50%; vertical-align: 0; }
.row .zone { color: var(--muted); font-size: 12px; margin-left: 6px; }
.zones { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 14px; }
.zones .k { color: var(--muted); font-size: 13px; margin-right: 4px; }
.zones .tag { font-size: 13px; padding: 2px 10px; font-variant-numeric: tabular-nums; }
.zones .tag[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.reported { margin-top: 44px; }
.reported .seg { margin-bottom: 14px; flex-wrap: wrap; }
.rtable td small { display: block; color: var(--muted); font-size: 12px; }
.rtable .cat { color: var(--ink-2); }
.rtable .med { font-weight: 500; }

/* Markets */
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.presets button[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }
.weights { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px 24px; margin-bottom: 24px; }
.weight label { display: block; font-weight: 500; font-size: 14px; }
.weight p { margin: 0 0 6px; color: var(--muted); font-size: 12.5px; line-height: 1.4; min-height: 2.8em; }
.weight .rng { display: flex; align-items: center; gap: 10px; }
.weight input[type="range"] { flex: 1; accent-color: var(--ink); }
.weight output { min-width: 4.5em; font-size: 13px; color: var(--ink-2); }
.score td .sbar { display: inline-block; vertical-align: middle; width: 120px; height: 10px; background: var(--wash); border-radius: 0 4px 4px 0; margin-right: 10px; position: relative; }
.score td .sbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 0 4px 4px 0; }
.score tbody tr { cursor: pointer; }
.score tbody tr:hover td { background: var(--wash); }
.score .rk { color: var(--muted); width: 2.5em; }
.score .cn small { color: var(--muted); margin-left: 6px; }

/* News */
.news { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--hair); }
.news li { padding: 14px 0; border-bottom: 1px solid var(--hair); display: grid; grid-template-columns: 76px 1fr; gap: 16px; }
.news time { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; padding-top: 2px; }
.news a { text-decoration: none; font-weight: 500; line-height: 1.4; }
.news a:hover { text-decoration: underline; }
.news .src { color: var(--muted); font-size: 13px; margin-top: 3px; }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.tag { border: 1px solid var(--hair); border-radius: 999px; padding: 0 8px; font-size: 12px; color: var(--ink-2); background: transparent; }
button.tag:hover { background: var(--wash); }

/* Data & API */
.fields a { margin-right: 12px; }
.api { margin-top: 28px; max-width: 760px; }
.key-out { margin: -8px 0 16px; padding: 12px 14px; border: 1px solid var(--hair); border-radius: 8px; background: var(--surface); font-size: 14px; }
.key-out code, .code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.code { background: var(--surface); border: 1px solid var(--hair); border-radius: 8px; padding: 14px; overflow-x: auto; color: var(--ink-2); margin: 0; white-space: pre; }

.foot { max-width: var(--w); margin: 0 auto; padding: 24px 24px 48px; color: var(--muted); font-size: 13px; }
.foot p { max-width: 80ch; margin: 0; }

/* Tooltip */
.tip { position: fixed; z-index: 30; pointer-events: none; background: var(--surface); color: var(--ink); border: 1px solid var(--hair);
  border-radius: 8px; padding: 8px 10px; font-size: 13px; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12); min-width: 150px; font-variant-numeric: tabular-nums; }
.tip b { display: block; font-weight: 600; margin-bottom: 4px; }
.tip .tr { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.tip .tr span:first-child { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.tip i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); display: inline-block; }

/* Responsive */
@media (max-width: 960px) {
  .split { grid-template-columns: 1fr; }
  .profile { border-left: 0; padding-left: 0; border-top: 1px solid var(--hair); padding-top: 24px; }
  .weights { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta { display: none; }
}
@media (max-width: 640px) {
  .top-in { padding: 10px 16px; gap: 12px; flex-wrap: wrap; }
  .top nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  main { padding: 0 16px; }
  .band { padding: 32px 0; }
  .headline { font-size: 26px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats div:nth-child(3) { padding-left: 0; border-left: 0; }
  .row { grid-template-columns: 22px minmax(84px, 110px) 1fr 70px; gap: 8px; padding: 3px 4px; }
  .weights { grid-template-columns: 1fr; }
  .news li { grid-template-columns: 1fr; gap: 2px; }
  .fx { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }
  .p-head { font-size: 19px; }
  .foot { padding: 24px 16px 40px; }
}
