/* Country and sector-by-country pages. Theme-aware through the site's --slate-* scale (it inverts in light mode).
   Four signal colours, each with one meaning: rising/over-represented, easing/under-represented, last 90 days, baseline. */
.cx {
  --cx-ink: rgb(var(--slate-100));
  --cx-body: rgb(var(--slate-200));
  --cx-muted: rgb(var(--slate-400));
  --cx-line: rgb(var(--slate-700));
  --cx-wash: rgb(var(--slate-800) / .55);
  --cx-base: rgb(var(--slate-500));
  --cx-up: #ff6b7d;
  --cx-down: #2dd4bf;
  --cx-recent: #f5b942;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 0 4rem;
  color: var(--cx-body);
  line-height: 1.6;
}
html.light .cx { --cx-up: #c8283f; --cx-down: #086a60; --cx-recent: #a8670a; }
.cx :where(a) { color: inherit; }
.cx-link { color: var(--cx-ink); text-decoration: underline; text-decoration-color: var(--cx-line); text-underline-offset: 3px; }
.cx-link:hover { text-decoration-color: currentColor; }
.cx :focus-visible { outline: 2px solid var(--cx-recent); outline-offset: 3px; border-radius: 2px; }

/* Header and verdict */
.cx-crumbs { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .8125rem; color: var(--cx-muted); padding: .25rem 0 1.5rem; }
.cx-crumbs a { display: inline-block; padding-block: .3rem; }
.cx-crumbs a:hover { color: var(--cx-ink); }
.cx-jump { display: flex; align-items: center; gap: .5rem; }
.cx-jump select { background: var(--cx-wash); color: var(--cx-ink); border: 1px solid var(--cx-line); border-radius: .5rem; padding: .4rem .6rem; font: inherit; max-width: 14rem; }
.cx-title { font-family: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif; font-weight: 800; letter-spacing: -.025em; line-height: 1; color: var(--cx-ink); font-size: clamp(2.25rem, 6vw, 3.75rem); margin: 0; }
.cx-verdict { font-family: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif; font-weight: 600; letter-spacing: -.015em; line-height: 1.2; color: var(--cx-ink); font-size: clamp(1.375rem, 3vw, 2rem); max-width: 40ch; margin: 1rem 0 0; text-wrap: balance; }
.cx-tone { display: inline-flex; align-items: center; gap: .4rem; font-family: "Instrument Sans", ui-sans-serif, system-ui, sans-serif; font-size: .8125rem; font-weight: 600; letter-spacing: 0; padding: .2rem .65rem; border-radius: 999px; border: 1px solid currentColor; vertical-align: middle; margin-left: .5rem; }
.cx-tone[data-tone="up"] { color: var(--cx-up); }
.cx-tone[data-tone="down"] { color: var(--cx-down); }
.cx-tone[data-tone="flat"] { color: var(--cx-muted); }
.cx-facts { display: flex; flex-wrap: wrap; gap: .25rem 1.75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; font-size: .9375rem; color: var(--cx-muted); }
.cx-facts strong { color: var(--cx-ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.cx-lede { max-width: 62ch; margin: 1rem 0 0; color: var(--cx-body); }

/* Pulse chart */
.cx-pulse { margin: 2rem 0 0; }
.cx-pulse svg { display: block; width: 100%; height: auto; overflow: visible; }
.cx-pulse .b { fill: var(--cx-base); opacity: .55; }
.cx-pulse .b.r { fill: var(--cx-recent); opacity: 1; }
.cx-pulse .b:hover { opacity: 1; }
.cx-pulse .avg { stroke: var(--cx-muted); stroke-dasharray: 3 4; stroke-width: 1; }
.cx-pulse .base { stroke: var(--cx-line); stroke-width: 1; }
.cx-pulse text { fill: var(--cx-muted); font-size: 12px; font-family: "Instrument Sans", ui-sans-serif, sans-serif; }
.cx-legend { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; font-size: .8125rem; color: var(--cx-muted); margin-top: .5rem; }
.cx-key { display: inline-block; width: .75rem; height: .75rem; border-radius: 2px; margin-right: .4rem; vertical-align: -1px; }
.cx-key[data-k="recent"] { background: var(--cx-recent); }
.cx-key[data-k="base"] { background: var(--cx-base); opacity: .55; }
.cx-key[data-k="avg"] { height: 0; width: 1rem; border-top: 1px dashed var(--cx-muted); border-radius: 0; }

/* Layout */
.cx-grid { display: grid; gap: 3rem 4rem; grid-template-columns: minmax(0, 1fr); margin-top: 3rem; }
@media (min-width: 62rem) { .cx-grid { grid-template-columns: minmax(0, 1fr) 20rem; } }
.cx-main > section + section { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--cx-line); }
.cx-h2 { font-family: "Bricolage Grotesque", "Instrument Sans", ui-sans-serif, system-ui, sans-serif; font-weight: 700; font-size: 1.375rem; letter-spacing: -.01em; line-height: 1.25; color: var(--cx-ink); margin: 0; }
.cx-sub { margin: .35rem 0 1.25rem; color: var(--cx-muted); font-size: .9375rem; max-width: 62ch; }
.cx-aside { border-left: 1px solid var(--cx-line); padding-left: 1.75rem; align-self: start; }
@media (max-width: 61.99rem) { .cx-aside { border-left: 0; padding-left: 0; border-top: 1px solid var(--cx-line); padding-top: 2rem; } }
@media (min-width: 62rem) { .cx-aside { position: sticky; top: 5rem; } }
.cx-aside > section + section { margin-top: 2rem; }
.cx-aside p { margin: .5rem 0 0; font-size: .9375rem; }

/* Differs from the world: bars diverge from a centre line */
.cx-diverge { list-style: none; margin: 0; padding: 0; display: grid; gap: .2rem; }
.cx-dv { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 12rem; align-items: center; gap: .75rem; padding: .45rem 0; }
.cx-dv-name { font-size: .9375rem; color: var(--cx-ink); overflow-wrap: anywhere; }
.cx-dv-name small { display: block; color: var(--cx-muted); font-size: .8125rem; }
.cx-track { position: relative; height: 1.1rem; }
.cx-track::before { content: ""; position: absolute; left: 50%; top: -.25rem; bottom: -.25rem; width: 1px; background: var(--cx-muted); }
.cx-fill { position: absolute; top: .2rem; bottom: .2rem; border-radius: 2px; }
.cx-fill[data-side="over"] { left: 50%; background: var(--cx-up); }
.cx-fill[data-side="under"] { right: 50%; background: var(--cx-down); }
.cx-dv-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; color: var(--cx-ink); font-size: .9375rem; }
.cx-dv-val small { display: block; font-weight: 400; color: var(--cx-muted); font-size: .8125rem; }
.cx-dv[data-ok="0"] .cx-dv-name, .cx-dv[data-ok="0"] .cx-dv-val { color: var(--cx-muted); }
.cx-axis { display: grid; grid-template-columns: minmax(7rem, 11rem) minmax(0, 1fr) 12rem; gap: .75rem; font-size: .8125rem; color: var(--cx-muted); margin-bottom: .25rem; }
.cx-axis span:nth-child(2) { display: flex; justify-content: space-between; }
@media (max-width: 36rem) { .cx-dv, .cx-axis { grid-template-columns: minmax(0, 1fr) 9rem; } .cx-dv-name { grid-column: 1 / -1; } .cx-track { grid-column: 1; } .cx-axis span:first-child, .cx-axis span:last-child { display: none; } }

/* Horizontal bars (groups, data types) */
.cx-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: .1rem; }
.cx-bar { display: grid; grid-template-columns: minmax(6rem, 11rem) minmax(0, 1fr) 6.5rem; align-items: center; gap: .75rem; padding: .4rem 0; font-size: .9375rem; }
.cx-bar-name { color: var(--cx-ink); overflow-wrap: anywhere; }
.cx-bar-name small { display: block; color: var(--cx-muted); font-size: .8125rem; }
.cx-bar-track { height: .6rem; border-radius: 2px; background: var(--cx-wash); position: relative; overflow: hidden; }
.cx-bar-all { position: absolute; inset: 0 auto 0 0; background: var(--cx-base); opacity: .6; border-radius: 2px; }
.cx-bar-recent { position: absolute; inset: 0 auto 0 0; background: var(--cx-recent); border-radius: 2px; }
.cx-bar-val { text-align: right; font-variant-numeric: tabular-nums; color: var(--cx-ink); font-weight: 700; }
.cx-bar-val small { font-weight: 400; color: var(--cx-muted); }
.cx-bar[data-solid] .cx-bar-all { opacity: 1; background: var(--cx-base); }
@media (max-width: 36rem) { .cx-bar { grid-template-columns: minmax(0, 1fr) 5.5rem; } .cx-bar-track { grid-column: 1 / -1; order: 3; } }

