.navbar-logo {
    height: 2.01rem;
    width: auto;
    margin-right: .5025rem;
    margin-top: -.2513rem;
    margin-bottom: -.2513rem;
}

.project-title {
    font-size: 1.1725rem;
    font-weight: 700;
}

html[data-mode="dark"] .project-title {
    color: #fff;
}

#navbarDropdownMenuLink {
    color: var(--text-color);
}
html[data-mode="light"] #navbarDropdownMenuLink {
    color: rgba(255,255,255,0.88);
}
/* default avatar — same look in both modes */
html[data-mode="light"] #navbarDropdownMenuLink .avatar-img.default-avatar,
html[data-mode="dark"]  #navbarDropdownMenuLink .avatar-img.default-avatar {
    filter: brightness(0) invert(1);
    opacity: 0.75;
}

/* the language toggle is a .btn-methodology (border/size from base.html);
   only its text colour is set here */
html[data-mode="light"] #languageDropdown,
html[data-mode="light"] #languageDropdown span {
    color: rgba(255,255,255,0.88);
}

.mode-toggle-btn {
    color: var(--text-color);
    opacity: 0.85;
    font-size: .7705rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5075rem;
    height: 1.5075rem;
    border: .0419rem solid rgba(0, 0, 0, 0.15);
    border-radius: .2513rem;
    background: transparent;
}

html[data-mode="light"] .mode-toggle-btn {
    border-color: #000;
}

html[data-mode="dark"] .mode-toggle-btn {
    border-color: rgba(255, 255, 255, 0.22);
}

/* Profile dropdown: fully opaque */
html[data-mode="dark"] .dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] {
    background: #1f1f1f !important;
    border: .0419rem solid rgba(255, 255, 255, 0.12);
    opacity: 1;
}

html[data-mode="light"] .dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] {
    background: #ffffff !important;
    border: .0419rem solid rgba(0, 0, 0, 0.12);
    opacity: 1;
}

.dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] .dropdown-item {
    color: var(--text-color, #333) !important;
}

html[data-mode="dark"] .dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] .dropdown-item {
    color: #e0e0e0 !important;
}

html[data-mode="dark"] .dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] .dropdown-item:hover {
    background: rgba(255, 255, 255, 0.08) !important;
}

html[data-mode="light"] .dropdown-menu[aria-labelledby="navbarDropdownMenuLink"] .dropdown-item:hover {
    background: rgba(0, 0, 0, 0.05) !important;
}

.mode-toggle-btn:hover {
    opacity: 1;
    text-decoration: none;
}

