.navbar-brand-text {
    font-weight: 700;
    font-size: 18px;
}
a.row.main-link:hover {
    text-decoration: none;
}
.fit-content {
    max-width: fit-content;
}
.quote {
    --tblr-alert-color: var(--tblr-muted);
    background: #fff;
    border: var(--tblr-border-width) var(--tblr-border-style) var(--tblr-border-color-translucent);
    border-left: 0.25rem var(--tblr-border-style) var(--tblr-alert-color);
    box-shadow: rgb(29 39 59 / 4%) 0 2px 4px 0;
    --tblr-alert-color: var(--tblr-info-text);
    --tblr-alert-bg: var(--tblr-info-bg-subtle);
    --tblr-alert-border-color: var(--tblr-info-border-subtle);
    --tblr-alert-link-color: var(--tblr-info-text);
}
.quote {
    --tblr-alert-color: var(--tblr-info);
}
/* Shaxsiy xabarlar — Telegram-style chat bubblelari */
.messages {
    display: flex;
    flex-direction: column;
}
.messages ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
}
.messages ul li {
    display: flex;
    width: 100%;
    margin: 0;
}
.messages ul li.sent {
    justify-content: flex-end;
}
.messages ul li.replies {
    justify-content: flex-start;
}
.messages ul li p {
    position: relative;
    margin: 0;
    padding: 8px 12px 6px;
    border-radius: 18px;
    max-width: 75%;
    line-height: 1.4;
    font-size: 14px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    box-shadow: 0 1px 1px rgba(0,0,0,.06);
}
.messages ul li.sent p {
    background: linear-gradient(135deg, #4f6df0 0%, #2848d4 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.messages ul li.replies p {
    background: var(--tblr-card-bg, #f1f3f5);
    color: var(--tblr-body-color, #1f2937);
    border-bottom-left-radius: 4px;
    border: 1px solid var(--tblr-border-color-translucent, rgba(0,0,0,.06));
}
[data-bs-theme="dark"] .messages ul li.replies p {
    background: #2a3042;
    color: #e6e9f0;
    border-color: #353c52;
}
.messages ul li.sent p a { color: #cfdcff; text-decoration: underline; }
.messages ul li.replies p a { color: #4f6df0; text-decoration: underline; }

.messages ul li p .msg-time {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 11px;
    margin-left: 8px;
    margin-top: 2px;
    float: right;
    line-height: 1.4;
    opacity: .85;
}
.messages ul li.sent p .msg-time { color: rgba(255,255,255,.85); }
.messages ul li.replies p .msg-time { color: var(--tblr-muted, #6b7488); }

.messages ul li p .msg-time .msg-read,
.messages ul li p .msg-time .msg-sent { color: #82e9de; }

.messages ul li p .msg-file {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 6px;
    padding: 4px 8px;
    border-radius: 8px;
    background: rgba(0,0,0,.08);
    font-size: 12.5px;
    text-decoration: none;
}
.messages ul li.sent p .msg-file { background: rgba(255,255,255,.18); color: #fff; }
.messages ul li.sent p .msg-file:hover { background: rgba(255,255,255,.28); color: #fff; }
.messages ul li.replies p .msg-file { background: rgba(83,115,151,.12); color: var(--tblr-body-color); }
.messages ul li.replies p .msg-file:hover { background: rgba(83,115,151,.22); }

@media (max-width: 575.98px) {
    .messages ul li p { max-width: 88%; font-size: 13.5px; }
}

/* Compose form karta uchun ozgina styling */
.mail-compose-card textarea.form-control {
    resize: vertical;
    min-height: 60px;
}

.karta_brand {
    float: right;
    width: 60px;
    filter: brightness(10);
}
@font-face {
    font-family: 'Karta';
    src: url('credit-card.regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}
.karta_kodi {
    font-family: 'Karta';
    font-size: 13px;
}

/* Submit-button cooldown (live timer) */
.w11-cooldown {
    cursor: not-allowed !important;
    opacity: .65;
    pointer-events: none;
    font-variant-numeric: tabular-nums;
}

/* Sidebar drawer (profil + sozlamalar paneli) */
.sidebar-offcanvas {
    width: 340px;
    max-width: 90vw;
    box-shadow: 4px 0 24px rgba(0, 0, 0, .18);
}

/* O'ng tomondagi doimiy panel (Forum + Chat so'ngi xabarlar) —
   tepa navbardan pastda, fon shaffof. */
.uz-right-nav {
    display: none;
}
@media (min-width: 992px) {
    .uz-right-nav {
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 56px;
        right: 0;
        width: 360px;
        max-height: calc(100vh - 72px);
        z-index: 1015;
        background: transparent;
    }
    .uz-right-nav__inner {
        flex: 0 1 auto;
        padding: 12px 12px 18px;
        overflow-y: auto;
        background: transparent;
    }
    .uz-right-nav .card {
        margin-bottom: .75rem !important;
    }
    .uz-right-nav .card-title {
        font-size: 12px;
        font-weight: 700;
        letter-spacing: 1px;
        text-transform: uppercase;
        color: #6b7488;
    }
    .uz-right-nav .list-group-item {
        border-left: 0;
        border-right: 0;
        transition: background-color .15s ease, transform .15s ease, box-shadow .15s ease;
        cursor: pointer;
    }
    /* Hover effekti — qaysi xabarga kirilayotgani aniq ko'rinadi */
    .uz-right-nav .list-group-item-action:hover,
    .uz-right-nav .list-group-item-action:focus {
        background: linear-gradient(90deg, rgba(106, 130, 251, .12) 0%, rgba(106, 130, 251, .04) 100%);
        box-shadow: inset 3px 0 0 #4f6df0;
        transform: translateX(2px);
        text-decoration: none;
    }
    .uz-right-nav .list-group-item-action:active {
        background: rgba(106, 130, 251, .2);
    }
    [data-bs-theme="dark"] .uz-right-nav .list-group-item-action:hover,
    [data-bs-theme="dark"] .uz-right-nav .list-group-item-action:focus {
        background: linear-gradient(90deg, rgba(106, 130, 251, .18) 0%, rgba(106, 130, 251, .06) 100%);
        box-shadow: inset 3px 0 0 #6a82fb;
    }
    [data-bs-theme="dark"] .uz-right-nav .card-title {
        color: #8a93a8;
    }
}

/* So'ngi xabarlar ro'yxati — 5 tasi ko'rinadi, qolgani zamonaviy scroll bilan */
.uz-recent-scroll {
    max-height: 296px;          /* ~5 ta element ko'rinadi, 6-chisi biroz ko'rinib turadi */
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    scrollbar-color: rgba(106, 130, 251, .45) transparent;
    scroll-behavior: smooth;
    -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%);
            mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent 100%);
}
.uz-recent-scroll::-webkit-scrollbar {
    width: 6px;
}
.uz-recent-scroll::-webkit-scrollbar-track {
    background: transparent;
}
.uz-recent-scroll::-webkit-scrollbar-thumb {
    background: rgba(106, 130, 251, .35);
    border-radius: 8px;
    transition: background .15s ease;
}
.uz-recent-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(106, 130, 251, .6);
}
.uz-recent-scroll::-webkit-scrollbar-thumb:hover {
    background: rgba(79, 109, 240, .85);
}
[data-bs-theme="dark"] .uz-recent-scroll {
    scrollbar-color: rgba(138, 147, 168, .45) transparent;
}
[data-bs-theme="dark"] .uz-recent-scroll::-webkit-scrollbar-thumb {
    background: rgba(138, 147, 168, .35);
}
[data-bs-theme="dark"] .uz-recent-scroll:hover::-webkit-scrollbar-thumb {
    background: rgba(138, 147, 168, .6);
}

/* Desktopda asosiy kontent o'rtada — har ikki yonda 368px joy ajratiladi
   (360px panel + 8px gap). Chap va o'ng panellar shu joyga joylashadi. */
@media (min-width: 992px) {
    /* 3 ustunli maket o'lchovlari:
       chap panel = 360px, o'ng panel = 360px, ustun bilan gap = 8px.
       => har yon = 368px, jami = 736px. */
    body:not(.is-admin-page) .wrapper {
        max-width: none !important;
        /* 100vw o'rniga 100%: body scroll konteyner (overflow-y:auto) bo'lgani uchun
           % vertikal scrollbar enini hisobga olmaydi (100vw scrollbar'ni qo'shib
           gorizontal scroll keltirardi). */
        width: calc(100% - 736px);
        margin-left: 368px !important;
        margin-right: 368px !important;
    }
    /* Tepa navbar — ekranni ikki yonboshga to'liq egallaydi.
       wrapper marginlarini negative bilan kompensatsiya qilamiz. */
    body:not(.is-admin-page) header.navbar.sticky-top {
        margin-left: -368px;
        margin-right: -368px;
        width: calc(100% + 736px);
        max-width: none;
        left: auto;
        right: auto;
    }
    /* Navbar ichidagi container-xl chetdagi cheklovsiz to'liq enlikni egallasin. */
    header.navbar.sticky-top > .container-xl {
        max-width: none !important;
        width: 100%;
        padding-left: 16px;
        padding-right: 16px;
    }
    /* O'rta kontent o'z ustunini TO'LIQ egallasin — Tabler'ning
       .container-xl{max-width:1320px} cheklovi kontentni markazlab, yon
       panellardan katta bo'shliq qoldirardi. Endi yaqin turadi. */
    body:not(.is-admin-page) .wrapper .page-body > .container-xl {
        max-width: none !important;
        width: 100%;
    }
    /* Uchala ustun tepasi bir chiziqda: kontent navbardan 12px past boshlanadi,
       chap va o'ng panel ichki yuqori bo'shlig'i ham 12px. */
    body:not(.is-admin-page) .wrapper .page-body {
        margin-top: 12px !important;
    }
    body:not(.is-admin-page) .sidebar-offcanvas .offcanvas-header {
        padding-top: 12px;
        padding-bottom: 6px;
    }
}

/* Gorizontal scroll'ni butunlay yo'qotish.
   body'da overflow-y:auto bo'lgani uchun overflow-x ham avtomatik "auto" ga
   aylanadi va eng kichik (sub-piksel) toshishda ham gorizontal scrollbar
   ko'rsatadi. overflow-x:clip vertikal scroll va sticky navbar'ni saqlagan
   holda gorizontal scroll'ni o'chiradi. (hidden — eski brauzerlar uchun fallback) */
html body {
    overflow-x: hidden;
    overflow-x: clip;
}

/* Admin sahifa: site main navbarlari yashirinadi, wrapper to'liq kenglikda */
body.is-admin-page .wrapper {
    max-width: none !important;
    width: 100%;
    margin: 0 !important;
}
/* Admin'da ham navbar saytdagidek — qidiruv paneli ko'rinadi (faqat site chap
   panelni ochadigan hamburger yashirin, chunki admin'da u kerak emas). */
body.is-admin-page .sidebar-toggle {
    display: none !important;
}
/* Admin sahifa: Tabler container-xl/row/col cheklovlarini olib tashlash —
   shunda admin shell to'liq kenglikni egallaydi va sidebarlar ekran chetlariga tegadi. */
body.is-admin-page .page-wrapper,
body.is-admin-page .page-body,
body.is-admin-page .page-body > .container-xl,
body.is-admin-page .page-body > .container-xl > .row,
body.is-admin-page .page-body > .container-xl > .row > .col {
    max-width: none !important;
    width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    flex: none !important;
}
body.is-admin-page .page-body > .container-xl > .row > .col > .row {
    margin: 0 !important;
}
body.is-admin-page .page-body > .container-xl > .row > .col > .row > * {
    padding: 0 !important;
}
/* Admin sahifa: site yon panellari endi DOIM render bo'ladi (PJAX uchun) —
   admin shell to'liq kenglik egallashi uchun ularni shu yerda yashiramiz. */
body.is-admin-page #sidebar-offcanvas,
body.is-admin-page .uz-right-nav {
    display: none !important;
}
.sidebar-offcanvas .offcanvas-header {
    padding: 1rem 1.25rem;
}
.sidebar-offcanvas .offcanvas-title {
    font-size: 1.05rem;
}
.sidebar-offcanvas .offcanvas-body {
    padding: 1rem;
}
.sidebar-offcanvas .card {
    margin-bottom: .75rem !important;
}

/* Mobilda navbar-search yashirin. Lupa bosilganda navbar ustini yopib
   to'liq overlay holida ochiladi (navbar o'zgarmaydi). */
@media (max-width: 767.98px) {
    header.navbar.sticky-top > .container-xl {
        position: relative;
    }
    .navbar-search {
        display: none !important;
    }
    .navbar-search.is-open {
        display: flex !important;
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        right: 0 !important;
        bottom: 0 !important;
        max-width: none !important;
        height: 100%;
        background: var(--tblr-body-bg, #fff);
        padding: 8px 12px;
        z-index: 1031;
        align-items: center;
        gap: 8px;
    }
    .navbar-search.is-open .navbar-search-close {
        flex: 0 0 auto;
        width: 36px;
        height: 36px;
        border: 0;
        background: transparent;
        border-radius: 50%;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        color: var(--tblr-body-color, #1f2937);
    }
    .navbar-search.is-open .navbar-search-close:hover {
        background-color: rgba(0, 0, 0, .06);
    }
    .navbar-search.is-open form {
        flex: 1 1 auto;
    }
    [data-bs-theme="dark"] .navbar-search.is-open {
        background: #181d29;
    }
    [data-bs-theme="dark"] .navbar-search.is-open .navbar-search-close {
        color: #e6e9f0;
    }
    [data-bs-theme="dark"] .navbar-search.is-open .navbar-search-close:hover {
        background-color: rgba(255, 255, 255, .08);
    }
    /* Mobil overlayda dropdownni navbar ostida joylashtiriladi */
    .navbar-search.is-open .navbar-search__results {
        position: fixed;
        top: 56px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 60px);
        border-radius: 0;
        border-left: 0;
        border-right: 0;
    }
}

/* Tepa sticky navbar (Bootstrap default z-index: 1020) o'ng .uz-right-nav (1029)
   tagida qolyapti — buni 1040 ga ko'taramiz, dropdown ham unga teng yoki yuqori. */
header.navbar.sticky-top {
    z-index: 1040 !important;
}
header.navbar .dropdown-menu {
    z-index: 1050 !important;
}

/* Navbar markazidagi qidiruv inputi */
.navbar-search .form-control {
    border-radius: 999px;
    background-color: rgba(0, 0, 0, .04);
    border-color: transparent;
    padding-left: 2.5rem;
    transition: background-color .2s ease, box-shadow .2s ease;
}
.navbar-search .form-control:focus {
    background-color: var(--tblr-body-bg, #fff);
    box-shadow: 0 0 0 3px rgba(83, 115, 151, .18);
}
.navbar-search .input-icon-addon {
    color: var(--tblr-muted, #6b7488);
    pointer-events: none;
}
[data-bs-theme="dark"] .navbar-search .form-control {
    background-color: rgba(255, 255, 255, .06);
    color: #e6e9f0;
}
[data-bs-theme="dark"] .navbar-search .form-control:focus {
    background-color: rgba(255, 255, 255, .1);
    box-shadow: 0 0 0 3px rgba(106, 130, 251, .25);
}

/* AJAX qidiruv natijalari dropdown */
.navbar-search__results {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    max-height: 70vh;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #e6e9f0;
    border-radius: 14px;
    box-shadow: 0 12px 32px rgba(15, 23, 42, .14);
    z-index: 1040;
    padding: 6px;
}
[data-bs-theme="dark"] .navbar-search__results {
    background: #1a1f2e;
    border-color: #2a3042;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .55);
}
.navbar-search__group-title {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #6b7488;
    padding: 8px 12px 4px;
}
.navbar-search__item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: 10px;
    color: inherit;
    text-decoration: none;
    transition: background-color .12s ease;
}
.navbar-search__item:hover,
.navbar-search__item.is-active {
    background-color: rgba(83, 115, 151, .08);
    text-decoration: none;
    color: inherit;
}
[data-bs-theme="dark"] .navbar-search__item:hover,
[data-bs-theme="dark"] .navbar-search__item.is-active {
    background-color: rgba(255, 255, 255, .07);
}
.navbar-search__item-icon {
    flex: 0 0 auto;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background-color: rgba(83, 115, 151, .1);
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #5a657f;
}
.navbar-search__item-text {
    flex: 1 1 auto;
    min-width: 0;
}
.navbar-search__item-title {
    font-size: 13.5px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar-search__item-sub {
    font-size: 12px;
    color: #6b7488;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.navbar-search__empty,
.navbar-search__loading {
    padding: 14px;
    text-align: center;
    color: #6b7488;
    font-size: 13px;
}
.navbar-search__footer {
    border-top: 1px solid #eef0f6;
    padding: 8px 10px;
    margin-top: 4px;
    text-align: center;
}
[data-bs-theme="dark"] .navbar-search__footer {
    border-top-color: #2a3042;
}
.navbar-search__footer a {
    color: #4f6df0;
    font-size: 12.5px;
    font-weight: 500;
    text-decoration: none;
}
.navbar-search__footer a:hover {
    text-decoration: underline;
}
mark.navbar-search__hl {
    background-color: rgba(255, 235, 59, .55);
    color: inherit;
    padding: 0 1px;
    border-radius: 2px;
}
[data-bs-theme="dark"] mark.navbar-search__hl {
    background-color: rgba(255, 235, 59, .25);
}

/* Forum ovoz tugmalari (m1/m2 — AJAX) */
.js-vote-group .btn-action {
    transition: color .15s ease, transform .15s ease;
}
.js-vote-group .btn-action.is-loading {
    opacity: .5;
    pointer-events: none;
}
.js-vote-group .js-vote-up.is-active {
    color: #2fb344;
}
.js-vote-group .js-vote-down.is-active {
    color: #d6336c;
}
.js-vote-group .btn-action.is-tapped {
    transform: scale(1.25);
}
.js-vote-group .js-vote-count.is-changed {
    animation: voteCountPulse .6s ease;
}
@keyframes voteCountPulse {
    0%   { transform: scale(1); color: inherit; }
    30%  { transform: scale(1.4); color: #4f6df0; }
    100% { transform: scale(1); color: inherit; }
}
.vote-pop {
    position: absolute;
    top: -8px;
    left: 50%;
    transform: translate(-50%, 0);
    font-size: 12px;
    font-weight: 700;
    pointer-events: none;
    opacity: 0;
    animation: votePopUp .8s ease forwards;
    z-index: 10;
}
.vote-pop--up { color: #2fb344; }
.vote-pop--down { color: #d6336c; }
@keyframes votePopUp {
    0%   { opacity: 0; transform: translate(-50%, 0); }
    20%  { opacity: 1; }
    100% { opacity: 0; transform: translate(-50%, -28px); }
}

/* Uzun kod bloklari uchun ochish/yopish */
.w11-code--collapsible {
    position: relative;
    max-height: 22em;
    overflow: hidden;
    transition: max-height .25s ease;
    padding-bottom: 44px !important;
}
.w11-code--collapsible.is-expanded {
    max-height: none;
}
.w11-code--collapsible::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 32px;
    height: 60px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, .95) 100%);
    pointer-events: none;
    transition: opacity .2s ease;
}
.w11-code--collapsible.is-expanded::after {
    opacity: 0;
}
[data-bs-theme="dark"] .w11-code--collapsible::after {
    background: linear-gradient(180deg, rgba(22, 26, 38, 0) 0%, rgba(22, 26, 38, .96) 100%);
}
.w11-code-collapse {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    border: 0;
    border-top: 1px solid rgba(83, 115, 151, .15);
    background: rgba(255, 255, 255, .85);
    color: #4f6df0;
    font-weight: 600;
    font-size: 12.5px;
    padding: 8px 12px;
    cursor: pointer;
    z-index: 2;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    transition: background-color .15s ease;
}
.w11-code-collapse:hover {
    background: rgba(238, 242, 255, .95);
}
[data-bs-theme="dark"] .w11-code-collapse {
    background: rgba(22, 26, 38, .85);
    color: #6a82fb;
    border-top-color: rgba(255, 255, 255, .08);
}
[data-bs-theme="dark"] .w11-code-collapse:hover {
    background: rgba(40, 50, 75, .95);
}

/* Chat — input bar pastda (Telegram-style) */
.chat-card-container {
    display: flex;
    flex-direction: column;
}
.chat-input-bar {
    background: var(--tblr-card-bg, #fff);
    border-top: 1px solid var(--tblr-border-color, #e6e9f0);
}
[data-bs-theme="dark"] .chat-input-bar {
    background: #1a1f2e;
    border-top-color: #2a3042;
}

/* ===== Chat — ilova kabi QULFLANGAN layout (sahifa scroll qilmaydi) =====
   Header tepaga, input pastga yopishadi; faqat o'rtadagi xabarlar ro'yxati
   scroll bo'ladi. Desktop ham, mobil ham bir xil ishlaydi. */
body.is-chat-page {
    overflow: hidden;
    height: 100vh;
}
/* iOS/mobil uchun dinamik viewport balandligi (manzil paneli bekinganda ham) */
@supports (height: 100dvh) {
    body.is-chat-page { height: 100dvh; }
}

.chat-card-container {
    position: fixed;
    top: 56px;                 /* sticky navbar balandligi */
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    z-index: 80;
    display: flex;
    flex-direction: column;
    height: auto;
    max-height: none;
    border-radius: 0 !important;
    overflow: hidden;
    gap: 0 !important;
}
.chat-card-container .card-header {
    flex: 0 0 auto;
    border-radius: 0 !important;
    margin: 0 !important;
}
.chat-card-container #chat-list {
    flex: 1 1 auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    margin-bottom: 0 !important;
}
.chat-card-container .chat-input-bar {
    flex: 0 0 auto;
    position: relative !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    margin: 0 !important;
    border-radius: 0 !important;
    border-top: 1px solid var(--tblr-border-color, #e6e9f0);
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .04);
}
[data-bs-theme="dark"] .chat-card-container .chat-input-bar {
    box-shadow: 0 -1px 4px rgba(0, 0, 0, .25);
}
.chat-card-container .chat-input-bar > form { margin: 0 !important; }

/* Desktopda yon panellar bor — chat o'rta ustunda joylashadi
   (chap dock 340+gap, o'ng panel 340+gap). */
@media (min-width: 992px) {
    .chat-card-container {
        left: 368px;
        right: 368px;
    }
}

/* ===================================================================
   Shaxsiy yozishmalar — chat uslubidagi QULFLANGAN layout
   (mailchat-container body.is-chat-page bilan birga ishlaydi)
   =================================================================== */
.mailchat-container {
    position: fixed;
    top: 56px;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0 !important;
    z-index: 80;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--tblr-bg-surface, #fff);
}
[data-bs-theme="dark"] .mailchat-container { background: #161b26; }
@media (min-width: 992px) {
    .mailchat-container { left: 368px; right: 368px; }
}

/* Tepa panel (header) */
.mailchat-header {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--tblr-card-bg, #fff);
    border-bottom: 1px solid var(--tblr-border-color, #e6e9f0);
}
[data-bs-theme="dark"] .mailchat-header { background: #1a1f2e; border-bottom-color: #2a3042; }
.mailchat-back {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--tblr-muted, #6b7488);
    text-decoration: none;
}
.mailchat-back:hover { background: rgba(37, 99, 235, .1); color: #2563eb; }
.mailchat-head-ava { flex: 0 0 auto; }
.mailchat-head-info { flex: 1 1 auto; min-width: 0; line-height: 1.2; }
.mailchat-head-name {
    font-weight: 700;
    font-size: 15px;
    color: inherit;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mailchat-head-name:hover { text-decoration: underline; }
.mailchat-head-sub {
    font-size: 12px;
    color: var(--tblr-muted, #8a93a8);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mailchat-head-menu { flex: 0 0 auto; }

/* O'rta — xabarlar ro'yxati (yagona scroll) */
.mailchat-container #mail-thread.mail-scroll {
    flex: 1 1 auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
}

/* Sana ajratgich (faqat ko'rsatadi, bosilmaydi) */
.mail-date-sep {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 10px 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
}
.mail-date-sep span {
    background: rgba(83, 115, 151, .12);
    color: var(--tblr-muted, #6b7488);
    font-size: 12px;
    font-weight: 600;
    padding: 3px 12px;
    border-radius: 999px;
}
[data-bs-theme="dark"] .mail-date-sep span { background: rgba(255, 255, 255, .1); }

/* Past — yozish maydoni (qulflangan) */
.mailchat-compose {
    flex: 0 0 auto;
    padding: 8px 10px;
    background: var(--tblr-card-bg, #fff);
    border-top: 1px solid var(--tblr-border-color, #e6e9f0);
}
[data-bs-theme="dark"] .mailchat-compose { background: #1a1f2e; border-top-color: #2a3042; }
.mail-composer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #e6e9f0);
    border-radius: 18px;
    padding: 6px 8px 6px 14px;
}
[data-bs-theme="dark"] .mail-composer { background: #1c2230; border-color: #2a3042; }
.mail-composer__text.form-control {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 6px 2px !important;
    border-radius: 0 !important;
    resize: none;
    min-height: 26px;
    max-height: 140px;
    line-height: 1.4;
    overflow-y: auto;
}
.mail-composer__bar { display: flex; align-items: center; gap: 4px; }
/* Tool tugmalar konteyneri (fayl + smaylik + code) — chat kabi textarea tagida */
.mail-composer__tools { display: flex; align-items: center; gap: 1px; }
/* Smaylik/code tugmalari (win11-smileys.js qo'shadi) ham fayl tugmasi uslubida */
.mail-composer__tools .btn,
.mail-tool-btn {
    width: 36px;
    height: 36px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0 !important;
    background: transparent !important;
    color: var(--tblr-muted, #6b7488) !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    cursor: pointer;
}
.mail-composer__tools .btn:hover,
.mail-tool-btn:hover { background: rgba(37, 99, 235, .1) !important; color: #2563eb !important; }
.mail-composer__tools .btn svg,
.mail-tool-btn svg { width: 18px; height: 18px; }
.mailchat-compose .fname { max-width: 40%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mail-send-btn.btn {
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2f7bff 0%, #2563eb 100%);
    border: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .3);
}
.mail-send-btn.btn:hover { filter: brightness(1.06); }
.mail-send-btn.btn .icon { width: 19px; height: 19px; }

/* ===== "Sizga javob yozishdi" paneli — chat tepasida pinned oynacha ===== */
.chat-card-container .chat-reply-notif {
    flex: 0 0 auto;
    max-height: 42%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: linear-gradient(180deg, rgba(255, 236, 179, .35) 0%, rgba(255, 236, 179, .12) 100%);
    border-bottom: 1px solid rgba(245, 159, 0, .25);
}
[data-bs-theme="dark"] .chat-card-container .chat-reply-notif {
    background: linear-gradient(180deg, rgba(245, 159, 0, .14) 0%, rgba(245, 159, 0, .05) 100%);
    border-bottom-color: rgba(245, 159, 0, .25);
}
.chat-reply-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    font-weight: 600;
    font-size: 13px;
}
.chat-reply-title { display: inline-flex; align-items: center; gap: 6px; color: #b8860b; }
[data-bs-theme="dark"] .chat-reply-title { color: #ffce6a; }
.chat-reply-close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--tblr-muted, #8a93a8);
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    width: 26px;
    height: 26px;
    border-radius: 50%;
}
.chat-reply-close:hover { background: rgba(0, 0, 0, .08); color: #e03131; }
.chat-reply-list { overflow-y: auto; }
.chat-reply-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 7px 12px;
    border-top: 1px solid rgba(245, 159, 0, .18);
}
.chat-reply-ava { flex: 0 0 auto; }
.chat-reply-body { flex: 1 1 auto; min-width: 0; }
.chat-reply-top { font-size: 13px; line-height: 1.2; }
.chat-reply-name { font-weight: 700; text-decoration: none; color: inherit; }
.chat-reply-name:hover { text-decoration: underline; }
.chat-reply-text {
    color: var(--tblr-muted, #6b7488);
    font-size: 12.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.chat-reply-goto { flex: 0 0 auto; border-radius: 8px; }

/* Yangi yuborilgan/qabul qilingan/fokus qilingan xabar 4 soniya yorqin ko'rinadi
   (bubble atrofida yumshoq halqa) */
.chat-msg.is-new-msg .chat-bubble,
.chat-msg.is-poll-new .chat-bubble,
.chat-msg.is-focused-msg .chat-bubble {
    animation: chatNewMsgPulse 4s ease forwards;
}
.chat-msg.is-poll-new .chat-bubble {
    animation: chatNewMsgPulse 4s ease forwards, chatNewMsgSlideIn 0.35s ease;
}
@keyframes chatNewMsgPulse {
    0%   { box-shadow: 0 0 0 3px rgba(79, 109, 240, .55); }
    40%  { box-shadow: 0 0 0 3px rgba(79, 109, 240, .32); }
    100% { box-shadow: 0 0 0 0 rgba(79, 109, 240, 0); }
}
@keyframes chatNewMsgSlideIn {
    0%   { transform: translateY(-8px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

/* Yangi xabar uchun "NEW" pulsing dot — bubble burchagida */
.chat-msg.is-poll-new .chat-bubble::after {
    content: "";
    position: absolute;
    top: -3px;
    right: -3px;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #4f6df0;
    box-shadow: 0 0 0 0 rgba(79, 109, 240, 0.7);
    animation: chatNewMsgDot 1.4s ease-out infinite, chatNewMsgDotFade 4s ease forwards;
    z-index: 2;
}
.chat-msg.mine.is-poll-new .chat-bubble::after { right: auto; left: -3px; }
@keyframes chatNewMsgDot {
    0%   { box-shadow: 0 0 0 0 rgba(79, 109, 240, 0.7); }
    70%  { box-shadow: 0 0 0 10px rgba(79, 109, 240, 0); }
    100% { box-shadow: 0 0 0 0 rgba(79, 109, 240, 0); }
}
@keyframes chatNewMsgDotFade {
    0%, 80% { opacity: 1; }
    100%    { opacity: 0; }
}
.chat-input-form textarea {
    border-radius: 18px;
    padding: 8px 14px;
    line-height: 1.4;
    overflow: hidden;
    transition: height .15s ease;
}
/* Code rejimi yoqilganda textarea va uning wrapper ni majburan kattalashtiramiz */
.chat-input-form { position: relative; }
.chat-input-form .w11-code-editor {
    flex: 1 1 100%;
    width: 100%;
    min-height: 240px;
    max-height: 60vh;
    position: relative;
}
.chat-input-form .w11-code-editor .w11-code-stage {
    min-height: 240px;
}
.chat-input-form textarea.w11-code-textarea {
    height: 240px !important;
    min-height: 240px !important;
    max-height: 60vh !important;
    border-radius: 0 !important;
    overflow: auto !important;
}
.chat-input-form:has(.w11-code-editor) .d-flex {
    align-items: stretch !important;
}
.chat-input-form:has(.w11-code-editor) button[type="submit"] {
    align-self: flex-end;
}

/* Mobilda code rejimi: smaylik yashiriladi, code tugmasi editor ichiga ko'chadi,
   editor iloji boricha katta ekran joyini egallaydi. */
@media (max-width: 767.98px) {
    /* Smaylik tugmasi mobilda code rejimida ko'rinmaydi */
    .chat-input-form:has(.w11-code-editor) .js-smiley-btn {
        display: none !important;
    }
    /* Toolbar editor ichida absolute joylashadi (chap tepa) */
    .chat-input-form:has(.w11-code-editor) .w11-input-toolbar {
        position: absolute;
        top: 6px;
        left: 6px;
        z-index: 12;
        margin: 0 !important;
        padding: 0;
        background: transparent;
        gap: 0 !important;
    }
    .chat-input-form:has(.w11-code-editor) .w11-input-toolbar .js-code-btn {
        background: rgba(255, 255, 255, 0.92);
        border: 1px solid rgba(0, 0, 0, 0.08);
        box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
        padding: 4px 6px;
    }
    [data-bs-theme="dark"] .chat-input-form:has(.w11-code-editor) .w11-input-toolbar .js-code-btn {
        background: rgba(40, 50, 75, 0.92);
        border-color: rgba(255, 255, 255, 0.1);
    }
    /* Code editor o'rta hajm — 30vh */
    .chat-input-form:has(.w11-code-editor) .w11-code-editor,
    .chat-input-form:has(.w11-code-editor) .w11-code-editor .w11-code-stage,
    .chat-input-form:has(.w11-code-editor) textarea.w11-code-textarea {
        min-height: 30vh !important;
        max-height: none !important;
        height: 30vh !important;
    }
    /* Code rejimida overlay (line-numbers ichidagi raqamlar bilan kollizyani oldini olish uchun
       textarea boshlang'ichida bo'sh joy qoldiramiz — tugma uchun) */
    .chat-input-form:has(.w11-code-editor) .w11-code-editor .w11-line-numbers .w11-ln-inner {
        padding-top: 36px !important;
    }
    .chat-input-form:has(.w11-code-editor) textarea.w11-code-textarea,
    .chat-input-form:has(.w11-code-editor) .w11-code-overlay {
        padding-top: 36px !important;
    }
}
/* ===== Chat composer — Telegram uslubi (matn tepada, tool ikonkalar pastda) ===== */
.chat-composer {
    display: flex;
    flex-direction: column;
    gap: 3px;
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #e6e9f0);
    border-radius: 18px;
    padding: 6px 8px 6px 12px;
    box-shadow: 0 1px 3px rgba(15, 23, 42, .06);
}
[data-bs-theme="dark"] .chat-composer {
    background: #1c2230;
    border-color: #2a3042;
}
.chat-composer__text.form-control {
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    padding: 4px 2px !important;
    border-radius: 0 !important;
    line-height: 1.4;
    min-height: 26px;
    max-height: 160px;
    overflow-y: auto;
    resize: none;
}
.chat-composer__bar {
    display: flex;
    align-items: center;
    gap: 4px;
}
.chat-composer__tools {
    display: flex;
    align-items: center;
    gap: 1px;
}
/* Tool ikonkalar (smaylik, code, fayl) — yumshoq ghost tugmalar */
.chat-composer__tools .btn,
.chat-tool-btn {
    width: 34px;
    height: 34px;
    min-height: 0;
    padding: 0;
    margin: 0;
    border: 0 !important;
    background: transparent !important;
    color: var(--tblr-muted, #6b7488) !important;
    border-radius: 50% !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: none !important;
    cursor: pointer;
    transition: background .15s ease, color .15s ease;
}
.chat-composer__tools .btn:hover,
.chat-tool-btn:hover {
    background: rgba(37, 99, 235, .10) !important;
    color: #2563eb !important;
}
.chat-tool-btn.has-file {
    background: rgba(37, 99, 235, .14) !important;
    color: #2563eb !important;
}
.chat-composer__tools .btn svg,
.chat-tool-btn svg { width: 18px; height: 18px; }

/* Yuborish tugmasi — to'q ko'k doira, o'ng chetda */
.chat-send-btn.btn {
    margin-left: auto;
    width: 40px;
    height: 40px;
    min-height: 0;
    padding: 0;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    background: linear-gradient(135deg, #2f7bff 0%, #2563eb 100%);
    border: 0;
    box-shadow: 0 2px 8px rgba(37, 99, 235, .30);
}
.chat-send-btn.btn:hover { filter: brightness(1.06); }
.chat-send-btn.btn .icon { width: 19px; height: 19px; }

/* Tanlangan fayl chipi (textarea va tool qatori orasida) */
.chat-composer__filename {
    align-items: center;
    gap: 8px;
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 10px;
    padding: 5px 8px 5px 10px;
    font-size: 12.5px;
    margin: 2px 0;
}
.chat-composer__filename .chat-fn-name {
    font-weight: 600;
    color: #2563eb;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 60%;
}
.chat-composer__filename .chat-fn-size { color: var(--tblr-muted, #8a93a8); }
.chat-composer__filename .chat-fn-remove {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: #8a93a8;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    width: 22px;
    height: 22px;
    border-radius: 50%;
}
.chat-composer__filename .chat-fn-remove:hover { background: rgba(0, 0, 0, .06); color: #e03131; }
[data-bs-theme="dark"] .chat-composer__filename { background: rgba(37, 99, 235, .14); border-color: rgba(37, 99, 235, .3); }

/* Biriktirilgan rasm/fayl — bubble ichida ko'rsatiladi */
.chat-att { display: block; margin-top: 6px; }
.chat-att--img img {
    max-width: 240px;
    max-height: 280px;
    width: auto;
    border-radius: 12px;
    display: block;
    cursor: zoom-in;
}
.chat-att--file {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    background: rgba(15, 23, 42, .05);
    border-radius: 10px;
    padding: 8px 12px;
    color: inherit;
    max-width: 260px;
}
.chat-att--file:hover { background: rgba(15, 23, 42, .09); }
.chat-msg.mine .chat-att--file { background: rgba(255, 255, 255, .16); }
.chat-msg.mine .chat-att--file:hover { background: rgba(255, 255, 255, .26); }
.chat-att__ico { flex: 0 0 auto; opacity: .85; display: inline-flex; }
.chat-att__meta { display: flex; flex-direction: column; min-width: 0; }
.chat-att__name { font-weight: 600; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-att__size { font-size: 11px; opacity: .7; }
[data-bs-theme="dark"] .chat-att--file { background: rgba(255, 255, 255, .06); }

/* Sana ajratuvchi (sticky emas — chat scroll bilan harakat qiladi) */
.chat-date-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    position: relative;
    background: rgba(83, 115, 151, .12);
    color: var(--tblr-muted, #6b7488);
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    padding: 4px 12px;
    border: 0;
    border-radius: 999px;
    margin: 12px auto !important;
    width: fit-content;
    max-width: 90%;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, transform .12s ease;
}
.chat-date-divider:hover {
    background: rgba(37, 99, 235, .16);
    color: #2563eb;
    transform: translateY(-1px);
}
.chat-date-divider .chat-date-ico { opacity: .8; }
[data-bs-theme="dark"] .chat-date-divider {
    background: rgba(255, 255, 255, .1);
}
[data-bs-theme="dark"] .chat-date-divider:hover {
    background: rgba(106, 130, 251, .2);
    color: #9db4ff;
}

/* ===== Pastga tushirish strelkasi (o'ngda pastda) ===== */
.chat-scroll-down {
    position: absolute;
    right: 16px;
    bottom: 84px;
    z-index: 40;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--tblr-bg-surface, #fff);
    color: #2563eb;
    box-shadow: 0 4px 14px rgba(0, 0, 0, .22);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px) scale(.9);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.chat-scroll-down.show {
    opacity: 1;
    visibility: visible;
    transform: none;
}
.chat-scroll-down:hover { background: #2563eb; color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .4); }
[data-bs-theme="dark"] .chat-scroll-down { background: #222838; color: #6ea8fe; }
[data-bs-theme="dark"] .chat-scroll-down:hover { background: #2563eb; color: #fff; }

/* ===== Kalendar popup (sanaga o'tish) ===== */
.chat-cal-overlay {
    position: fixed;
    inset: 0;
    z-index: 1095;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: chatSeenFade .15s ease;
}
.chat-cal {
    width: 320px;
    max-width: 100%;
    background: var(--tblr-bg-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    overflow: hidden;
    animation: chatSeenPop .18s ease;
}
[data-bs-theme="dark"] .chat-cal { background: #1c2230; }
.chat-cal__head {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--tblr-border-color, #e6e9f0);
}
[data-bs-theme="dark"] .chat-cal__head { border-bottom-color: #2a3042; }
.chat-cal__title { flex: 1 1 auto; text-align: center; font-weight: 700; font-size: 14.5px; }
.chat-cal__nav, .chat-cal__close {
    border: 0;
    background: transparent;
    color: var(--tblr-muted, #6b7488);
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.chat-cal__nav:hover { background: rgba(37, 99, 235, .12); color: #2563eb; }
.chat-cal__close { font-size: 22px; }
.chat-cal__close:hover { background: rgba(0, 0, 0, .07); color: #e03131; }
.chat-cal__wd, .chat-cal__grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 2px;
    padding: 6px 10px;
}
.chat-cal__wd { padding-bottom: 0; }
.chat-cal__wdc {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    color: var(--tblr-muted, #8a93a8);
    padding: 4px 0;
}
.chat-cal__grid { padding-top: 2px; padding-bottom: 12px; }
.chat-cal__cell { aspect-ratio: 1 / 1; }
.chat-cal__day {
    aspect-ratio: 1 / 1;
    border: 0;
    background: transparent;
    border-radius: 50%;
    font-size: 13px;
    color: var(--tblr-body-color, #1a2233);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s ease, color .12s ease;
}
[data-bs-theme="dark"] .chat-cal__day { color: #d7dbe6; }
.chat-cal__day:hover { background: rgba(37, 99, 235, .14); color: #2563eb; }
.chat-cal__day.is-today { font-weight: 700; box-shadow: inset 0 0 0 1.5px rgba(37, 99, 235, .5); }
.chat-cal__day.is-disabled { color: var(--tblr-disabled, #c3c9d4); cursor: default; pointer-events: none; }
[data-bs-theme="dark"] .chat-cal__day.is-disabled { color: #444c5e; }

/* ===== Kichik toast (chat) ===== */
.chat-toast {
    position: absolute;
    left: 50%;
    bottom: 90px;
    transform: translateX(-50%) translateY(10px);
    z-index: 60;
    background: rgba(15, 23, 42, .9);
    color: #fff;
    font-size: 13px;
    padding: 8px 16px;
    border-radius: 22px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .3);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
    white-space: nowrap;
}
.chat-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ==================================================================
   Chat — Telegram uslubidagi bubble dizayn
   - Mening xabarim (.mine) o'ngda ko'k bubble, avatar/ism ko'rsatilmaydi
   - Boshqalarniki (.other) chapda avatar + rangli ism bilan
   ================================================================== */
#chat-list { padding: 8px 6px 12px; }

.chat-msg {
    display: flex;
    align-items: flex-end;
    gap: 9px;
    padding: 1px 10px;
    margin: 5px 0;
}
.chat-msg.mine { flex-direction: row-reverse; }

.chat-msg__ava { flex: 0 0 auto; }
.chat-msg__ava .avatar { width: 38px; height: 38px; }

.chat-msg__body {
    display: flex;
    flex-direction: column;
    max-width: 88%;
    min-width: 0;
}
.chat-msg.mine .chat-msg__body { align-items: flex-end; }

.chat-bubble {
    position: relative;
    padding: 9px 14px 7px;
    border-radius: 18px;
    background: #fff;
    border: 1px solid rgba(15, 23, 42, .06);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .10);
    max-width: 100%;
    min-width: 76px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
}
.chat-msg.other .chat-bubble { border-bottom-left-radius: 6px; }
.chat-msg.mine  .chat-bubble {
    background: #5b82d6;                 /* soddaroq, yumshoq tekis ko'k (gradientsiz) */
    color: #fff;
    border-color: transparent;
    border-bottom-right-radius: 6px;
    box-shadow: 0 1px 3px rgba(91, 130, 214, .22);
}
[data-bs-theme="dark"] .chat-msg.mine .chat-bubble { background: #4d6fb8; box-shadow: none; }

.chat-msg__name {
    display: inline-block;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.15;
    margin-bottom: 3px;
    text-decoration: none;
}
.chat-msg__name:hover { text-decoration: underline; }
.chat-bubble .badge { vertical-align: middle; margin-left: 4px; }

.chat-msg__text { font-size: 14.5px; line-height: 1.45; }
.chat-msg__text a { color: #2563eb; text-decoration: underline; }
.chat-msg.mine .chat-msg__text a { color: #fff; }

.chat-msg__meta {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 3px;
    margin-top: 3px;
    font-size: 11px;
    line-height: 1;
}
.chat-msg__time { color: var(--tblr-muted, #8a93a8); white-space: nowrap; }
.chat-msg.mine .chat-msg__time { color: rgba(255, 255, 255, .8); }

.chat-msg__menu .btn {
    width: 24px;
    height: 24px;
    min-height: 0;
    padding: 0;
    opacity: .5;
}
.chat-msg__menu .btn:hover { opacity: 1; }
.chat-msg.mine .chat-msg__menu .btn { color: rgba(255, 255, 255, .85); }
.chat-msg__menu .icon { width: 16px; height: 16px; }

/* O'qildi/o'qilmadi ikonkasi (faqat o'z xabarlarda) */
.chat-read { display: inline-flex; align-items: center; }
.chat-msg.mine .chat-read.is-sent { color: rgba(255, 255, 255, .7); }
.chat-msg.mine .chat-read.is-read { color: #cfe6ff; }   /* o'qilgan — yumshoq moviy */

/* Desktop (≥992px) — yozishmalar va matnni ozgina kattaroq, qulayroq o'qish uchun */
@media (min-width: 992px) {
    .chat-msg__text { font-size: 16px; line-height: 1.5; }
    .chat-bubble { padding: 11px 18px 9px; border-radius: 20px; min-width: 90px; }
    .chat-msg.other .chat-bubble { border-bottom-left-radius: 7px; }
    .chat-msg.mine  .chat-bubble { border-bottom-right-radius: 7px; }
    .chat-msg__body { max-width: 72%; }
    .chat-msg__ava .avatar { width: 42px; height: 42px; }
    .chat-msg__name { font-size: 14px; }
    .chat-msg__meta { font-size: 11.5px; margin-top: 4px; }
    .chat-msg { gap: 11px; }
}

/* "Kim o'qigan" ko'zcha tugmasi */
.chat-seen-btn {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    border: 0;
    background: transparent;
    padding: 0 2px;
    cursor: pointer;
    color: rgba(255, 255, 255, .8);
    line-height: 1;
    border-radius: 8px;
    transition: background .15s ease, color .15s ease;
}
.chat-seen-btn:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.chat-seen-count { font-size: 10.5px; font-weight: 600; }

/* "Kim o'qigan" popup (overlay + oynacha) */
.chat-seen-overlay {
    position: fixed;
    inset: 0;
    z-index: 1090;
    background: rgba(15, 23, 42, .45);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    animation: chatSeenFade .15s ease;
}
@keyframes chatSeenFade { from { opacity: 0; } to { opacity: 1; } }
.chat-seen-popup {
    width: 340px;
    max-width: 100%;
    max-height: 70vh;
    background: var(--tblr-bg-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: chatSeenPop .18s ease;
}
@keyframes chatSeenPop { from { transform: translateY(10px) scale(.98); opacity: 0; } to { transform: none; opacity: 1; } }
[data-bs-theme="dark"] .chat-seen-popup { background: #1c2230; }
.chat-seen-popup__head {
    display: flex;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--tblr-border-color, #e6e9f0);
    flex: 0 0 auto;
}
[data-bs-theme="dark"] .chat-seen-popup__head { border-bottom-color: #2a3042; }
.chat-seen-popup__title { font-weight: 700; font-size: 14.5px; }
.chat-seen-popup__close {
    margin-left: auto;
    border: 0;
    background: transparent;
    color: var(--tblr-muted, #8a93a8);
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
}
.chat-seen-popup__close:hover { background: rgba(0, 0, 0, .07); color: #e03131; }
.chat-seen-popup__body { overflow-y: auto; padding: 6px; }
.chat-seen-loading { text-align: center; padding: 26px 0; }
.chat-seen-empty { text-align: center; color: var(--tblr-muted, #8a93a8); padding: 26px 12px; font-size: 13.5px; }
.chat-seen-user {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    transition: background .12s ease;
}
.chat-seen-user:hover { background: rgba(37, 99, 235, .08); }
.chat-seen-ava { position: relative; flex: 0 0 auto; }
.chat-seen-dot {
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #2fb344;
    box-shadow: 0 0 0 2px var(--tblr-bg-surface, #fff);
}
[data-bs-theme="dark"] .chat-seen-dot { box-shadow: 0 0 0 2px #1c2230; }
.chat-seen-info { display: flex; flex-direction: column; min-width: 0; }
.chat-seen-name { font-weight: 600; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-seen-time { font-size: 11.5px; color: var(--tblr-muted, #8a93a8); }

/* Code blok bubble ichida — to'liq kenglikni egallaydi */
.chat-msg__body:has(pre.w11-code) { max-width: 96%; }
.chat-bubble:has(pre.w11-code) { width: 100%; }
.chat-bubble pre.w11-code {
    margin: 6px 0 2px;
    max-width: 100%;
    width: auto;
    border-radius: 10px;
    box-sizing: border-box;
}
.chat-bubble pre.w11-code > code { width: 100%; box-sizing: border-box; }

/* Dark mode */
[data-bs-theme="dark"] .chat-bubble {
    background: #222838;
    border-color: rgba(255, 255, 255, .06);
    box-shadow: 0 1px 2px rgba(0, 0, 0, .3);
}
[data-bs-theme="dark"] .chat-msg.mine .chat-bubble {
    background: linear-gradient(135deg, #2f7bff 0%, #2563eb 100%);
}
[data-bs-theme="dark"] .chat-msg__time { color: #7a8499; }
[data-bs-theme="dark"] .chat-msg__text a { color: #6ea8fe; }

/* Mobil — bubble deyarli to'liq kenglik, avatar biroz kichikroq */
@media (max-width: 575.98px) {
    .chat-msg__body { max-width: 90%; }
    .chat-msg__ava .avatar { width: 34px; height: 34px; }
    .chat-msg__text { font-size: 14px; }
}

/* Profil rasmini yuklash — preview kartasi */
.photo-preview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    border: 1px solid var(--tblr-border-color, #e6e9f0);
    border-radius: 12px;
    background: rgba(83, 115, 151, .03);
}
[data-bs-theme="dark"] .photo-preview-card {
    background: rgba(255, 255, 255, .03);
    border-color: #2a3042;
}
.photo-preview-card img {
    flex: 0 0 auto;
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    background-color: rgba(83, 115, 151, .08);
}
.photo-preview-info {
    flex: 1 1 auto;
    min-width: 0;
}
.photo-preview-name {
    font-size: 14px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.photo-preview-status {
    font-size: 12px;
    margin-top: 4px;
    color: var(--tblr-muted, #6b7488);
}
.photo-preview-status.is-success { color: #2fb344; }
.photo-preview-status.is-error { color: #d6336c; }

/* /code/ maqolasi uchun rating widget */
.code-rating-widget {
    background: linear-gradient(135deg, rgba(106,130,251,.06) 0%, rgba(79,109,240,.04) 100%);
    border: 1px solid rgba(106,130,251,.15);
    border-radius: 14px;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
}
[data-bs-theme="dark"] .code-rating-widget {
    background: linear-gradient(135deg, rgba(106,130,251,.08) 0%, rgba(79,109,240,.04) 100%);
    border-color: rgba(106,130,251,.2);
}
.code-rating-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .65rem;
}
.code-rating-label {
    font-weight: 600;
    color: var(--tblr-body-color);
}
.code-rating-summary {
    display: inline-flex;
    align-items: baseline;
    gap: .35rem;
}
.code-rating-avg {
    font-size: 1.4rem;
    font-weight: 700;
    color: #4f6df0;
    line-height: 1;
}
.code-rating-stars {
    display: flex;
    gap: 4px;
}
.code-rating-star {
    border: 0;
    background: transparent;
    padding: 4px;
    cursor: pointer;
    color: rgba(83,115,151,.25);
    transition: transform .15s ease, color .15s ease;
}
.code-rating-star:hover:not(:disabled) {
    transform: scale(1.15);
    color: #ffa500;
}
.code-rating-star:disabled {
    cursor: not-allowed;
    opacity: .65;
}
.code-rating-star.is-filled,
.code-rating-star.is-hover {
    color: #ffa500;
}
.code-rating-star.is-filled svg path:last-child,
.code-rating-star.is-hover svg path:last-child {
    fill: #ffa500;
}
.code-rating-star.is-pulse {
    animation: ratingPulse .5s ease;
}
@keyframes ratingPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* AJAX fayl yuklash drop-zone */
.ajax-dropzone {
    position: relative;
    border: 2px dashed #d0d6e0;
    border-radius: 14px;
    padding: 28px 20px;
    text-align: center;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease;
    background: rgba(83, 115, 151, .03);
}
.ajax-dropzone:hover,
.ajax-dropzone.is-drag {
    border-color: #4f6df0;
    background-color: rgba(106, 130, 251, .07);
}
.ajax-dropzone.is-disabled {
    opacity: .55;
    cursor: not-allowed;
    pointer-events: none;
}
.ajax-dropzone__inner svg {
    color: #6b7488;
    margin-bottom: 8px;
}
.ajax-dropzone__title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
}
.ajax-dropzone__sub {
    font-size: 12px;
    color: #6b7488;
    margin-top: 2px;
}
.ajax-dropzone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}
[data-bs-theme="dark"] .ajax-dropzone {
    border-color: #2a3042;
    background: rgba(255, 255, 255, .03);
}
[data-bs-theme="dark"] .ajax-dropzone__title { color: #e6e9f0; }

.ajax-uploaded-list {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.ajax-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid #e6e9f0;
    border-radius: 10px;
    background: #fff;
}
.ajax-item.is-success { border-color: #2fb344; background: rgba(47, 179, 68, .05); }
.ajax-item.is-error { border-color: #d6336c; background: rgba(214, 51, 108, .05); }
[data-bs-theme="dark"] .ajax-item { background: #1a1f2e; border-color: #2a3042; }
[data-bs-theme="dark"] .ajax-item.is-success { background: rgba(47, 179, 68, .12); }
[data-bs-theme="dark"] .ajax-item.is-error { background: rgba(214, 51, 108, .12); }
.ajax-item__icon { color: #5a657f; flex-shrink: 0; }
.ajax-item__info { flex: 1 1 auto; min-width: 0; }
.ajax-item__name { font-size: 13.5px; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ajax-item__meta { display: flex; gap: 10px; font-size: 12px; color: #6b7488; margin-top: 2px; }
.ajax-item__bar {
    height: 4px;
    background: #eef0f6;
    border-radius: 999px;
    overflow: hidden;
    margin-top: 6px;
}
.ajax-item__bar-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #6a82fb, #4f6df0);
    transition: width .15s ease;
}
.ajax-item.is-success .ajax-item__bar-fill { background: #2fb344; }
.ajax-item.is-error .ajax-item__bar-fill { background: #d6336c; }
[data-bs-theme="dark"] .ajax-item__bar { background: #2a3042; }

/* Sidebar trigger tugmasi */
.sidebar-toggle {
    border: 0;
    background: transparent;
    color: var(--tblr-body-color);
    line-height: 1;
}
.sidebar-toggle:hover,
.sidebar-toggle:focus {
    background-color: rgba(0, 0, 0, .055);
    color: var(--tblr-body-color);
}
[data-bs-theme="dark"] .sidebar-toggle:hover,
[data-bs-theme="dark"] .sidebar-toggle:focus {
    background-color: rgba(255, 255, 255, .07);
}

/* Ketma-ket bir foydalanuvchidan kelgan postlar — vizual guruhlash */
.list-group-item-grouped {
    padding-top: .35rem !important;
    padding-bottom: .5rem !important;
    border-top: 0 !important;
}
.list-group-item-grouped > .row {
    --tblr-gutter-y: 0;
}
/* Yopiq mavzu bo'yog'i guruhlanganda ham saqlanadi */
.list-group-item-grouped.bg-red-lt {
    background-color: var(--tblr-red-lt) !important;
}

/* ============================================================
   Mobil navbar — o'ng tomondan suriluvchi off-canvas drawer
   (toggle tugmasi navbarning o'ng tomonida joylashgan)
   ============================================================ */

/* ---------- Mobil (<768px) ---------- */
@media (max-width: 767.98px) {

    /* Drawer konteyneri */
    .navbar-offcanvas {
        width: 290px;
        max-width: 85vw;
        box-shadow: -4px 0 24px rgba(0, 0, 0, .18);
    }

    /* Header (logo + yopish tugmasi) */
    .navbar-offcanvas .offcanvas-header {
        padding: 1rem 1.25rem;
        border-bottom: 1px solid var(--tblr-border-color);
    }
    .navbar-offcanvas .offcanvas-header .navbar-brand {
        margin: 0;
        padding: 0;
        text-decoration: none;
    }
    .navbar-offcanvas .offcanvas-header .navbar-brand-text {
        font-size: 1.125rem;
        font-weight: 700;
        letter-spacing: .02em;
    }

    /* Body */
    .navbar-offcanvas .offcanvas-body {
        padding: .75rem;
    }

    /* Nav ro'yxati */
    .navbar-offcanvas .navbar-nav {
        flex-direction: column;
        gap: .15rem;
        width: 100%;
    }
    .navbar-offcanvas .navbar-nav .nav-item {
        width: 100%;
    }

    /* Nav-link — kengroq tap target, chiroyli hover */
    .navbar-offcanvas .navbar-nav .nav-link {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .7rem .85rem;
        border-radius: .5rem;
        color: var(--tblr-body-color);
        font-weight: 500;
        line-height: 1.25;
        transition: background-color .15s ease, color .15s ease;
    }
    .navbar-offcanvas .navbar-nav .nav-link:hover,
    .navbar-offcanvas .navbar-nav .nav-link:focus {
        background-color: rgba(0, 0, 0, .055);
        color: var(--tblr-body-color);
    }
    [data-bs-theme="dark"] .navbar-offcanvas .navbar-nav .nav-link:hover,
    [data-bs-theme="dark"] .navbar-offcanvas .navbar-nav .nav-link:focus {
        background-color: rgba(255, 255, 255, .07);
    }

    /* Aktiv element */
    .navbar-offcanvas .navbar-nav .nav-item.active > .nav-link,
    .navbar-offcanvas .navbar-nav .nav-link.active {
        background-color: var(--tblr-primary-lt, rgba(32, 107, 196, .14));
        color: var(--tblr-primary, #206bc4);
    }
    .navbar-offcanvas .navbar-nav .nav-item.active > .nav-link .nav-link-icon,
    .navbar-offcanvas .navbar-nav .nav-link.active .nav-link-icon {
        color: var(--tblr-primary, #206bc4);
    }

    /* Ikonkalar — drawer'da albatta ko'rinsin */
    .navbar-offcanvas .nav-link .nav-link-icon {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
        width: 1.5rem;
        height: 1.5rem;
        flex-shrink: 0;
        color: var(--tblr-secondary, #6c757d);
    }
    .navbar-offcanvas .nav-link-icon .icon {
        width: 1.25rem;
        height: 1.25rem;
    }

    /* Nav-link-title kengayib bo'shliq egallasin (badge'ni o'ng chetga itaradi) */
    .navbar-offcanvas .nav-link .nav-link-title {
        flex: 1 1 auto;
        min-width: 0;
    }

    /* Badge — o'ng chetga */
    .navbar-offcanvas .nav-link .badge {
        margin-left: auto;
        flex-shrink: 0;
    }

    /* "Yana" dropdown — chevron va xulqi */
    .navbar-offcanvas .nav-item.dropdown .dropdown-toggle::after {
        margin-left: auto;
        transition: transform .2s ease;
    }
    .navbar-offcanvas .nav-item.dropdown.show > .dropdown-toggle::after {
        transform: rotate(180deg);
    }

    /* "Yana" pastki ro'yxat — tekis va ichkariga surilgan */
    .navbar-offcanvas .dropdown-menu {
        position: static !important;
        float: none;
        border: 0;
        box-shadow: none;
        padding: .15rem 0 .25rem 0;
        margin: 0;
        background: transparent;
        transform: none !important;
        inset: auto !important;
        min-width: 0;
    }
    .navbar-offcanvas .dropdown-menu-columns,
    .navbar-offcanvas .dropdown-menu-column {
        display: block !important;
        min-width: 0 !important;
        padding: 0 !important;
    }

    /* Dropdown elementlari */
    .navbar-offcanvas .dropdown-item {
        display: flex;
        align-items: center;
        gap: .75rem;
        padding: .55rem .85rem .55rem 2rem;
        border-radius: .375rem;
        font-size: .9rem;
        color: var(--tblr-body-color);
        white-space: normal;
    }
    .navbar-offcanvas .dropdown-item:hover,
    .navbar-offcanvas .dropdown-item:focus {
        background-color: rgba(0, 0, 0, .055);
        color: var(--tblr-body-color);
    }
    [data-bs-theme="dark"] .navbar-offcanvas .dropdown-item:hover,
    [data-bs-theme="dark"] .navbar-offcanvas .dropdown-item:focus {
        background-color: rgba(255, 255, 255, .07);
    }

    /* Dropdown ikonkalari — har bir item'da ko'rinsin (d-none o'chiriladi) */
    .navbar-offcanvas .dropdown-item .dropdown-item-icon {
        display: inline-flex !important;
        width: 1.15rem;
        height: 1.15rem;
        margin: 0;
        flex-shrink: 0;
        opacity: .75;
        color: var(--tblr-secondary, #6c757d);
    }
}

/* ---------- Desktop (≥768px) — off-canvas xulqini bekor qilish ---------- */
@media (min-width: 768px) {
    .navbar-offcanvas {
        position: static !important;
        z-index: auto !important;
        visibility: visible !important;
        transform: none !important;
        background: transparent !important;
        border: 0 !important;
        box-shadow: none !important;
        width: auto !important;
        height: auto !important;
        flex-grow: 1;
        display: flex !important;
    }

    .navbar-offcanvas .offcanvas-body {
        padding: 0;
        overflow: visible;
    }

    /* Desktop'da backdrop bo'lmasin */
    body > .offcanvas-backdrop {
        display: none !important;
    }
}

/* ===== Shaxsiy fotosuratlar — AJAX viewer (lightbox) ===== */
.photo-album .js-photo { transition: transform .15s ease; cursor: zoom-in; }
.photo-album .js-photo:hover { transform: scale(1.05); }

body.photo-viewer-open { overflow: hidden; }
.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(8, 12, 20, .92);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 56px 16px 92px;
}
.photo-viewer.show { display: flex; animation: chatSeenFade .18s ease; }
.photo-viewer__stage { max-width: 100%; max-height: 100%; display: flex; align-items: center; justify-content: center; }
.photo-viewer__img {
    max-width: 100%;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 12px 50px rgba(0, 0, 0, .5);
    object-fit: contain;
}
.photo-viewer__close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 26px;
    line-height: 1;
    cursor: pointer;
}
.photo-viewer__close:hover { background: rgba(255, 255, 255, .22); }
.photo-viewer__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .1);
    color: #fff;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
}
.photo-viewer__nav:hover { background: rgba(255, 255, 255, .2); }
.photo-viewer__prev { left: 14px; }
.photo-viewer__next { right: 14px; }
.photo-viewer__bar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: linear-gradient(0deg, rgba(0, 0, 0, .55), transparent);
}
.photo-viewer__act {
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    padding: 9px 18px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease;
}
.photo-viewer__act:hover { background: rgba(255, 255, 255, .28); }
.photo-viewer__act.is-danger { background: rgba(224, 49, 49, .85); }
.photo-viewer__act.is-danger:hover { background: #e03131; }

/* ===== Telegram-uslub: avatar ichidagi album + viewer sana/info ===== */
.tg-avatar.js-avatar-album { position: relative; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.tg-avatar.js-avatar-album:hover { transform: scale(1.04); box-shadow: 0 0 0 3px rgba(37, 99, 235, .45); }
.tg-avatar .tg-avatar-count {
    position: absolute; right: 0; bottom: 0;
    min-width: 20px; height: 20px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    background: #2563eb; color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
    border-radius: 999px; border: 2px solid var(--tblr-card-bg, #fff);
    box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
}
.photo-viewer__bar { flex-direction: column; align-items: center; }
.photo-viewer__info { display: flex; flex-direction: column; align-items: center; gap: 1px; color: #fff; }
.photo-viewer__date { font-size: 13.5px; font-weight: 600; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.photo-viewer__count { font-size: 11.5px; opacity: .75; }
.photo-viewer__acts { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.photo-viewer__loading { color: #fff; padding: 8px; }

.photo-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translateX(-50%) translateY(10px);
    z-index: 1110;
    background: rgba(15, 23, 42, .92);
    color: #fff;
    padding: 9px 18px;
    border-radius: 22px;
    font-size: 13.5px;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .3);
    opacity: 0;
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: none;
}
.photo-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.photo-toast.is-err { background: #c92a2a; }

/* ===== Profil — Reyting bloki (zamonaviy) ===== */
.prof-rating {
    background: var(--tblr-bg-surface, #fff);
    border: 1px solid var(--tblr-border-color, #eef0f4);
    border-radius: 14px;
    padding: 14px 16px;
}
[data-bs-theme="dark"] .prof-rating { background: rgba(255, 255, 255, .03); border-color: #2a3042; }
.prof-rating__top { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 9px; }
.prof-rating__title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .8px; color: var(--tblr-muted, #8a93a8); }
.prof-rating__pct { font-size: 22px; font-weight: 800; line-height: 1; }
.prof-rating__pct.is-high { color: #2fb344; }
.prof-rating__pct.is-mid  { color: #f59f00; }
.prof-rating__pct.is-low  { color: #e03131; }
.prof-rating__track { height: 8px; border-radius: 999px; background: rgba(127, 127, 127, .15); overflow: hidden; }
.prof-rating__fill { height: 100%; border-radius: 999px; transition: width .5s ease; }
.prof-rating__fill.is-high { background: linear-gradient(90deg, #2fb344, #37c64b); }
.prof-rating__fill.is-mid  { background: linear-gradient(90deg, #f59f00, #ffc94d); }
.prof-rating__fill.is-low  { background: linear-gradient(90deg, #e03131, #ff6b6b); }
.prof-rating__stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; }
.prof-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 11px 6px;
    border-radius: 12px;
    background: rgba(127, 127, 127, .05);
    text-align: center;
}
.prof-stat__ico { display: inline-flex; color: var(--tblr-muted, #8a93a8); margin-bottom: 2px; }
.prof-stat__num { font-size: 20px; font-weight: 800; line-height: 1; color: var(--tblr-body-color, #1a2233); }
.prof-stat__label { font-size: 11.5px; font-weight: 600; color: var(--tblr-muted, #8a93a8); }
.prof-stat--up .prof-stat__ico, .prof-stat--up .prof-stat__num { color: #2fb344; }
.prof-stat--down .prof-stat__ico, .prof-stat--down .prof-stat__num { color: #e03131; }
[data-bs-theme="dark"] .prof-stat { background: rgba(255, 255, 255, .04); }
[data-bs-theme="dark"] .prof-stat__num { color: #e7eaf0; }

/* ===== Reyting — ikonka amallari qatori ===== */
.prof-rating__actions { display: flex; align-items: center; gap: 6px; margin-top: 12px; }
.prof-ract {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid var(--tblr-border-color, #e6e9f0);
    background: transparent;
    color: var(--tblr-muted, #6b7488);
    border-radius: 10px;
    padding: 6px 10px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.prof-ract:hover { background: rgba(37, 99, 235, .08); color: #2563eb; border-color: rgba(37, 99, 235, .3); }
.prof-ract.is-up { color: #2fb344; }
.prof-ract.is-up:hover { background: rgba(47, 179, 68, .1); border-color: rgba(47, 179, 68, .4); color: #2fb344; }
.prof-ract.is-down { color: #e03131; }
.prof-ract.is-down:hover { background: rgba(224, 49, 49, .1); border-color: rgba(224, 49, 49, .4); color: #e03131; }
[data-bs-theme="dark"] .prof-ract { border-color: #2a3042; }

/* Reyting oynachasi (modal) */
.prate-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 23, 42, .5);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity .18s ease;
}
.prate-modal.show { opacity: 1; }
.prate-box {
    width: 360px;
    max-width: 100%;
    max-height: 76vh;
    background: var(--tblr-bg-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, .35);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: translateY(12px) scale(.98);
    transition: transform .2s ease;
}
.prate-modal.show .prate-box { transform: none; }
[data-bs-theme="dark"] .prate-box { background: #1c2230; }
.prate-head { display: flex; align-items: center; padding: 13px 16px; border-bottom: 1px solid var(--tblr-border-color, #eef0f4); flex: 0 0 auto; }
[data-bs-theme="dark"] .prate-head { border-bottom-color: #2a3042; }
.prate-title { font-weight: 700; font-size: 15px; }
.prate-close { margin-left: auto; border: 0; background: transparent; color: var(--tblr-muted, #8a93a8); font-size: 24px; line-height: 1; cursor: pointer; width: 30px; height: 30px; border-radius: 50%; }
.prate-close:hover { background: rgba(0, 0, 0, .07); color: #e03131; }
.prate-body { overflow-y: auto; padding: 8px; }
.prate-loading, .prate-empty { text-align: center; padding: 26px 12px; color: var(--tblr-muted, #8a93a8); font-size: 13.5px; }

.prate-srow { display: flex; align-items: center; justify-content: space-between; padding: 11px 12px; border-radius: 10px; }
.prate-srow + .prate-srow { margin-top: 2px; }
.prate-srow:nth-child(odd) { background: rgba(127, 127, 127, .05); }
.prate-slabel { color: var(--tblr-muted, #6b7488); font-size: 13.5px; }
.prate-sval { font-weight: 800; font-size: 16px; }
.prate-sval.up { color: #2fb344; }
.prate-sval.down { color: #e03131; }

.prate-formula { background: rgba(37, 99, 235, .07); border-radius: 10px; padding: 10px 12px; font-size: 13.5px; }
.prate-calc { text-align: center; font-size: 15px; margin: 10px 2px; color: var(--tblr-body-color, #1a2233); }
[data-bs-theme="dark"] .prate-calc { color: #e7eaf0; }
.prate-tips { margin: 6px 0 4px; padding-left: 18px; font-size: 13px; color: var(--tblr-muted, #6b7488); }
.prate-tips li { margin-bottom: 5px; }
.prate-tips b.up, .prate-formula b.up { color: #2fb344; }
.prate-tips b.down, .prate-formula b.down { color: #e03131; }

.prate-user { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; text-decoration: none; color: inherit; }
.prate-user:hover { background: rgba(37, 99, 235, .07); }
.prate-uname { flex: 1 1 auto; min-width: 0; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.prate-vbadges { display: inline-flex; gap: 4px; flex: 0 0 auto; }
.prate-vb { font-size: 12px; font-weight: 700; padding: 2px 7px; border-radius: 999px; }
.prate-vb.up { background: rgba(47, 179, 68, .14); color: #2fb344; }
.prate-vb.down { background: rgba(224, 49, 49, .14); color: #e03131; }

/* Reyting — ovoz berilgan holat (foydalanuvchiga to'g'ridan-to'g'ri ovoz) */
.prof-ract.js-rvote { user-select: none; }
.prof-ract.is-up.is-voted { background: rgba(47, 179, 68, .16); border-color: rgba(47, 179, 68, .55); color: #2fb344; }
.prof-ract.is-down.is-voted { background: rgba(224, 49, 49, .16); border-color: rgba(224, 49, 49, .55); color: #e03131; }
.prof-ract.is-voted svg { fill: currentColor; }
.prof-ract.is-up.is-voted svg { fill: rgba(47, 179, 68, .25); }
.prof-ract.is-down.is-voted svg { fill: rgba(224, 49, 49, .25); }
.prof-ract:active { transform: scale(.94); }

/* Reyting logika oynachasi — bo'limlar */
.prate-note { font-size: 12px; color: var(--tblr-muted, #8a93a8); text-align: center; margin: -2px 2px 8px; }
.prate-sec { margin-top: 12px; padding-top: 11px; border-top: 1px solid var(--tblr-border-color, #eef0f4); }
[data-bs-theme="dark"] .prate-sec { border-top-color: #2a3042; }
.prate-sec__h { font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--tblr-body-color, #1a2233); }
[data-bs-theme="dark"] .prate-sec__h { color: #e7eaf0; }
.prate-p { font-size: 13px; line-height: 1.5; color: var(--tblr-muted, #6b7488); margin: 0; }
.prate-body .prate-tips { margin: 0; padding-left: 18px; }

/* Statistika — profil/post ovozlari taqsimoti (sub qatorlar) */
.prate-body .prate-srow { background: rgba(127, 127, 127, .045); }
.prate-srow--sub { background: transparent !important; padding: 5px 12px 5px 22px !important; margin-top: 0 !important; }
.prate-srow--sub .prate-slabel { font-size: 12.5px; }
.prate-sval-sm { font-weight: 700; font-size: 13.5px; color: var(--tblr-muted, #8a93a8); }

/* ===== Profil — dastxat (status) zamonaviy ===== */
.prof-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13.5px;
    line-height: 1.4;
    color: var(--tblr-body-color, #1a2233);
    max-width: 100%;
}
.prof-status svg { opacity: .6; flex: 0 0 auto; }
.prof-status[onclick] { cursor: pointer; border-radius: 8px; padding: 3px 8px; margin-left: -8px; transition: background .15s ease, color .15s ease; }
.prof-status[onclick]:hover { background: rgba(37, 99, 235, .08); color: #2563eb; }
.prof-status[onclick]:hover svg { opacity: 1; }
.prof-status.is-empty { color: var(--tblr-muted, #8a93a8); font-style: italic; }
.prof-status span { overflow: hidden; text-overflow: ellipsis; }
.prof-status-edit { margin-top: 8px; }
.prof-status-form { display: flex; flex-direction: column; gap: 8px; max-width: 380px; }
.prof-status-form .form-control { border-radius: 10px; }
.prof-status-actions { display: flex; gap: 6px; align-items: center; }

/* ===== Profil tablari — zamonaviy segment ===== */
#prof-tabs.prof-tabbar {
    display: flex;
    gap: 3px;
    list-style: none;
    margin: 10px 0 2px;
    padding: 4px;
    background: rgba(127, 127, 127, .07);
    border-radius: 13px;
    border: 0 !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
#prof-tabs.prof-tabbar::-webkit-scrollbar { display: none; }
#prof-tabs.prof-tabbar .nav-item { flex: 1 1 0; min-width: max-content; }
#prof-tabs.prof-tabbar .nav-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: 0 !important;
    border-radius: 10px;
    padding: 8px 12px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--tblr-muted, #6b7488);
    white-space: nowrap;
    transition: background .15s ease, color .15s ease, box-shadow .15s ease;
}
#prof-tabs.prof-tabbar .nav-link:hover { color: var(--tblr-body-color, #1a2233); }
#prof-tabs.prof-tabbar .nav-link.active {
    background: var(--tblr-bg-surface, #fff);
    color: #2563eb;
    box-shadow: 0 2px 8px rgba(20, 30, 60, .12);
}
#prof-tabs.prof-tabbar .nav-link .badge { font-size: 11px; font-weight: 700; padding: 2px 6px; border-radius: 999px; }
[data-bs-theme="dark"] #prof-tabs.prof-tabbar { background: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] #prof-tabs.prof-tabbar .nav-link.active { background: #222838; color: #6ea8fe; }

/* ===== Navbar bildirishnoma dropdown (Umumiy + Shaxsiy) ===== */
.ntfd-wrap { position: relative; }
.ntfd-backdrop { position: fixed; inset: 0; z-index: 1090; background: rgba(15, 23, 42, .4); opacity: 0; transition: opacity .2s ease; }
.ntfd-backdrop.show { opacity: 1; }
@media (min-width: 576px) { .ntfd-backdrop { display: none !important; } }

.ntfd-panel {
    position: fixed;
    top: 60px;
    right: 12px;
    width: 400px;
    max-width: calc(100vw - 24px);
    background: var(--tblr-bg-surface, #fff);
    border-radius: 16px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .28);
    z-index: 1095;
    display: flex;
    flex-direction: column;
    max-height: 72vh;
    overflow: hidden;
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity .18s ease, transform .18s ease;
}
.ntfd-panel.show { opacity: 1; transform: none; }
[data-bs-theme="dark"] .ntfd-panel { background: #1c2230; }
.ntfd-phead { display: flex; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--tblr-border-color, #eef0f4); flex: 0 0 auto; }
[data-bs-theme="dark"] .ntfd-phead { border-bottom-color: #2a3042; }
.ntfd-ptitle { font-weight: 700; font-size: 15px; }
.ntfd-pclose { margin-left: auto; border: 0; background: transparent; color: var(--tblr-muted, #8a93a8); cursor: pointer; width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; }
.ntfd-pclose:hover { background: rgba(0, 0, 0, .07); color: #e03131; }
.ntfd-content { overflow-y: auto; flex: 1 1 auto; }
.ntfd-loading, .ntfd-empty { text-align: center; padding: 28px 14px; color: var(--tblr-muted, #8a93a8); font-size: 13.5px; }
.ntfd-pfoot { flex: 0 0 auto; text-align: center; padding: 11px; border-top: 1px solid var(--tblr-border-color, #eef0f4); }
[data-bs-theme="dark"] .ntfd-pfoot { border-top-color: #2a3042; }
.ntfd-pfoot a { font-weight: 600; font-size: 13.5px; color: #2563eb; text-decoration: none; }
.ntfd-pfoot a:hover { text-decoration: underline; }

.ntfd-tabs { display: flex; gap: 3px; padding: 8px 8px 0; }
.ntfd-tab {
    flex: 1 1 0;
    border: 0;
    background: transparent;
    cursor: pointer;
    padding: 9px 8px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13.5px;
    color: var(--tblr-muted, #6b7488);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: background .15s ease, color .15s ease;
}
.ntfd-tab:hover { background: rgba(127, 127, 127, .06); }
.ntfd-tab.active { background: rgba(37, 99, 235, .1); color: #2563eb; }
.ntfd-badge { background: #e5484d; color: #fff; font-size: 11px; font-weight: 700; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; border-radius: 999px; text-align: center; }

.ntfd-pane { padding: 6px; }
.ntfd-item { display: flex; align-items: center; gap: 11px; padding: 10px; border-radius: 10px; text-decoration: none; color: inherit; transition: background .12s ease; }
.ntfd-item + .ntfd-item { border-top: 1px solid var(--tblr-border-color, #f1f3f7); }
[data-bs-theme="dark"] .ntfd-item + .ntfd-item { border-top-color: #262d3d; }
a.ntfd-item:hover { background: rgba(37, 99, 235, .06); }
.ntfd-ava { flex: 0 0 auto; width: 40px; height: 40px; border-radius: 50%; background-size: cover; background-position: center; background-color: #eef1f6; box-shadow: 0 0 0 1px rgba(20, 30, 60, .06); }
.ntfd-body { flex: 1 1 auto; min-width: 0; }
.ntfd-text { font-size: 13.5px; line-height: 1.4; color: var(--tblr-body-color, #1a2233); }
[data-bs-theme="dark"] .ntfd-text { color: #e7eaf0; }
.ntfd-text a { color: #2563eb; font-weight: 600; text-decoration: none; }
.ntfd-text b { font-weight: 700; }
.ntfd-time { font-size: 11.5px; color: var(--tblr-muted, #8a93a8); margin-top: 2px; }

/* ===== Dropdown: yangilar tepada + "o'qildi" tugmalari ===== */
.ntfd-item { position: relative; }
.ntfd-item:hover { background: rgba(37, 99, 235, .06); }
.ntfd-item__link { position: absolute; inset: 0; z-index: 1; border-radius: 10px; }
.ntfd-item .ntfd-ava, .ntfd-item .ntfd-body { position: relative; z-index: 0; }

/* yangi (o'qilmagan) element */
.ntfd-item.is-new { background: rgba(37, 99, 235, .07); }
.ntfd-item.is-new:hover { background: rgba(37, 99, 235, .11); }
.ntfd-item.is-new::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 3px; background: #2563eb; z-index: 2; }
[data-bs-theme="dark"] .ntfd-item.is-new { background: rgba(56, 116, 255, .14); }

/* "yangi" yorlig'i (umumiy) */
.ntfd-tag { display: inline-block; margin-left: 6px; padding: 1px 7px; font-size: 10px; font-weight: 700; line-height: 1.5; color: #fff; background: #2563eb; border-radius: 20px; vertical-align: middle; }

/* har bir elementdagi "o'qildi" tugmasi */
.ntfd-read { position: relative; z-index: 3; flex: 0 0 auto; align-self: center; border: 1px solid rgba(37, 99, 235, .35); background: #fff; color: #2563eb; font-size: 11.5px; font-weight: 600; padding: 4px 10px; border-radius: 8px; cursor: pointer; transition: background .12s ease, color .12s ease; white-space: nowrap; }
.ntfd-read:hover { background: #2563eb; color: #fff; }
[data-bs-theme="dark"] .ntfd-read { background: #1a2233; border-color: rgba(56, 116, 255, .5); color: #6ea0ff; }
.ntfd-done { position: relative; z-index: 3; flex: 0 0 auto; align-self: center; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; color: #16a34a; white-space: nowrap; }
.ntfd-done::before { content: "✓"; font-size: 12px; }

/* "Hammasini o'qilgan qilish" sarlavhasi */
.ntfd-allread { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 12px; margin: -2px 0 6px; background: rgba(37, 99, 235, .08); border: 1px solid rgba(37, 99, 235, .18); border-radius: 10px; }
.ntfd-allread__cnt { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 700; color: #2563eb; }
.ntfd-allread button { border: none; background: none; padding: 0; color: #2563eb; font-size: 12px; font-weight: 600; cursor: pointer; text-decoration: underline; white-space: nowrap; }
.ntfd-allread button:hover { opacity: .8; }
[data-bs-theme="dark"] .ntfd-allread { background: rgba(56, 116, 255, .15); border-color: rgba(56, 116, 255, .3); }
[data-bs-theme="dark"] .ntfd-allread__cnt, [data-bs-theme="dark"] .ntfd-allread button { color: #6ea0ff; }

/* Mobil — pastdan chiqadigan sheet */
@media (max-width: 575.98px) {
    .ntfd-panel {
        position: fixed !important;
        top: auto !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: 82vh;
        border-radius: 18px 18px 0 0;
        transform: translateY(100%);
    }
    .ntfd-panel.show { transform: none; }
    body.ntfd-open { overflow: hidden; }
}

/* MUHIM: hidden atributi display:flex/fixed ni bekor qilmasin
   (aks holda yopiq panel ko'rinmas holda bosishlarni to'sadi) */
.ntfd-panel[hidden], .ntfd-backdrop[hidden] { display: none !important; }

/* ===================================================================
   Bildirishnomalar sahifasi — uzfor.css da (kafolatli yangi yuklanadi)
   =================================================================== */
.ntf-page { overflow: hidden; border-radius: 16px; }
.ntf-page__head { display: flex; align-items: center; gap: 9px; padding: 14px 16px 8px; }
.ntf-page__ico { color: #2563eb; flex: 0 0 auto; }
.ntf-page__title { margin: 0; font-size: 17px; font-weight: 700; }

.ntf-tabs { display: flex; gap: 4px; margin: 0 12px 8px; background: rgba(127, 127, 127, .07); padding: 4px; border-radius: 13px; }
.ntf-tab { flex: 1 1 0; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 10px; border-radius: 10px; font-weight: 600; font-size: 14px; color: var(--tblr-muted, #6b7488); text-decoration: none !important; transition: background .15s, color .15s, box-shadow .15s; }
.ntf-tab:hover { color: var(--tblr-body-color, #1a2233); }
.ntf-tab.active { background: var(--tblr-bg-surface, #fff); color: #2563eb; box-shadow: 0 2px 8px rgba(20, 30, 60, .1); }
.ntf-badge { min-width: 20px; height: 20px; padding: 0 6px; background: #e5484d; color: #fff; font-size: 11.5px; font-weight: 700; line-height: 20px; text-align: center; border-radius: 999px; }

.ntf-list { display: flex; flex-direction: column; }
.ntf-list .ntf-item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none !important;
    color: inherit;
    position: relative;
    transition: background .15s ease;
}
.ntf-list .ntf-item + .ntf-item { border-top: 1px solid var(--tblr-border-color, #f1f3f7); }
a.ntf-item:hover { background: rgba(37, 99, 235, .05); }
.ntf-list .ntf-item > .ntf-ava {
    display: block !important;
    flex: 0 0 auto !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
    background-color: #eef1f6;
    box-shadow: 0 0 0 1px rgba(20, 30, 60, .06);
}
.ntf-list .ntf-item > .ntf-item-body { flex: 1 1 auto !important; min-width: 0 !important; }
.ntf-item-text { display: block; font-size: 14px; line-height: 1.4; color: var(--tblr-body-color, #1a2233); word-break: break-word; }
.ntf-item-text a { color: #2563eb; font-weight: 700; text-decoration: none; }
.ntf-item-text b { font-weight: 700; }
.ntf-item-time { display: block; font-size: 12px; margin-top: 2px; color: var(--tblr-muted, #8a93a8); }
.ntf-item--static { cursor: default; }
.ntf-adm { color: #2563eb; text-decoration: none; }
.ntf-adm:hover { text-decoration: underline; }

.ntf-unread { background: rgba(37, 99, 235, .06); }
.ntf-unread::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #2563eb; }
.ntf-dot { flex: 0 0 auto; width: 9px; height: 9px; border-radius: 50%; background: #2563eb; box-shadow: 0 0 0 4px rgba(37, 99, 235, .14); }

.ntf-empty { text-align: center; padding: 40px 24px; }
.ntf-empty-title { font-weight: 700; font-size: 15px; }
.ntf-empty .text-muted { font-size: 13px; max-width: 340px; margin: 4px auto 0; }

.ntf-page__foot { padding: 12px 14px; border-top: 1px solid var(--tblr-border-color, #eef0f4); }
.ntf-page__foot .js-ntf-more { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 11px; border: 1px solid var(--tblr-border-color, #e6e9f0); background: var(--tblr-bg-surface, #fff); color: var(--tblr-body-color, #1a2233); font-weight: 600; font-size: 14px; border-radius: 12px; cursor: pointer; }
.ntf-page__foot .js-ntf-more:hover { background: rgba(37, 99, 235, .06); border-color: rgba(37, 99, 235, .3); color: #2563eb; }
.ntf-more-count { min-width: 22px; padding: 1px 7px; background: rgba(127, 127, 127, .1); color: var(--tblr-muted, #6b7488); border-radius: 999px; font-size: 12px; font-weight: 700; }
.ntf-fade { animation: ntfFadeIn .22s ease; }
@keyframes ntfFadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
.ntf-loading { opacity: .4; pointer-events: none; }
.ntf-item-new { animation: ntfFadeIn .25s ease; }

[data-bs-theme="dark"] .ntf-tabs { background: rgba(255, 255, 255, .05); }
[data-bs-theme="dark"] .ntf-tab.active { background: #222838; color: #6ea8fe; }
[data-bs-theme="dark"] .ntf-item-text { color: #e7eaf0; }
[data-bs-theme="dark"] .ntf-list .ntf-item + .ntf-item { border-top-color: #262d3d; }

/* ===== O'qilmagan bildirishnomalar — ajralib turadi + hisoblagich ===== */
.ntf-unread { background: rgba(37, 99, 235, .07) !important; }
.ntf-unread .ntf-item-text { font-weight: 600; }

/* "yangi" belgi (o'ng tomonda) */
.ntf-new-badge {
    flex: 0 0 auto;
    align-self: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .3px;
    color: #fff;
    background: #2563eb;
    padding: 2px 8px;
    border-radius: 999px;
    margin-left: 6px;
    white-space: nowrap;
}

/* O'qilmaganlar hisoblagich banneri */
.ntf-unread-bar {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 0 12px 8px;
    padding: 9px 13px;
    background: rgba(37, 99, 235, .08);
    border: 1px solid rgba(37, 99, 235, .18);
    border-radius: 11px;
    font-size: 13.5px;
    color: var(--tblr-body-color, #1a2233);
}
.ntf-unread-bar b { color: #2563eb; font-size: 15px; }
.ntf-unread-pulse {
    flex: 0 0 auto;
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: #2563eb;
    box-shadow: 0 0 0 0 rgba(37, 99, 235, .5);
    animation: ntfPulse 1.6s ease-out infinite;
}
@keyframes ntfPulse {
    0% { box-shadow: 0 0 0 0 rgba(37, 99, 235, .5); }
    70% { box-shadow: 0 0 0 8px rgba(37, 99, 235, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0); }
}
[data-bs-theme="dark"] .ntf-unread { background: rgba(37, 99, 235, .13) !important; }
[data-bs-theme="dark"] .ntf-unread-bar { background: rgba(37, 99, 235, .14); border-color: rgba(37, 99, 235, .3); color: #e7eaf0; }

/* ===== Forum post: Ctrl+V biriktirma chiplari (chat kabi) ===== */
.pu-attach { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.pu-chip { position: relative; display: flex; align-items: center; gap: 9px; max-width: 260px; padding: 6px 30px 6px 6px; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #e6e9f0); border-radius: 12px; box-shadow: 0 1px 3px rgba(20, 30, 60, .06); }
[data-bs-theme="dark"] .pu-chip { background: #1a2233; border-color: #2a3346; }
.pu-chip__thumb { flex: 0 0 auto; width: 46px; height: 46px; border-radius: 9px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: #eef1f6; color: #2563eb; }
[data-bs-theme="dark"] .pu-chip__thumb { background: #232c3e; color: #6ea0ff; }
.pu-chip__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pu-chip__info { min-width: 0; }
.pu-chip__name { font-size: 12.5px; font-weight: 600; color: var(--tblr-body-color, #1a2233); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
[data-bs-theme="dark"] .pu-chip__name { color: #e7eaf0; }
.pu-chip__meta { font-size: 11px; color: var(--tblr-muted, #8a93a8); margin-top: 1px; }
.pu-chip.is-done .pu-chip__meta { color: #16a34a; }
.pu-chip.is-error { border-color: rgba(220, 38, 38, .4); }
.pu-chip.is-error .pu-chip__meta { color: #dc2626; }
.pu-chip__x { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; line-height: 18px; text-align: center; border: none; border-radius: 50%; background: rgba(20, 30, 60, .06); color: #555; font-size: 15px; cursor: pointer; padding: 0; }
.pu-chip__x:hover { background: #dc2626; color: #fff; }
[data-bs-theme="dark"] .pu-chip__x { background: rgba(255, 255, 255, .08); color: #aab; }
.pu-spin { width: 18px; height: 18px; border: 2px solid rgba(37, 99, 235, .25); border-top-color: #2563eb; border-radius: 50%; animation: pu-spin .7s linear infinite; }
@keyframes pu-spin { to { transform: rotate(360deg); } }

/* ===== Top-list (reyting) — zamonaviy ===== */
.top-head .top-filter { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 14px; }
.top-pill { display: inline-block; padding: 5px 13px; border-radius: 20px; font-size: 13px; font-weight: 600; color: #5b6478; background: var(--tblr-bg-surface-secondary, #f1f3f7); border: 1px solid transparent; text-decoration: none; transition: background .12s ease, color .12s ease; }
.top-pill:hover { color: #2563eb; }
.top-pill.active { background: #2563eb; color: #fff; }
[data-bs-theme="dark"] .top-pill { background: #232a3a; color: #aab2c5; }
[data-bs-theme="dark"] .top-pill.active { background: #3b82f6; color: #fff; }
.top-row { display: flex; align-items: center; gap: 12px; text-decoration: none; color: inherit; }
.top-rank { flex: 0 0 auto; width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 13px; font-weight: 700; background: var(--tblr-bg-surface-secondary, #eef1f6); color: #7a849b; }
.top-rank.is-gold { background: linear-gradient(135deg, #ffd700, #ffa500); color: #5a3a00; box-shadow: 0 2px 8px rgba(255,170,0,.4); }
.top-rank.is-silver { background: linear-gradient(135deg, #e6e9f0, #b8c0d0); color: #44505f; }
.top-rank.is-bronze { background: linear-gradient(135deg, #e8a87c, #cd7f32); color: #4a2a00; }
.top-ava { flex: 0 0 auto; width: 44px; height: 44px; border-radius: 50%; background-size: cover; background-position: center; background-color: #eef1f6; box-shadow: 0 0 0 1px rgba(20,30,60,.06); }
.top-info { flex: 1 1 auto; min-width: 0; }
.top-name { display: block; font-weight: 600; font-size: 14.5px; color: var(--tblr-body-color, #1a2233); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
[data-bs-theme="dark"] .top-name { color: #e7eaf0; }
.top-metric { display: block; font-size: 12.5px; color: var(--tblr-muted, #8a93a8); margin-top: 1px; }
.top-metric b { color: #2563eb; font-weight: 700; }
.top-chev { flex: 0 0 auto; color: #c2c8d4; }

/* ===== Profil faolligi — Postlar (modern) + bulk delete + photo ikonka ===== */
.post-item { position: relative; }
.post-item .post-topic { font-size: 12.5px; color: var(--tblr-muted, #8a93a8); display: flex; align-items: center; gap: 5px; margin-bottom: 6px; }
.post-item .post-topic a { color: #2563eb; font-weight: 600; text-decoration: none; }
.post-item .post-text { font-size: 14px; line-height: 1.55; color: var(--tblr-body-color, #1a2233); word-break: break-word; }
[data-bs-theme="dark"] .post-item .post-text { color: #dfe3ea; }
.post-item .post-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--tblr-border-color, #f1f3f7); }
.post-item .post-date { font-size: 11.5px; color: var(--tblr-muted, #8a93a8); }
.post-item .post-go { font-size: 12.5px; font-weight: 600; color: #2563eb; text-decoration: none; white-space: nowrap; }
.post-img-ico { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; margin: 2px; border-radius: 7px; font-size: 12px; font-weight: 600; color: #7a52d6; background: rgba(122,82,214,.1); vertical-align: middle; }
[data-bs-theme="dark"] .post-img-ico { color: #b69bf0; background: rgba(122,82,214,.18); }
.post-item.is-selectable { cursor: pointer; }
.post-item.is-selectable .card-body { padding-left: 44px !important; }
.post-check { position: absolute; left: 12px; top: 14px; margin: 0; z-index: 2; }
.post-check input { width: 18px; height: 18px; cursor: pointer; }
.post-item.is-checked { box-shadow: 0 0 0 2px #2563eb inset; background: rgba(37,99,235,.05); }
.post-bulkbar { position: sticky; top: 62px; z-index: 20; display: flex; align-items: center; gap: 8px; padding: 8px 12px; margin-bottom: 10px; border-radius: 12px; background: var(--tblr-card-bg, #fff); border: 1px solid var(--tblr-border-color, #e6e9f0); box-shadow: 0 4px 14px rgba(20,30,60,.1); }
[data-bs-theme="dark"] .post-bulkbar { background: #1a2233; border-color: #2a3346; }
.post-bulkbar[hidden] { display: none !important; }

/* ===== Forum mavzu: boshqaruv paneli + javob formasi (modern) ===== */
.topic-manage .tm-act { display: flex; align-items: center; gap: 9px; font-size: 14px; padding: 11px 14px; color: var(--tblr-body-color, #1a2233); text-decoration: none; }
.topic-manage .tm-act .tm-ico { flex: 0 0 auto; color: #aab2c5; }
.topic-manage .tm-act:hover { background: rgba(37,99,235,.05); }
.topic-manage .tm-act.text-danger .tm-ico { color: #dc3545; }
.reply-card textarea { min-height: 92px; resize: vertical; }

/* ===== Javob yozish bloki (#write) joylashuvi =====
   1) Yuqoridagi postlar kartasi bilan BIR XIL enda bo'lsin: .row>* gutter
      paddingini olib tashlaymiz (postlar kartasida `p-0` bor edi).
   2) Postlarga YOPISHIB tursin: tepa bo'shliq (gutter margin + reply-card mt-2)
      olib tashlanadi, chegaralar ustma-ust qo'yiladi. */
#write {
    margin-top: 0 !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
}
#write .reply-card {
    margin-top: -1px !important;        /* postlar kartasi pastki chegarasi bilan ustma-ust */
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}
/* Javob maydoni ichidagi yon padding ham yo'q — textarea/toolbar katta div
   (postlar kartasi) bilan to'liq bir tekisda, chetdan chetga. */
#write .reply-card > .card-body {
    padding-left: 0 !important;
    padding-right: 0 !important;
    padding-bottom: 0 !important;
}
/* Tepadagi postlar kartasi pastdan tekis bo'lsin — javob bloki bilan uzluksiz ulanadi */
.card:has(#post-list) {
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

/* Postga sakrab kelganda Telegram-uslub yoritish (3s) */
@keyframes postFlash {
    0%   { background-color: rgba(37, 99, 235, .15); box-shadow: inset 3px 0 0 0 rgba(37, 99, 235, .9); }
    12%  { background-color: rgba(37, 99, 235, .15); box-shadow: inset 3px 0 0 0 rgba(37, 99, 235, .9); }
    100% { background-color: rgba(37, 99, 235, 0);   box-shadow: inset 3px 0 0 0 rgba(37, 99, 235, 0); }
}
.fpost.post-flash { animation: postFlash 3s ease-out; border-radius: 10px; }
[data-bs-theme="dark"] .fpost.post-flash { animation: postFlashDark 3s ease-out; }
@keyframes postFlashDark {
    0%   { background-color: rgba(96, 165, 250, .18); box-shadow: inset 3px 0 0 0 rgba(96, 165, 250, .95); }
    12%  { background-color: rgba(96, 165, 250, .18); box-shadow: inset 3px 0 0 0 rgba(96, 165, 250, .95); }
    100% { background-color: rgba(96, 165, 250, 0);   box-shadow: inset 3px 0 0 0 rgba(96, 165, 250, 0); }
}

/* Post tahrirlandi izohi — post tagida mayda */
.post-edited { display: inline-flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 11.5px; line-height: 1.4; color: #8a93a6; font-style: italic; }
.post-edited svg { flex: 0 0 auto; opacity: .8; }
.post-edited__time { color: #aab2c5; font-style: normal; }
.post-edited--admin { color: #d97706; background: rgba(245,158,11,.10); border: 1px solid rgba(245,158,11,.25); border-radius: 8px; padding: 3px 9px; font-style: normal; }
.post-edited--admin b { font-weight: 600; }
.post-edited--admin .post-edited__time { color: #b9852f; }

/* ===== Forum qidiruvi (search.php) ===== */
.search-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.search-tabs .top-pill { display: inline-flex; align-items: center; gap: 5px; }
.search-tabs .top-pill svg { opacity: .85; }
.search-bar { display: flex; align-items: center; gap: 8px; background: var(--tblr-bg-surface-secondary, #f1f3f7); border: 1px solid var(--tblr-border-color, #e6e8ef); border-radius: 12px; padding: 6px 6px 6px 12px; }
.search-bar:focus-within { border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.12); }
.search-bar__ico { flex: 0 0 auto; color: #8a93a8; display: inline-flex; }
.search-bar__input { flex: 1 1 auto; min-width: 0; border: 0; background: transparent; outline: none; font-size: 15px; color: var(--tblr-body-color, #1a2233); padding: 7px 0; }
.search-bar__input::placeholder { color: #aab2c5; }
.search-bar__filter { flex: 0 0 auto; border: 0; background: transparent; color: #5b6478; font-size: 13px; font-weight: 600; outline: none; cursor: pointer; max-width: 140px; }
.search-bar__btn { flex: 0 0 auto; border: 0; background: #2563eb; color: #fff; font-weight: 600; font-size: 14px; padding: 9px 18px; border-radius: 9px; cursor: pointer; transition: background .12s ease; }
.search-bar__btn:hover { background: #1d4ed8; }
[data-bs-theme="dark"] .search-bar { background: #1a2030; border-color: #2a3346; }
[data-bs-theme="dark"] .search-bar__input { color: #e7eaf0; }
[data-bs-theme="dark"] .search-bar__filter { color: #aab2c5; background: transparent; }

.search-count { font-size: 14px; color: #5b6478; padding: 4px 2px 10px; }
.search-count__n { display: inline-block; min-width: 22px; padding: 1px 9px; margin-left: 4px; background: #2563eb; color: #fff; border-radius: 20px; font-size: 12.5px; font-weight: 700; text-align: center; }
[data-bs-theme="dark"] .search-count { color: #aab2c5; }

.search-result .card-body { padding: 14px 16px; }
.search-result__head { display: flex; align-items: center; gap: 10px; margin-bottom: 9px; }
.search-result__ava { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; background-size: cover; background-position: center; background-color: #eef1f6; box-shadow: 0 0 0 1px rgba(20,30,60,.06); }
.search-result__meta { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.search-result__name { font-weight: 600; font-size: 14px; color: var(--tblr-body-color, #1a2233); text-decoration: none; }
.search-result__name:hover { color: #2563eb; }
.search-result__date { font-size: 12px; color: #8a93a8; }
.search-result__text { font-size: 14.5px; line-height: 1.55; color: var(--tblr-body-color, #1a2233); word-break: break-word; overflow-wrap: anywhere; }
[data-bs-theme="dark"] .search-result__text, [data-bs-theme="dark"] .search-result__name { color: #e7eaf0; }
.search-result__foot { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 11px; padding-top: 10px; border-top: 1px solid var(--tblr-border-color, #eef0f5); font-size: 13px; }
.search-result__crumb { color: #8a93a8; min-width: 0; }
.search-result__crumb a { color: #5b6478; text-decoration: none; }
.search-result__crumb a:hover { color: #2563eb; }
.search-result__crumb a b { color: var(--tblr-body-color, #1a2233); font-weight: 600; }
.search-result__sep { color: #c2c8d4; margin: 0 2px; }
.search-result__go { margin-left: auto; display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; color: #2563eb; font-weight: 600; text-decoration: none; }
.search-result__go:hover { color: #1d4ed8; }
.search-result__title { display: flex; align-items: flex-start; gap: 8px; font-size: 15.5px; font-weight: 600; color: var(--tblr-body-color, #1a2233); text-decoration: none; line-height: 1.4; }
.search-result__title svg { flex: 0 0 auto; margin-top: 2px; color: #2563eb; }
.search-result__title:hover span { color: #2563eb; }
.search-result__sub { font-size: 13px; color: #8a93a8; margin-top: 7px; }
.search-result__sub a { color: #5b6478; text-decoration: none; }
.search-result__sub a:hover { color: #2563eb; }
[data-bs-theme="dark"] .search-result__title { color: #e7eaf0; }
mark.search-hl, .search-result__text [style*="FFEE58"], .search-result__text [style*="FFFF33"] { background: #fff3a8; color: inherit; border-radius: 3px; padding: 0 2px; }
[data-bs-theme="dark"] mark.search-hl { background: #6b5d1a; color: #fff7d6; }

.empty-state-card { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 44px 20px; background: var(--tblr-bg-surface, #fff); border: 1px solid var(--tblr-border-color, #e6e8ef); border-radius: 14px; color: #8a93a8; font-size: 15px; }
.empty-state-card svg { color: #c2c8d4; }
[data-bs-theme="dark"] .empty-state-card { background: #161b28; border-color: #2a3346; }

/* ===== Ijtimoiy kirish (Google / Telegram) ===== */
.oa-social-wrap { margin-bottom: 6px; }
.oa-social { display: flex; flex-direction: column; gap: 10px; }
.oa-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 12px 16px; border-radius: 12px; font-size: 15px; font-weight: 600; text-decoration: none; border: 1px solid transparent; cursor: pointer; transition: transform .08s ease, box-shadow .15s ease, background .15s ease; }
.oa-btn:active { transform: translateY(1px); }
.oa-btn svg { flex: 0 0 auto; }
.oa-btn--google { background: #fff; color: #3c4043; border-color: #dadce0; box-shadow: 0 1px 2px rgba(60,64,67,.1); }
.oa-btn--google:hover { background: #f8faff; box-shadow: 0 2px 8px rgba(60,64,67,.15); color: #3c4043; }
.oa-btn--tg { background: linear-gradient(135deg, #2aabee, #229ed9); color: #fff; box-shadow: 0 2px 10px rgba(34,158,217,.35); }
.oa-btn--tg:hover { background: linear-gradient(135deg, #2ab0f5, #1f95cf); color: #fff; }
.oa-btn--dev { background: #fff7ed; color: #c2410c; border-color: #fed7aa; font-size: 13px; font-weight: 600; }
.oa-btn--dev:hover { background: #ffedd5; color: #c2410c; }
[data-bs-theme="dark"] .oa-btn--google { background: #1a2030; color: #e7eaf0; border-color: #2a3346; }
[data-bs-theme="dark"] .oa-btn--google:hover { background: #222a3c; color: #e7eaf0; }
[data-bs-theme="dark"] .oa-btn--dev { background: #2a1c0e; color: #fb923c; border-color: #5a3a1a; }
.oa-or { display: flex; align-items: center; text-align: center; gap: 12px; margin: 16px 0 8px; color: #8a93a8; font-size: 13px; }
.oa-or::before, .oa-or::after { content: ""; flex: 1; height: 1px; background: var(--tblr-border-color, #e6e8ef); }
[data-bs-theme="dark"] .oa-or::before, [data-bs-theme="dark"] .oa-or::after { background: #2a3346; }

/* Nik tanlash sahifasi */
.oa-complete__head { text-align: center; }
.oa-prov { display: inline-flex; align-items: center; gap: 6px; padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 700; color: #fff; }
.oa-prov--google { background: #4285F4; }
.oa-prov--tg { background: linear-gradient(135deg, #2aabee, #229ed9); }
.oa-sex { display: flex; gap: 10px; }
.oa-sex__opt { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px; border: 1.5px solid var(--tblr-border-color, #e6e8ef); border-radius: 11px; cursor: pointer; font-weight: 600; color: #5b6478; transition: border-color .12s ease, background .12s ease, color .12s ease; }
.oa-sex__opt input { accent-color: #2563eb; }
.oa-sex__opt:hover { border-color: #93b4f5; }
.oa-sex__opt.active, .oa-sex__opt:has(input:checked) { border-color: #2563eb; background: rgba(37,99,235,.06); color: #2563eb; }
[data-bs-theme="dark"] .oa-sex__opt { background: #1a2030; border-color: #2a3346; color: #aab2c5; }
