/* ==========================================================================
   Sci-Office ортақ дизайн жүйесі (2026-10-04) — профиль беті мен басты
   беттегі стильдің бір жерге жиналған нұсқасы: каталог, кафедра, орталықтар,
   журналдар, мероприятиелер, докторантура, премия, басқару беттері осыны
   қолданады. Қаріптер base.html-де (Inter + PT Serif) жүктеледі.
   ========================================================================== */
:root {
  /* Tailwind түстері (base.html tailwind.config) осы RGB арналарынан алынады.
     Палитра — ҚазҰУ логотипі: қанық көк + қоңыр-сары (2026-10-06). */
  --c-navy: 27 50 99;     /* #1b3263 */
  --c-brand: 43 108 176;  /* #2b6cb0 */
  --c-cyan: 34 163 196;
  --c-gold: 214 152 42;   /* #d6982a */
  --c-ink: 22 32 44;
  --c-mute: 82 96 112;
  --c-line: 222 229 238;
  --c-soft: 243 246 251;
  --surface: #fff;
  --surface-2: #f8fafd;
  --page-bg: #f3f5f9;
  --ui-ink: rgb(var(--c-ink));
  --ui-navy: rgb(var(--c-navy));
  --ui-line: rgb(var(--c-line));
  --ui-soft: rgb(var(--c-soft));
  --ui-mute: rgb(var(--c-mute));
  --ui-gold: rgb(var(--c-gold));
}

/* ==========================================================================
   Беттің ені мен қаріп өлшемі (2026-10-06): үлкен экранда бет экранның
   85%-ын алады, қаріп экран еніне қарай үлкейеді (rem-ге негізделген).
   ========================================================================== */
html { font-size: 16px; }
@media (min-width: 1440px) { html { font-size: 17px; } }
@media (min-width: 1700px) { html { font-size: 18px; } }
@media (min-width: 2100px) { html { font-size: 20px; } }
@media (min-width: 2500px) { html { font-size: 22px; } }
.site-container { width: 100%; max-width: 80rem; }
@media (min-width: 1280px) { .site-container { max-width: 85vw; } }
body { background: var(--page-bg) !important; color: var(--ui-ink) !important; }