html[data-mode="light"] .mode-toggle-btn:hover,
html[data-mode="light"] .mode-toggle-btn:focus,
html[data-mode="light"] .mode-toggle-btn:active {
    background: var(--btn-hover-bg, #ffe27d);
    color: #000 !important;
    border-color: #000;
}


/* ── Account toggle + menu (same look as the language switcher) ── */
.acct-toggle.btn-methodology {
    display: inline-flex; align-items: center; justify-content: center; gap: .2513rem;
    padding: 0 .335rem 0 .2094rem; text-decoration: none; cursor: pointer;
}
.acct-toggle::after { display: none; }
.acct-avatar {
    flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center;
    width: 1.0888rem; height: 1.0888rem; border-radius: 50%; overflow: hidden;
    background: rgba(255, 255, 255, .18); color: #fff;
    font-size: .5863rem; font-weight: 800; line-height: 1; padding-top: .0838rem; box-sizing: border-box;
}
.acct-avatar img { width: 100%; height: 100%; object-fit: cover; }
.acct-avatar .acct-ico { width: 72%; height: 72%; }
.acct-avatar:has(.acct-ico) { padding-top: 0; }
.acct-avatar:has(img) { padding-top: 0; }
.acct-caret { width: .5863rem; height: .5863rem; transition: transform .15s ease; }
.acct-toggle[aria-expanded="true"] .acct-caret { transform: rotate(180deg); }
html[data-mode="dark"] .acct-avatar { background: rgba(76, 175, 80, .25); color: #e8f5e9; }

html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] {
    min-width: 10.8875rem; padding: .2513rem; margin-top: .335rem;
    border-radius: .5863rem; border: .0419rem solid #e5e7eb; background: #fff !important;
    box-shadow: 0 .4188rem 1.2563rem rgba(15, 23, 42, .14), 0 .0838rem .2513rem rgba(15, 23, 42, .06) !important;
}
.acct-menu-head { display: flex; align-items: center; gap: .5025rem; padding: .4188rem .4188rem .5025rem; }
.acct-avatar.lg { width: 1.7588rem; height: 1.7588rem; font-size: .7956rem; background: #1A2B4B; color: #fff; padding-top: .1256rem; }
.acct-avatar.lg:has(img) { padding-top: 0; }
.acct-menu-who { display: flex; flex-direction: column; min-width: 0; }
.acct-menu-name { font-size: .7119rem; font-weight: 800; color: #0f172a; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-menu-user { font-size: .5863rem; color: #64748B; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.acct-menu-sep { height: .0419rem; margin: .0838rem .2513rem .2513rem; background: #e5e7eb; }
.acct-form { margin: 0; }
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item {
    display: flex; align-items: center; gap: .5025rem; width: 100%;
    min-height: 1.8425rem; padding: .335rem .5025rem; margin: 0;
    border: 0 !important; border-radius: .4188rem !important; background: transparent;
    color: #0f172a !important; font-size: .7119rem; font-weight: 600; line-height: 1.2;
    text-align: left; cursor: pointer; transition: background-color .15s ease, color .15s ease;
}
.acct-item svg { flex: 0 0 auto; width: .8375rem; height: .8375rem; }
.acct-item .acct-item-end { margin-left: auto; transition: transform .15s ease; }
.acct-item:hover .acct-item-end { transform: translateX(.0838rem); }
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item:hover,
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item:focus-visible { background: #F1F5FB !important; outline: none; }
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-logout { color: #DC2626 !important; }
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-logout:hover,
html[data-mode] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-logout:focus-visible { background: rgba(220, 38, 38, .08) !important; }

html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] {
    border-color: rgba(255, 255, 255, .12); background: #24282e !important;
    box-shadow: 0 .5025rem 1.34rem rgba(0, 0, 0, .45) !important;
}
html[data-mode="dark"] .acct-avatar.lg { background: #4caf50; }
html[data-mode="dark"] .acct-menu-name { color: #f1f5f9; }
html[data-mode="dark"] .acct-menu-user { color: #94a3b8; }
html[data-mode="dark"] .acct-menu-sep { background: rgba(255, 255, 255, .1); }
html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item { color: #e5e7eb !important; }
html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item:hover,
html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-item:focus-visible { background: rgba(255, 255, 255, .06) !important; }
html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-logout { color: #f87171 !important; }
html[data-mode="dark"] .dropdown-menu.acct-menu[aria-labelledby="navbarDropdownMenuLink"] .acct-logout:hover { background: rgba(248, 113, 113, .1) !important; }

/* ── Language toggle: same bordered button as Telegram / methodology ── */
.lang-toggle.btn-methodology {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: .2094rem;
    padding: 0 .4188rem;
    text-decoration: none;
    cursor: pointer;
}
.lang-toggle .lang-toggle-code {
    font-size: .67rem; font-weight: 800; letter-spacing: .04em; line-height: 1;
    position: relative; top: .0628rem;   /* Overpass caps sit high: optical centring */
}
.lang-toggle .lang-toggle-caret { width: .5863rem; height: .5863rem; transition: transform .15s ease; }
.lang-toggle[aria-expanded="true"] .lang-toggle-caret { transform: rotate(180deg); }
.lang-toggle::after { display: none !important; }

/* ── Language menu (desktop / tablet dropdown) ── */
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] {
    min-width: 8.7938rem;
    padding: .2513rem;
    margin-top: .335rem;
    border-radius: .5863rem;
    border: .0419rem solid #e5e7eb;
    background: #fff !important;
    box-shadow: 0 .4188rem 1.2563rem rgba(15, 23, 42, .14), 0 .0838rem .2513rem rgba(15, 23, 42, .06) !important;
    overflow: hidden;
}
.lang-menu.dropdown-menu::before, .lang-menu.dropdown-menu::after { display: none; }
.lang-menu-form { margin: 0; padding: 0; display: flex; flex-direction: column; gap: .0838rem; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item {
    display: flex;
    align-items: center;
    gap: .5025rem;
    width: 100%;
    min-height: 1.8425rem;
    padding: .335rem .5025rem;
    margin: 0;
    border: 0 !important;
    border-radius: .4188rem !important;
    background: transparent !important;
    color: #0f172a !important;
    font-size: .7119rem;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease;
}
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-code {
    flex: 0 0 auto;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 1.4238rem; height: 1.0888rem; padding: 0 .2513rem;
    border-radius: .2931rem;
    line-height: 1;
    padding-top: .1256rem;   /* Overpass caps sit high: optical centring */
    background: #EAF0FA; color: #2D4F8A;
    font-size: .5025rem; font-weight: 800; letter-spacing: .04em;
}
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-name { flex: 1 1 auto; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-check { flex: 0 0 auto; width: .7538rem; height: .7538rem; color: #2D4F8A; opacity: 0; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item:hover, .lang-menu .lang-menu-item:focus-visible { background: #F1F5FB !important; outline: none; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item.active { background: #EAF0FA !important; color: #1A2B4B !important; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item.active .lang-menu-code { background: #1A2B4B !important; color: #fff !important; }
html[data-mode] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item.active .lang-menu-check { opacity: 1; }

html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] {
    border-color: rgba(255, 255, 255, .12);
    background: #24282e !important;
    box-shadow: 0 .5025rem 1.34rem rgba(0, 0, 0, .45) !important;
}
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item { color: #e5e7eb !important; }
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-code { background: rgba(255, 255, 255, .08); color: #cbd5e1; }
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item:hover,
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item:focus-visible { background: rgba(255, 255, 255, .06) !important; }
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item.active { background: rgba(76, 175, 80, .16) !important; color: #fff !important; }
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-item.active .lang-menu-code { background: #4caf50 !important; color: #fff !important; }
html[data-mode="dark"] .dropdown-menu.lang-menu[aria-labelledby="languageDropdown"] .lang-menu-check { color: #4caf50; }

/* ── Page navigation links (next to title) ── */
.page-nav {
    display: flex;
    align-items: center;
    gap: .1675rem;
    margin-left: .1675rem;
}

.page-nav-link {
    font-size: 1.1725rem;
    font-weight: 700;
    text-decoration: none;
    padding: .1675rem .5863rem;
    border-radius: .335rem;
    border: .0628rem solid transparent;   /* reserved so .active border doesn't shift layout */
    transition: background 0.2s, color 0.2s, border-color 0.2s;
    white-space: nowrap;
    cursor: pointer;
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: .335rem;
}

.page-nav-badge {
    font-size: .402rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: .0838rem .2931rem;
    border-radius: .1675rem;
    line-height: 1.1;
    vertical-align: middle;
}

html[data-mode="dark"] .page-nav-badge {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
}

html[data-mode="light"] .page-nav-badge {
    background: rgba(0, 0, 0, 0.08);
    color: rgba(0, 0, 0, 0.55);
}

.page-nav-link:hover,
.page-nav-link:focus,
.page-nav-link.active {}

.page-nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: .67rem;
    right: .67rem;
    height: .1047rem;
    border-radius: .0838rem;
    background: transparent;
    transition: background 0.2s;
}

.page-nav-link.active::after {
    background: currentColor;
}

/* Light — navbar is navy, so page links are white (same as dark) */
html[data-mode="light"] .page-nav-link,
body.light .page-nav-link,
html[data-mode="light"] .page-nav-link span,
body.light .page-nav-link span {
    color: #ffffff;
}

html[data-mode="light"] .page-nav-link:hover,
html[data-mode="light"] .page-nav-link:focus,
body.light .page-nav-link:hover,
body.light .page-nav-link:focus {
    color: #ffffff !important;
    background: rgba(255, 255, 255, 0.10);
    text-decoration: none;
}

/* Active page — day: blue theme bg + 1.5px brighter border (instead of grey) */
html[data-mode="light"] .page-nav-link.active {
    color: #ffffff;
    background: rgba(61, 108, 184, 0.55) !important;
    border-color: rgba(140, 178, 230, 0.95) !important;
}

/* Dark */
html[data-mode="dark"] .page-nav-link {
    color: #fff;
}

html[data-mode="dark"] .page-nav-link:hover,
html[data-mode="dark"] .page-nav-link:focus {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    text-decoration: none;
}

/* Active page — night: green theme bg + 1.5px brighter border (instead of grey) */
html[data-mode="dark"] .page-nav-link.active {
    color: #fff;
    background: rgba(76, 175, 80, 0.22) !important;
    border-color: rgba(76, 175, 80, 0.85) !important;
}

/* ── Resources hover dropdown ── */
.nav-resources-wrap { position:relative; }
.nav-resources-btn {
    display:inline-flex; align-items:center; gap:.2094rem;
    cursor:pointer;
}
/* same chevron as the language / account toggles: 14px SVG, centred on
   the text, flips while the menu is open */
.nav-resources-btn .nav-res-chevron {
    flex: 0 0 auto;
    width: .5863rem; height: .5863rem;
    position: relative; top: -.0419rem;   /* Overpass: optical centre of the label */
    opacity: .85;
    transition: transform .2s;
}
.nav-resources-wrap:hover .nav-res-chevron { transform:rotate(180deg); }
.nav-resources-dropdown {
    position:absolute; top:calc(100% + .2513rem); right:0;
    min-width:9.6313rem;
    background:#1A2B4B;
    border:.0419rem solid rgba(255,255,255,.12);
    border-radius:.4188rem;
    padding:.2513rem 0;
    box-shadow:0 .335rem 1.1725rem rgba(0,0,0,.30);
    opacity:0; visibility:hidden;
    transform:translateY(-.2513rem);
    transition:opacity .15s, transform .15s, visibility .15s;
    z-index:2100;
}
.nav-resources-wrap:hover .nav-resources-dropdown {
    opacity:1; visibility:visible; transform:translateY(0);
}
/* The navbar itself turns dark grey (not navy) in dark mode — this dropdown
   hangs off it, so it needs to follow instead of staying hardcoded navy. */
html[data-mode="dark"] .nav-resources-dropdown {
    background:#1f1f1f;
    border-color:#333;
}
.nav-res-item {
    display:flex; align-items:center; gap:.4188rem;
    padding:.3769rem .67rem;
    color:rgba(255,255,255,.80);
    font-size:.9715rem; font-weight:600;
    text-decoration:none; cursor:pointer;
    background:none; border:none; width:100%; text-align:left;
    transition:background .12s, color .12s;
    white-space:nowrap;
}
.nav-res-item:hover { background:rgba(255,255,255,.10); color:#fff; text-decoration:none; }
.nav-res-item i { width:.67rem; text-align:center; opacity:.75; }
.nav-res-divider { height:.0419rem; background:rgba(255,255,255,.10); margin:.1675rem 0; }
/* Touch screens have no hover: a tap on the menu name toggles .open (JS below). */
.nav-resources-wrap.open .nav-resources-dropdown { opacity:1; visibility:visible; transform:translateY(0); }
.nav-resources-wrap.open .nav-res-chevron { transform:rotate(180deg); }
.nav-res-item.active { background:rgba(255,255,255,.14); color:#fff; }
/* Small left-aligned caption above a group of entries (ADM menu: "Dayjestlar"). */
.nav-res-group {
    padding:.2513rem .67rem .1675rem;
    color:rgba(255,255,255,.55);
    font-size:.737rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase;
    text-align:left; white-space:nowrap; cursor:default;
}
.nav-overflow-menu .nav-res-group { color:rgba(26,43,75,.55); }
html[data-mode="dark"] .nav-overflow-menu .nav-res-group { color:rgba(255,255,255,.55); }
html[data-mode="dark"] .nav-res-item.active { background:rgba(76,175,80,.22); }
.nav-overflow-menu .nav-res-item.active { background:rgba(31,58,147,.12); color:#1A2B4B; }
html[data-mode="dark"] .nav-overflow-menu .nav-res-item.active { background:rgba(76,175,80,.22); color:#fff; }

/* ── Responsive nav: reduce size when links start to crowd ── */
@media (min-width:992px) and (max-width:1600px) {
    .page-nav { gap:.0838rem; margin-left:.0838rem; }
    .page-nav-link { font-size:.9045rem; padding:.1675rem .3769rem; }
}
@media (min-width:992px) and (max-width:1300px) {
    .page-nav-link { font-size:.7705rem; padding:.1675rem .2931rem; }
}

/* ── Overflow ("…") menu: links that don't fit before the contact cluster ── */
.page-nav { position: relative; flex-wrap: nowrap; }
.nav-overflow { position: relative; display: none; }        /* JS shows when needed */
.nav-overflow-toggle {
    font-size: 1.1725rem; font-weight: 700; line-height: 1;
    padding: .1675rem .5025rem; border-radius: .335rem;
    border: .0628rem solid transparent; background: transparent; cursor: pointer;
    display: inline-flex; align-items: center; gap: .1675rem;
    color: inherit; transition: background .2s, color .2s;
}
@media (min-width:992px) and (max-width:1600px) {
    .nav-overflow-toggle { font-size: .9045rem; padding: .1675rem .3769rem; }
}
@media (min-width:992px) and (max-width:1300px) {
    .nav-overflow-toggle { font-size: .7705rem; padding: .1675rem .2931rem; }
}
/* The navbar bar is dark/coloured in BOTH themes, so the toggle is white in both
   (mirrors .page-nav-link, which is #fff in day and night). */
.nav-overflow-toggle,
html[data-mode="light"] .nav-overflow-toggle,
body.light .nav-overflow-toggle,
html[data-mode="dark"] .nav-overflow-toggle { color: #ffffff; }
.nav-overflow-toggle:hover,
.nav-overflow-toggle:focus-visible {
    background: rgba(255,255,255,.12);
    color: #ffffff;
}
.nav-overflow-toggle:focus-visible { outline: .0838rem solid #ffffff; outline-offset: .0838rem; }
/* Active page hidden inside the menu → toggle wears the active-page style itself. */
html[data-mode="light"] .nav-overflow.has-active .nav-overflow-toggle,
body.light .nav-overflow.has-active .nav-overflow-toggle {
    background: rgba(61, 108, 184, 0.55);
    border-color: rgba(140, 178, 230, 0.95);
}
html[data-mode="dark"] .nav-overflow.has-active .nav-overflow-toggle {
    background: rgba(76, 175, 80, 0.22);
    border-color: rgba(76, 175, 80, 0.85);
}

.nav-overflow-menu {
    position: absolute; top: calc(100% + .2513rem); right: 0;
    min-width: 9.2125rem; padding: .2513rem;
    display: flex; flex-direction: column; gap: .0838rem;
    background: #fff; border: .0419rem solid rgba(0,0,0,.10);
    border-radius: .4188rem; box-shadow: 0 .4188rem 1.2563rem rgba(0,0,0,.16);
    opacity: 0; visibility: hidden; transform: translateY(-.1675rem);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
    z-index: 1200;
}
html[data-mode="dark"] .nav-overflow-menu {
    background: #1c2129; border-color: rgba(255,255,255,.12);
    box-shadow: 0 .4188rem 1.2563rem rgba(0,0,0,.45);
}
/* Open on hover OR keyboard focus; a small hover bridge keeps it open across the gap. */
.nav-overflow:hover .nav-overflow-menu,
.nav-overflow:focus-within .nav-overflow-menu {
    opacity: 1; visibility: visible; transform: translateY(0);
}
.nav-overflow-menu::before {                    /* invisible bridge over the 6px gap */
    content: ''; position: absolute; top: -.335rem; left: 0; right: 0; height: .335rem;
}
.nav-overflow-menu .page-nav-link {
    font-size: .7705rem; padding: .335rem .5025rem;
    width: 100%; justify-content: flex-start; border-radius: .2931rem;
}
/* Menu sits on a light (day) / dark-surface (night) panel — NOT on the navbar bar —
   so links here need panel-appropriate colour, overriding the white navbar colour. */
html[data-mode="light"] .nav-overflow-menu .page-nav-link,
body.light .nav-overflow-menu .page-nav-link,
html[data-mode="light"] .nav-overflow-menu .page-nav-link span,
body.light .nav-overflow-menu .page-nav-link span {
    color: #1A2B4B;
}
html[data-mode="dark"] .nav-overflow-menu .page-nav-link,
html[data-mode="dark"] .nav-overflow-menu .page-nav-link span {
    color: rgba(255,255,255,.90);
}
.nav-overflow-menu .page-nav-link:hover,
.nav-overflow-menu .page-nav-link:focus {
    background: rgba(31,58,147,.10) !important;
}
html[data-mode="dark"] .nav-overflow-menu .page-nav-link:hover,
html[data-mode="dark"] .nav-overflow-menu .page-nav-link:focus {
    background: rgba(255,255,255,.08) !important;
}
/* Active page inside the menu keeps its highlighted look. */
html[data-mode="light"] .nav-overflow-menu .page-nav-link.active,
body.light .nav-overflow-menu .page-nav-link.active {
    color: #ffffff !important;
    background: rgba(61, 108, 184, 0.95) !important;
    border-color: rgba(140, 178, 230, 0.95) !important;
}
html[data-mode="dark"] .nav-overflow-menu .page-nav-link.active {
    color: #ffffff !important;
    background: rgba(76, 175, 80, 0.30) !important;
    border-color: rgba(76, 175, 80, 0.85) !important;
}

/* "Dayjestlar" is a submenu container, not a single destination link — inside
   the overflow panel it must NOT get the solid blue/green "active page" fill
   (that treatment is for a link you're already on); it stays plain panel-
   coloured like its siblings, active or not. */
html[data-mode="light"] .nav-overflow-menu .nav-resources-wrap.active,
body.light .nav-overflow-menu .nav-resources-wrap.active {
    background: transparent !important;
    border-color: transparent !important;
}
html[data-mode="dark"] .nav-overflow-menu .nav-resources-wrap.active {
    background: transparent !important;
    border-color: transparent !important;
}
html[data-mode="light"] .nav-overflow-menu .nav-resources-wrap .nav-resources-btn,
body.light .nav-overflow-menu .nav-resources-wrap .nav-resources-btn {
    color: #1A2B4B;
}
html[data-mode="dark"] .nav-overflow-menu .nav-resources-wrap .nav-resources-btn {
    color: rgba(255,255,255,.90);
}

/* .nav-resources-wrap already IS a .page-nav-link, so it already inherits
   that sibling rule's font-size/padding/hover — adding a second layer of
   padding+font-size on the inner .nav-resources-btn span (as a previous
   version of this rule did) just squeezed the text into a smaller box.
   Only override what's actually different here: push the chevron to the
   right, and fly the submenu out sideways instead of dropping below. */
.nav-overflow-menu .nav-resources-wrap { position: relative; justify-content: space-between; }
.nav-overflow-menu .nav-res-chevron,
.nav-overflow-menu .nav-resources-wrap:hover .nav-res-chevron,
.nav-overflow-menu .nav-resources-wrap.open .nav-res-chevron { transform: rotate(-90deg); }
.nav-overflow-menu .nav-resources-dropdown {
    top: 0; left: calc(100% + .2513rem); right: auto;
    background: #fff; border-color: rgba(0,0,0,.10);
    box-shadow: 0 .4188rem 1.2563rem rgba(0,0,0,.16);
}
html[data-mode="dark"] .nav-overflow-menu .nav-resources-dropdown {
    background: #1c2129; border-color: rgba(255,255,255,.12);
    box-shadow: 0 .4188rem 1.2563rem rgba(0,0,0,.45);
}
.nav-overflow-menu .nav-res-item { color: #1A2B4B; }
.nav-overflow-menu .nav-res-item:hover { background: rgba(31,58,147,.10); color: #1A2B4B; }
html[data-mode="dark"] .nav-overflow-menu .nav-res-item { color: rgba(255,255,255,.90); }
html[data-mode="dark"] .nav-overflow-menu .nav-res-item:hover { background: rgba(255,255,255,.08); color: #fff; }

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

/* Metodologiya button custom styles */
.btn-methodology {
    color: #adb5bd;
    background: transparent;
    font-size: .8375rem;
    font-weight: 600;
    border: .0419rem solid #adb5bd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
    height: 1.5075rem;
    padding: 0 .67rem;
    border-radius: .2513rem;
    transition: background 0.18s, color 0.18s;
    outline: none;
    white-space: nowrap;
    margin: 0;
    vertical-align: middle;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    box-sizing: border-box;
}

html[data-mode="light"] .btn-methodology {
    color: rgba(255,255,255,0.88);
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

button.btn-methodology::-moz-focus-inner {
    border: 0;
    padding: 0;
}

html[data-mode="light"] .btn-methodology:hover,
html[data-mode="light"] .btn-methodology:focus,
html[data-mode="light"] .btn-methodology:active {
    background: rgba(255,255,255,0.20) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.65) !important;
    text-decoration: none;
}

html[data-mode="dark"] .btn-methodology:hover,
html[data-mode="dark"] .btn-methodology:focus,
html[data-mode="dark"] .btn-methodology:active {
    background: #2D4F8A;
    color: #fff !important;
    text-decoration: none;
}

/* Telegram bot link button */
.btn-telegram-bot {
    color: #adb5bd;
    background: transparent;
    font-size: .8375rem;
    font-weight: 600;
    border: .0419rem solid #adb5bd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .2513rem;
    line-height: 1;
    height: 1.5075rem;
    padding: 0 .67rem;
    border-radius: .2513rem;
    transition: background 0.18s, color 0.18s, border-color 0.18s;
    outline: none;
    white-space: nowrap;
    text-decoration: none;
}

html[data-mode="light"] .btn-telegram-bot {
    color: rgba(255,255,255,0.88);
    border-color: rgba(255,255,255,0.35);
    background: rgba(255,255,255,0.08);
}

html[data-mode="light"] .btn-telegram-bot:hover,
html[data-mode="light"] .btn-telegram-bot:focus,
html[data-mode="light"] .btn-telegram-bot:active {
    background: rgba(255,255,255,0.20) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,0.65) !important;
    text-decoration: none;
}

html[data-mode="dark"] .btn-telegram-bot:hover,
html[data-mode="dark"] .btn-telegram-bot:focus,
html[data-mode="dark"] .btn-telegram-bot:active {
    background: #2D4F8A;
    color: #fff !important;
    text-decoration: none;
}

.btn-telegram-bot svg {
    width: .67rem;
    height: .67rem;
    fill: currentColor;
    flex-shrink: 0;
}

/* Video guide modal: near full-page overlay */
#videoGuideModal .modal-dialog {
    width: 500vw;
    max-width: 50.25rem;
    margin: .8375rem auto;
}
@media (min-width: 992px) { #videoGuideModal .modal-dialog { width: 335vw; } }

#videoGuideModal .modal-content {
    background: #1f1f1f;
    border: .0419rem solid rgba(255, 255, 255, 0.14);
    border-radius: .5025rem;
    overflow: hidden;
    box-shadow: none !important;
    /* remove shadow */
    -webkit-box-shadow: none;
    filter: none;
}

#videoGuideModal .modal-dialog {
    box-shadow: none;
    -webkit-box-shadow: none;
    filter: none;
}

/* Ensure no nested element (header/body/iframe) adds any shadow/glow */
#videoGuideModal .modal-header,
#videoGuideModal .modal-body,
#videoGuideModal iframe {
    box-shadow: none;
    -webkit-box-shadow: none;
    filter: none;
}

#videoGuideModal .modal-header {
    border-bottom: .0419rem solid rgba(255, 255, 255, 0.14);
}

#videoGuideModal .modal-title {
    color: #f8fafc;
    font-weight: 700;
}

#videoGuideModal .close {
    color: #ffffff;
    text-shadow: none;
    opacity: 0.85;
}

#videoGuideModal .close:hover {
    opacity: 1;
}

#videoGuideModal .modal-body {
    padding: 0;
    height: min(78vh, 30.15rem);
}
@media (min-width: 992px) { #videoGuideModal .modal-body { height: min(52.26vh, 30.15rem); } }

#videoGuideModal iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* Full-screen backdrop */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0;
    width: 100vw;
    height: 100vh;
    background: #000;
}
.modal-backdrop.show { opacity: 0.75 !important; }
@media (max-width: 991.98px) {
    .modal-backdrop {
        width: 100vw;
        height: 100vh;
    }
}

/* Mobile: video guide modal — near-fullscreen, 16:9 proportional height */
@media (max-width: 991.98px) {
    #videoGuideModal .modal-dialog {
        width: calc(100vw - .335rem);
        max-width: calc(100vw - .335rem);
        margin: .1675rem auto;
    }

    #videoGuideModal .modal-body {
        height: 56.25vw;
        /* 16:9 */
    }

    #videoGuidePartsModal .modal-dialog {
        max-width: calc(100% - 1.34rem);
        margin: .8375rem auto;
    }
}

/* Light mode modal styling */
html[data-mode="light"] #videoGuideModal .modal-content {
    background: var(--bg-color);
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-mode="light"] #videoGuideModal .modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.12);
    background: transparent;
}

html[data-mode="light"] #videoGuideModal .modal-title {
    color: #000;
}

html[data-mode="light"] #videoGuideModal .close {
    color: #000;
}

/* Video parts selection modal */
#videoGuidePartsModal .modal-dialog {
    max-width: 21.775rem;
}

#videoGuidePartsModal .modal-content {
    border-radius: .5025rem;
    overflow: hidden;
    box-shadow: none !important;
    -webkit-box-shadow: none;
    filter: none;
    background: #1f1f1f;
    border: .0419rem solid rgba(255, 255, 255, 0.14);
}

#videoGuidePartsModal .modal-header {
    border-bottom: .0419rem solid rgba(255, 255, 255, 0.14);
}

#videoGuidePartsModal .modal-title {
    color: #f8fafc;
    font-weight: 700;
}

#videoGuidePartsModal .close {
    color: #ffffff;
    text-shadow: none;
    opacity: 0.85;
}

#videoGuidePartsModal .close:hover {
    opacity: 1;
}

#videoGuidePartsModal .modal-body {
    padding: .67rem;
}

