/* ============================================================
   Sayt boʻylab qoʻshimchalar.
   Bu fayl barcha sahifalarga ulangan.
   ============================================================ */

/* ---------- Test rejimi chizigʻi ----------
   Sahifaning eng tepasida turadi. Header "fixed" boʻlgani uchun
   uni ham, ichki sahifalardagi breadcrumbs oʻlchamini ham
   chiziq balandligicha pastga suramiz. */

:root {
  --testbar-h: 36px;
}

.testbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1100;
  height: var(--testbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  background: #fff;
  color: #0f172a;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.2;
  text-align: center;
  letter-spacing: 0.01em;
}

.testbar::before {
  content: "";
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #b45309;
}

/* header chiziq ostiga tushadi */
.header {
  top: var(--testbar-h);
}

/* ichki sahifalarda kontent header + chiziq balandligicha pastga suriladi */
.breadcrumbs {
  margin-top: calc(var(--height-header) + var(--testbar-h));
}

@media (max-width: 768px) {
  :root {
    --testbar-h: 32px;
  }

  .testbar {
    font-size: 12.5px;
    padding: 0 10px;
  }
}

@media (max-width: 420px) {
  :root {
    --testbar-h: 44px;
  }

  .testbar {
    font-size: 12px;
    line-height: 1.25;
  }
}

/* ---------- Koʻzi ojizlar uchun versiya (BVI) ----------
   Tugma header-dagi ijtimoiy tarmoq belgilariga oʻxshab turadi.
   Bosilganda bvi.js panelni ochadi. */

.header-bvi,
.header-search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  margin-right: 8px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background-color: rgba(255, 255, 255, 0.1019607843);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  flex: 0 0 auto;
}

.header-bvi:hover,
.header-bvi:focus-visible,
.header-search:hover,
.header-search:focus-visible {
  background-color: rgba(255, 255, 255, 0.24);
  color: #fff;
}

.header-bvi i,
.header-search i {
  font-size: 17px;
  line-height: 1;
}

/* offcanvas menyuda fon och boʻlgani uchun rangni almashtiramiz */
.offcanvas .header-bvi,
.offcanvas .header-search {
  background-color: rgba(13, 36, 96, 0.1);
  color: #0d2460;
}

.offcanvas .header-bvi:hover,
.offcanvas .header-bvi:focus-visible,
.offcanvas .header-search:hover,
.offcanvas .header-search:focus-visible {
  background-color: rgba(13, 36, 96, 0.18);
  color: #0d2460;
}

/* ============================================================
   TUNGI REJIM

   Diqqat: mavzudagi --white oʻzgaruvchisi 61 joyda MATN rangi va
   atigi 16 joyda fon sifatida ishlatilgan. Shuning uchun uni
   agʻdarib boʻlmaydi — footer va hero yozuvlari qorayib ketardi.
   Buning oʻrniga faqat matn/fon uchun ishlatiladigan
   oʻzgaruvchilar almashtiriladi, oq yuzalar esa nuqtali tuzatiladi.
   ============================================================ */

:root[data-theme="dark"] {
  /* natijalar.css semantik oʻzgaruvchilari — toza almashadi */
  --ink: #e6ebf5;
  --ink-2: #a8b2c6;
  --ink-3: #7c8699;
  --line: #2a3446;
  --surface: #151d2c;
  --surface-2: #1b2436;
  --navy: #8fb0e4;

  /* matn uchun ishlatiladigan neytral ranglar */
  --neutral800: #e6ebf5;
  --neutral700: #d7dee9;
  --neutral600: #c2cadb;
  --neutral500: #a8b2c6;
  --neutral400: #8b96ad;
  --neutral300: #6b7896;
  --neutral200: #3a4560;
  --neutral100: #2a3446;
  --neutral50: #1b2436;
  --neutral1000: #101725;

  /* urgʻu ranglari och fonda emas, toʻq fonda ishlashi kerak */
  --card700: #8fb0e4;
  --card300: #5aa9ea;
}

