/* Figure kit for ziyad-al-aly website. Token-driven so figures work on light pages (the site) and dark pages.
   Fonts: Newsreader (titles), Instrument Sans (labels, values). */
.fig {
  --fig-ink: #0E1A2B; --fig-text: #2B3645; --fig-muted: #5B6676; --fig-rule: #DDE1E6; --fig-grid: #E6E8EB;
  --fig-surface: #FFFFFF; --fig-wash: #F4F4F1; --fig-hi: #C2410C; --fig-hi-soft: #E2875D; --fig-lo: #2A6FBF; --fig-lo-soft: #8FB4E3;
  --fig-neutral: #C9CED5; --fig-context: #9AA6B6;
  margin: 0; padding: clamp(18px, 3vw, 32px); background: var(--fig-surface); color: var(--fig-text);
  border: 1px solid var(--fig-rule); border-radius: 6px; font-family: 'Instrument Sans', system-ui, sans-serif;
  min-width: 0;
}
.fig * { box-sizing: border-box; }
.fig h3 { margin: 0; font-family: 'Newsreader', Georgia, serif; font-weight: 400; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.15; color: var(--fig-ink); text-wrap: balance; }
.fig .fig-sub { margin: 8px 0 0; font-size: 15px; line-height: 1.5; color: var(--fig-muted); max-width: 62ch; }
.fig .fig-body { margin-top: 24px; }
.fig .fig-note { margin: 18px 0 0; font-size: 14px; line-height: 1.55; color: var(--fig-text); max-width: 64ch; }
.fig .fig-src { margin: 16px 0 0; padding-top: 12px; border-top: 1px solid var(--fig-rule); font-size: 12px; line-height: 1.5; color: var(--fig-muted); }
.fig .fig-src a { color: inherit; }
.fig details { margin-top: 10px; font-size: 13px; color: var(--fig-muted); }
.fig details summary { cursor: pointer; }
.fig details table { margin-top: 8px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.fig details th, .fig details td { text-align: left; padding: 4px 14px 4px 0; border-bottom: 1px solid var(--fig-grid); font-weight: 400; }
.fig details th { color: var(--fig-ink); font-weight: 600; }
.fig .tbl-wrap { overflow-x: auto; }
.fig .legend { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--fig-text); margin-bottom: 14px; }
.fig .legend span { display: inline-flex; align-items: center; gap: 7px; }
.fig .sw { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }

/* Dot-and-interval rows */
.fig .dp-group + .dp-group { margin-top: 22px; }
.fig .dp-glabel { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--fig-ink); margin: 0 0 6px; }
.fig .dp-row, .fig .dp-axis { display: grid; grid-template-columns: minmax(8rem, 13rem) 1fr 3.4rem; gap: 12px; align-items: center; }
.fig .dp-row { min-height: 30px; }
.fig .dp-label { font-size: 14px; color: var(--fig-text); line-height: 1.25; }
.fig .dp-val { font-size: 14px; font-weight: 600; color: var(--fig-ink); text-align: right; }
.fig .dp-track { position: relative; height: 26px; }
.fig .dp-tick { position: absolute; top: 0; bottom: 0; width: 1px; background: var(--fig-grid); }
.fig .dp-tick.zero { background: var(--fig-context); }
.fig .dp-ci { position: absolute; top: 50%; height: 2px; margin-top: -1px; background: var(--fig-lo-soft); border-radius: 2px; }
.fig .dp-dot { position: absolute; top: 50%; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: var(--fig-lo); box-shadow: 0 0 0 2px var(--fig-surface); }
.fig .dp-axis .dp-track { height: 18px; }
.fig .dp-tl { position: absolute; top: 0; transform: translateX(-50%); font-size: 12px; color: var(--fig-muted); font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .fig .dp-row, .fig .dp-axis { grid-template-columns: 1fr 3rem; row-gap: 2px; }
  .fig .dp-row .dp-label { grid-column: 1 / -1; }
  .fig .dp-axis > span:first-child { display: none; }
}

/* Horizontal bars */
.fig .hb-row { display: grid; grid-template-columns: minmax(7.5rem, 11rem) 1fr; gap: 12px; align-items: center; min-height: 34px; }
.fig .hb-label { font-size: 14px; color: var(--fig-text); }
.fig .hb-track { position: relative; height: 22px; display: flex; align-items: center; gap: 8px; padding-right: 7.5rem; background: linear-gradient(var(--fig-context), var(--fig-context)) left center / 1px 100% no-repeat; }
.fig .hb-bar { height: 20px; border-radius: 0 4px 4px 0; flex: none; }
.fig .hb-v { flex: none; font-size: 14px; font-weight: 600; color: var(--fig-ink); white-space: nowrap; }
.fig .panels { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: 28px 40px; }
.fig .panel h4 { margin: 0 0 4px; font-size: 15px; font-weight: 600; color: var(--fig-ink); }
.fig .panel .ref { margin: 0 0 12px; font-size: 13px; color: var(--fig-muted); }
.fig .hb-wide .hb-row { grid-template-columns: minmax(9rem, 17rem) 1fr; }
@media (max-width: 560px) { .fig .hb-row, .fig .hb-wide .hb-row { grid-template-columns: 1fr; row-gap: 2px; } }