#videoGuidePartsModal .video-part-btn {
    width: 100%;
    justify-content: center;
    margin: 0 0 .4188rem 0;
}

#videoGuidePartsModal .video-part-btn:last-child {
    margin-bottom: 0;
}

/* Light mode */
html[data-mode="light"] #videoGuidePartsModal .modal-content {
    background: var(--bg-color);
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-mode="light"] #videoGuidePartsModal .modal-header {
    border-bottom-color: rgba(0, 0, 0, 0.12);
    background: transparent;
}

/* Glass headers for both video modals */
@supports ((-webkit-backdrop-filter: blur(.0419rem)) or (backdrop-filter: blur(.0419rem))) {

    html[data-mode="light"] #videoGuideModal .modal-header,
    html[data-mode="light"] #videoGuidePartsModal .modal-header {
        background-color: var(--glass-strip, rgba(246, 245, 231, 0.78));
        -webkit-backdrop-filter: blur(var(--glass-blur, .5863rem)) saturate(var(--glass-saturate, 140%));
        backdrop-filter: blur(var(--glass-blur, .5863rem)) saturate(var(--glass-saturate, 140%));
    }

    html[data-mode="dark"] #videoGuideModal .modal-header,
    html[data-mode="dark"] #videoGuidePartsModal .modal-header {
        background-color: var(--glass-surface-strong, rgba(31, 31, 31, 0.78));
        -webkit-backdrop-filter: blur(var(--glass-blur, .67rem)) saturate(var(--glass-saturate, 135%));
        backdrop-filter: blur(var(--glass-blur, .67rem)) saturate(var(--glass-saturate, 135%));
    }
}

