/* =========================================================================
   Buloqboshi — raqamli pasport
   G'oya: "buloq boshi" — manba. Kechasi vohadagi suv.
     faol subyektlar   = suv      (#1a9e90 / yorug'da #00897a)
     faoliyatsiz       = quruq yer (#bd8436 / yorug'da #a66c1c)
   Ikkala juftlik ham yorqinlik oralig'i, xroma, rang ko'rmaslik (CVD)
   va kontrast tekshiruvlaridan o'tgan. --spring faqat bezak uchun.
   Shrift: Geologica (bitta oila, o'zgaruvchan: wght, SHRP).
   ========================================================================= */

@font-face {
  font-family: "Geologica";
  src: url("fonts/geologica-latin.woff2") format("woff2");
  font-weight: 100 900; font-style: oblique 0deg 12deg; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
                 U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
                 U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Geologica";
  src: url("fonts/geologica-latin-ext.woff2") format("woff2");
  font-weight: 100 900; font-style: oblique 0deg 12deg; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
                 U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB,
                 U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  --ink:    #061618;
  --ink-2:  #0b2326;
  --ink-3:  #12302f;
  --line:   rgba(163, 222, 214, 0.12);
  --line-2: rgba(163, 222, 214, 0.22);
  --foam:   #e7f3f0;
  --silt:   #9dbab5;
  --mute:   #6f8f8a;

  --water:  #1a9e90;
  --dry:    #bd8436;
  --spring: #5fe3d4;
  --good:   #0ca30c;
  --bad:    #d03b3b;

  --heat-1: #0f2c2c; --heat-2: #133f3c; --heat-3: #15564f;
  --heat-4: #177063; --heat-5: #1a8d7c; --heat-6: #43b9a8;

  --shadow: 0 24px 60px -28px rgba(0, 0, 0, 0.85);
  --font: "Geologica", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --gutter: clamp(20px, 6vw, 96px);
}

:root[data-theme="light"] {
  color-scheme: light;
  --ink:    #eef5f3;
  --ink-2:  #ffffff;
  --ink-3:  #dfeae7;
  --line:   rgba(13, 42, 42, 0.12);
  --line-2: rgba(13, 42, 42, 0.22);
  --foam:   #0d2a2a;
  --silt:   #45625e;
  --mute:   #647f7b;

  --water:  #00897a;
  --dry:    #a66c1c;
  --spring: #0aa593;

  --heat-1: #e3f1ee; --heat-2: #bfe2db; --heat-3: #8ecdc1;
  --heat-4: #56b1a2; --heat-5: #1e8e7f; --heat-6: #0b695e;

  --shadow: 0 22px 50px -30px rgba(13, 42, 42, 0.45);
}

/* ---------------- Asos ---------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  font-variation-settings: "SHRP" 0;
  color: var(--foam);
  background: var(--ink);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, dl, dd, ol { margin: 0; }
button { font: inherit; color: inherit; }
a { color: inherit; }

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

::selection { background: color-mix(in srgb, var(--water) 45%, transparent); }

.tnum { font-variant-numeric: tabular-nums; }

/* ---------------- Yuklanish ---------------- */

.loader {
  position: fixed; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 18px;
  background: var(--ink);
  transition: opacity .8s ease, visibility .8s;
}
.loader.done { opacity: 0; visibility: hidden; }
.loader-mark { width: 56px; height: 56px; }
.loader-mark circle { fill: var(--spring); }
.loader-mark path {
  fill: none; stroke: var(--spring); stroke-width: 2.4; stroke-linecap: round;
  animation: rise 1.6s ease-in-out infinite;
}
.loader-mark path:nth-of-type(2) { animation-delay: .25s; }
@keyframes rise { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }
.loader-name {
  font-size: 15px; font-weight: 600; letter-spacing: .01em; color: var(--silt);
  font-variation-settings: "SHRP" 60;
}

/* ---------------- Sahna ---------------- */

.stage { position: fixed; inset: 0; z-index: 0; }
.stage canvas { display: block; width: 100% !important; height: 100% !important; }
.stage.scene-failed {
  background: radial-gradient(50% 55% at 68% 52%, color-mix(in srgb, var(--water) 30%, transparent), transparent 70%);
}