[data-theme="dark"] body {
  background-color: #0d131f;
  color: #e6ebf5;
}

/* --- sahifa yuzalari --- */
[data-theme="dark"] .layout,
[data-theme="dark"] .nat,
[data-theme="dark"] section {
  background-color: transparent;
}

/* navigatsiya paneli (oddiy holatda oq edi) */
[data-theme="dark"] .header-text {
  background-color: #131b29;
}

[data-theme="dark"] .header-text-link,
[data-theme="dark"] .header-text-dropdown-link,
[data-theme="dark"] .menu-link,
[data-theme="dark"] .submenu-link {
  color: #e6ebf5;
}

[data-theme="dark"] .header-text-dropdown,
[data-theme="dark"] .header__menu__submenu,
[data-theme="dark"] .header-top-lang-menu {
  background: #1b2436;
  color: #e6ebf5;
}

[data-theme="dark"] .header-text-dropdown-link:hover,
[data-theme="dark"] .header-top-lang-menu li[role="option"]:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

[data-theme="dark"] .offcanvas {
  background-color: #131b29;
  color: #e6ebf5;
}

[data-theme="dark"] .offcanvas .header-bvi,
[data-theme="dark"] .offcanvas .header-search,
[data-theme="dark"] .offcanvas .header-theme {
  background-color: rgba(255, 255, 255, 0.1);
  color: #e6ebf5;
}

/* --- oq kartochkalar --- */
[data-theme="dark"] .news-page-main-cards-card,
[data-theme="dark"] .leadership-page .is-oq,
[data-theme="dark"] .leadership-page-cards:nth-child(2),
[data-theme="dark"] .application-wrapper-card-cards,
[data-theme="dark"] .application-step-item,
[data-theme="dark"] .education-card,
[data-theme="dark"] .staff-main-wrapper-card,
[data-theme="dark"] .contacts-main,
[data-theme="dark"] .contacts-form {
  background-color: #151d2c;
  color: #e6ebf5;
}

[data-theme="dark"] .leadership-page .is-oq .leadership-page-cards-card h3,
[data-theme="dark"] .leadership-page .is-oq .leadership-page-cards-card b,
[data-theme="dark"] .leadership-page .is-oq .leadership-contacts a {
  color: #e6ebf5;
}

[data-theme="dark"] .news-page-main-cards-card p {
  color: #e6ebf5;
}

/* --- formalar --- */
[data-theme="dark"] .contacts-form-wrapper label input,
[data-theme="dark"] .contacts-form-wrapper label textarea,
[data-theme="dark"] .qn__field,
[data-theme="dark"] .filters input,
[data-theme="dark"] .filters select {
  background-color: #101725;
  border-color: #2a3446;
  color: #e6ebf5;
}

[data-theme="dark"] .contacts-form h3,
[data-theme="dark"] .contacts-form-wrapper label span {
  color: #e6ebf5;
}

/* --- test chizigʻi --- */
[data-theme="dark"] .testbar {
  background: #1b2436;
  color: #e6ebf5;
}

/* --- qidiruv oynasi --- */
[data-theme="dark"] .ss__box {
  background: #151d2c;
}

[data-theme="dark"] .ss__bar {
  border-bottom-color: #2a3446;
}

[data-theme="dark"] .ss__input,
[data-theme="dark"] .ss__title {
  color: #e6ebf5;
}

[data-theme="dark"] .ss__list a:hover,
[data-theme="dark"] .ss__list a:focus-visible {
  background: #1b2436;
}

[data-theme="dark"] .ss__kind {
  background: #22304d;
  color: #a9c6f0;
}

[data-theme="dark"] .ss mark,
[data-theme="dark"] .qn mark {
  background: #7a5d16;
  color: #fff;
}

/* --- jadval va postlar --- */
[data-theme="dark"] .qn__scroll,
[data-theme="dark"] .post {
  background: #151d2c;
  border-color: #2a3446;
}

[data-theme="dark"] .post:hover {
  border-color: #3d5680;
}

