/*
 * Jaisandar UI polish 439
 * 1) Бірыңғай батырма жүйесі (primary / secondary / segmented / icon)
 * 2) Оқылымдылық: ең кіші шрифт өлшемдері (мәтін ≥ 12px, бас әріпті белгі ≥ 11px)
 * 3) Фото: тұрақты scale() үлкейтуін алып тастау (суретті бұлдыратады)
 * Бұл файл ең соңында жүктеледі. Ескі патчтардағы !important ережелерін басу үшін
 * селекторлар `:root body:not(#jai439)` префиксімен жазылған (ID деңгейіндегі басымдық).
 */

:root {
  --ui-ink: #10283a;
  --ui-muted: #5a6b75;
  --ui-border: #d3dfe3;
  --ui-surface: #ffffff;
  --ui-surface-soft: #f2f6f7;
  --ui-primary: #006666;
  --ui-primary-hover: #005151;
  --ui-focus: #1aa39b;
  --ui-radius: 10px;
  --ui-h: 40px;
  --ui-h-seg: 36px;
  --ui-fs: 14px;
  --ui-fs-seg: 13px;
  --ui-shadow: 0 1px 2px rgba(16, 40, 58, .08);
  --ui-shadow-active: 0 2px 6px rgba(16, 40, 58, .16);
}

/* ------------------------------------------------------------------ */
/* 0. Фокус — пернетақтамен жүргенде қай батырма таңдалғаны көрінсін   */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) :is(button, a, [role="button"], [role="tab"], select, input):focus-visible {
  outline: 2px solid var(--ui-focus) !important;
  outline-offset: 2px !important;
}

/* ------------------------------------------------------------------ */
/* 1. PRIMARY — негізгі әрекет: PNG жүктеу, Салыстыру, Бөлісу          */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) :is(.visual-download-button:not(.economy-fullscreen-button), .jai-compare-go, .share-view-button) {
  min-height: var(--ui-h) !important;
  height: auto !important;
  padding: 0 16px !important;
  border-radius: var(--ui-radius) !important;
  border: 1px solid var(--ui-primary) !important;
  background: var(--ui-primary) !important;
  color: #fff !important;
  font-size: var(--ui-fs) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  box-shadow: var(--ui-shadow) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
  transition: background-color .15s ease, box-shadow .15s ease, transform .15s ease !important;
}
:root body:not(#jai439) :is(.visual-download-button:not(.economy-fullscreen-button), .jai-compare-go, .share-view-button) :is(b, span, strong) {
  font-size: var(--ui-fs) !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: inherit !important;
}
:root body:not(#jai439) :is(.visual-download-button:not(.economy-fullscreen-button), .jai-compare-go, .share-view-button) > i {
  width: 22px !important;
  height: 22px !important;
  min-width: 22px !important;
  border-radius: 6px !important;
  font-size: 13px !important;
  place-items: center !important;
  background: rgba(255, 255, 255, .16) !important;
  color: #fff !important;
}
:root body:not(#jai439) :is(.visual-download-button:not(.economy-fullscreen-button), .jai-compare-go, .share-view-button):hover {
  background: var(--ui-primary-hover) !important;
  border-color: var(--ui-primary-hover) !important;
  box-shadow: var(--ui-shadow-active) !important;
}
:root body:not(#jai439) :is(.visual-download-button, .jai-compare-go, .share-view-button):active { transform: translateY(1px) !important; }

/* ------------------------------------------------------------------ */
/* 2. SECONDARY — қосымша әрекет: Толық экран, Сүзгі, Салыстыру ашу     */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) :is(.chart-expand, .economy-fullscreen-button, .comparison-open, .jai-filter-toggle, .jai311-focus-btn) {
  min-height: var(--ui-h) !important;
  height: auto !important;
  padding: 0 14px !important;
  border-radius: var(--ui-radius) !important;
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-ink) !important;
  font-size: var(--ui-fs) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  box-shadow: var(--ui-shadow) !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 8px !important;
}
:root body:not(#jai439) :is(.chart-expand, .economy-fullscreen-button, .comparison-open, .jai-filter-toggle, .jai311-focus-btn) :is(b, span, strong) {
  font-size: var(--ui-fs) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  color: inherit !important;
}
:root body:not(#jai439) .economy-fullscreen-button > i {
  background: var(--ui-surface-soft) !important;
  color: var(--ui-primary) !important;
  border-radius: 6px !important;
}
:root body:not(#jai439) :is(.chart-expand, .economy-fullscreen-button, .comparison-open, .jai-filter-toggle, .jai311-focus-btn):hover {
  border-color: var(--ui-primary) !important;
  color: var(--ui-primary) !important;
}
:root body:not(#jai439) .jai-compare-clear {
  min-height: var(--ui-h) !important;
  padding: 0 12px !important;
  border-radius: var(--ui-radius) !important;
  font-size: var(--ui-fs) !important;
  font-weight: 600 !important;
  color: var(--ui-muted) !important;
}