/* Latest listings */
.cx-list { list-style: none; margin: 0; padding: 0; }
.cx-list li { display: flex; justify-content: space-between; gap: 1rem; padding: .6rem 0; border-bottom: 1px solid var(--cx-line); font-size: .9375rem; }
.cx-list a { color: var(--cx-ink); text-decoration: none; }
.cx-list a:hover { text-decoration: underline; }
.cx-list span { color: var(--cx-muted); text-align: right; }

/* Notes */
.cx-note { font-size: .875rem; color: var(--cx-muted); max-width: 62ch; }
.cx-duty { font-size: .9375rem; color: var(--cx-body); }
.cx-cta { display: inline-block; margin-top: .75rem; padding: .55rem 1rem; border-radius: .5rem; background: var(--cx-ink); color: rgb(var(--slate-900)); font-weight: 700; text-decoration: none; font-size: .9375rem; }
.cx-cta:hover { opacity: .9; }
.cx-aside ul.cx-plain { list-style: none; margin: .5rem 0 0; padding: 0; display: grid; gap: .35rem; font-size: .9375rem; }
details.cx-more summary { cursor: pointer; color: var(--cx-muted); font-size: .875rem; margin-top: .75rem; }
details.cx-more table { width: 100%; font-size: .875rem; margin-top: .5rem; border-collapse: collapse; }
details.cx-more td, details.cx-more th { padding: .25rem 0; text-align: left; border-bottom: 1px solid var(--cx-line); font-variant-numeric: tabular-nums; }
details.cx-more td:last-child, details.cx-more th:last-child { text-align: right; }