/* Логотиптің қоңыр-сары детальдары */
.gold-rule { height: 3px; border-radius: 9999px; background: linear-gradient(90deg, rgb(var(--c-gold)), rgba(var(--c-gold) / .25)); }
.text-gold-deep { color: #9a6413; }
html.dark .text-gold-deep { color: #f3c46a; }

/* Басшылық лауазымы — ФИО астында жазылатын жол (ярлык емес) */
.lead-role { display: flex; align-items: flex-start; gap: .45rem; margin-top: .25rem; font-size: .78rem; line-height: 1.3;
             color: #8a5a12; font-weight: 600; }
.lead-role::before { content: ""; flex-shrink: 0; width: 3px; align-self: stretch; min-height: 1em; border-radius: 9999px;
                     background: rgb(var(--c-gold)); }
html.dark .lead-role { color: #f3c46a; }
.pf-admin-role { display: flex; align-items: center; gap: .55rem; margin-top: .35rem; padding-left: .7rem;
                 border-left: 3px solid rgb(var(--c-gold)); font-family: "PT Serif", Georgia, serif; font-style: italic;
                 font-size: 1.02rem; font-weight: 700; color: #8a5a12; }
html.dark .pf-admin-role { color: #f3c46a; }

.mono-label { font-family: ui-monospace, SFMono-Regular, monospace; font-size:.72rem; letter-spacing: .12em;
              text-transform: uppercase; color: #7a8797; }

/* Карточкалар */
.ui-card { background: #fff; border: 1px solid var(--ui-line); border-radius: 24px;
           box-shadow: 0 1px 2px rgba(15,42,74,.04), 0 4px 14px rgba(15,42,74,.05); }
.ui-card-sm { background: #fff; border: 1px solid var(--ui-line); border-radius: 18px; }
a.ui-card, a.ui-card-sm { transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
a.ui-card:hover, a.ui-card-sm:hover { transform: translateY(-2px); border-color: #c9d7ec;
                                      box-shadow: 0 14px 32px -16px rgba(15,42,74,.35); }

/* Беттің жоғарғы блогы (профильдегідей: ақ, үсті жіңішке градиент жолақ) */
.ui-hero { position: relative; overflow: hidden; }
.ui-hero::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 5px;
                   background: linear-gradient(90deg, #0f2a4a 0%, #1f6feb 60%, #22a3c4 100%); }
.ui-title { font-family: "PT Serif", Georgia, serif; font-weight: 700; color: var(--ui-navy); line-height: 1.15; }
.ui-h1 { font-size: 1.9rem; }
.ui-h2 { font-size: 1.4rem; }
.ui-h3 { font-size: 1.1rem; }
@media (max-width: 640px) { .ui-h1 { font-size: 1.55rem; } .ui-h2 { font-size: 1.25rem; } }

/* Көрсеткіш тақташалары */
.ui-stat { background: var(--ui-soft); border-radius: 14px; padding: .6rem .75rem; min-width: 0; }
.ui-stat .v { font-family: "PT Serif", Georgia, serif; font-size: 1.35rem; font-weight: 700; line-height: 1.05; color: var(--ui-navy); }
.ui-stat .l { font-size:.72rem; color: var(--ui-mute); margin-top: .3rem; line-height: 1.2; }
.ui-stat-white { background: #fff; border: 1px solid var(--ui-line); }

/* Бүйірлік мәзір (профильдегі .pf-nav-пен бірдей) — батырма да, сілтеме де болуы мүмкін */
.ui-nav { display: flex; flex-direction: column; gap: .2rem; }
.ui-nav .ui-nav-item { display: flex; align-items: center; gap: .7rem; width: 100%; text-align: left;
        padding: .45rem .55rem; border-radius: 14px; font-size: .84rem; font-weight: 600; color: #3b4a5c; transition: .15s; }
.ui-nav .ui-nav-item:hover { background: var(--ui-soft); color: var(--ui-navy); }
.ui-nav .ui-nav-item .ico { width: 2rem; height: 2rem; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; transition: .15s; }
.ui-nav .ui-nav-item .ico svg { width: 1rem; height: 1rem; }
.ui-nav .ui-nav-item .cnt { margin-left: auto; font-size:.72rem; font-weight: 700; padding: .1rem .5rem; border-radius: 9999px;
        background: var(--ui-soft); color: var(--ui-mute); }
.ui-nav .ui-nav-item.active { background: var(--ui-navy); color: #fff; box-shadow: 0 8px 18px -10px rgba(15,42,74,.8); }
.ui-nav .ui-nav-item.active .ico { background: rgba(255,255,255,.14) !important; color: #fff !important; }
.ui-nav .ui-nav-item.active .cnt { background: rgba(255,255,255,.16); color: #fff; }
@media (max-width: 1023px) {
  .ui-nav { flex-direction: row; overflow-x: auto; padding-bottom: .25rem; scrollbar-width: thin; }
  .ui-nav .ui-nav-item { width: auto; flex-shrink: 0; padding: .35rem .7rem .35rem .35rem; font-size: .78rem; }
  .ui-nav .ui-nav-item .ico { width: 1.75rem; height: 1.75rem; }
  .ui-nav .ui-nav-item .cnt { margin-left: .2rem; }
}

/* Бүйір мәзірі + мазмұн торы */
.ui-shell { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; align-items: start; }
@media (min-width: 1024px) { .ui-shell { grid-template-columns: 270px minmax(0, 1fr); } }

/* Бекітілген бүйір мәзір (ui-tabs.js қосады, тек ≥1024px): бет айналмайды,
   бүйір мәзірі мен мазмұн бағандары өз ішінде айналады. */
html.shell-locked, html.shell-locked body { overflow: hidden; height: 100%; }
html.shell-locked footer { display: none; }
html.shell-locked .ui-shell, html.shell-locked [data-scroll-shell] { align-items: stretch; }
html.shell-locked .ui-shell > *, html.shell-locked [data-scroll-shell] > * {
  min-height: 0; max-height: 100%; overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; padding-right: 2px; position: static !important; }
/* Бүйір мәзірі ешқашан өз ішінде айналмайды — толық көрінеді */
html.shell-locked .ui-shell > aside, html.shell-locked [data-scroll-shell] > aside { overflow: visible; max-height: none; }
/* Мәзір экранға сыймайтын жағдай: бет қалыпты айналады, мәзір толық күйінде жабысып тұрады */
html.shell-sticky .ui-shell > aside, html.shell-sticky [data-scroll-shell] > aside {
  position: sticky !important; top: var(--sticky-top, 6rem); align-self: start; }
@media (min-width: 1024px) {
  /* Ықшам бүйір мәзірі — бекіту режимі жиірек сыйсын */
  .ui-nav .ui-nav-item, .pf-nav .tab-btn { padding-top: .32rem !important; padding-bottom: .32rem !important; }
  .ui-nav .ui-nav-item .ico, .pf-nav .tab-btn .ico { width: 1.75rem !important; height: 1.75rem !important; }
}

/* Бөлім панельдері (бір беттің ішіндегі ауыспалы бөлімдер) */
.ui-tab-panel { display: none; }
.ui-tab-panel.active { display: block; animation: uiFade .18s ease-out; }
@keyframes uiFade { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.ui-panel { padding: 1.6rem; }
@media (max-width: 640px) { .ui-panel { padding: 1.1rem; } }

/* «Белгі — мән» жолдары (жарияланым/патент толық мәліметі) */
.detail-grid { display: grid; grid-template-columns: minmax(7rem, 9.5rem) minmax(0, 1fr); gap: .35rem .9rem; }
.detail-grid dt { font-weight: 600; color: var(--ui-navy); }
.detail-grid dd { color: #3b4a5c; line-height: 1.45; min-width: 0; }
@media (max-width: 640px) { .detail-grid { grid-template-columns: 1fr; gap: .1rem; } .detail-grid dd { margin-bottom: .35rem; } }

/* Чиптер мен сегменттік сүзгілер */
.ui-chip { display: inline-flex; align-items: center; gap: .3rem; height: 1.6rem; padding: 0 .65rem; border-radius: 9999px;
           font-size: .72rem; font-weight: 600; background: var(--ui-soft); color: #3b4a5c; white-space: nowrap; }
.ui-seg { display: inline-flex; align-items: center; padding: .15rem; border-radius: 9999px; background: var(--ui-soft); gap: .1rem; }
.ui-seg > button, .ui-seg > a { height: 1.85rem; padding: 0 .8rem; border-radius: 9999px; font-size: .74rem; font-weight: 600;
           color: var(--ui-mute); white-space: nowrap; display: inline-flex; align-items: center; gap: .3rem; }
.ui-seg > .active { background: #fff; color: var(--ui-navy); box-shadow: 0 1px 3px rgba(15,42,74,.15); }

/* Жолақ диаграмма */
.ui-bar { height: .4rem; background: var(--ui-line); border-radius: 9999px; overflow: hidden; }
.ui-bar > span { display: block; height: 100%; border-radius: 9999px; background: var(--ui-navy); }

/* Адам карточкасы (тізімдерде) */
.ui-person { display: flex; gap: .85rem; align-items: flex-start; padding: 1rem; }
.ui-avatar { width: 3.25rem; height: 3.25rem; border-radius: 14px; object-fit: cover; flex-shrink: 0;
             display: grid; place-items: center; font-family: "PT Serif", Georgia, serif; font-weight: 700; font-size: 1.25rem;
             color: #fff; background: linear-gradient(135deg, #0f2a4a, #1f6feb); }
.ui-badge-lead { display: inline-flex; align-items: center; gap: .25rem; font-size:.72rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; padding: .15rem .5rem;
                 border-radius: 9999px; background: #fdf3e1; color: #9a6413; }

/* ==========================================================================
   Түнгі контрастты режим (2026-10-06): html.dark — base.html-дегі
   ауыстырғыш қосады (localStorage). Tailwind түстері айнымалылар арқылы
   ауысады, қалғаны (ақ фондар, стандартты Tailwind түстері, қатаң
   жазылған hex) осында қайта анықталады.
   ========================================================================== */
html.dark {
  color-scheme: dark;
  --c-navy: 226 236 255;
  --c-brand: 138 190 255;
  --c-cyan: 110 220 240;
  --c-gold: 245 192 84;
  --c-ink: 246 248 252;
  --c-mute: 196 206 220;
  --c-line: 64 78 100;
  --c-soft: 30 39 54;
  --surface: #131b28;
  --surface-2: #1a2434;
  --page-bg: #090d14;
}
html.dark .bg-white, html.dark .card, html.dark .ui-card, html.dark .ui-card-sm, html.dark .pf-card,
html.dark .site-nav, html.dark .topnav-dropdown, html.dark .pf-menu, html.dark footer,
html.dark .input, html.dark input:not([type=checkbox]):not([type=radio]):not([type=range]), html.dark select, html.dark textarea,
html.dark .btn-ghost, html.dark .ui-btn-light, html.dark .pf-btn, html.dark .ui-stat-white, html.dark .ui-seg > .active,
html.dark .lang-seg a.active, html.dark .bg-white\/80, html.dark .bg-white\/75 {
  background-color: var(--surface) !important; color: rgb(var(--c-ink)); border-color: rgb(var(--c-line)) !important;
}
html.dark .site-nav { background: rgba(19,27,40,.94) !important; }
html.dark ::placeholder { color: #8d9bb0; }
/* Қою фонды түймелер мен белсенді элементтер — ақ мәтінмен, логотип көгі */
html.dark .bg-navy, html.dark .ui-btn-dark, html.dark .btn-primary, html.dark .pf-btn-primary,
html.dark .ui-nav .ui-nav-item.active, html.dark .pf-nav .tab-btn.active, html.dark .bg-brand {
  background-color: #2f63b5 !important; color: #fff !important;
}
html.dark .bg-navy\/80 { background-color: rgba(47,99,181,.85) !important; }
html.dark .ui-btn-dark:hover, html.dark .btn-primary:hover, html.dark .pf-btn-primary:hover { background-color: #3a74cc !important; }
html.dark .bg-brand\/10, html.dark .bg-brand\/5, html.dark .bg-cyan\/10 { background-color: rgba(138,190,255,.14) !important; }
/* Мәзір мен ұсақ басқару элементтері */
html.dark .topnav-link, html.dark .ui-nav .ui-nav-item, html.dark .pf-nav .tab-btn, html.dark .topnav-dropdown-link { color: #e6edf7; }
html.dark .topnav-link:hover, html.dark .topnav-link.active, html.dark .ui-icon-btn, html.dark .lang-seg,
html.dark .topnav-dropdown-link:hover, html.dark .ui-nav .ui-nav-item:hover, html.dark .pf-nav .tab-btn:hover {
  background: #223047 !important; color: #fff !important;
}
html.dark .lang-seg a { color: #c4cedc; }
html.dark .detail-grid dd, html.dark .ui-chip, html.dark .mono-label, html.dark .pf-stat .l, html.dark .ui-stat .l { color: #d3dbe7 !important; }
html.dark .text-black { color: #fff !important; }
/* Логотип пен суреттерге — жұмсақ ақ фон (мөлдір PNG қараңғыда жоғалмас үшін) */
html.dark img.brand-logo { filter: drop-shadow(0 0 1px rgba(255,255,255,.6)); }
/* Тек бір беттің ішінде ғана жазылған hex түстер (bg-[#…], text-[#…]) */
html.dark [class*="bg-[#f"], html.dark [class*="bg-[#e"], html.dark [class*="bg-[#d"] { background-color: var(--surface-2) !important; }
html.dark [class*="text-[#"] { color: #e3c48a !important; }
html.dark [class*="border-[#"] { border-color: rgb(var(--c-line)) !important; }
/* Стандартты Tailwind ашық фондары → күңгірт реңк */
html.dark .bg-green-50, html.dark .bg-emerald-50, html.dark .bg-green-50\/50, html.dark .bg-emerald-100, html.dark .bg-lime-50, html.dark .bg-teal-50 { background-color: rgba(34,197,94,.16) !important; }
html.dark .bg-amber-50, html.dark .bg-amber-100, html.dark .bg-yellow-50, html.dark .bg-orange-50, html.dark .bg-amber-50\/60 { background-color: rgba(245,170,40,.16) !important; }
html.dark .bg-red-50, html.dark .bg-red-100, html.dark .bg-rose-50 { background-color: rgba(248,80,80,.17) !important; }
html.dark .bg-blue-50, html.dark .bg-blue-50\/50, html.dark .bg-sky-50, html.dark .bg-cyan-50, html.dark .bg-indigo-50, html.dark .bg-indigo-100 { background-color: rgba(96,165,250,.16) !important; }
html.dark .bg-violet-50, html.dark .bg-purple-50, html.dark .bg-fuchsia-50 { background-color: rgba(192,132,252,.17) !important; }
html.dark .bg-gray-50, html.dark .bg-gray-100, html.dark .bg-slate-50, html.dark .bg-slate-100 { background-color: var(--surface-2) !important; }
html.dark [class*="text-green-"], html.dark [class*="text-emerald-"], html.dark [class*="text-lime-"], html.dark [class*="text-teal-"] { color: #6ee7a0 !important; }
html.dark [class*="text-amber-"], html.dark [class*="text-yellow-"], html.dark [class*="text-orange-"] { color: #fcd27a !important; }
html.dark [class*="text-red-"], html.dark [class*="text-rose-"] { color: #ff9b9b !important; }
html.dark [class*="text-blue-"], html.dark [class*="text-sky-"], html.dark [class*="text-cyan-"], html.dark [class*="text-indigo-"] { color: #9ccaff !important; }
html.dark [class*="text-violet-"], html.dark [class*="text-purple-"], html.dark [class*="text-fuchsia-"] { color: #d9b4ff !important; }
html.dark [class*="text-gray-"], html.dark [class*="text-slate-"] { color: #d3dbe7 !important; }
html.dark [class*="border-green-"], html.dark [class*="border-amber-"], html.dark [class*="border-red-"], html.dark [class*="border-blue-"] { border-color: rgb(var(--c-line)) !important; }
/* Кестелер мен жолақтар */
html.dark tr:hover td { background-color: rgba(255,255,255,.03); }
html.dark .ui-bar > span { background: #5b9bff; }
html.dark .ui-hero::before { background: linear-gradient(90deg, #2f63b5 0%, #5b9bff 60%, #f5c054 100%); }
/* 2026-10-17: қараңғы режимде оқылмайтын қатаң жазылған түстер (форма белгілері, секция тақырыптары, ақ !-түймелер) */
html.dark .\!bg-green-50, html.dark .\!bg-emerald-50 { background-color: rgba(34,197,94,.16) !important; }
html.dark .\!bg-amber-50, html.dark .\!bg-yellow-50 { background-color: rgba(245,170,40,.16) !important; }
html.dark .\!bg-red-50, html.dark .\!bg-rose-50 { background-color: rgba(248,80,80,.17) !important; }
html.dark .\!bg-blue-50, html.dark .\!bg-sky-50 { background-color: rgba(96,165,250,.16) !important; }
html.dark [class*="!text-green-"], html.dark [class*="!text-emerald-"] { color: #6ee7a0 !important; }
html.dark [class*="!text-amber-"] { color: #fcd27a !important; }
html.dark [class*="!text-red-"] { color: #ff9b9b !important; }
html.dark [class*="!text-blue-"] { color: #9ccaff !important; }
html.dark .label { color: #c4cedc; }
html.dark .sec-title { color: rgb(var(--c-navy)); }
html.dark .\!bg-white { color: #0f2a4a !important; }
html.dark .home .ui-btn-gold { color: #3b2500; }
html.dark .pf .tab-panel .sec-title { color: rgb(var(--c-navy)); }
/* Теманы ауыстыру түймесінің белгішесі */
.theme-ico-sun { display: none; }
html.dark .theme-ico-sun { display: block; }
html.dark .theme-ico-moon { display: none; }

/* ========= Скролл UX (2026-10-10) ========= */
:root { --sb-thumb: #8fa3c7; --sb-thumb-h: #5f7bb0; --sb-track: #e6ebf5; }
html.dark { --sb-thumb: #51648c; --sb-thumb-h: #7b92c4; --sb-track: #1b2740; }
.overflow-x-auto, .overflow-y-auto, .overflow-auto, .sx-top {
  scrollbar-width: auto; scrollbar-color: var(--sb-thumb) var(--sb-track); -webkit-overflow-scrolling: touch;
}
.overflow-x-auto::-webkit-scrollbar, .overflow-y-auto::-webkit-scrollbar, .overflow-auto::-webkit-scrollbar, .sx-top::-webkit-scrollbar { height: 14px; width: 14px; }
.overflow-x-auto::-webkit-scrollbar-track, .overflow-y-auto::-webkit-scrollbar-track, .overflow-auto::-webkit-scrollbar-track, .sx-top::-webkit-scrollbar-track { background: var(--sb-track); border-radius: 9999px; }
.overflow-x-auto::-webkit-scrollbar-thumb, .overflow-y-auto::-webkit-scrollbar-thumb, .overflow-auto::-webkit-scrollbar-thumb, .sx-top::-webkit-scrollbar-thumb {
  background: var(--sb-thumb); border-radius: 9999px; border: 3px solid var(--sb-track); min-width: 48px; min-height: 48px; }
.overflow-x-auto::-webkit-scrollbar-thumb:hover, .overflow-y-auto::-webkit-scrollbar-thumb:hover, .sx-top::-webkit-scrollbar-thumb:hover { background: var(--sb-thumb-h); }
/* Кең кестелер (кафедра құрамы, факультет кафедралары): компьютерде/планшетте контейнер енінде орналасады — көлденең айналусыз */
@media (min-width: 641px) {
  table.fit-table { font-size: .76rem; }
  table.fit-table th, table.fit-table td { padding-right: .3rem; overflow-wrap: break-word; }
  table.fit-table td.whitespace-nowrap { font-size: .6rem; letter-spacing: -.01em; }
  table.fit-table td.text-xs { font-size: .68rem; }          /* идентификаторлар бөлінбейді, тек кішірейеді */
  table.fit-table td.fit-wrap { white-space: normal; }
  table.fit-table th { line-height: 1.15; vertical-align: bottom; overflow-wrap: anywhere; hyphens: auto; font-size: .64rem; }
}
/* Көлденең айналдыру жолағының айнасы (биік кестелер үшін — кесте үстінде, бет айналғанда да қолжетімді) */
.sx-top { position: sticky; top: var(--hdr-h, 76px); z-index: 25; overflow-x: auto; overflow-y: hidden; height: 16px; margin-bottom: 4px;
  background: var(--surface, transparent); border-radius: 9999px; }
.sx-top > div { height: 1px; }
/* Құлыпталған макетте айналатын аймақ тақырыптан төмен басталады — sticky жолақ жоғарғы шетте тұруы керек */
html.shell-locked .sx-top { top: 0; }
.overflow-x-auto { overscroll-behavior-x: contain; }
/* Көлденең айналдыруға болатынын көрсететін жиек көлеңкелері */
.sx-l { box-shadow: inset 14px 0 12px -12px rgba(15, 42, 74, .28); }
.sx-r { box-shadow: inset -14px 0 12px -12px rgba(15, 42, 74, .28); }
.sx-l.sx-r { box-shadow: inset 14px 0 12px -12px rgba(15, 42, 74, .28), inset -14px 0 12px -12px rgba(15, 42, 74, .28); }
/* Карта/3D граф: бет айналуына кедергі жасамайды, подсказка */
.collab-map-wrap, #collabGraph { touch-action: pan-y; }
.coop-hint { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 20; pointer-events: none;
  background: rgba(11, 21, 48, .86); color: #fff; font: 600 .78rem Inter, sans-serif; padding: .55rem .9rem; border-radius: 9999px;
  opacity: 0; transition: opacity .2s; text-align: center; max-width: 90%; }
.coop-hint.on { opacity: 1; }
@media (pointer: coarse) {
  .overflow-x-auto::-webkit-scrollbar, .sx-top::-webkit-scrollbar { height: 10px; }
  .sx-top { height: 12px; }
}

/* ========= Мобильді нұсқа (2026-10-10) ========= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
@media (max-width: 640px) {
  /* iOS фокуста масштабтамауы үшін өріс қарпі ≥16px; саусаққа ыңғайлы биіктік */
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]), select, textarea { font-size: 16px !important; }
  input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="file"]), select { min-height: 2.6rem; }
  input[type="checkbox"], input[type="radio"] { width: 1.15rem; height: 1.15rem; }
  .ui-seg { flex-wrap: wrap; border-radius: 1.1rem; }
  .ui-seg > button, .ui-seg > a { height: 2.2rem; }
  .ui-chip { min-height: 1.9rem; }
  main { padding-left: .75rem !important; padding-right: .75rem !important; }
  .ui-panel, .ui-hero { padding: 1rem !important; }
  .pd-kpi .pd-delta { white-space: normal; line-height: 1.25; }
  .pd-kpi { padding: .8rem .85rem .7rem; }
  table { font-size: .8rem; }
  .coop-hint { font-size: .72rem; }
  /* grid-cols көрсетілмеген торлар — бір «auto» бағанмен кең өріс контейнерден шығып кетпесін */
  .grid:not([class^="grid-cols-"]):not([class*=" grid-cols-"]) { grid-template-columns: minmax(0, 1fr); }
  input:not([type="checkbox"]):not([type="radio"]), select, textarea { max-width: 100%; }
}
@media (max-width: 480px) {
  /* Тақырып бір қатарға сыяды (бұрын 3 қатар болып, экранның 15%-ын алатын) */
  header.sticky { padding-top: .35rem; }
  header .site-container { padding-left: .5rem; padding-right: .5rem; }
  .topnav-row { flex-wrap: nowrap !important; gap: .25rem !important; padding-left: .4rem !important; padding-right: .4rem !important; min-height: 3rem; }
  .topnav-row > a { margin-right: 0 !important; }
  .brand-logo { height: 2.1rem; }
  .topnav-row .ui-icon-btn { width: 2.4rem; height: 2.4rem; }
  .lang-seg { height: 2.2rem; margin-left: .15rem; }
  .lang-seg a { min-width: 1.75rem; padding: 0 .38rem; font-size: .72rem; }
  .topnav-row .ui-btn { padding-left: .65rem; padding-right: .65rem; font-size: .8rem; height: 2.2rem; }
  .topnav-row .ui-btn-dark { display: none; }          /* «Тіркелу» — мәзірде/кіру бетінде бар */
  #mobile-nav-panel { max-height: calc(100vh - 4.5rem); }
}


/* ========= 2026-10-14: планшет / смартфон — ыңғайсыз ішкі прокруткалар мен өлшемдер ========= */
@media (max-width: 767px) {
  /* ішкі тізімдерде жеке айналдыру жолағы болмасын — бет қана айналады (ашылмалы іздеу тізімдері мен модальдер қалады) */
  main .overflow-y-auto[class*="max-h-"]:not(.profile-picker-dropdown):not(#profileSearchResults):not([data-cols-pop]):not(.max-w-2xl):not(#chat):not(.as-log) {
    max-height: none !important; overflow: visible !important; }
  .ui-stat .v { font-size: 1.35rem; }
  .ui-shell { gap: .9rem; }
  img, video, canvas, svg { max-width: 100%; }
  pre, code { white-space: pre-wrap; word-break: break-word; }
  .ui-seg { max-width: 100%; }
  /* кестелер (өз айналдыру контейнері жоқтары) — көлденең айналады, бетті кеңейтпейді */
  main table:not(#collabTable) { display: block; max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
}
@media (min-width: 641px) and (max-width: 1023px) {
  /* планшет: бөлім мәзірі (ui-nav) бір қатарда айналатын лента, мазмұн — толық ені */
  .ui-shell { grid-template-columns: minmax(0, 1fr); }
  .site-container { max-width: 100%; }
  main { padding-left: 1rem !important; padding-right: 1rem !important; }
}


/* 2026-10-22: оқуды аяқтаған, бірақ қорғамаған докторанттар — барлық тізімде қызыл (PhdTrajectory.is_unprotected) */
.phd-red { background: rgba(220, 38, 38, .09) !important; box-shadow: inset 3px 0 0 #dc2626; }
.phd-red a, .phd-red .phd-nm { color: #b91c1c !important; }
.phd-red-chip { display: inline-flex; align-items: center; padding: .1rem .6rem; border-radius: 9999px; font-size: .68rem; font-weight: 800; background: #dc2626; color: #fff; white-space: nowrap; margin-left: .35rem; }
html.dark .phd-red { background: rgba(248, 113, 113, .13) !important; box-shadow: inset 3px 0 0 #f87171; }
html.dark .phd-red a, html.dark .phd-red .phd-nm { color: #fca5a5 !important; }
html.dark .phd-red-chip { background: #b91c1c; color: #fff; }

/* 2026-10-23: тақырыпта бекітілген ашық градиент (from-emerald-50 via-white to-white) қараңғы режимде мәтінді жасырып тұрды */
html.dark [class*="bg-gradient-to-"][class*="to-white"] { background-image: none !important; background-color: var(--surface-2) !important; }
html.dark [class*="bg-gradient-to-"][class*="to-white"][class*="from-emerald-"] { background-image: linear-gradient(135deg, rgba(34, 197, 94, .16), rgba(34, 197, 94, .03)) !important; background-color: transparent !important; }
html.dark .border-emerald-100 { border-color: rgba(34, 197, 94, .35) !important; }