[data-theme="dark"] .pmodal__box,
[data-theme="dark"] .pmodal__nav button,
[data-theme="dark"] .loadmore,
[data-theme="dark"] .qn__pager button,
[data-theme="dark"] .qn__pdf {
  background: #151d2c;
  border-color: #2a3446;
  color: #e6ebf5;
}

/* --- xarita yorqin oq boʻlib turmasin --- */
[data-theme="dark"] .contacts-map iframe {
  filter: brightness(0.85) contrast(1.05);
}

/* ---------- Footer: rasmiy havolalar ----------
   373-son qaror, 3-ilova, 3-band: "boshqa tegishli veb-saytlarga va
   Oʻzbekiston Respublikasining Hukumat portaliga havolalar". */

.footer-official {
  padding: 20px 0 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.footer-official__title {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.footer-official__list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
}

.footer-official__list a {
  display: inline-block;
  padding: 7px 13px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background-color: rgba(255, 255, 255, 0.06);
  color: #fff;
  font-size: 13.5px;
  line-height: 1.35;
  text-decoration: none;
  transition: background-color .18s ease, border-color .18s ease;
}

.footer-official__list a:hover,
.footer-official__list a:focus-visible {
  background-color: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.4);
  color: #fff;
}

@media (max-width: 560px) {
  .footer-official__list a {
    font-size: 12.5px;
    padding: 6px 11px;
  }
}

/* BVI: fonlar olib tashlanadi, shuning uchun ramka currentColor bilan */
body .bvi-body[data-bvi-theme] .footer-official__list a {
  border: 1px solid currentColor !important;
}

/* ---------- Sayt boʻyicha qidiruv ---------- */