/* Matn ustuni o'qilishi uchun chapdan soya; xarita o'ng tomonda toza qoladi */
.stage-shade {
  position: fixed; inset: 0; z-index: 1; pointer-events: none;
  background:
    linear-gradient(90deg,
      var(--ink) 0%,
      color-mix(in srgb, var(--ink) 90%, transparent) 24%,
      color-mix(in srgb, var(--ink) 35%, transparent) 44%,
      transparent 60%),
    linear-gradient(180deg,
      color-mix(in srgb, var(--ink) 75%, transparent) 0%,
      transparent 14%, transparent 82%,
      color-mix(in srgb, var(--ink) 85%, transparent) 100%);
}

/* Hover yorlig'i */
.scene-tip {
  position: fixed; z-index: 20; pointer-events: none;
  transform: translate(-50%, -130%);
  padding: 5px 10px;
  font-size: 12.5px; font-weight: 550;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 8px;
  white-space: nowrap; opacity: 0; transition: opacity .15s;
}
.scene-tip.on { opacity: 1; }

/* Fokus hudud yorlig'i — faqat kirishda */
.scene-tag {
  position: fixed; z-index: 15; pointer-events: none;
  transform: translate(-50%, -150%);
  display: flex; align-items: baseline; gap: 10px;
  padding: 9px 15px 9px 13px;
  background: color-mix(in srgb, var(--ink-2) 88%, transparent);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border: 1px solid color-mix(in srgb, var(--spring) 45%, transparent);
  border-radius: 999px;
  white-space: nowrap; opacity: 0; transition: opacity .5s ease;
}
.scene-tag.on { opacity: 1; }
.scene-tag i {
  align-self: center; width: 8px; height: 8px; border-radius: 50%;
  background: var(--spring); box-shadow: 0 0 0 4px color-mix(in srgb, var(--spring) 22%, transparent);
}
.scene-tag b { font-size: 13.5px; font-weight: 600; }
.scene-tag span { font-size: 12.5px; color: var(--silt); }

/* Xaritada tanlangan hudud */
.map-card {
  position: fixed; z-index: 25;
  transform: translate(-50%, calc(-100% - 16px));
  width: 248px; padding: 16px 18px 14px;
  background: color-mix(in srgb, var(--ink-2) 95%, transparent);
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: var(--shadow);
  animation: cardIn .28s cubic-bezier(.22, 1, .36, 1);
}
@keyframes cardIn { from { opacity: 0; transform: translate(-50%, calc(-100% - 6px)) scale(.96); } }
.mc-close {
  position: absolute; top: 10px; right: 10px;
  width: 24px; height: 24px; display: grid; place-items: center;
  border: 0; border-radius: 7px; background: none; color: var(--mute); cursor: pointer;
}
.mc-close:hover { color: var(--foam); background: var(--ink-3); }
.mc-close svg { width: 12px; height: 12px; stroke: currentColor; stroke-width: 2.4; fill: none; stroke-linecap: round; }
.mc-name { font-size: 15.5px; font-weight: 650; margin: 0 26px 12px 0; font-variation-settings: "SHRP" 40; }
.mc-rows { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; font-size: 13px; }
.mc-rows dt { color: var(--silt); display: flex; align-items: center; gap: 8px; }
.mc-rows dd { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.mc-rows .rule { grid-column: 1 / -1; height: 1px; background: var(--line); margin: 3px 0; }
.mc-rows .vs dt, .mc-rows .vs dd { color: var(--spring); }
.key { width: 9px; height: 9px; border-radius: 2px; flex: none; display: inline-block; }
.key.water { background: var(--water); }
.key.dry { background: var(--dry); }

.map-ctl {
  position: fixed; z-index: 16; right: clamp(20px, 4vw, 56px); bottom: 28px;
  display: flex; align-items: center; gap: 10px;
  opacity: 0; transition: opacity .5s ease; pointer-events: none;
}
.map-ctl.on { opacity: 1; }
.map-ctl.on > * { pointer-events: auto; }
.map-hint { font-size: 13px; color: var(--silt); transition: opacity .4s; }
.map-hint.faded { opacity: 0; }
.map-reset {
  padding: 8px 14px; font-size: 13px; font-weight: 550; cursor: pointer;
  color: var(--foam); background: var(--ink-2);
  border: 1px solid var(--line-2); border-radius: 999px;
}
.map-reset:hover { border-color: var(--spring); }

/* ---------------- Yuqori panel ---------------- */

.appbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 14px var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background .3s, border-color .3s;
}
.appbar.solid {
  background: color-mix(in srgb, var(--ink) 84%, transparent);
  backdrop-filter: blur(14px) saturate(140%); -webkit-backdrop-filter: blur(14px) saturate(140%);
  border-bottom-color: var(--line);
}
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.brand-mark circle { fill: var(--spring); }
.brand-mark path { fill: none; stroke: var(--spring); stroke-width: 2.6; stroke-linecap: round; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.15; }
.brand-txt b { font-size: 14.5px; font-weight: 650; font-variation-settings: "SHRP" 40; }
.brand-txt span { font-size: 12px; color: var(--silt); }

