/* ============================================================
   Base reset + typography — СтраноМетр
   ============================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.mono {
  font-family: "IBM Plex Mono", monospace;
  font-feature-settings: "tnum" 1;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

::selection {
  background: var(--accent);
  color: #fff;
}

/* Layout helpers */
.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

.band {
  padding-top: 84px;
  padding-bottom: 84px;
}

.band--tight {
  padding-top: 54px;
  padding-bottom: 54px;
}

/* Typography */
.eyebrow {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--accent-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.eyebrow::before {
  content: "";
  width: 26px;
  height: 8px;
  background: var(--tick);
  background-size: 9px 8px;
}

.h-display {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -.02em;
}

.section-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.05;
  letter-spacing: -.02em;
}

.section-title.sm {
  font-size: clamp(22px, 2.8vw, 30px);
}

.section-lead {
  color: var(--ink-soft);
  max-width: 64ch;
  font-size: 16px;
}

.lead {
  font-size: clamp(17px, 1.9vw, 20px);
  color: var(--ink-soft);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 13px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 15px;
  transition: transform .15s, box-shadow .15s, background .15s;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
}

.btn-primary:hover {
  background: var(--accent-ink);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -12px var(--accent);
}

.btn-ghost {
  border: 1.5px solid var(--line-strong);
  color: var(--ink);
}

.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* Material Icons */
.micon {
  font-family: "Material Symbols Rounded";
  font-weight: normal;
  font-style: normal;
  line-height: 1;
  white-space: nowrap;
  direction: ltr;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: inherit;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* Code badge */
.code {
  display: inline-grid;
  place-items: center;
  min-width: 2em;
  height: 1.55em;
  padding: 0 .42em;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: .74em;
  letter-spacing: .04em;
  line-height: 1;
  text-transform: uppercase;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--ink-soft);
}

.code.solid {
  background: var(--accent-soft);
  border-color: #BFE0DC;
  color: var(--accent-ink);
}

/* Status chip */
.statuschip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  letter-spacing: .1em;
  text-transform: uppercase;
  padding: 4px 9px;
  border-radius: 999px;
  font-weight: 600;
}

.statuschip .micon {
  font-size: 13px;
}

.statuschip.ready {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid #BFE0DC;
}

/* Nav */
header.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(239, 242, 241, .9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.02em;
}

.brand .glyph {
  width: 30px;
  height: 30px;
  border: 1.5px solid var(--ink);
  border-radius: 7px;
  position: relative;
  flex: none;
}

.brand .glyph::before {
  content: "";
  position: absolute;
  inset: 6px 4px;
  background: var(--tick);
  background-size: 4px 100%;
  opacity: .85;
}

.brand .glyph::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  height: 1.5px;
  background: var(--accent);
  top: 50%;
}

.nav-links {
  display: flex;
  gap: 22px;
  margin-left: auto;
  align-items: center;
}

.nav-links a {
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 6px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.nav-links a:hover {
  color: var(--ink);
}

.nav-links a.is-active {
  color: var(--ink);
  border-color: var(--accent);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 12px;
  flex: 1;
  max-width: 280px;
  position: relative;
}

.nav-search .micon {
  font-size: 18px;
  color: var(--muted);
}

.nav-search input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 14px;
  width: 100%;
  color: var(--ink);
}

/* Global search dropdown */
.gs-drop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: 0 12px 32px -8px rgba(21,41,46,.18);
  z-index: 200;
  overflow: hidden;
  max-height: 420px;
  overflow-y: auto;
}

.gs-section {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.gs-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  font-size: 13px;
  color: var(--ink);
  text-decoration: none;
  transition: background .1s;
  min-width: 0;
}

.gs-item:hover,
.gs-item.gs-active {
  background: var(--accent-soft);
}

/* Country ISO-code badge — used in global search and compare chips */
.iso-badge {
  display: inline-grid;
  place-items: center;
  min-width: 28px;
  padding: 2px 6px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: .04em;
  text-transform: uppercase;
  background: var(--accent-soft);
  border: 1px solid #BFE0DC;
  border-radius: 5px;
  color: var(--accent-ink);
  flex: none;
  line-height: 1.4;
}

.gs-cat {
  flex: none;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  white-space: nowrap;
}