html[data-mode="light"] #videoGuidePartsModal .modal-title {
    color: #000;
}

html[data-mode="light"] #videoGuidePartsModal .close {
    color: #000;
}

html[data-mode="light"] #videoGuidePartsModal .video-part-btn {
    color: #1A2B4B;
    border-color: rgba(26,43,75,0.35);
    background: rgba(26,43,75,0.06);
}

html[data-mode="light"] #videoGuidePartsModal .video-part-btn:hover,
html[data-mode="light"] #videoGuidePartsModal .video-part-btn:focus,
html[data-mode="light"] #videoGuidePartsModal .video-part-btn:active {
    background: #1A2B4B !important;
    color: #fff !important;
    border-color: #1A2B4B !important;
    text-decoration: none;
}

/* Dark mode */
html[data-mode="dark"] #videoGuidePartsModal .video-part-btn:hover,
html[data-mode="dark"] #videoGuidePartsModal .video-part-btn:focus,
html[data-mode="dark"] #videoGuidePartsModal .video-part-btn:active {
    background: #2D4F8A;
    color: #fff !important;
    border-color: #2D4F8A;
    text-decoration: none;
}

#weeklyExcelModal .modal-dialog {
    max-width: 20.1rem;
}

#weeklyExcelModal .modal-content {
    border-radius: .5025rem;
    overflow: hidden;
    box-shadow: 0 .335rem 1.34rem rgba(0, 0, 0, 0.5), 0 .0838rem .335rem rgba(0, 0, 0, 0.4) !important;
    -webkit-box-shadow: 0 .335rem 1.34rem rgba(0, 0, 0, 0.5), 0 .0838rem .335rem rgba(0, 0, 0, 0.4);
    background: #1f1f1f;
    border: .0419rem solid rgba(255, 255, 255, 0.14);
}