.appbar-nav { display: flex; gap: 22px; margin-left: 12px; }
.appbar-nav a { font-size: 14px; color: var(--silt); text-decoration: none; }
.appbar-nav a:hover { color: var(--foam); }

.appbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.appbar-date { font-size: 13px; color: var(--silt); margin-right: 6px; white-space: nowrap; }

.btn-ghost, .btn-icon {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; cursor: pointer; text-decoration: none;
  color: var(--foam); background: color-mix(in srgb, var(--ink-2) 70%, transparent);
  border: 1px solid var(--line-2); border-radius: 10px;
  transition: border-color .2s, background .2s;
}
.btn-ghost { padding: 0 14px; font-size: 13.5px; font-weight: 550; }
.btn-icon { width: 38px; }
.btn-ghost:hover, .btn-icon:hover { border-color: var(--spring); }
.btn-ghost svg, .btn-icon svg {
  width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9;
  stroke-linecap: round; stroke-linejoin: round;
}
.btn-icon .i-sun { display: none; }
:root[data-theme="light"] .btn-icon .i-sun { display: block; }
:root[data-theme="light"] .btn-icon .i-moon { display: none; }

/* ---------------- Kirish ---------------- */

/* main butun sahifani qoplaydi — bosishni o'tkazib yuboradi, aks holda
   o'ng tomondagi xaritani aylantirib ham, bosib ham bo'lmaydi.
   pointer-events meros bo'ladi: kerakli joylarda qayta yoqiladi. */
main { position: relative; z-index: 2; pointer-events: none; }
.deck { pointer-events: auto; }

.chapter {
  position: relative;
  padding: 0 var(--gutter);
  pointer-events: none;                 /* bo'sh joydan bosish xaritaga o'tadi */
}
.chapter .ch-body, .intro-body, .scroll-cue { pointer-events: auto; }

.intro {
  min-height: 100svh;
  display: flex; flex-direction: column; justify-content: center;
  padding-top: 96px; padding-bottom: 72px;
}
.intro-body { max-width: 38rem; }

/* Sahifaning yagona "ovozli" elementi — nom o'zi */
.wordmark {
  font-size: clamp(56px, 7.6vw, 150px);
  white-space: nowrap;
  line-height: .86;
  font-weight: 760;
  letter-spacing: -0.052em;
  font-variation-settings: "SHRP" 100;
  margin: 0 0 28px -0.04em;
}
.wordmark .ch { display: inline-block; }

.intro-lede {
  max-width: 34ch;
  font-size: clamp(18px, 1.55vw, 21px);
  line-height: 1.55;
  color: var(--silt);
}
.intro-lede b { color: var(--foam); font-weight: 600; white-space: nowrap; }

.figures {
  display: grid; grid-template-columns: repeat(4, auto);
  justify-content: start; gap: 12px clamp(24px, 3.4vw, 48px);
  margin-top: 40px;
}
.figures div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 6px; }
.figures dd {
  font-size: clamp(30px, 3.2vw, 44px); font-weight: 650; line-height: 1;
  letter-spacing: -0.03em; font-variation-settings: "SHRP" 60;
}
.figures dd.up { color: var(--spring); }
.figures dt { font-size: 13.5px; line-height: 1.35; color: var(--silt); max-width: 14ch; min-height: 2.7em; }

.map-caption {
  margin-top: 36px; max-width: 42ch;
  font-size: 13.5px; line-height: 1.5; color: var(--mute);
  padding-left: 14px; border-left: 2px solid var(--water);
}

.scroll-cue {
  position: absolute; left: var(--gutter); bottom: 28px;
  width: 40px; height: 40px; display: grid; place-items: center;
  border: 1px solid var(--line-2); border-radius: 50%; color: var(--silt);
}
.scroll-cue svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.scroll-cue:hover { color: var(--foam); border-color: var(--spring); }