.ss {
  position: fixed;
  inset: 0;
  z-index: 1300;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 8vh 16px 24px;
  background: rgba(8, 17, 34, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

.ss[hidden] {
  display: none;
}

body.ss-open {
  overflow: hidden;
}

.ss__box {
  width: min(680px, 100%);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(8, 17, 34, 0.32);
  overflow: hidden;
}

.ss__bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid #e2e8f0;
}

.ss__bar > i {
  color: #64748b;
  font-size: 19px;
  flex: 0 0 auto;
}

.ss__input {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 17px;
  color: #0f172a;
  padding: 4px 0;
}

.ss__close {
  flex: 0 0 auto;
  border: 0;
  background: transparent;
  color: #64748b;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
}

.ss__close:hover {
  color: #0f172a;
}

.ss__status {
  margin: 0;
  padding: 10px 16px;
  color: #475569;
  font-size: 13.5px;
}

.ss__status:empty {
  display: none;
}

.ss__list {
  margin: 0;
  padding: 0 8px 10px;
  list-style: none;
  overflow-y: auto;
}

.ss__list a {
  display: block;
  padding: 11px 12px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.ss__list a:hover,
.ss__list a:focus-visible {
  background: #f1f5f9;
}

.ss__kind {
  display: inline-block;
  margin-bottom: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e8eefa;
  color: #1c3f77;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.ss__title {
  display: block;
  color: #0f172a;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
}

.ss__snip {
  display: block;
  margin-top: 3px;
  color: #475569;
  font-size: 13.5px;
  line-height: 1.5;
}

.ss mark {
  background: #fde68a;
  color: inherit;
  padding: 0 2px;
  border-radius: 3px;
}

@media (max-width: 560px) {
  .ss {
    padding: 0;
  }

  .ss__box {
    max-height: 100vh;
    height: 100%;
    border-radius: 0;
  }
}

/* Nutq sintezi oʻchirilgan — blok koʻrsatilmasin */
.bvi-block-speech {
  display: none !important;
}

/* Rang sxemalari: oq, qora, sargʻish va toʻq jigarrang qoldirildi.
   Moviy variant olib tashlandi. */
html body .bvi-panel a.bvi-link.bvi-theme-blue {
  display: none !important;
}

/* ============================================================
   BVI — OQ SXEMA uchun alohida sozlash

   BVI oq mavzuda "*" selektoriga background:#fff !important qoʻyadi,
   shuning uchun butun sahifa bitta oq varaqqa aylanadi: qayer boʻlim
   tugab, qayeri boshlangani bilinmaydi.

   Yechim: oqning bir necha pogʻonasi (#fff / #f2f2f2 / #e6e6e6) va
   qora chiziqlar. Barcha fonlar qora matn bilan 15:1 dan yuqori
   kontrast beradi, ya'ni koʻrish qobiliyati past foydalanuvchi uchun
   xavfsiz.

   Aniqlik: BVI qoidasi (0,3,1) — bizniki ham (0,3,1), lekin site.css
   bvi.css dan KEYIN yuklanadi, shuning uchun tenglikda bizniki gʻolib.
   ============================================================ */

/* --- sahifa asosiy foni --- */
body .bvi-body[data-bvi-theme="white"] {
  background-color: #ffffff !important;
}

/* --- yuqori panel va menyu --- */
body .bvi-body[data-bvi-theme="white"] .header-top {
  background-color: #e6e6e6 !important;
  border-bottom: 1px solid #000000 !important;
}

body .bvi-body[data-bvi-theme="white"] .header-text {
  background-color: #f2f2f2 !important;
  border-bottom: 2px solid #000000 !important;
}

/* --- sahifa sarlavhasi (breadcrumbs) --- */
body .bvi-body[data-bvi-theme="white"] .breadcrumbs {
  background-color: #e6e6e6 !important;
  border-bottom: 2px solid #000000 !important;
  padding-bottom: 14px !important;
}

/* --- footer --- */
body .bvi-body[data-bvi-theme="white"] .footer {
  background-color: #e6e6e6 !important;
  border-top: 2px solid #000000 !important;
}

/* --- kartochkalar: oq yuza + qalin qora ramka --- */
body .bvi-body[data-bvi-theme="white"] .leadership-page-cards,
body .bvi-body[data-bvi-theme="white"] .post,
body .bvi-body[data-bvi-theme="white"] .news-page-main-cards-card,
body .bvi-body[data-bvi-theme="white"] .contacts-main-card,
body .bvi-body[data-bvi-theme="white"] .application-step-item,
body .bvi-body[data-bvi-theme="white"] .application-wrapper-card-cards,
body .bvi-body[data-bvi-theme="white"] .staff-main-wrapper-card,
body .bvi-body[data-bvi-theme="white"] .gallery-page-main-left-card,
body .bvi-body[data-bvi-theme="white"] .gallery-page-main-right,
body .bvi-body[data-bvi-theme="white"] .hero__stats-item,
body .bvi-body[data-bvi-theme="white"] .qn__card {
  background-color: #ffffff !important;
  border: 2px solid #000000 !important;
  border-radius: 6px !important;
}

/* --- oʻrab turuvchi bloklar: bir pogʻona kulrang --- */
body .bvi-body[data-bvi-theme="white"] .contacts-main,
body .bvi-body[data-bvi-theme="white"] .contacts-form,
body .bvi-body[data-bvi-theme="white"] .qn__scroll,
body .bvi-body[data-bvi-theme="white"] .nat__stats > div,
body .bvi-body[data-bvi-theme="white"] .filters {
  background-color: #f2f2f2 !important;
  border: 2px solid #000000 !important;
  border-radius: 6px !important;
}

/* --- jadval: sarlavha qatori ajralib tursin --- */
body .bvi-body[data-bvi-theme="white"] .nat th {
  background-color: #e6e6e6 !important;
  border: 1px solid #000000 !important;
}

body .bvi-body[data-bvi-theme="white"] .nat td {
  background-color: #ffffff !important;
  border: 1px solid #000000 !important;
}

body .bvi-body[data-bvi-theme="white"] .nat tbody tr:nth-child(even) td {
  background-color: #f7f7f7 !important;
}

/* --- forma maydonlari --- */
body .bvi-body[data-bvi-theme="white"] input,
body .bvi-body[data-bvi-theme="white"] textarea,
body .bvi-body[data-bvi-theme="white"] select {
  background-color: #ffffff !important;
  border: 2px solid #000000 !important;
  border-radius: 4px !important;
}

/* --- bloklar orasida nafas --- */
body .bvi-body[data-bvi-theme="white"] .leadership-page-cards-card,
body .bvi-body[data-bvi-theme="white"] .post__body,
body .bvi-body[data-bvi-theme="white"] .news-page-main-cards-card {
  padding: 14px 16px !important;
}

body .bvi-body[data-bvi-theme="white"] .layout {
  padding-top: 8px !important;
}

/* Qolgan sxemalar (qora, sargʻish, jigarrang) uchun umumiy chegara.
   currentColor har bir sxemaning matn rangini oladi. */
body.bvi-active .leadership-page-cards,
body.bvi-active .post,
body.bvi-active .news-page-main-cards-card,
body.bvi-active .contacts-main,
body.bvi-active .contacts-form,
body.bvi-active .contacts-main-card,
body.bvi-active .application-step-item,
body.bvi-active .application-wrapper-card-cards,
body.bvi-active .staff-main-wrapper-card,
body.bvi-active .gallery-page-main-left-card,
body.bvi-active .gallery-page-main-right,
body.bvi-active .qn__scroll,
body.bvi-active .qn__card,
body.bvi-active .hero__stats-item,
body.bvi-active .nat__stats > div {
  border: 1px solid currentColor !important;
  border-radius: 6px !important;
}

/* jadval kataklari ham ajralib tursin */
body.bvi-active .nat th,
body.bvi-active .nat td {
  border: 1px solid currentColor !important;
}

/* kartochka ichidagi matn siqilib qolmasin */
body.bvi-active .leadership-page-cards-card,
body.bvi-active .post__body,
body.bvi-active .news-page-main-cards-card {
  padding: 12px 14px !important;
}

/* ---------- Hero video BVI rejimida ----------
   BVI har bir elementga background:#fff !important qoʻyadi va hero
   qatlamlari videoni butunlay bosib qoladi.

   MUHIM: BVI qoidasining aniqligi (0,3,1) —
   "body .bvi-body[data-bvi-theme=...] *:not(.bvi-no-styles)".
   Oddiy "body.bvi-active .hero__bg" (0,2,1) undan past, shuning uchun
   !important boʻlsa ham ishlamaydi. Shu sababli quyida aynan shunday
   aniqlikdagi selektor ishlatilgan: site.css bvi.css dan keyin
   yuklangani uchun tenglikda gʻolib chiqadi. */

body .bvi-body[data-bvi-theme] .hero,
body .bvi-body[data-bvi-theme] .hero__bg,
body .bvi-body[data-bvi-theme] .hero__container,
body .bvi-body[data-bvi-theme] .hero__placeholder,
body .bvi-body[data-bvi-theme] .hero__actions {
  background-color: transparent !important;
}

body .bvi-body[data-bvi-theme] .hero__bg-video {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

/* Matn video ustida oʻqilishi uchun oʻz fonida qolsin.
   Fon rangini BVI beradi (har sxemada oʻzinikini), biz faqat
   ichki boʻshliq va ramka qoʻshamiz. */
body .bvi-body[data-bvi-theme] .hero__content {
  padding: 22px 26px !important;
  border: 2px solid currentColor !important;
  border-radius: 8px !important;
}

/* ---------- BVI panelini oʻng ustunga koʻchirish ----------
   Kutubxonaning oʻz koʻrinishi — sahifa tepasidagi keng gorizontal
   panel. U header va menyuni bosib qoladi, logotip qirqiladi.
   Shuning uchun panelni oʻngdagi tik ustunga aylantiramiz va
   sahifa kontentini shu kenglikka surib qoʻyamiz. */

:root {
  --bvi-col: 300px;
}

html body .bvi-panel.bvi-fixed-top,
html body .bvi-panel {
  position: fixed !important;
  top: 0;
  right: 0;
  bottom: 0;
  left: auto !important;
  width: var(--bvi-col);
  margin: 0 !important;
  padding: 18px 16px 24px !important;
  overflow-y: auto;
  overscroll-behavior: contain;
  background-color: #f2f4f7 !important;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.18) !important;
}

/* bloklar ustma-ust joylashsin */
html body .bvi-panel .bvi-blocks {
  flex-direction: column;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 4px;
}

html body .bvi-panel .bvi-block {
  padding: 12px 0 !important;
  border-bottom: 1px solid #d6dae1;
}

html body .bvi-panel .bvi-block:last-child {
  border-bottom: 0;
}

html body .bvi-panel .bvi-block .bvi-block-title {
  text-align: left;
  margin-bottom: 0.55rem !important;
}

/* tugmalar ustunga sigʻsin */
html body .bvi-panel a.bvi-link {
  margin: 0 6px 6px 0;
  min-width: 44px;
}

/* Sahifa kontenti panel ostida qolmasin.
   "> .bvi-body" shart: kutubxona _init() har chaqirilganda sahifani
   qayta oʻraydi, natijada ichma-ich ikkita .bvi-body paydo boʻladi.
   Oddiy selektor ikkalasiga ham chetlama qoʻyib, kontentni 600px
   toraytirib yuborardi. */
body.bvi-active > .bvi-body {
  padding-right: var(--bvi-col);
}

/* header "fixed" boʻlgani uchun uni ham qisqartiramiz.
   left: 0 shart — busiz brauzer left ni statik joylashuvdan oladi
   va header oʻng tomonga surilib, siqilib qoladi. */
body.bvi-active .header {
  left: 0 !important;
  right: var(--bvi-col) !important;
  width: auto !important;
}

@media (max-width: 900px) {
  :root {
    --bvi-col: 260px;
  }
}

@media (max-width: 640px) {
  :root {
    --bvi-col: 78vw;
  }

  html body .bvi-panel.bvi-fixed-top,
  html body .bvi-panel {
    max-width: 320px;
  }

  body.bvi-active .bvi-body {
    padding-right: 0;
  }

  body.bvi-active .header {
    right: 0;
  }
}

/* Panel ochiq turganda tugma kerak emas: qayta bosilsa ikkinchi panel
   qoʻshilib ketadi. Chiqish uchun panelning "Oddiy versiya" tugmasi bor. */
body.bvi-active .header-bvi {
  display: none;
}

/* BVI paneli test chizigʻini bosib qolmasin */
body.bvi-active .testbar {
  display: none;
}

body.bvi-active .header {
  top: 0;
}

body.bvi-active .breadcrumbs {
  margin-top: var(--height-header);
}

/* ---------- "Yuqoriga" tugmasi ----------
   Tugmani totop.js yasaydi. Sahifa pastga surilganda
   .is-visible sinfi qoʻshiladi. */

.totop {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1030; /* offcanvas (1045) va modallardan past */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  background: linear-gradient(180deg, #0d2460 0, #2a407a 100%);
  color: #fff;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(13, 36, 96, 0.28);

  /* koʻrinmagan holat */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
}

.totop.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto;
}

.totop:hover {
  background: linear-gradient(180deg, #143078, #35509a 100%);
}

.totop:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.totop i {
  font-size: 20px;
  line-height: 1;
}

/* BVI paneli oʻng ustunni egallaydi — tugma uning ostida qolmasin */
body.bvi-active .totop {
  right: calc(var(--bvi-col) + 20px);
}

[data-theme="dark"] .totop {
  background: linear-gradient(180deg, #1b2436, #263250 100%);
  border-color: #3a4560;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.45);
}

[data-theme="dark"] .totop:hover {
  background: linear-gradient(180deg, #222d44, #31405f 100%);
}

@media (max-width: 768px) {
  .totop {
    right: 14px;
    bottom: 14px;
    width: 42px;
    height: 42px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .totop {
    transition: none;
  }
}