#weeklyExcelModal .modal-header {
    border-bottom: .0419rem solid rgba(255, 255, 255, 0.14);
}

#weeklyExcelModal .modal-title {
    color: #f8fafc;
    font-weight: 700;
}

#weeklyExcelModal .close {
    color: #fff;
    text-shadow: none;
    opacity: 0.85;
}

#weeklyExcelModal .modal-body {
    padding: .8375rem 1.005rem;
}

#weeklyExcelModal .modal-footer {
    border-top: .0419rem solid rgba(255, 255, 255, 0.14);
    padding: .5025rem 1.005rem;
}

html[data-mode="light"] #weeklyExcelModal .modal-content {
    background: #ffffff;
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 .335rem 1.34rem rgba(0, 0, 0, 0.18), 0 .0838rem .335rem rgba(0, 0, 0, 0.10) !important;
}

html[data-mode="light"] #weeklyExcelModal .modal-header,
html[data-mode="light"] #weeklyExcelModal .modal-footer {
    border-color: rgba(0, 0, 0, 0.12);
}

html[data-mode="light"] #weeklyExcelModal .modal-title {
    color: #000;
}

html[data-mode="light"] #weeklyExcelModal .close {
    color: #000;
}

html[data-mode="light"] #weeklyExcelModal .weekly-excel-desc {
    color: #222;
}