.gs-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gs-empty {
  padding: 14px 12px;
  font-size: 13px;
  color: var(--muted);
}

/* SVG icon in icontile */
.micon-svg {
  width: 24px;
  height: 24px;
  display: block;
  background-color: currentColor;
  -webkit-mask-image: var(--ms-icon);
  mask-image: var(--ms-icon);
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
}

/* Sec layout */
.sec {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.sec-head {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Icon tile */
.icontile {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid #CBE3DF;
  flex: none;
}

.icontile .micon {
  font-size: 24px;
}

.icontile.spark {
  background: var(--spark-soft);
  color: var(--spark-ink);
  border-color: rgba(224, 145, 58, .32);
}

/* Hub grid cards */
.hubgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(248px, 1fr));
  gap: 16px;
}

.hubcard {
  display: flex;
  flex-direction: column;
  gap: 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}

.hubcard:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
  box-shadow: 0 20px 40px -28px rgba(21, 41, 46, .45);
}

.hubcard::after {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 7px;
  background: var(--tick);
  background-size: 9px 7px;
  opacity: 0;
  transition: opacity .15s;
}

.hubcard:hover::after {
  opacity: .5;
}

.hc-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hc-title {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 18px;
  letter-spacing: -.01em;
}

.hc-desc {
  font-size: 14px;
  color: var(--ink-soft);
  flex: 1;
}

.hc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-strong);
}

.hc-count {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
}

.hc-arr {
  display: inline-flex;
  color: var(--accent);
  transition: transform .15s;
}

.hc-arr .micon {
  font-size: 20px;
}

.hubcard:hover .hc-arr {
  transform: translateX(3px);
}

/* Link list */
.link-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.link-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--line);
  transition: padding-left .18s, background .18s;
}

.link-row:hover {
  padding-left: 12px;
  background: linear-gradient(90deg, var(--accent-soft), transparent);
}

.link-row .idx {
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  width: 26px;
  flex: none;
}

.link-row .txt {
  flex: 1;
  font-weight: 500;
  font-size: 15.5px;
}

.link-row .arr {
  color: var(--accent);
  transition: transform .18s;
}

.link-row:hover .arr {
  transform: translateX(4px);
}

/* Steps */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.step {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
  position: relative;
}

.step .no {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  letter-spacing: .1em;
}

.step h3 {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 20px;
  margin: 14px 0 8px;
  letter-spacing: -.01em;
}

.step p {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.step .ruler {
  height: 9px;
  background: var(--tick);
  background-size: 9px 9px;
  margin-top: 18px;
  opacity: .55;
}

/* Compare table */
.cmp-scroll {
  overflow-x: auto;
}

table.cmp {
  width: 100%;
  border-collapse: collapse;
  min-width: 560px;
}

table.cmp th,
table.cmp td {
  padding: 0;
  text-align: left;
}

table.cmp thead th {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  vertical-align: bottom;
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

table.cmp thead th.country {
  text-align: right;
}

table.cmp thead .ctry-head {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 700;
  font-size: 15px;
  color: var(--ink);
  text-transform: none;
  letter-spacing: 0;
}

table.cmp tbody td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
}

table.cmp tbody tr:hover td {
  background: var(--surface-2);
}

.pname {
  display: flex;
  flex-direction: column;
}

.pname b {
  font-weight: 600;
  font-size: 14.5px;
}

.pname span {
  font-size: 11.5px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

.cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}

.cell .num {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 14.5px;
}

.cell.is-lead .num {
  color: var(--accent);
}

/* Rank badge */
.rank-badge {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 700;
  font-size: 15px;
  color: var(--accent-ink);
}

.rank-total {
  font-size: 12px;
  color: var(--muted);
  font-family: "IBM Plex Mono", monospace;
}

/* Link arrow */
.link-arr {
  display: inline-flex;
  align-items: center;
  color: var(--accent);
}

/* Reveal animation */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s ease, transform .7s ease;
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
  .reveal { opacity: 1; transform: none; }
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Chip */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  border-radius: 99px;
  padding: 7px 8px 7px 13px;
  font-size: 14px;
  font-weight: 600;
}

.chip .x {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  transition: background .15s, color .15s;
  cursor: pointer;
}

.chip .x:hover {
  background: var(--bad-soft);
  color: var(--bad);
}