/* Index */
.cx-find { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0 1rem; }
.cx-find input { flex: 1 1 12rem; min-width: 0; max-width: 22rem; background: var(--cx-wash); border: 1px solid var(--cx-line); color: var(--cx-ink); border-radius: .5rem; padding: .55rem .8rem; font: inherit; }
.cx-find button { background: var(--cx-ink); color: rgb(var(--slate-900)); border: 0; border-radius: .5rem; padding: .55rem 1rem; font-weight: 700; cursor: pointer; }
.cx-rows { list-style: none; margin: 0; padding: 0; }
.cx-row { display: grid; grid-template-columns: 2rem minmax(8rem, 1.4fr) 6.5rem 5rem 5rem 6rem; align-items: center; gap: 1rem; padding: .7rem 0; border-bottom: 1px solid var(--cx-line); font-size: .9375rem; }
.cx-row[hidden] { display: none; }
.cx-rank { color: var(--cx-muted); font-variant-numeric: tabular-nums; font-size: .8125rem; }
.cx-row a.n { color: var(--cx-ink); font-weight: 600; text-decoration: none; }
.cx-row a.n:hover { text-decoration: underline; }
.cx-spark { width: 6rem; height: 1.5rem; }
.cx-spark polyline { fill: none; stroke: var(--cx-base); stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.cx-spark[data-tone="up"] polyline { stroke: var(--cx-up); }
.cx-spark[data-tone="down"] polyline { stroke: var(--cx-down); }
.cx-num { font-variant-numeric: tabular-nums; text-align: right; color: var(--cx-ink); font-weight: 700; }
.cx-num small { display: block; font-weight: 400; color: var(--cx-muted); font-size: .75rem; }
.cx-chg { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.cx-chg[data-tone="up"] { color: var(--cx-up); } .cx-chg[data-tone="down"] { color: var(--cx-down); } .cx-chg[data-tone="flat"] { color: var(--cx-muted); }
.cx-rowhead { color: var(--cx-muted); font-size: .8125rem; border-bottom: 1px solid var(--cx-line); }
@media (max-width: 47.99rem) { .cx-row { grid-template-columns: 1.4rem minmax(0, 1fr) 3.75rem 4rem; gap: .6rem; } .cx-row .sp, .cx-row .tt { display: none; } }
@media (prefers-reduced-motion: no-preference) { .cx-fill, .cx-bar-recent, .cx-bar-all { transition: width .3s ease; } }