/* Kirish ketma-ketligi — sahifadagi yagona orkestrlangan harakat */
body:not(.ready) .wordmark .ch { opacity: 0; transform: translateY(.3em); }
body.ready .wordmark .ch {
  opacity: 1; transform: none;
  transition: opacity .7s ease, transform .9s cubic-bezier(.19, 1, .22, 1);
  transition-delay: calc(var(--i) * 45ms + 250ms);
}
body:not(.ready) .intro-lede, body:not(.ready) .figures, body:not(.ready) .map-caption { opacity: 0; }
body.ready .intro-lede, body.ready .figures, body.ready .map-caption { opacity: 1; transition: opacity 1s ease; }
body.ready .intro-lede  { transition-delay: .95s; }
body.ready .figures     { transition-delay: 1.2s; }
body.ready .map-caption { transition-delay: 1.5s; }

/* ---------------- Hikoya boblari ---------------- */

.chapters { position: relative; }
.chapters .chapter { min-height: 150svh; }
.ch-body {
  position: sticky; top: 18svh;
  max-width: 31rem;
  padding: 8px 0 40px;
}
.ch-kicker { font-size: 14px; color: var(--spring); margin-bottom: 14px; font-weight: 550; }
.ch-title {
  font-size: clamp(32px, 3.5vw, 50px); line-height: 1.06;
  font-weight: 650; letter-spacing: -0.03em;
  font-variation-settings: "SHRP" 70;
  margin-bottom: 20px;
}
.ch-text { font-size: 17px; line-height: 1.62; color: var(--silt); max-width: 36ch; }
.ch-text b { color: var(--foam); font-weight: 600; white-space: nowrap; }
.ch-viz { margin-top: 30px; }
.ch-body .map-caption { margin-top: 28px; }

/* O'rin shkalasi — 16 ta nuqta, hudud o'rni yoritilgan */
.rank-dots { display: flex; gap: 5px; align-items: center; margin-top: 10px; }
.rank-dots i { width: 14px; height: 6px; border-radius: 3px; background: var(--ink-3); }
.rank-dots i.me { background: var(--spring); width: 26px; }
.rank-cap { display: flex; justify-content: space-between; font-size: 12px; color: var(--mute); margin-top: 7px; max-width: 322px; }