/* Grouped columns */
.fig .gc { display: grid; grid-template-columns: 2.4rem 1fr; gap: 8px; }
.fig .gc-y { position: relative; height: 240px; font-size: 12px; color: var(--fig-muted); font-variant-numeric: tabular-nums; }
.fig .gc-y span { position: absolute; right: 0; transform: translateY(50%); }
.fig .gc-plot { position: relative; height: 240px; display: flex; align-items: flex-end; justify-content: space-around; border-bottom: 1px solid var(--fig-context); }
.fig .gc-grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--fig-grid); }
.fig .gc-group { position: relative; display: flex; align-items: flex-end; gap: 2px; height: 100%; }
.fig .gc-col { position: relative; width: clamp(22px, 5vw, 28px); border-radius: 4px 4px 0 0; }
.fig .gc-col b { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-size: 13px; font-weight: 600; color: var(--fig-ink); white-space: nowrap; }
.fig .gc-na { width: clamp(22px, 5vw, 28px); font-size: 11px; color: var(--fig-muted); text-align: center; align-self: flex-end; padding-bottom: 4px; }
.fig .gc-x { display: flex; justify-content: space-around; margin-left: calc(2.4rem + 8px); padding-top: 8px; font-size: 13px; color: var(--fig-text); text-align: center; }
.fig .gc-x span { flex: 1; }

/* Waffle */
.fig .wf { display: grid; grid-template-columns: repeat(25, 1fr); gap: 3px; max-width: 640px; }
.fig .wf i { display: block; aspect-ratio: 1; border-radius: 2px; }

/* Timeline */
.fig .tl { display: grid; grid-template-columns: 11rem repeat(11, 1fr); row-gap: 10px; align-items: center; }
.fig .tl-year { font-size: 12px; color: var(--fig-muted); text-align: left; border-left: 1px solid var(--fig-grid); padding-left: 4px; font-variant-numeric: tabular-nums; }
.fig .tl-name { font-size: 14px; font-weight: 600; color: var(--fig-ink); line-height: 1.25; padding-right: 10px; }
.fig .tl-bar { height: 10px; border-radius: 5px; background: var(--fig-hi-soft); position: relative; }
.fig .tl-bar.now { background: linear-gradient(90deg, var(--fig-hi-soft) 75%, transparent); }
.fig .tl-bar.pol { background: transparent; height: 1px; border-top: 1px dashed transparent; }
.fig .tl-ms { grid-column: 2 / -1; display: grid; grid-template-columns: repeat(11, 1fr); margin-top: -6px; }
.fig .tl-m { font-size: 12px; line-height: 1.3; color: var(--fig-text); padding: 6px 6px 0 0; position: relative; }
.fig .tl-m::before { content: ""; display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--fig-hi); box-shadow: 0 0 0 2px var(--fig-surface); margin-bottom: 5px; }
.fig .tl-m.p::before { background: var(--fig-lo); }
.fig .tl-m em { font-style: italic; color: var(--fig-muted); display: block; }
.fig .tl-list { display: none; }
@media (max-width: 980px) {
  .fig .tl { display: none; }
  .fig .tl-list { display: block; }
  .fig .tl-list section + section { margin-top: 18px; }
  .fig .tl-list h4 { margin: 0; font-size: 15px; color: var(--fig-ink); }
  .fig .tl-list h4 span { font-weight: 400; color: var(--fig-muted); font-size: 13px; margin-left: 6px; }
  .fig .tl-list ul { margin: 8px 0 0; padding: 0 0 0 14px; border-left: 2px solid var(--fig-hi-soft); list-style: none; }
  .fig .tl-list li { font-size: 14px; line-height: 1.45; margin: 0 0 6px; }
  .fig .tl-list li b { font-weight: 600; color: var(--fig-ink); margin-right: 6px; font-variant-numeric: tabular-nums; }
}