html[data-mode="dark"] #weeklyExcelModal .weekly-excel-desc {
    color: rgba(255, 255, 255, 0.88);
}

.btn-weekly-download {
    display: inline-flex;
    align-items: center;
    gap: .2513rem;
    padding: 0 .8375rem;
    height: 1.5075rem;
    font-weight: 600;
    font-size: .6365rem;
    border-radius: .2513rem;
    border: .0419rem solid currentColor;
    background: transparent;
    transition: background 0.18s, color 0.18s;
    text-decoration: none;
}

html[data-mode="light"] .btn-weekly-download {
    color: #000;
    border-color: #000;
}

html[data-mode="light"] .btn-weekly-download:hover,
html[data-mode="light"] .btn-weekly-download:focus {
    background: var(--btn-hover-bg, #ffe27d);
    color: #000;
    text-decoration: none;
}

html[data-mode="dark"] .btn-weekly-download {
    color: #f8fafc;
    border-color: rgba(255, 255, 255, 0.35);
}

html[data-mode="dark"] .btn-weekly-download:hover,
html[data-mode="dark"] .btn-weekly-download:focus {
    background: rgba(76, 175, 80, 0.15);
    border-color: #4caf50;
    color: #4caf50;
    text-decoration: none;
}

.tools-opt-list { display:flex; flex-direction:column; gap:.5025rem; }
.tools-opt { display:flex; align-items:center; gap:.5863rem; width:100%; text-align:left;
    border:.0419rem solid rgba(0,0,0,.12); border-radius:.5025rem; padding:.5863rem .67rem;
    background:transparent; color:inherit; cursor:pointer; transition:background .15s,border-color .15s; }
.tools-opt:hover { border-color:#2D4F8A; background:rgba(45,79,138,.06); }
.tools-opt-ic { flex:0 0 1.7588rem; height:1.7588rem; border-radius:.4188rem; display:flex; align-items:center;
    justify-content:center; background:rgba(45,79,138,.12); color:#2D4F8A; font-size:.7705rem; }
.tools-opt-txt { display:flex; flex-direction:column; gap:.1256rem; }
.tools-opt-title { font-weight:700; font-size:.7035rem; }
.tools-opt-desc { font-size:.5762rem; opacity:.7; line-height:1.35; }
.diff-date-row { display:flex; flex-direction:column; gap:.2513rem; }
.diff-date-lbl { font-weight:600; font-size:.6365rem; }
/* Light mode: diff download button sits on a white modal — use blue, not the
   navbar's white-on-transparent styling (base.html). ID + !important to win. */
html[data-mode="light"] #priceDiffDownloadBtn {
    color:#2D4F8A; border-color:#2D4F8A; background:#fff;
}
html[data-mode="light"] #priceDiffDownloadBtn:hover,
html[data-mode="light"] #priceDiffDownloadBtn:focus {
    color:#fff !important; background:#2D4F8A !important; border-color:#2D4F8A !important;
}
html[data-mode="dark"] .tools-opt { border-color:rgba(255,255,255,.15); }
html[data-mode="dark"] .tools-opt:hover { border-color:#4caf50 !important; background:rgba(76,175,80,.08) !important; }
html[data-mode="dark"] .tools-opt-ic { background:rgba(76,175,80,.14); color:#4caf50; }

/* Mobile: keep the download modal centered and within the viewport
   (the 480px max-width otherwise overflows a ~390px screen and shifts it off-center) */
@media (max-width: 767px) {
    #weeklyExcelModal .modal-dialog {
        max-width: 92vw;
        margin-left: auto;
        margin-right: auto;
    }
}


/* ── moved from inline style attributes ── */
.fas.nav-ext-icon { font-size:.7em; opacity:.75; margin-left:.2513rem; }
.fas.nav-ext-icon-sm { font-size:.6em; opacity:.75; }
.btn-methodology.btn-icon { padding:0 .4188rem; }
.fab.nav-btn-icon { font-size:.938rem; }
.fas.nav-btn-icon { font-size:.938rem; }
.btn-methodology.btn-labeled { padding: 0 .5863rem; gap: .2931rem; display: inline-flex; align-items: center; }
.nav-item.nav-actions { gap: .2513rem; }
.btn-methodology.btn-icon-link { padding: 0 .4188rem; display:inline-flex; align-items:center; text-decoration:none; }
.btn-methodology.btn-labeled-link { padding: 0 .5863rem; gap: .2931rem; display:inline-flex; align-items:center; text-decoration:none; }
.modal-body.modal-body-centered { padding: 1.005rem; text-align: center; }
.modal-empty-text { margin:0; opacity: 0.6; }
.fas.modal-title-icon { font-size:.67rem; }
.diff-date-row.is-last { margin-top:.5025rem; }
.diff-error { color:#dc2626; font-size:.603rem; margin-top:.4188rem; }
.modal-footer.modal-footer-end { justify-content:flex-end; gap:.4188rem; }