/* Vertical flex stack */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack.tight { gap: 10px; }
.stack.loose { gap: 26px; }

/* Context layout (indicator hub page hero) */
.context {
  display: grid;
  grid-template-columns: 1.1fr .9fr;
  gap: 44px;
  align-items: center;
}

@media (max-width: 900px) {
  .context { grid-template-columns: 1fr; gap: 32px; }
}

/* Stat row */
.statrow { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 20px; }
.statrow .stat { display: flex; flex-direction: column; gap: 3px; }
.statrow b { font-family: "IBM Plex Mono", monospace; font-size: 24px; font-weight: 600; letter-spacing: -.01em; }
.statrow .stat:first-child b { color: var(--accent); }
.statrow span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }

/* Big card (leader / value card) */
.bigcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: 0 30px 60px -42px rgba(21, 41, 46, .45);
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bigcard::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 9px;
  background: var(--tick);
  background-size: 9px 9px;
  opacity: .5;
}

.bigcard .lbl {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Big numeric value */
.bigval {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: clamp(36px, 5vw, 52px);
  line-height: 1;
  letter-spacing: -.02em;
  color: var(--spark-ink);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.bigval .unit {
  display: block;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink-soft);
  letter-spacing: 0;
  margin-top: 8px;
}

/* Demo / source tag */
.tag-demo {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--spark-soft);
  color: var(--spark-ink);
  border: 1px solid rgba(224, 145, 58, .4);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 11px;
  letter-spacing: .04em;
  font-family: "IBM Plex Mono", monospace;
}

/* Producers bar list */
.prod { display: flex; flex-direction: column; }

.prow {
  display: grid;
  grid-template-columns: 26px 156px 1fr 92px;
  align-items: center;
  gap: 14px;
  padding: 12px 8px;
  border-bottom: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
  transition: background .12s;
}

.prow:last-child { border-bottom: none; }

a.prow:hover { background: var(--surface-2); border-radius: 8px; border-bottom-color: transparent; }

.prow.me {
  background: var(--accent-soft);
  border-radius: 10px;
  border-bottom-color: transparent;
}

.prow .rk {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  color: var(--muted);
  text-align: right;
}

.prow.me .rk { color: var(--accent-ink); font-weight: 600; }

.prow .who {
  display: flex;
  align-items: center;
  gap: 9px;
  font-weight: 600;
  font-size: 14px;
  min-width: 0;
}

.prow .track {
  height: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

.prow .track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tick);
  background-size: 7px 100%;
  opacity: .4;
}

.prow .fill {
  display: block;
  height: 100%;
  border-radius: 5px;
  background: var(--accent);
  opacity: .45;
  position: relative;
  z-index: 1;
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}

.prow.me .fill { opacity: 1; }

.prow .amt {
  font-family: "IBM Plex Mono", monospace;
  font-size: 13px;
  font-weight: 600;
  text-align: right;
}

@media (max-width: 620px) {
  .prow { grid-template-columns: 22px 1fr 72px; gap: 10px; }
  .prow .track { display: none; }
}

/* Query links grid */
.qgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 720px) { .qgrid { grid-template-columns: 1fr; } }

.qlink {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 15px 18px;
  font-weight: 600;
  font-size: 14.5px;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}

.qlink:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -20px var(--accent);
}

.qlink .ql-l {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.qlink .arr {
  display: inline-flex;
  color: var(--accent);
  flex: none;
  align-items: center;
  gap: 6px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  font-weight: 600;
}

.qlink .arr .micon { font-size: 18px; }

/* Cross-link banner */
.banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--ink);
  color: #EAF1EF;
  border-radius: var(--radius);
  padding: 28px 30px;
  border-top: 4px solid var(--accent);
}