/* Kichik reyting ro'yxati (bob ichida) */
.mini-rank { display: grid; gap: 9px; }
.mini-rank li { list-style: none; display: grid; grid-template-columns: 22px 9.5rem 1fr auto; align-items: center; gap: 12px; font-size: 14px; }
.mini-rank ol { padding: 0; }
.mini-rank .n { color: var(--mute); font-variant-numeric: tabular-nums; }
.mini-rank .nm { color: var(--silt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-rank .me .nm { color: var(--foam); font-weight: 600; }
.mini-rank .t { height: 6px; border-radius: 3px; background: var(--ink-3); overflow: hidden; }
.mini-rank .t i { display: block; height: 100%; border-radius: 3px; background: var(--mute); width: 0; transition: width 1s cubic-bezier(.22, 1, .36, 1); }
.mini-rank .me .t i { background: var(--spring); }
.mini-rank .v { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; min-width: 3.5em; }

/* Yangi va tugatilgan — ikki katta son */
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; max-width: 26rem; }
.pair dd { font-size: 46px; font-weight: 650; line-height: 1; letter-spacing: -0.03em; font-variation-settings: "SHRP" 60; }
.pair dt { font-size: 13.5px; color: var(--silt); margin-top: 8px; display: flex; gap: 8px; align-items: center; }
.pair .gain dd { color: var(--good); }
.pair div { display: flex; flex-direction: column-reverse; }
.ratio-bar { display: flex; gap: 3px; height: 10px; margin-top: 20px; max-width: 26rem; }
.ratio-bar i { display: block; height: 100%; border-radius: 3px; width: 0; transition: width 1.1s cubic-bezier(.22, 1, .36, 1); }
.ratio-bar .gain { background: var(--good); }
.ratio-bar .loss { background: var(--bad); }

/* Tarmoqlar ro'yxati (bob ichida) */
.sectors { display: grid; gap: 8px; max-width: 30rem; }
.sector { display: grid; grid-template-columns: 9.5rem 1fr 3.2rem; align-items: center; gap: 12px; font-size: 13.5px; }
.sector .nm { color: var(--silt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sector .bars { display: flex; gap: 2px; height: 10px; }
.sector .bars i { display: block; height: 100%; width: 0; transition: width 1s cubic-bezier(.22, 1, .36, 1); }
.sector .bars .w { background: var(--water); border-radius: 3px 0 0 3px; }
.sector .bars .d { background: var(--dry); border-radius: 0 3px 3px 0; }
.sector .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }
.legend { display: flex; gap: 18px; font-size: 13px; color: var(--silt); margin-bottom: 14px; }
.legend span { display: inline-flex; align-items: center; gap: 7px; }

/* Solishtirma — ikki tomonlama */
.compare { display: grid; gap: 7px; max-width: 30rem; }
.cmp { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; align-items: center; font-size: 13.5px; }
.cmp .nm { color: var(--silt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmp .axis { display: grid; grid-template-columns: 1fr 1px 1fr; align-items: center; height: 22px; }
.cmp .axis > span { display: flex; align-items: center; gap: 7px; height: 100%; min-width: 0; }
.cmp .axis .l { justify-content: flex-end; }
.cmp .axis .mid { width: 1px; height: 100%; background: var(--line-2); }
.cmp .cbar { height: 10px; width: 0; transition: width 1s cubic-bezier(.22, 1, .36, 1); }
.cmp .cbar.pos { background: var(--water); border-radius: 0 3px 3px 0; }
.cmp .cbar.neg { background: var(--dry); border-radius: 3px 0 0 3px; }
.cmp .num { font-size: 12.5px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--silt); flex: none; }

/* Faollik halqasi — bo'sh qismi "quruq yer" */
.ring-row { display: flex; align-items: center; gap: 28px; }
.ring { position: relative; width: 150px; height: 150px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { fill: none; stroke: var(--dry); stroke-width: 14; opacity: .85; }
.ring .arc { fill: none; stroke: var(--water); stroke-width: 14; stroke-linecap: butt; transition: stroke-dashoffset 1.3s cubic-bezier(.22, 1, .36, 1); }
.ring .c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring .c b { font-size: 30px; font-weight: 650; letter-spacing: -0.03em; line-height: 1; }
.ring .c span { font-size: 12px; color: var(--silt); margin-top: 4px; }
.ring-keys { display: grid; gap: 12px; }
.ring-keys div { display: flex; flex-direction: column; }
.ring-keys dt { font-size: 13px; color: var(--silt); display: flex; align-items: center; gap: 8px; }
.ring-keys dd { font-size: 24px; font-weight: 650; letter-spacing: -0.02em; }

/* ---------------- Ma'lumotlar bo'limi ---------------- */

.deck {
  position: relative; z-index: 3;
  background: var(--ink);
  padding: 96px var(--gutter) 56px;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: clamp(24px, 3vw, 48px); row-gap: 96px;
}
/* xaritadan ma'lumotlarga yumshoq o'tish */
.deck::before {
  content: ""; position: absolute; left: 0; right: 0; top: -38svh; height: 38svh;
  background: linear-gradient(180deg, transparent, var(--ink));
  pointer-events: none;
}

.block { grid-column: 1 / -1; min-width: 0; }
#reyting { grid-column: 1 / span 6; }
#harakat { grid-column: 7 / span 6; }

.block-head { margin-bottom: 26px; max-width: 62ch; }
.block-head h2 {
  font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1;
  font-weight: 650; letter-spacing: -0.025em;
  font-variation-settings: "SHRP" 70;
  margin-bottom: 10px;
}
.block-head p { font-size: 15px; color: var(--silt); line-height: 1.55; }
.block-head p b { color: var(--foam); font-weight: 600; white-space: nowrap; }

/* Tanlov tugmalari — bitta qatorda */
.switch {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  background: var(--ink-2); border: 1px solid var(--line); border-radius: 12px;
}
.switch button {
  padding: 7px 11px; font-size: 13px; font-weight: 500; color: var(--silt); white-space: nowrap;
  background: none; border: 0; border-radius: 8px; cursor: pointer;
}
.switch button:hover { color: var(--foam); }
.switch button[aria-selected="true"] { background: var(--ink-3); color: var(--foam); }

/* Reyting */
.rank { list-style: none; padding: 0; margin: 22px 0 0; display: grid; gap: 2px; }
.rank li {
  display: grid; grid-template-columns: 26px minmax(7rem, 10rem) 1fr 4.6rem;
  align-items: center; gap: 12px;
  padding: 6px 10px; border-radius: 9px; font-size: 14px;
}
.rank li.me { background: color-mix(in srgb, var(--water) 16%, transparent); }
.rank .n { color: var(--mute); font-variant-numeric: tabular-nums; text-align: right; }
.rank .nm { color: var(--silt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rank li.me .nm { color: var(--foam); font-weight: 600; }
.rank .t { height: 12px; }
.rank .t i { display: block; height: 100%; width: 0; border-radius: 0 3px 3px 0; background: color-mix(in srgb, var(--mute) 55%, transparent); transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.rank li.me .t i { background: var(--water); }
.rank .v { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* Yangi va tugatilgan */
.flow-legend { display: flex; gap: 18px; font-size: 13px; color: var(--silt); margin-bottom: 12px; }
.flow-legend span { display: inline-flex; align-items: center; gap: 7px; }
.k-gain, .k-loss { width: 9px; height: 9px; border-radius: 2px; display: inline-block; }
.k-gain { background: var(--good); }
.k-loss { background: var(--bad); }
.flow { display: grid; gap: 2px; }
.flow-row {
  display: grid; grid-template-columns: 1fr 8.5rem 1fr 3.4rem;
  align-items: center; gap: 10px; padding: 5px 8px; border-radius: 9px; font-size: 13.5px;
}
.flow-row.me { background: color-mix(in srgb, var(--water) 16%, transparent); }
.flow-row .nm { text-align: center; color: var(--silt); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flow-row.me .nm { color: var(--foam); font-weight: 600; }
.flow-row .side { display: flex; align-items: center; gap: 7px; height: 22px; }
.flow-row .side.l { justify-content: flex-end; }
.flow-row .side i { display: block; height: 11px; width: 0; transition: width .9s cubic-bezier(.22, 1, .36, 1); }
.flow-row .side.l i { background: var(--bad); border-radius: 3px 0 0 3px; }
.flow-row .side.r i { background: var(--good); border-radius: 0 3px 3px 0; }
.flow-row .side span { font-size: 12.5px; color: var(--mute); font-variant-numeric: tabular-nums; min-width: 2.2em; }
.flow-row .side.l span { text-align: right; }
.flow-row .net { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--good); }
.flow-row .net.neg { color: var(--bad); }

/* Issiqlik xaritasi */
.heat-scale { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--silt); margin-bottom: 16px; flex-wrap: wrap; }
.heat-scale .steps { display: flex; gap: 2px; }
.heat-scale .steps i { width: 38px; height: 12px; border-radius: 2px; }
.heat-scale .steps i:first-child { border-radius: 3px 0 0 3px; }
.heat-scale .steps i:last-child { border-radius: 0 3px 3px 0; }
.heat-wrap { overflow-x: auto; padding-bottom: 6px; }
.heat { display: grid; gap: 2px; min-width: 760px; }
.heat .cl { font-size: 12.5px; color: var(--silt); text-align: center; padding-bottom: 8px; line-height: 1.25; }
.heat .rl { font-size: 13px; color: var(--silt); text-align: right; padding-right: 12px; align-self: center; white-space: nowrap; }
.heat .rl.me { color: var(--foam); font-weight: 600; }
.heat .cell {
  height: 34px; border-radius: 3px;
  display: grid; place-items: center;
  font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums;
  cursor: default;
}
.heat .cell.me { box-shadow: inset 0 0 0 2px var(--spring); }

/* Jadval */
.table-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-bottom: 16px; }
.table-tools .btn-ghost { margin-left: auto; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--ink-2); }
table { width: 100%; border-collapse: collapse; min-width: 880px; font-size: 13.5px; }
th {
  position: sticky; top: 0; z-index: 1;
  padding: 12px 14px; text-align: right; white-space: nowrap;
  font-weight: 550; color: var(--silt);
  background: var(--ink-2); border-bottom: 1px solid var(--line-2);
  cursor: pointer; user-select: none;
}
th:first-child, td:first-child { text-align: left; }
th:hover { color: var(--foam); }
th[aria-sort="descending"]::after { content: " ↓"; color: var(--spring); }
th[aria-sort="ascending"]::after { content: " ↑"; color: var(--spring); }
td {
  padding: 10px 14px; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums; color: var(--silt);
  border-bottom: 1px solid var(--line);
}
td:first-child { color: var(--foam); font-weight: 500; }
tbody tr:hover td { background: var(--ink-3); }
tr.me td { background: color-mix(in srgb, var(--water) 14%, transparent); color: var(--foam); }
tr.total td { font-weight: 600; color: var(--foam); border-bottom: 0; border-top: 1px solid var(--line-2); }
td.pos { color: var(--good); font-weight: 600; }
td.neg { color: var(--bad); font-weight: 600; }

/* Tarmoqlar tasnifi — kartalar emas, ikki ustunli ro'yxat */
.gloss { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); column-gap: 48px; }
.gloss-item { padding: 22px 0; border-top: 1px solid var(--line); }
.gloss-item h3 { font-size: 17px; font-weight: 620; margin-bottom: 4px; display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.gloss-item .code { font-size: 12.5px; font-weight: 500; color: var(--mute); }
.gloss-item p { font-size: 14px; color: var(--silt); line-height: 1.6; margin: 6px 0 12px; max-width: 60ch; }
.gloss-item .nums { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: var(--silt); }
.gloss-item .nums b { color: var(--foam); font-weight: 600; font-variant-numeric: tabular-nums; }
.gloss-item .badge { font-size: 12.5px; font-weight: 600; color: var(--spring); }

/* Manbalar */
.sources {
  grid-column: 1 / -1; padding-top: 28px; border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); gap: 16px 40px;
  font-size: 13px; color: var(--mute); line-height: 1.55;
}
.sources b { color: var(--silt); font-weight: 600; display: block; margin-bottom: 2px; }

/* Maslahat oynasi */
.tip {
  position: fixed; z-index: 90; pointer-events: none;
  min-width: 170px; max-width: 280px; padding: 10px 13px;
  font-size: 12.5px; line-height: 1.5;
  background: var(--ink-2); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity .12s;
}
.tip.on { opacity: 1; }
.tip .t { font-weight: 600; margin-bottom: 6px; }
.tip .r { display: flex; gap: 12px; color: var(--silt); }
.tip .r b { margin-left: auto; color: var(--foam); font-variant-numeric: tabular-nums; }

/* ---------------- Katta ekran ---------------- */

.tv {
  position: fixed; inset: 0; z-index: 120;
  display: flex; flex-direction: column;
  background:
    radial-gradient(60% 70% at 85% 20%, color-mix(in srgb, var(--water) 18%, transparent), transparent 70%),
    var(--ink);
}
.tv-top { display: flex; align-items: center; gap: 1vw; padding: 2.4vh 3.2vw; }
.tv-top .brand-mark { width: 2.6vw; height: 2.6vw; min-width: 30px; min-height: 30px; }
.tv-top b { font-size: 1.6vw; font-weight: 650; font-variation-settings: "SHRP" 60; }
.tv-clock { margin-left: auto; font-size: 1.6vw; color: var(--silt); font-variant-numeric: tabular-nums; }
.tv-stage { flex: 1; min-height: 0; display: grid; padding: 0 3.2vw; }
.tv-slide {
  grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: center;
  opacity: 0; transform: translateY(2vh); pointer-events: none;
  transition: opacity .6s ease, transform .7s cubic-bezier(.22, 1, .36, 1);
}
.tv-slide.on { opacity: 1; transform: none; pointer-events: auto; }
.tv-kicker { font-size: 1.3vw; color: var(--spring); font-weight: 550; margin-bottom: 1.6vh; }
.tv-title { font-size: 4vw; line-height: 1.04; font-weight: 650; letter-spacing: -0.035em; font-variation-settings: "SHRP" 80; max-width: 22ch; }
.tv-huge { font-size: 15vw; line-height: .88; font-weight: 700; letter-spacing: -0.05em; font-variation-settings: "SHRP" 100; color: var(--spring); }
.tv-sub { font-size: 1.5vw; color: var(--silt); margin-top: 2vh; max-width: 48ch; line-height: 1.45; }
.tv-row { display: flex; flex-wrap: wrap; gap: 2vh 5vw; margin-top: 5vh; }
.tv-row div { display: flex; flex-direction: column-reverse; gap: .6vh; }
.tv-row dd { font-size: 5vw; font-weight: 650; line-height: 1; letter-spacing: -0.035em; font-variation-settings: "SHRP" 60; }
.tv-row dt { font-size: 1.15vw; color: var(--silt); }
.tv-row .up { color: var(--spring); }
.tv-list { display: grid; gap: 1.6vh; margin-top: 4vh; max-width: 70vw; }
.tv-list div { display: grid; grid-template-columns: 3vw 20vw 1fr 8vw; align-items: center; gap: 1.4vw; font-size: 1.5vw; }
.tv-list .n { color: var(--mute); text-align: right; }
.tv-list .t { height: 1.4vh; min-height: 10px; background: var(--ink-3); border-radius: 4px; overflow: hidden; }
.tv-list .t i { display: block; height: 100%; background: var(--mute); border-radius: 4px; }
.tv-list .me { color: var(--foam); font-weight: 650; }
.tv-list .me .t i { background: var(--spring); }
.tv-list .v { text-align: right; font-weight: 650; }
.tv-bottom { display: flex; align-items: center; gap: 2vw; padding: 2vh 3.2vw; }
.tv-dots { display: flex; gap: .6vw; }
.tv-dots button { width: 2.6vw; min-width: 24px; height: 4px; padding: 0; border: 0; border-radius: 2px; background: var(--ink-3); cursor: pointer; }
.tv-dots button[aria-current="true"] { background: var(--spring); }
.tv-keys { margin-left: auto; font-size: .95vw; color: var(--mute); }
.tv-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.tv-bar i { display: block; height: 100%; width: 0; background: var(--spring); }
body.tv-on { overflow: hidden; }

/* ---------------- Moslashuvchanlik ---------------- */

@media (max-width: 1099px) {
  #reyting, #harakat { grid-column: 1 / -1; }
  .appbar-nav { display: none; }
}

@media (max-width: 860px) {
  .stage-shade {
    background: linear-gradient(180deg,
      color-mix(in srgb, var(--ink) 70%, transparent) 0%,
      transparent 12%, transparent 40%,
      color-mix(in srgb, var(--ink) 80%, transparent) 62%,
      var(--ink) 100%);
  }
  .appbar { gap: 12px; padding: 10px 16px; }
  .appbar-date, .btn-ghost span { display: none; }
  .btn-ghost { width: 38px; padding: 0; }
  .table-tools .btn-ghost { width: auto; padding: 0 14px; }
  .table-tools .btn-ghost span { display: inline; }
  /* Mobil: xarita tepada ochiq turadi, matn pastki qismda qorong'i fonda */
  .intro { justify-content: flex-start; padding: 46svh 20px 96px; min-height: auto; }
  .intro-body { position: relative; }
  .intro-body::before {
    content: ""; position: absolute; inset: -40px -20px -24px; z-index: -1;
    background: linear-gradient(180deg, transparent, var(--ink) 70px);
  }
  .scene-tag { display: none; }
  /* nom ekranga aniq sig'sin: kenglik/o'lcham nisbati ≈ 5,2 */
  .wordmark { font-size: min(96px, calc((100vw - 40px) / 5.3)); margin-bottom: 18px; }
  .figures { grid-template-columns: repeat(2, auto); margin-top: 28px; }
  .chapters .chapter { min-height: auto; padding: 46svh 16px 12svh; }
  .ch-body {
    position: relative; top: auto;
    padding: 24px 20px 26px;
    background: color-mix(in srgb, var(--ink) 90%, transparent);
    backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--line); border-radius: 20px;
  }
  .ch-title { font-size: 30px; }
  .ch-text { font-size: 16px; }
  .sector, .cmp { grid-template-columns: 7.4rem 1fr 3rem; }
  .cmp { grid-template-columns: 7.4rem 1fr; }
  .mini-rank li { grid-template-columns: 20px 7.4rem 1fr auto; }
  .ring-row { gap: 18px; }
  .ring { width: 120px; height: 120px; }
  .deck { padding: 72px 16px 40px; row-gap: 72px; }
  .rank li { grid-template-columns: 22px 7.5rem 1fr 4rem; gap: 8px; padding: 6px 6px; }
  .flow-row { grid-template-columns: 1fr 6.4rem 1fr 2.8rem; gap: 6px; padding: 5px 4px; }
  .map-card { left: 12px !important; right: 12px; top: auto !important; bottom: 12px; width: auto; transform: none; animation: none; }
  .map-ctl { right: 16px; bottom: 16px; }
  .map-hint { display: none; }
  .tv-title { font-size: 7vw; } .tv-huge { font-size: 24vw; } .tv-sub { font-size: 4vw; }
  .tv-row dd { font-size: 10vw; } .tv-row dt { font-size: 3.2vw; }
  .tv-list div { grid-template-columns: 6vw 34vw 1fr 14vw; font-size: 3.6vw; }
  .tv-kicker { font-size: 3.6vw; } .tv-top b, .tv-clock { font-size: 4vw; } .tv-keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
  body:not(.ready) .wordmark .ch, body:not(.ready) .intro-lede,
  body:not(.ready) .figures, body:not(.ready) .map-caption { opacity: 1; transform: none; }
}

@media print {
  .stage, .stage-shade, .appbar, .map-ctl, .scene-tag, .scroll-cue { display: none !important; }
  .deck::before { display: none; }
  body { background: #fff; color: #000; }
}