/* Flow */
.fig .flow { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0; position: relative; }
.fig .flow-step { position: relative; padding: 0 22px 0 0; }
.fig .flow-step + .flow-step { padding-left: 22px; border-left: 1px solid var(--fig-rule); }
.fig .flow-n { font-family: 'Newsreader', Georgia, serif; font-size: 34px; line-height: 1; color: var(--fig-hi); }
.fig .flow-h { margin: 10px 0 0; font-family: 'Newsreader', Georgia, serif; font-size: 21px; line-height: 1.2; color: var(--fig-ink); }
.fig .flow-ex { margin: 12px 0 0; font-size: 14px; line-height: 1.55; color: var(--fig-text); }
.fig .flow-ex b { display: block; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--fig-muted); font-weight: 600; margin-bottom: 4px; }
.fig .flow-arrow { position: absolute; top: 8px; right: -9px; width: 18px; height: 18px; border-radius: 50%; background: var(--fig-surface); color: var(--fig-hi); font-size: 14px; line-height: 18px; text-align: center; z-index: 1; }
@media (max-width: 980px) {
  .fig .flow { grid-template-columns: 1fr; gap: 22px; }
  .fig .flow-step, .fig .flow-step + .flow-step { padding: 0 0 0 16px; border-left: 2px solid var(--fig-hi-soft); }
  .fig .flow-arrow { display: none; }
}

/* Map */
.fig .mc-wrap { width: 100%; }
.fig .mc-map { width: 100%; height: auto; display: block; }
.fig .mc-base path { fill: var(--fig-grid); stroke: var(--fig-surface); stroke-width: .5; }
.fig .mc-hit { fill: var(--fig-hi-soft); stroke: var(--fig-surface); stroke-width: .6; }
.fig .mc-hit:hover, .fig .mc-dot:hover { fill: var(--fig-hi); }
.fig .mc-dot { fill: var(--fig-hi); stroke: var(--fig-surface); stroke-width: 2; }
.fig .mc-stats { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 0 0 14px; }
.fig .mc-stats div { font-size: 13px; color: var(--fig-muted); }
.fig .mc-stats strong { display: block; font-size: 30px; font-weight: 600; color: var(--fig-ink); line-height: 1.1; }
.fig .mc-list { columns: 3 15rem; column-gap: 28px; margin: 12px 0 0; padding: 0; list-style: none; font-size: 13px; line-height: 1.45; }
.fig .mc-list li { break-inside: avoid; padding: 5px 0; border-bottom: 1px solid var(--fig-grid); }
.fig .mc-list b { color: var(--fig-ink); font-weight: 600; }
.fig .mc-list a { color: var(--fig-text); }

/* Integrated layout: preserve readable plotting space inside study columns. */
.fig .panels{grid-template-columns:minmax(0,1fr)}
.fig .hb-row,.fig .hb-wide .hb-row{grid-template-columns:minmax(0,1fr);gap:4px;margin-top:12px}
.fig .hb-track{display:grid;grid-template-columns:minmax(0,1fr) 6rem;gap:12px;padding-right:0;min-width:0;background:none}
.fig .hb-bar{align-self:center;max-width:100%}
.fig .hb-v{font-variant-numeric:tabular-nums}
.fig .fig-axis-unit{font-size:12px;color:var(--fig-muted);margin-top:14px}
.fig .fig-bar-axis{display:flex;justify-content:space-between;margin:4px calc(6rem + 12px) 0 0;font-size:11px;color:var(--fig-muted);font-variant-numeric:tabular-nums}
.fig .group-context{font-size:13px;margin-bottom:16px}
.fig .gc-group{gap:8px;min-width:0}
.fig .gc-na{width:clamp(22px,5vw,28px);height:100%;position:relative;font-size:0;padding:0}
.fig .gc-na::after{content:'Not reported';position:absolute;bottom:12px;left:50%;transform:translateX(-50%);font-size:10px;line-height:1.2;width:54px;white-space:normal}
.fig .gc-col{min-width:0}
.fig .gc-col[style*='--fig-context']{background:#69798C!important}
.fig .wf i[style*='--fig-grid']{background:#c9ced5!important;border:1px solid #69798C}
.fig .wf i{min-width:0}
.fig .tl{grid-template-columns:11rem repeat(11,minmax(0,1fr))}
.fig .tl-name a,.fig .tl-list a{text-underline-offset:3px}
.fig .tl a:focus-visible,.fig summary:focus-visible,.fig .tbl-wrap:focus-visible{outline:3px solid var(--accent);outline-offset:4px}
.fig .tl-m{overflow-wrap:anywhere}
.fig .tl-list{margin:0}
.fig table caption{text-align:left;color:var(--fig-ink);font-weight:600;padding-bottom:8px}
.fig .tbl-wrap{max-width:100%}
.fig details th[scope=row]{font-weight:400;color:var(--fig-text)}
.fig .fig-note,.fig .fig-src{overflow-wrap:anywhere}
@media(max-width:380px){.fig{padding:14px}.fig .hb-track{grid-template-columns:minmax(0,1fr) 5.25rem;gap:8px}.fig .fig-bar-axis{margin-right:calc(5.25rem + 8px)}.fig .hb-v{font-size:13px}.fig .gc-col b{font-size:11px}.fig .gc-group{gap:4px}.fig .gc-na::after{width:42px;font-size:9px}.fig .gc-y{font-size:10px}.fig .gc{grid-template-columns:1.6rem 1fr}.fig .gc-x{margin-left:calc(1.6rem + 8px);font-size:11px}}