.banner .bn-txt { display: flex; flex-direction: column; gap: 6px; }
.banner h3 { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 22px; color: #fff; letter-spacing: -.01em; }
.banner p { font-size: 14px; color: #A7C2BD; max-width: 52ch; }

/* Key facts grid (country profile) */
.facts {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

@media (max-width: 720px) { .facts { grid-template-columns: 1fr 1fr; } }

.fact { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 5px; }
.fact .k { font-family: "IBM Plex Mono", monospace; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.fact .v { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 17px; color: var(--ink); letter-spacing: -.01em; }

/* Strengths / weaknesses rank cards */
.rgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 680px) { .rgrid { grid-template-columns: 1fr; } }

.rcard {
  display: flex;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
}

.rcard.good { border-left: 3px solid var(--accent); }
.rcard.bad  { border-left: 3px solid var(--bad); }

.rankbadge {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  width: 60px;
  height: 60px;
  border-radius: 12px;
  font-family: "IBM Plex Mono", monospace;
  line-height: 1;
}

.rankbadge.good { background: var(--accent-soft); color: var(--accent-ink); border: 1px solid #BFE0DC; }
.rankbadge.bad  { background: var(--bad-soft);    color: var(--bad);        border: 1px solid #E3C5B9; }
.rankbadge .hash { font-size: 10px; opacity: .7; }
.rankbadge .num  { font-size: 23px; font-weight: 600; }

.rc-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; flex: 1; }
.rc-name { font-weight: 600; font-size: 14.5px; }
.rc-val  { font-family: "IBM Plex Mono", monospace; font-size: 13px; color: var(--ink-soft); }
.rc-note { font-size: 12.5px; color: var(--muted); }

.wbar { display: flex; flex-direction: column; gap: 5px; }

.wbar .track {
  height: 8px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 5px;
  position: relative;
  overflow: hidden;
}

.wbar .track::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tick);
  background-size: 7px 100%;
  opacity: .4;
}

.wbar .fill {
  height: 100%;
  border-radius: 5px;
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.rcard.good .wbar .fill { background: var(--accent); }
.rcard.bad  .wbar .fill { background: var(--bad); }

.wbar .scale {
  display: flex;
  justify-content: space-between;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10px;
  color: var(--muted);
}

/* Full metrics table */
.mscroll { overflow-x: auto; }

.mtable {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  min-width: 520px;
}

.mtable th {
  text-align: left;
  font-family: "IBM Plex Mono", monospace;
  font-size: 10.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  padding: 0 14px 12px;
  border-bottom: 1px solid var(--line);
}

.mtable td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}

.mtable tr:last-child td { border-bottom: none; }
.mtable tr:hover td { background: var(--surface-2); }

.m-name { font-weight: 600; }
.m-val  { font-family: "IBM Plex Mono", monospace; font-weight: 600; white-space: nowrap; }

.m-rank {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12.5px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
}

.m-rank small { font-weight: 400; }
.m-rank.good { background: var(--accent-soft); color: var(--accent-ink); }
.m-rank.bad  { background: var(--bad-soft);    color: var(--bad); }
.m-rank.mid  { background: var(--surface-2);   color: var(--ink-soft); }

.m-worldbar { min-width: 120px; }

.m-worldbar .t {
  height: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.m-worldbar .t::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tick);
  background-size: 6px 100%;
  opacity: .4;
}

.m-worldbar i {
  display: block;
  height: 100%;
  background: var(--line-strong);
  border-radius: 4px;
  transition: width .5s cubic-bezier(.2, .8, .2, 1);
}

.m-worldbar.good i { background: var(--accent); }
.m-worldbar.bad  i { background: var(--bad); }

@media (max-width: 620px) { .m-worldbar { display: none; } }

/* Breadcrumb */
.crumbs { border-bottom: 1px solid var(--line); background: var(--surface-2); }

.crumbs-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 12px 24px;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
}

.crumbs-in a { color: var(--ink-soft); }
.crumbs-in a:hover { color: var(--accent-ink); }
.crumbs-in .sep { opacity: .5; }
.crumbs-in .cur { color: var(--ink); }

/* Answer-first hero (CI page) */
.answer { border-bottom: 1px solid var(--line); }

.answer-grid {
  display: grid;
  grid-template-columns: 1.15fr .85fr;
  gap: 50px;
  align-items: start;
}

@media (max-width: 920px) {
  .answer-grid { grid-template-columns: 1fr; gap: 36px; }
}

.answer h1 {
  font-size: clamp(26px, 4vw, 44px);
  margin: 14px 0 0;
  max-width: 20ch;
}

.answer .ctx {
  font-size: 17px;
  color: var(--ink-soft);
  margin-top: 18px;
  max-width: 54ch;
}