/* ------------------------------------------------------------------ */
/* 3. SEGMENTED — ауыстырғыштар: кезең, жыл, режим, банк көрсеткіші     */
/*    Пішіні бәріне бірдей, белсенді түсі рубриканың өз түсінде қалады   */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) :is(.period-button, .economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button, .bank-year, .bank-metric, .bank-compare-tabs button) {
  --seg-accent: var(--ui-primary);
  min-height: var(--ui-h-seg) !important;
  height: auto !important;
  padding: 0 14px !important;
  border-radius: 9px !important;
  border: 1px solid var(--ui-border) !important;
  background: var(--ui-surface) !important;
  color: var(--ui-ink) !important;
  font-size: var(--ui-fs-seg) !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  line-height: 1.2 !important;
  box-shadow: none !important;
}
:root body:not(#jai439) .period-button { --seg-accent: #223d57; }
:root body:not(#jai439) :is(.economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button) { --seg-accent: #990033; }
:root body:not(#jai439) :is(.bank-year, .bank-metric, .bank-compare-tabs button) { --seg-accent: #001e7e; }

:root body:not(#jai439) :is(.period-button, .economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button, .bank-year, .bank-metric, .bank-compare-tabs button):hover {
  border-color: var(--seg-accent) !important;
  color: var(--seg-accent) !important;
}
:root body:not(#jai439) :is(.period-button, .economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button, .bank-year, .bank-metric, .bank-compare-tabs button):is(.active, .is-active, [aria-pressed="true"], [aria-selected="true"]) {
  background: var(--seg-accent) !important;
  border-color: var(--seg-accent) !important;
  color: #fff !important;
  box-shadow: var(--ui-shadow-active) !important;
}
:root body:not(#jai439) :is(.period-button, .economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button, .bank-year, .bank-metric, .bank-compare-tabs button) :is(span, b, small) {
  font-size: inherit !important;
  color: inherit !important;
}

/* Ай таңдағыштары (2 жолды батырма: ай атауы + нөмірі) */
:root body:not(#jai439) :is(.inflation-period-months button, .bank-month) {
  border-radius: 9px !important;
  border-color: var(--ui-border) !important;
}
:root body:not(#jai439) :is(.inflation-period-months button, .bank-month) > span { font-size: 12.5px !important; font-weight: 700 !important; }
:root body:not(#jai439) .bank-month { font-size: 12.5px !important; font-weight: 700 !important; }
:root body:not(#jai439) :is(.inflation-period-months button, .bank-month) > small { font-size: 10.5px !important; }

/* ------------------------------------------------------------------ */
/* 4. Навигация карточкалары (ішкі рубрикалар) — мәтін өлшемдері        */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) :is(.market-subtab, .economy-subtab, .bank-subtab, .infographic-subtab) { border-radius: 12px !important; }
:root body:not(#jai439) :is(.market-subtab, .economy-subtab, .bank-subtab, .infographic-subtab) :is(b, strong) {
  font-size: 14px !important;
  line-height: 1.25 !important;
}
:root body:not(#jai439) :is(.market-subtab, .economy-subtab, .bank-subtab, .infographic-subtab) small {
  font-size: 12px !important;
  line-height: 1.35 !important;
}

/* Негізгі рубрика батырмалары: бір жол, бас әріпсіз, бірдей салмақ */
:root body:not(#jai439) .rubric-button > span {
  font-size: 14px !important;
  font-weight: 700 !important;
  letter-spacing: 0 !important;
  text-transform: none !important;
  white-space: nowrap !important;
  line-height: 1.2 !important;
}
:root body:not(#jai439) .rubric-button.rubric-secondary > span { opacity: 1 !important; }

/* ------------------------------------------------------------------ */
/* 5. ICON батырмалары                                                 */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) .icon-button.search-toggle {
  font-size: 0 !important;
  color: var(--ui-ink) !important;
  display: inline-grid;
  place-items: center !important;
}
:root body:not(#jai439) .icon-button.search-toggle::before {
  content: "";
  width: 18px;
  height: 18px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m15.5 15.5 5 5'/%3E%3C/svg%3E") center / contain no-repeat;
}
:root body:not(#jai439) :is(.home-slider-arrow, .article-share-button) { border-radius: var(--ui-radius) !important; }
:root body:not(#jai439) .home-slider-arrow { min-width: 38px !important; min-height: 38px !important; }

/* ------------------------------------------------------------------ */
/* 6. ОҚЫЛЫМДЫЛЫҚ — ең кіші шрифттер                                    */
/*    Ереже: қарапайым мәтін ≥ 12px, бас әріпті кішкентай белгі ≥ 11px   */
/* ------------------------------------------------------------------ */

/* Тиккер (KASE акциялары) */
:root body:not(#jai439) .stock-top strong { font-size: 12px !important; }
:root body:not(#jai439) .stock-top small { font-size: 10.5px !important; }
:root body:not(#jai439) .stock-price > strong { font-size: 12px !important; }
:root body:not(#jai439) .stock-price > span { font-size: 11px !important; font-weight: 700 !important; }

/* Header бағам виджеті */
:root body:not(#jai439) .header-indicator-name { font-size: 11px !important; }
:root body:not(#jai439) .header-indicator-value > small { font-size: 11px !important; }

/* Басты бет */
:root body:not(#jai439) :is(.home-story-category, .home-story-label, .home-slider-category, .home-mobile-news-copy > small) { font-size: 11px !important; }
:root body:not(#jai439) :is(.home-story-meta, .home-slider-meta) { font-size: 12px !important; }
:root body:not(#jai439) .home-slider-counter > span { font-size: 12px !important; }
:root body:not(#jai439) .home-economy-panel-head > p { font-size: 12.5px !important; }
:root body:not(#jai439) .home-economy-panel-head > span { font-size: 11.5px !important; }
:root body:not(#jai439) .home-economy-panel-list :is(b, strong) { font-size: 13.5px !important; }
:root body:not(#jai439) .home-economy-panel-list small { font-size: 11.5px !important; line-height: 1.35 !important; }
:root body:not(#jai439) .home-section-heading span { font-size: 11px !important; }
:root body:not(#jai439) .home-section-heading small { font-size: 12.5px !important; }
/* «Соңғы материалдар» тақырыбы қою фонда оқылмайтын */
:root body:not(#jai439) .home-latest-heading h2 { color: #f1f6f8 !important; }
:root body:not(#jai439) .home-latest-heading span { color: rgba(241, 246, 248, .72) !important; }
:root body:not(#jai439) .home-latest-heading small { color: rgba(241, 246, 248, .8) !important; }

/* Карточкалар */
:root body:not(#jai439) :is(.card-category, .visual-label, .jai-format-badge) { font-size: 11px !important; }
:root body:not(#jai439) .card-meta { font-size: 12px !important; }
:root body:not(#jai439) .card-views, :root body:not(#jai439) .card-views > i { font-size: 11px !important; }

/* Analytics spotlight */
:root body:not(#jai439) .rubric-spotlight-tags > span { font-size: 11px !important; }
:root body:not(#jai439) .rubric-spotlight-copy > span { font-size: 11px !important; }
:root body:not(#jai439) .rubric-spotlight-copy > p { font-size: 13px !important; }
:root body:not(#jai439) .rubric-spotlight-viz > b { font-size: 11px !important; }

/* Қор нарығы */
:root body:not(#jai439) .market-date-badge > small { font-size: 10.5px !important; }
:root body:not(#jai439) .market-date-badge > b { font-size: 12.5px !important; }
:root body:not(#jai439) .kase-stocks-meta-title > b { font-size: 11px !important; }
:root body:not(#jai439) .ranked-stock-name > small { font-size: 11.5px !important; }
:root body:not(#jai439) .ranked-stock-value > small { font-size: 11px !important; }
:root body:not(#jai439) :is(.market-source, .market-rubric-kicker) { font-size: 11.5px !important; }
:root body:not(#jai439) .market-block-heading :is(span, small) { font-size: 11.5px !important; }

/* Экономика / инфляция */
:root body:not(#jai439) .inflation-component-copy > b { font-size: 13px !important; }
:root body:not(#jai439) .inflation-component-copy > small { font-size: 11px !important; line-height: 1.3 !important; }
:root body:not(#jai439) .inflation-component-copy > :is(b, small) {
  white-space: normal !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
}
:root body:not(#jai439) .inflation-period-current > span { font-size: 10.5px !important; }
:root body:not(#jai439) .inflation-period-loading { font-size: 11px !important; }
:root body:not(#jai439) .inflation-picker-caption > small { font-size: 11.5px !important; }
:root body:not(#jai439) .inflation-picker-caption > span { font-size: 11px !important; }
:root body:not(#jai439) .economy-chart-legend > span { font-size: 12px !important; }
:root body:not(#jai439) :is(.economy-source, .economy-source a, .bank-source, .bank-source a) { font-size: 11.5px !important; }
:root body:not(#jai439) :is(.economy-updated, .economy-updated b, .jai-data-freshness, .jai-data-freshness *) { font-size: 11.5px !important; }
:root body:not(#jai439) .inflation-data-note { font-size: 12.5px !important; }
:root body:not(#jai439) .economy-chart-card span:not([class]) { font-size: 11.5px !important; }
:root body:not(#jai439) .economy-table th { font-size: 12px !important; }
:root body:not(#jai439) .economy-value-pill { font-size: 12.5px !important; }
:root body:not(#jai439) th.jai-mobile-col-show { font-size: 12.5px !important; }

/* Банк секторы */
:root body:not(#jai439) .bank-scale-name > strong { font-size: 13px !important; }
:root body:not(#jai439) .bank-scale-name > small { font-size: 11px !important; }
:root body:not(#jai439) .bank-scale-values > strong { font-size: 12.5px !important; }
:root body:not(#jai439) .bank-scale-rank { font-size: 11.5px !important; }
:root body:not(#jai439) .bank-rank-name > strong { font-size: 14px !important; }
:root body:not(#jai439) .bank-rank-name > small { font-size: 11.5px !important; }
:root body:not(#jai439) .bank-rank-amount { font-size: 13px !important; }
:root body:not(#jai439) .bank-rank-number { font-size: 12px !important; }
:root body:not(#jai439) .bank-ranking-columns > span { font-size: 11px !important; }
:root body:not(#jai439) :is(.bank-export-status, .bank-compare-toolbar > span, .bank-block-head span) { font-size: 11px !important; }

/* Мобиль: дерек тартпасы, sheet, төменгі навигация */
:root body:not(#jai439) .jai-data-drawer small { font-size: 10.5px !important; }
:root body:not(#jai439) .jai-data-drawer-group-title { font-size: 11px !important; }
:root body:not(#jai439) .jai-data-drawer-copy > b { font-size: 13.5px !important; }
:root body:not(#jai439) .jai-data-drawer-copy > small { font-size: 11.5px !important; line-height: 1.3 !important; }
:root body:not(#jai439) :is(.jai-data-drawer-data > small, .jai-data-drawer > small, .jai-mobile-sheet-head > small) { font-size: 10.5px !important; }
:root body:not(#jai439) .jai-mobile-sheet-toggle b { font-size: 13.5px !important; }
:root body:not(#jai439) .jai-mobile-sheet-toggle small { font-size: 11px !important; }
:root body:not(#jai439) :is(.jai-mobile-sheet-head, .jai-data-drawer) > small, :root body:not(#jai439) .jai-mobile-sheet-head small { font-size: 10.5px !important; }
:root body:not(#jai439) .jai-data-cross-item > :is(span, i) { font-size: 11px !important; }
:root body:not(#jai439) :is(.mobile-bottom-nav, .jai309-article-dock) :is(button, a) > span { font-size: 10.5px !important; line-height: 1.15 !important; }

/* Мақала беті */
:root body:not(#jai439) .article-rubric-link > span { font-size: 12px !important; }
:root body:not(#jai439) :is(.article-share-title, .related-kicker, .eyebrow) { font-size: 11.5px !important; }
:root body:not(#jai439) .article-telegram-copy > span { font-size: 11.5px !important; }
:root body:not(#jai439) .single-meta > span { font-size: 13px !important; }

/* Footer */
:root body:not(#jai439) .copyright > span { font-size: 12px !important; }

/* ------------------------------------------------------------------ */
/* 7. ФОТО — тұрақты үлкейту суретті бұлдыратады; hover-эффект қалады   */
/* ------------------------------------------------------------------ */
:root body:not(#jai439) .home-slider-media img,
:root body:not(#jai439) .home-slider-slide.is-active .home-slider-media img {
  transform: none !important;
}
:root body:not(#jai439) :is(.home-slider-media, .home-story-visual, .card-visual, .single-hero) img {
  image-rendering: auto;
  backface-visibility: hidden;
}

/* ------------------------------------------------------------------ */
/* 8. Орналасу түзетулері (үлкейген шрифт сыйсын)                      */
/* ------------------------------------------------------------------ */

/* Рубрика навигациясы: 8 бағанды тор → мазмұнға қарай ені бар жол */
@media (min-width: 761px) {
  :root body:not(#jai439) .rubric-tabs {
    display: flex !important;
    justify-content: space-between !important;
    gap: 6px !important;
  }
  :root body:not(#jai439) .rubric-tabs > .rubric-button {
    flex: 1 1 auto !important;
    width: auto !important;
    min-width: 0 !important;
    justify-content: center !important;
  }
}
@media (min-width: 761px) and (max-width: 1279px) {
  :root body:not(#jai439) .rubric-button > span { font-size: 12.5px !important; white-space: normal !important; }
}

/* Тиккер карточкалары: 142px → 170px (бағасы мен атауы толық сыйсын) */
:root body:not(#jai439) .top-stocks-panel .stock-item {
  flex: 0 0 170px !important;
  width: 170px !important;
  min-width: 170px !important;
}

/* Мобиль header-дегі бағам виджеті: 124px → 172px, сан кесілмесін */
@media (max-width: 760px) {
  :root body:not(#jai439) .site-header .header-market-rotator {
    width: 172px !important;
    min-width: 172px !important;
    flex: 0 0 172px !important;
  }
  :root body:not(#jai439) .site-header .header-indicator-value strong { max-width: none !important; overflow: visible !important; }

  /* Ауыстырғыштар мобильде ықшамдау */
  :root body:not(#jai439) :is(.period-button, .economy-mode-tabs button, .inflation-period-years button, .inflation-universe-tabs button, .bank-year, .bank-metric, .bank-compare-tabs button) {
    padding: 0 10px !important;
    min-width: 0 !important;
  }
}

/* 5.10.44 · ПК header-дегі бағам виджеті: «64 37…» болып кесілмесін */
:root body:not(#jai439) .site-header .header-indicator-value strong { max-width: none !important; overflow: visible !important; }
@media (min-width: 761px) {
  :root body:not(#jai439) .site-header .header-market-rotator { min-width: 176px !important; }
}