.srcline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  font-family: "IBM Plex Mono", monospace;
  font-size: 12px;
  color: var(--muted);
  flex-wrap: wrap;
}

/* Mini facts grid */
.minifacts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  margin-top: 22px;
}

.minifacts div { background: var(--surface); padding: 13px 15px; }
.minifacts b { font-family: "IBM Plex Mono", monospace; font-size: 19px; font-weight: 600; display: block; letter-spacing: -.01em; }
.minifacts span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; display: block; }
.minifacts .accent b { color: var(--accent); }

/* Generic card shell */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 30px; }

.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; align-items: stretch; }

@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }

/* World rank gauge */
.gscale { position: relative; height: 64px; margin: 38px 8px 6px; }
.gscale .rail { position: absolute; left: 0; right: 0; top: 50%; height: 2px; background: var(--ink); border-radius: 2px; }
.gscale .ticks { position: absolute; left: 0; right: 0; top: calc(50% + 6px); height: 9px; background: var(--tick); background-size: calc(100%/19) 9px; opacity: .55; }
.gscale .ends { position: absolute; left: 0; right: 0; top: calc(50% + 20px); display: flex; justify-content: space-between; font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted); }

.gpin { position: absolute; top: 50%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; }

.gpin .dot {
  width: 46px; height: 46px; border-radius: 50%;
  background: var(--surface); border: 2px solid var(--accent);
  display: grid; place-items: center;
  box-shadow: 0 0 0 5px var(--accent-soft), 0 6px 14px -6px var(--accent);
}

.gpin .dot b { font-family: "IBM Plex Mono", monospace; font-weight: 600; font-size: 13px; line-height: 1; color: var(--accent-ink); }

.gpin .cap {
  position: absolute; top: calc(100% + 8px);
  white-space: nowrap;
  font-family: "IBM Plex Mono", monospace; font-size: 12px; font-weight: 600; color: var(--accent-ink);
}

/* Trend bars */
.trend { display: flex; align-items: flex-end; gap: 10px; height: 180px; margin-top: 26px; padding-bottom: 2px; }

.tcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 8px; }

.tcol .bar {
  width: 100%; max-width: 58px;
  background: var(--accent-soft); border: 1px solid #BFE0DC;
  border-radius: 6px 6px 3px 3px;
  position: relative;
  transition: height .8s cubic-bezier(.2, .8, .2, 1);
  min-height: 6px;
}

.tcol.now .bar { background: var(--accent); border-color: var(--accent-ink); }

.tcol .val { font-family: "IBM Plex Mono", monospace; font-size: 11.5px; font-weight: 600; }
.tcol.now .val { color: var(--accent-ink); }
.tcol .yr { font-family: "IBM Plex Mono", monospace; font-size: 11px; color: var(--muted); }

/* PAA related questions */
.paa { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

@media (max-width: 720px) { .paa { grid-template-columns: 1fr; } }

/* FAQ accordion */
.faq { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.faq details { border-bottom: 1px solid var(--line); }
.faq details:last-child { border-bottom: none; }

.faq summary {
  list-style: none; cursor: pointer;
  padding: 20px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 16px; letter-spacing: -.01em;
}

.faq summary::-webkit-details-marker { display: none; }

.faq summary .ic {
  flex: none; width: 24px; height: 24px;
  border: 1.5px solid var(--line-strong); border-radius: 6px;
  position: relative; transition: .2s;
}

.faq summary .ic::before,
.faq summary .ic::after {
  content: ""; position: absolute;
  background: var(--accent-ink); border-radius: 2px;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
}

.faq summary .ic::before { width: 11px; height: 1.6px; }
.faq summary .ic::after { width: 1.6px; height: 11px; transition: .2s; }

.faq details[open] summary .ic { background: var(--accent-soft); border-color: var(--accent); }
.faq details[open] summary .ic::after { transform: translate(-50%, -50%) scaleY(0); }

.faq .ans { padding: 0 24px 22px; color: var(--ink-soft); font-size: 15px; max-width: 70ch; }
.faq .ans b { color: var(--ink); font-weight: 600; }

/* Footer */
footer {
  background: var(--ink);
  color: #C9D6D4;
  border-top: 4px solid var(--accent);
}

.foot-in {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 60px 24px 34px;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 36px;
}

.foot-grid h4 {
  font-family: "IBM Plex Mono", monospace;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #7FA09C;
  margin-bottom: 16px;
}

.foot-grid a {
  display: block;
  color: #C9D6D4;
  font-size: 14px;
  padding: 5px 0;
  transition: color .15s;
}

.foot-grid a:hover {
  color: #fff;
}

.foot-brand {
  font-family: "Bricolage Grotesque", sans-serif;
  font-weight: 800;
  font-size: 22px;
  color: #fff;
  letter-spacing: -.02em;
}

.foot-brand p {
  font-family: "IBM Plex Sans";
  font-weight: 400;
  font-size: 14px;
  color: #9DB6B2;
  margin-top: 12px;
  max-width: 30ch;
}

.foot-bottom {
  border-top: 1px solid rgba(255, 255, 255, .12);
  margin-top: 42px;
  padding-top: 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: space-between;
  font-size: 12.5px;
  color: #7FA09C;
}

/* ===== Countries catalog ===== */

/* Page-level search bar */
.search-wrap { position: relative; max-width: 520px; }
.search-wrap .micon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--muted); font-size: 22px; pointer-events: none; }
.search-wrap input { width: 100%; border: 1.5px solid var(--line-strong); background: var(--surface); border-radius: 12px; padding: 15px 18px 15px 48px; font-size: 16px; font-family: inherit; color: var(--ink); }
.search-wrap input::placeholder { color: var(--muted); }
.search-wrap input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }

/* Region filter chips */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filters-cont  { display: flex; flex-wrap: wrap; gap: 8px; }
.filters-group { display: flex; flex-wrap: wrap; gap: 8px; }
.filters-sep   { width: 1px; height: 28px; background: var(--line-strong); margin: 0 4px; align-self: center; }

.fchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  border-radius: 99px;
  padding: 8px 14px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
  cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}

.fchip:hover { border-color: var(--accent); color: var(--ink); }
.fchip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.fchip--group.active { background: var(--accent); border-color: var(--accent-ink); }

/* Country card grid */
.cgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(264px, 1fr)); gap: 14px; }

.ccard {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  transition: transform .15s, box-shadow .15s, border-color .15s;
  position: relative;
  overflow: hidden;
}

.ccard:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 20px 40px -28px rgba(21,41,46,.45); }

.ccard::after {
  content: "";
  position: absolute;
  left: 20px; right: 20px; bottom: 0;
  height: 7px;
  background: var(--tick);
  background-size: 9px 7px;
  opacity: 0;
  transition: opacity .15s;
}

.ccard:hover::after { opacity: .5; }

.cc-top { display: flex; align-items: center; gap: 13px; }

.cc-flag {
  display: inline-grid;
  place-items: center;
  min-width: 50px;
  height: 38px;
  padding: 0 9px;
  font-family: "IBM Plex Mono", monospace;
  font-weight: 600;
  font-size: 17px;
  letter-spacing: .04em;
  background: var(--accent-soft);
  border: 1px solid #BFE0DC;
  border-radius: 9px;
  color: var(--accent-ink);
  line-height: 1;
  flex: none;
}

.cc-id { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cc-name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 700; font-size: 18px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cc-region { font-family: "IBM Plex Mono", monospace; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }

.cc-stats { display: flex; flex-direction: column; gap: 8px; border-top: 1px dashed var(--line-strong); padding-top: 13px; flex: 1; }
.cc-stat { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 13px; }
.cc-stat .k { color: var(--muted); }
.cc-stat .v { font-family: "IBM Plex Mono", monospace; font-weight: 600; color: var(--ink); }

.cc-go { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 4px; }
.cc-go .lbl { font-family: "IBM Plex Mono", monospace; font-size: 12px; color: var(--accent-ink); font-weight: 600; }
.cc-go .micon { color: var(--accent); font-size: 20px; transition: transform .15s; }
.ccard:hover .cc-go .micon { transform: translateX(3px); }

/* No-results note */
.nores { display: none; padding: 18px 20px; border: 1px dashed var(--line-strong); border-radius: 12px; color: var(--muted); font-size: 14px; background: var(--surface-2); }
.nores.on { display: block; }

/* Count note */
.count-note { font-family: "IBM Plex Mono", monospace; font-size: 12.5px; color: var(--muted); }
