/* ── ACCESSIBILITY & THEME STYLES ──────────────────────────────── */
:root {
  --app-font-scale: 1;
  --theme-primary-rgb: 37, 99, 235;
  --theme-primary: rgb(var(--theme-primary-rgb));
  --tp-primary: rgb(var(--theme-primary-rgb)) !important;
}

html[data-font-scale="small"] { --app-font-scale: 0.9; font-size: 90%; }
html[data-font-scale="normal"] { --app-font-scale: 1; font-size: 100%; }
html[data-font-scale="large"] { --app-font-scale: 1.15; font-size: 115%; }
html[data-font-scale="xlarge"] { --app-font-scale: 1.3; font-size: 130%; }

/* 🎨 DYNAMIC THEME ACCENTS: SIDEBAR, YOZUVLAR, TUGMALAR (RASM ORQASI O'ZGARMAYDI) */

/* 1. SIDEBAR (Talaba, O'qituvchi & Admin) */
.tp-sidebar .tp-nav-item {
  color: #334155;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}
.tp-sidebar .tp-nav-item .left-group span:not(.material-symbols-outlined) {
  color: inherit;
}
.tp-sidebar .tp-nav-item span.material-symbols-outlined {
  color: #64748b;
  transition: color 0.2s ease;
}
.tp-sidebar .tp-nav-item:hover {
  background: rgba(var(--theme-primary-rgb), 0.08) !important;
  color: rgb(var(--theme-primary-rgb)) !important;
}
.tp-sidebar .tp-nav-item:hover .left-group span:not(.material-symbols-outlined),
.tp-sidebar .tp-nav-item:hover span.material-symbols-outlined {
  color: rgb(var(--theme-primary-rgb)) !important;
}

.tp-sidebar .tp-nav-item.active {
  background: rgb(var(--theme-primary-rgb)) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  box-shadow: 0 4px 14px rgba(var(--theme-primary-rgb), 0.35) !important;
}
.tp-sidebar .tp-nav-item.active .left-group span:not(.material-symbols-outlined),
.tp-sidebar .tp-nav-item.active span,
.tp-sidebar .tp-nav-item.active span.material-symbols-outlined {
  color: #ffffff !important;
}

/* Light mode AI / Highlight button (.ai-btn: EduCoin, AI yordamchi) */
.tp-sidebar .tp-nav-item.ai-btn {
  background: linear-gradient(135deg, #eff6ff 0%, #f5f3ff 100%) !important;
  border: 1.5px solid #c7d2fe !important;
  color: #3730a3 !important;
}
.tp-sidebar .tp-nav-item.ai-btn .left-group span:not(.material-symbols-outlined) {
  color: #3730a3 !important;
  font-weight: 700 !important;
}
.tp-sidebar .tp-nav-item.ai-btn span.material-symbols-outlined {
  color: #4f46e5 !important;
}
.tp-sidebar .tp-nav-item.ai-btn:hover {
  background: #e0e7ff !important;
  border-color: #818cf8 !important;
  color: #312e81 !important;
}
.tp-sidebar .tp-nav-item.ai-btn:hover .left-group span:not(.material-symbols-outlined) {
  color: #312e81 !important;
}
.tp-sidebar .tp-nav-item.ai-btn.active {
  background: linear-gradient(135deg, #4f46e5 0%, #3730a3 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.4) !important;
}
.tp-sidebar .tp-nav-item.ai-btn.active .left-group span:not(.material-symbols-outlined),
.tp-sidebar .tp-nav-item.ai-btn.active span,
.tp-sidebar .tp-nav-item.ai-btn.active span.material-symbols-outlined {
  color: #ffffff !important;
}

.tp-sidebar .tp-brand-text p {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.tp-sidebar .tp-nav-badge {
  background: rgb(var(--theme-primary-rgb)) !important;
  color: #ffffff !important;
}
.tp-user-pill .tp-avatar {
  border-color: rgb(var(--theme-primary-rgb)) !important;
}
.a-sidebar .a-nav a.active {
  color: #ffffff !important;
  background: rgb(var(--theme-primary-rgb)) !important;
  box-shadow: 0 4px 14px rgba(var(--theme-primary-rgb), 0.35) !important;
}
.a-sidebar .a-nav a.active span {
  color: #ffffff !important;
}
.a-sidebar .a-nav a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

/* 2. YOZUVLAR, SARLAVHALAR VA HAVOLALAR */
.header-brand .name {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.header-brand .sub {
  border-left-color: rgb(var(--theme-primary-rgb)) !important;
}
.main-nav a.active {
  color: rgb(var(--theme-primary-rgb)) !important;
  border-bottom-color: rgb(var(--theme-primary-rgb)) !important;
}
.main-nav a:hover {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.pre-label,
.sec-tag,
.hero-tag,
.badge-label {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.text-primary,
.link-primary,
a.read-more,
.card-action,
.dept-card:hover h3,
.news-card:hover h3,
.elon-card:hover h4 {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.stat-box .material-symbols-outlined,
.stat-box .stat-num,
.c-icon {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.breadcrumb a:hover,
.breadcrumb span.current {
  color: rgb(var(--theme-primary-rgb)) !important;
}

/* 3. TUGMALAR, BADJLAR VA INTERAKTIV ELEMENTLAR */
.btn-primary, .btn.btn-primary, button.btn-primary {
  background: rgb(var(--theme-primary-rgb)) !important;
  border-color: rgb(var(--theme-primary-rgb)) !important;
  color: #ffffff !important;
}
.btn-primary:hover, .btn.btn-primary:hover {
  filter: brightness(0.92);
}
.btn-outline {
  border-color: rgb(var(--theme-primary-rgb)) !important;
  color: rgb(var(--theme-primary-rgb)) !important;
}
.btn-outline:hover {
  background: rgb(var(--theme-primary-rgb)) !important;
  color: #ffffff !important;
}
input:focus, select:focus, textarea:focus, .form-control:focus {
  border-color: rgb(var(--theme-primary-rgb)) !important;
  box-shadow: 0 0 0 3px rgba(var(--theme-primary-rgb), 0.18) !important;
}
.nav-tab.active, .filter-btn.active, .pagination span.active {
  background: rgb(var(--theme-primary-rgb)) !important;
  color: #ffffff !important;
}
.access-hamburg-btn:hover {
  color: rgb(var(--theme-primary-rgb)) !important;
}
.header-actions .access-hamburg-btn {
  width: 44px !important;
  height: 44px !important;
  flex: 0 0 44px;
  margin: 0 !important;
}
.header-actions .access-hamburg-btn:hover,
.header-actions .access-hamburg-btn:focus-visible {
  outline: 2px solid rgba(var(--theme-primary-rgb), .35);
  outline-offset: 2px;
}
.header-actions .access-hamburg-btn {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid rgba(var(--theme-primary-rgb), .18);
  border-radius: 14px;
  background: rgba(var(--theme-primary-rgb), .08);
  color: rgb(var(--theme-primary-rgb));
}
.header-actions .access-hamburg-btn:hover,
.header-actions .access-hamburg-btn:focus-visible {
  background: rgba(var(--theme-primary-rgb), .15);
  outline: 2px solid rgba(var(--theme-primary-rgb), .35);
  outline-offset: 2px;
}
.header-actions .access-hamburg-btn .material-symbols-outlined {
  font-size: 22px;
}

/* 4. RASM VA FOTO MUHOFAZASI (RASM ORQASIGA RANGLAR TEGMASLIGI UCHUN) */
.hero-bg,
.hero-overlay,
.gallery-item,
.news-card-img,
.elon-card-img,
.dept-card-img {
  filter: none !important;
}

/* ==========================================================================
   🌙 DARK THEME MODE (TUNGI VA KO'ZGA QULAY REJIM)
   ========================================================================== */
html[data-theme-mode="dark"] {
  /* Material Design 3 Palette Tokens in Dark Mode */
  --md-sys-color-primary: #aec6ff;
  --md-sys-color-on-primary: #002e69;
  --md-sys-color-primary-container: #1b3d7a;
  --md-sys-color-on-primary-container: #d8e2ff;
  
  --md-sys-color-secondary: #bec6dc;
  --md-sys-color-on-secondary: #283141;
  --md-sys-color-secondary-container: #3f4759;
  --md-sys-color-on-secondary-container: #dbe2f9;

  --md-sys-color-tertiary: #e1c46d;
  --md-sys-color-on-tertiary: #3c2f00;
  --md-sys-color-tertiary-container: #574500;
  --md-sys-color-on-tertiary-container: #ffe090;

  --md-sys-color-error: #ffb4ab;
  --md-sys-color-on-error: #690005;
  --md-sys-color-error-container: #93000a;
  --md-sys-color-on-error-container: #ffdad6;

  --md-sys-color-background: #0b0f19;
  --md-sys-color-on-background: #f1f5f9;
  --md-sys-color-surface: #111827;
  --md-sys-color-on-surface: #f8fafc;
  --md-sys-color-surface-variant: #1e293b;
  --md-sys-color-on-surface-variant: #94a3b8;
  --md-sys-color-outline: #475569;
  --md-sys-color-outline-variant: #1f2937;
  --md-sys-color-inverse-surface: #f2f0f4;
  --md-sys-color-inverse-on-surface: #1b1b1f;
  --md-sys-color-inverse-primary: #315cab;
  
  --md-sys-color-surface-container-lowest: #0b0f19;
  --md-sys-color-surface-container-low: #111827;
  --md-sys-color-surface-container: #1e293b;
  --md-sys-color-surface-container-high: #243048;
  --md-sys-color-surface-container-highest: #2d3b58;
  --md-sys-color-surface-dim: #0b0f19;
  --md-sys-color-surface-bright: #1e293b;

  /* Extended Containers */
  --md-ext-orange-container: #451a03;
  --md-ext-on-orange-container: #fed7aa;
  --md-ext-violet-container: #3b0764;
  --md-ext-on-violet-container: #e9d5ff;
  --md-ext-rose-container: #4c0519;
  --md-ext-on-rose-container: #fecdd3;
  --md-ext-teal-container: #042f2e;
  --md-ext-on-teal-container: #99f6e4;
  --md-ext-green-container: #052e16;
  --md-ext-on-green-container: #bbf7d0;

  /* Public Site Legacy Aliases */
  --navy: #60a5fa;
  --navy-mid: #3b82f6;
  --navy-light: #2563eb;
  --gold: #fbbf24;
  --gold-light: #fef3c7;
  --sky: #38bdf8;
  --sky-light: rgba(56, 189, 248, 0.15);
  --white: #111827;
  --bg: #0b0f19;
  --bg-card: #111827;
  --text-main: #f8fafc;
  --text-muted: #94a3b8;
  --border: #1f2937;

  /* Talaba Portal Tokens */
  --tp-bg: #0b0f19;
  --tp-surface: #111827;
  --tp-text-main: #f8fafc;
  --tp-text-sub: #94a3b8;
  --tp-border: #1f2937;
  --tp-primary-light: rgba(37, 99, 235, 0.18);

  /* O'qituvchi Portal Tokens */
  --tc-bg: #0b0f19;
  --tc-surface: #111827;
  --tc-card: #111827;
  --tc-text: #f8fafc;
  --tc-text-main: #f8fafc;
  --tc-text-sub: #94a3b8;
  --tc-border: #1f2937;
  --tc-primary-light: rgba(59, 130, 246, 0.15);

  /* Admin Portal Tokens */
  --adm-bg: #0b0f19;
  --adm-surface: #111827;
  --adm-border: #1f2937;
  --adm-border-hover: #374151;
  --adm-text-main: #f8fafc;
  --adm-text-muted: #94a3b8;
  --adm-text-light: #64748b;
  --adm-primary-light: rgba(37, 99, 235, 0.18);
  --adm-sidebar-bg: #070a12;
  --adm-sidebar-surface: #111827;
  --adm-sidebar-border: #1f2937;
}

html[data-theme-mode="dark"] body {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}

/* Header & Top Bar */
html[data-theme-mode="dark"] .header {
  background: #111827 !important;
  border-bottom: 1px solid #1f2937 !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.4) !important;
}

/* Header Brand Text */
html[data-theme-mode="dark"] .header-brand .brand-text .name {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .header-brand .brand-text .sub {
  color: #94a3b8 !important;
}

/* Main Navigation: Links, Dropdown Buttons, Icons & Active States */
html[data-theme-mode="dark"] .main-nav a,
html[data-theme-mode="dark"] .main-nav .dd-trigger {
  color: #cbd5e1 !important;
  background: transparent;
}

html[data-theme-mode="dark"] .main-nav a .material-symbols-outlined,
html[data-theme-mode="dark"] .main-nav .dd-trigger .material-symbols-outlined,
html[data-theme-mode="dark"] .main-nav .dd-trigger .arrow {
  color: inherit !important;
}

html[data-theme-mode="dark"] .main-nav a:hover,
html[data-theme-mode="dark"] .main-nav .dd-trigger:hover,
html[data-theme-mode="dark"] .dd-wrap:focus-within .dd-trigger {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
}

html[data-theme-mode="dark"] .main-nav a.active,
html[data-theme-mode="dark"] .main-nav .dd-trigger.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25) !important;
}

html[data-theme-mode="dark"] .main-nav a.active .material-symbols-outlined,
html[data-theme-mode="dark"] .main-nav .dd-trigger.active .material-symbols-outlined,
html[data-theme-mode="dark"] .main-nav .dd-trigger.active .arrow {
  color: #0f172a !important;
}

/* Dropdown Menus */
html[data-theme-mode="dark"] .dd-menu {
  background: #1f2937 !important;
  border: 1px solid #374151 !important;
  box-shadow: 0 10px 25px rgba(0,0,0,0.5) !important;
}
html[data-theme-mode="dark"] .dd-menu a {
  color: #e2e8f0 !important;
}
html[data-theme-mode="dark"] .dd-menu a:hover {
  background: #374151 !important;
  color: #ffffff !important;
}

/* Language Switcher Segmented Control (UZ, RU, EN) */
html[data-theme-mode="dark"] .lang-switcher {
  border: 1.5px solid rgba(255, 255, 255, 0.22) !important;
  background: rgba(15, 23, 42, 0.8) !important;
}

html[data-theme-mode="dark"] .lang-switcher a {
  color: #e2e8f0 !important;
  font-weight: 700 !important;
  text-decoration: none;
  transition: all 0.18s ease;
}

html[data-theme-mode="dark"] .lang-switcher a + a {
  border-left: 1px solid rgba(255, 255, 255, 0.18) !important;
}

html[data-theme-mode="dark"] .lang-switcher a:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.14) !important;
}

html[data-theme-mode="dark"] .lang-switcher a.active {
  background: #ffffff !important;
  color: #0f172a !important;
  font-weight: 800 !important;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.35) !important;
}

/* Header Action Icon Buttons (Accessibility, Push Notifications, PWA, Hamburger) */
html[data-theme-mode="dark"] .header .icon-btn,
html[data-theme-mode="dark"] .icon-btn {
  color: #e2e8f0 !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.14) !important;
}

html[data-theme-mode="dark"] .header .icon-btn:hover,
html[data-theme-mode="dark"] .icon-btn:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.28) !important;
}

/* Mobile Drawer */
html[data-theme-mode="dark"] .mobile-nav {
  background: #111827 !important;
  border-right: 1px solid #1f2937 !important;
  color: #f1f5f9 !important;
}
html[data-theme-mode="dark"] .mobile-nav .drawer-head {
  border-bottom: 1px solid #1f2937 !important;
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .mobile-nav a {
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .mobile-nav a:hover,
html[data-theme-mode="dark"] .mobile-nav a.active {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
}

/* Cards, Content Containers & Boxes across Public, Talaba and Admin */
html[data-theme-mode="dark"] .card,
html[data-theme-mode="dark"] .dept-card,
html[data-theme-mode="dark"] .dk-card,
html[data-theme-mode="dark"] .dk-body,
html[data-theme-mode="dark"] .news-card,
html[data-theme-mode="dark"] .elon-card,
html[data-theme-mode="dark"] .a-card,
html[data-theme-mode="dark"] .a-card.tonal,
html[data-theme-mode="dark"] .a-stat,
html[data-theme-mode="dark"] .a-action,
html[data-theme-mode="dark"] .a-table-wrap,
html[data-theme-mode="dark"] .tp-card,
html[data-theme-mode="dark"] .tp-stat-box,
html[data-theme-mode="dark"] .book-item-card,
html[data-theme-mode="dark"] .hero-stat-card,
html[data-theme-mode="dark"] .tp-sidebar,
html[data-theme-mode="dark"] .tp-topbar,
html[data-theme-mode="dark"] .tp-main,
html[data-theme-mode="dark"] .quick-mod-btn,
html[data-theme-mode="dark"] .footer,
html[data-theme-mode="dark"] .section,
html[data-theme-mode="dark"] .file-box,
html[data-theme-mode="dark"] .contact-card,
html[data-theme-mode="dark"] .about-card,
html[data-theme-mode="dark"] .kaf-box,
html[data-theme-mode="dark"] .article-box,
html[data-theme-mode="dark"] .search-card,
html[data-theme-mode="dark"] .achievement,
html[data-theme-mode="dark"] .pillar-card,
html[data-theme-mode="dark"] .metric-card {
  background-color: #111827 !important;
  color: #f1f5f9 !important;
  border-color: #1f2937 !important;
}

/* Kafedralar & Directions Cards in Dark Mode */
html[data-theme-mode="dark"] .dk-card {
  background-color: #111827 !important;
  border: 1px solid #1f2937 !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme-mode="dark"] .dk-body {
  background-color: #111827 !important;
}
html[data-theme-mode="dark"] .dk-top {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
}
html[data-theme-mode="dark"] .dk-body h3,
html[data-theme-mode="dark"] .dept-card h3 {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .dk-body p,
html[data-theme-mode="dark"] .dept-card p {
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .dk-head-name {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .dk-head-role {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .dk-body .btn-ghost,
html[data-theme-mode="dark"] .dept-card .btn-ghost,
html[data-theme-mode="dark"] .btn-ghost {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #f8fafc !important;
  border: 1px solid rgba(255, 255, 255, 0.16) !important;
}
html[data-theme-mode="dark"] .dk-body .btn-ghost:hover,
html[data-theme-mode="dark"] .dept-card .btn-ghost:hover,
html[data-theme-mode="dark"] .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.18) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.3) !important;
}

/* Universal Dark Override for Inline Light Containers across Public, Talaba and Admin */
html[data-theme-mode="dark"] div[style*="background:#ffffff"],
html[data-theme-mode="dark"] div[style*="background: #ffffff"],
html[data-theme-mode="dark"] div[style*="background:white"],
html[data-theme-mode="dark"] div[style*="background: white"],
html[data-theme-mode="dark"] div[style*="background:#fff"],
html[data-theme-mode="dark"] div[style*="background: #fff"],
html[data-theme-mode="dark"] div[style*="background:#f8fafc"],
html[data-theme-mode="dark"] div[style*="background: #f8fafc"],
html[data-theme-mode="dark"] div[style*="background:#faf8fd"],
html[data-theme-mode="dark"] div[style*="background: #faf8fd"],
html[data-theme-mode="dark"] div[style*="background:var(--white)"],
html[data-theme-mode="dark"] div[style*="background: var(--white)"],
html[data-theme-mode="dark"] div[style*="surface-container-lowest"],
html[data-theme-mode="dark"] div[style*="surface-container-low"],
html[data-theme-mode="dark"] section[style*="background:#ffffff"],
html[data-theme-mode="dark"] section[style*="background: #ffffff"],
html[data-theme-mode="dark"] section[style*="background:white"],
html[data-theme-mode="dark"] section[style*="background: white"],
html[data-theme-mode="dark"] section[style*="background:#f8fafc"],
html[data-theme-mode="dark"] section[style*="background: #f8fafc"],
html[data-theme-mode="dark"] section[style*="background:var(--white)"],
html[data-theme-mode="dark"] section[style*="background: var(--white)"],
html[data-theme-mode="dark"] section[style*="surface-container-lowest"],
html[data-theme-mode="dark"] section[style*="surface-container-low"],
html[data-theme-mode="dark"] article[style*="background:#ffffff"],
html[data-theme-mode="dark"] article[style*="background:white"],
html[data-theme-mode="dark"] aside[style*="background:#ffffff"],
html[data-theme-mode="dark"] aside[style*="background:white"] {
  background-color: #111827 !important;
  border-color: #1f2937 !important;
  color: #f8fafc !important;
}

/* Admin Top Bar & Controls in Dark Mode */
html[data-theme-mode="dark"] .a-top {
  background: rgba(17, 24, 39, 0.88) !important;
  backdrop-filter: blur(16px) !important;
  -webkit-backdrop-filter: blur(16px) !important;
  border-bottom: 1px solid #1f2937 !important;
}
html[data-theme-mode="dark"] .a-top.scrolled {
  background: rgba(17, 24, 39, 0.98) !important;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4) !important;
}
html[data-theme-mode="dark"] .a-top-title h1 {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .a-top-title .a-top-crumb {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .a-clock-pill {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .a-top-link-btn,
html[data-theme-mode="dark"] .a-top-icon-btn,
html[data-theme-mode="dark"] .a-user {
  background: #1e293b !important;
  border-color: #334155 !important;
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .a-top-link-btn:hover,
html[data-theme-mode="dark"] .a-top-icon-btn:hover,
html[data-theme-mode="dark"] .a-user:hover {
  background: #334155 !important;
  border-color: #475569 !important;
  color: #ffffff !important;
}
html[data-theme-mode="dark"] .a-top-link-btn span,
html[data-theme-mode="dark"] .a-user .u-name {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .a-user .u-role {
  color: #60a5fa !important;
}
html[data-theme-mode="dark"] .a-action b,
html[data-theme-mode="dark"] .a-card h2,
html[data-theme-mode="dark"] .a-sec-title,
html[data-theme-mode="dark"] .a-stat .num {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .a-action small,
html[data-theme-mode="dark"] .a-card .sub,
html[data-theme-mode="dark"] .a-lead,
html[data-theme-mode="dark"] .a-stat .lbl {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .a-table-wrap {
  background: #111827 !important;
  border: 1.5px solid #1f2937 !important;
}
html[data-theme-mode="dark"] .a-table th,
html[data-theme-mode="dark"] table th {
  background: #1e293b !important;
  color: #cbd5e1 !important;
  border-bottom: 1.5px solid #334155 !important;
}
html[data-theme-mode="dark"] .a-table td,
html[data-theme-mode="dark"] table td {
  background: transparent !important;
  color: #f1f5f9 !important;
  border-top: 1px solid #1f2937 !important;
}
html[data-theme-mode="dark"] .a-table tr:hover td,
html[data-theme-mode="dark"] table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.04) !important;
}
html[data-theme-mode="dark"] .a-li {
  border-top-color: #1f2937 !important;
}
html[data-theme-mode="dark"] .a-li .hd {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .a-li .sp {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .a-kv {
  border-top-color: #1f2937 !important;
}
html[data-theme-mode="dark"] .a-kv span:first-child {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .a-kv span:last-child {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] dialog.md-dialog {
  background: #111827 !important;
  border: 1px solid #1f2937 !important;
  color: #f8fafc !important;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6) !important;
}
html[data-theme-mode="dark"] dialog.md-dialog h3 {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] dialog.md-dialog p {
  color: #94a3b8 !important;
}

/* Talaba Portal Components in Dark Mode */
html[data-theme-mode="dark"] .tp-main {
  background-color: #0b0f19 !important;
  color: #f1f5f9 !important;
}
html[data-theme-mode="dark"] .tp-topbar {
  background-color: #111827 !important;
  border-bottom: 1px solid #1f2937 !important;
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .tp-stat-box,
html[data-theme-mode="dark"] .tp-card,
html[data-theme-mode="dark"] .book-item-card {
  background-color: #111827 !important;
  border-color: #1f2937 !important;
  color: #f8fafc !important;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3) !important;
}
html[data-theme-mode="dark"] .tp-stat-info .num {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .tp-stat-info .lbl {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .quick-mod-btn {
  background-color: #111827 !important;
  border-color: #1f2937 !important;
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .quick-mod-btn span.title {
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .quick-mod-btn:hover {
  background-color: #1e293b !important;
  border-color: #3b82f6 !important;
}
html[data-theme-mode="dark"] .baho-pill-wait {
  background-color: #1e293b !important;
  color: #94a3b8 !important;
  border-color: #334155 !important;
}
html[data-theme-mode="dark"] .exam-row {
  background-color: #1e293b !important;
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] code {
  background: #1e293b !important;
  color: #60a5fa !important;
  border: 1px solid #334155 !important;
}

html[data-theme-mode="dark"] .pillar-card {
  background: #111827 !important;
  border-color: #1f2937 !important;
  box-shadow: 0 4px 16px rgba(0,0,0,0.4) !important;
}
html[data-theme-mode="dark"] .pillar-card h3 {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .pillar-card p {
  color: #94a3b8 !important;
}

html[data-theme-mode="dark"] .tp-user-pill,
html[data-theme-mode="dark"] .tp-chip-gpa,
html[data-theme-mode="dark"] .tp-icon-btn {
  background: #1f2937 !important;
  color: #f1f5f9 !important;
}

/* ── STUDENT & TEACHER SIDEBAR IN DARK MODE ── */
html[data-theme-mode="dark"] .tp-sidebar {
  background: #111827 !important;
  border-right-color: #1f2937 !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-brand-text h2 {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-brand-text p {
  color: #60a5fa !important;
}

/* Inactive items in Dark Mode */
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item {
  color: #cbd5e1 !important;
  background: transparent !important;
  border: 1.5px solid transparent !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item .left-group span:not(.material-symbols-outlined) {
  color: #cbd5e1 !important;
  font-weight: 500;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item span.material-symbols-outlined {
  color: #94a3b8 !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item:hover {
  background: rgba(255, 255, 255, 0.08) !important;
  color: #ffffff !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item:hover .left-group span:not(.material-symbols-outlined),
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item:hover span.material-symbols-outlined {
  color: #ffffff !important;
}

/* Highlighted items (.ai-btn: EduCoin, AI yordamchi) in Dark Mode */
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.2) 0%, rgba(59, 130, 246, 0.16) 100%) !important;
  border: 1.5px solid rgba(129, 140, 248, 0.45) !important;
  color: #e0e7ff !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3) !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn .left-group span:not(.material-symbols-outlined) {
  color: #e0e7ff !important;
  font-weight: 700 !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn span.material-symbols-outlined {
  color: #a5b4fc !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn:hover {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.35) 0%, rgba(59, 130, 246, 0.3) 100%) !important;
  border-color: #818cf8 !important;
  color: #ffffff !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn:hover .left-group span:not(.material-symbols-outlined),
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn:hover span.material-symbols-outlined {
  color: #ffffff !important;
}

/* Active Highlighted item in Dark Mode */
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%) !important;
  border-color: rgba(255, 255, 255, 0.35) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 18px rgba(99, 102, 241, 0.5) !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active .left-group span:not(.material-symbols-outlined),
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active span,
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active span.material-symbols-outlined {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* Active Normal item in Dark Mode */
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  color: #ffffff !important;
  font-weight: 700 !important;
  border: 1.5px solid transparent !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.45) !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active .left-group span:not(.material-symbols-outlined),
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active span,
html[data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active span.material-symbols-outlined {
  color: #ffffff !important;
  font-weight: 700 !important;
}

/* Teacher portal KPI highlight item in Dark Mode */
html[data-theme-mode="dark"] .tp-sidebar .tp-highlight-kpi {
  background: rgba(2, 132, 199, 0.18) !important;
  border: 1.5px solid rgba(56, 189, 248, 0.4) !important;
  color: #38bdf8 !important;
}
html[data-theme-mode="dark"] .tp-sidebar .tp-highlight-kpi span {
  color: #38bdf8 !important;
}

/* Headings & Text Contrast */
html[data-theme-mode="dark"] h1, 
html[data-theme-mode="dark"] h2, 
html[data-theme-mode="dark"] h3, 
html[data-theme-mode="dark"] h4,
html[data-theme-mode="dark"] h5,
html[data-theme-mode="dark"] h6 {
  color: #f8fafc !important;
}

html[data-theme-mode="dark"] p,
html[data-theme-mode="dark"] td,
html[data-theme-mode="dark"] th,
html[data-theme-mode="dark"] li,
html[data-theme-mode="dark"] .file-name {
  color: #f1f5f9 !important;
}

html[data-theme-mode="dark"] span:not(.material-symbols-outlined):not(.status-badge):not(.action-badge):not(.badge):not(.btn):not(.tag):not(.av):not(.dot-badge):not(.a-badge) {
  color: #cbd5e1;
}

/* Badge and Alert Tinted Backgrounds in Dark Mode */
html[data-theme-mode="dark"] [style*="background:#dcfce7"],
html[data-theme-mode="dark"] [style*="background: #dcfce7"],
html[data-theme-mode="dark"] [style*="background:#f0fdf4"],
html[data-theme-mode="dark"] [style*="background: #f0fdf4"] {
  background: rgba(34, 197, 94, 0.16) !important;
  color: #4ade80 !important;
  border-color: rgba(34, 197, 94, 0.3) !important;
}
html[data-theme-mode="dark"] [style*="background:#fee2e2"],
html[data-theme-mode="dark"] [style*="background: #fee2e2"],
html[data-theme-mode="dark"] [style*="background:#fef2f2"],
html[data-theme-mode="dark"] [style*="background: #fef2f2"] {
  background: rgba(239, 68, 68, 0.16) !important;
  color: #f87171 !important;
  border-color: rgba(239, 68, 68, 0.3) !important;
}
html[data-theme-mode="dark"] [style*="background:#eff6ff"],
html[data-theme-mode="dark"] [style*="background: #eff6ff"],
html[data-theme-mode="dark"] [style*="background:#e0f2fe"],
html[data-theme-mode="dark"] [style*="background: #e0f2fe"] {
  background: rgba(37, 99, 235, 0.18) !important;
  color: #60a5fa !important;
  border-color: rgba(37, 99, 235, 0.35) !important;
}
html[data-theme-mode="dark"] [style*="background:#fffbeb"],
html[data-theme-mode="dark"] [style*="background: #fffbeb"],
html[data-theme-mode="dark"] [style*="background:#fef9c3"],
html[data-theme-mode="dark"] [style*="background: #fef9c3"] {
  background: rgba(245, 158, 11, 0.16) !important;
  color: #fbbf24 !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
}

/* Dark mode overrides for hardcoded inline colors */
html[data-theme-mode="dark"] [style*="color:#0f172a"],
html[data-theme-mode="dark"] [style*="color: #0f172a"],
html[data-theme-mode="dark"] [style*="color:#000000"],
html[data-theme-mode="dark"] [style*="color: #000000"],
html[data-theme-mode="dark"] [style*="color:#1b1b1f"],
html[data-theme-mode="dark"] [style*="color: #1b1b1f"],
html[data-theme-mode="dark"] [style*="color:#1e293b"],
html[data-theme-mode="dark"] [style*="color: #1e293b"] {
  color: #f8fafc !important;
}

html[data-theme-mode="dark"] [style*="color:#334155"],
html[data-theme-mode="dark"] [style*="color: #334155"],
html[data-theme-mode="dark"] [style*="color:#475569"],
html[data-theme-mode="dark"] [style*="color: #475569"],
html[data-theme-mode="dark"] [style*="color:#64748b"],
html[data-theme-mode="dark"] [style*="color: #64748b"],
html[data-theme-mode="dark"] [style*="color:#6b7280"],
html[data-theme-mode="dark"] [style*="color: #6b7280"] {
  color: #cbd5e1 !important;
}

/* Metric stat numbers contrast in dark mode */
html[data-theme-mode="dark"] .section-metrics {
  background: #0b0f19 !important;
  border-bottom-color: #1f2937 !important;
}
html[data-theme-mode="dark"] .metric-card {
  background: #111827 !important;
  border-color: #1f2937 !important;
}
html[data-theme-mode="dark"] .metric-lbl {
  color: #cbd5e1 !important;
}
html[data-theme-mode="dark"] .metric-icon-box {
  background: rgba(255, 255, 255, 0.08) !important;
}
html[data-theme-mode="dark"] [style*="color:#1d4ed8"],
html[data-theme-mode="dark"] [style*="color: #1d4ed8"] {
  color: #60a5fa !important;
}
html[data-theme-mode="dark"] [style*="color:#16a34a"],
html[data-theme-mode="dark"] [style*="color: #16a34a"] {
  color: #4ade80 !important;
}
html[data-theme-mode="dark"] [style*="color:#d97706"],
html[data-theme-mode="dark"] [style*="color: #d97706"] {
  color: #fbbf24 !important;
}
html[data-theme-mode="dark"] [style*="color:#7c3aed"],
html[data-theme-mode="dark"] [style*="color: #7c3aed"] {
  color: #c084fc !important;
}

/* File list box inside repositories */
html[data-theme-mode="dark"] .file-box {
  background: #111827 !important;
  border: 1px solid #1f2937 !important;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3) !important;
}
html[data-theme-mode="dark"] .file-box .file-name {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .file-box .file-icon {
  background: rgba(2, 132, 199, 0.2) !important;
  color: #38bdf8 !important;
}

/* Form inputs in Dark Mode */
html[data-theme-mode="dark"] input:not([type="submit"]):not([type="button"]):not([type="radio"]):not([type="checkbox"]),
html[data-theme-mode="dark"] textarea,
html[data-theme-mode="dark"] select {
  background: #1e293b !important;
  color: #f8fafc !important;
  border-color: #334155 !important;
}
html[data-theme-mode="dark"] input::placeholder,
html[data-theme-mode="dark"] textarea::placeholder {
  color: #94a3b8 !important;
}

/* ==========================================================================
   ⚡ HIGH CONTRAST (QORA-SARIQ YUQORI KONTRAST REJIM)
   ========================================================================== */
html[data-contrast="high-contrast"] {
  filter: contrast(135%);
}

html[data-contrast="high-contrast"] body {
  background-color: #000000 !important;
  color: #ffff00 !important; /* Qora fonda yorqin sariq matn */
}

html[data-contrast="high-contrast"] .header,
html[data-contrast="high-contrast"] .footer,
html[data-contrast="high-contrast"] .card,
html[data-contrast="high-contrast"] .dept-card,
html[data-contrast="high-contrast"] .news-card,
html[data-contrast="high-contrast"] .elon-card,
html[data-contrast="high-contrast"] .section,
html[data-contrast="high-contrast"] .file-box,
html[data-contrast="high-contrast"] .access-drawer,
html[data-contrast="high-contrast"] .mobile-nav {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

/* Header & Nav in High Contrast */
html[data-contrast="high-contrast"] .main-nav a,
html[data-contrast="high-contrast"] .main-nav .dd-trigger {
  color: #ffff00 !important;
  border: 1px solid rgba(255, 255, 0, 0.4) !important;
}

html[data-contrast="high-contrast"] .main-nav a .material-symbols-outlined,
html[data-contrast="high-contrast"] .main-nav .dd-trigger .material-symbols-outlined,
html[data-contrast="high-contrast"] .main-nav .dd-trigger .arrow {
  color: inherit !important;
}

html[data-contrast="high-contrast"] .main-nav a:hover,
html[data-contrast="high-contrast"] .main-nav .dd-trigger:hover,
html[data-contrast="high-contrast"] .main-nav a.active,
html[data-contrast="high-contrast"] .main-nav .dd-trigger.active {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 800 !important;
  border-color: #ffff00 !important;
}

html[data-contrast="high-contrast"] .main-nav a.active .material-symbols-outlined,
html[data-contrast="high-contrast"] .main-nav .dd-trigger.active .material-symbols-outlined,
html[data-contrast="high-contrast"] .main-nav .dd-trigger.active .arrow {
  color: #000000 !important;
}

/* Language Switcher in High Contrast */
html[data-contrast="high-contrast"] .lang-switcher {
  border: 2px solid #ffff00 !important;
  background: #000000 !important;
}

html[data-contrast="high-contrast"] .lang-switcher a {
  color: #ffff00 !important;
  font-weight: 800 !important;
}

html[data-contrast="high-contrast"] .lang-switcher a + a {
  border-left: 2px solid #ffff00 !important;
}

html[data-contrast="high-contrast"] .lang-switcher a:hover,
html[data-contrast="high-contrast"] .lang-switcher a.active {
  background: #ffff00 !important;
  color: #000000 !important;
  font-weight: 900 !important;
}

/* Header icon buttons in High Contrast */
html[data-contrast="high-contrast"] .header .icon-btn,
html[data-contrast="high-contrast"] .icon-btn {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 2px solid #ffff00 !important;
}

html[data-contrast="high-contrast"] .header .icon-btn:hover,
html[data-contrast="high-contrast"] .icon-btn:hover {
  background: #ffff00 !important;
  color: #000000 !important;
}

/* Dropdown menus in High Contrast */
html[data-contrast="high-contrast"] .dd-menu,
html[data-contrast="high-contrast"] .portal-entry-menu {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
}
html[data-contrast="high-contrast"] .dd-menu a,
html[data-contrast="high-contrast"] .portal-entry-item {
  color: #ffff00 !important;
}
html[data-contrast="high-contrast"] .dd-menu a:hover,
html[data-contrast="high-contrast"] .portal-entry-item:hover {
  background: #ffff00 !important;
  color: #000000 !important;
}
html[data-contrast="high-contrast"] .portal-entry-item .pe-title,
html[data-contrast="high-contrast"] .portal-entry-item .pe-desc {
  color: inherit !important;
}

/* All text elements in High Contrast */
html[data-contrast="high-contrast"] a,
html[data-contrast="high-contrast"] h1,
html[data-contrast="high-contrast"] h2,
html[data-contrast="high-contrast"] h3,
html[data-contrast="high-contrast"] h4,
html[data-contrast="high-contrast"] h5,
html[data-contrast="high-contrast"] h6,
html[data-contrast="high-contrast"] p,
html[data-contrast="high-contrast"] span:not(.btn-txt),
html[data-contrast="high-contrast"] div,
html[data-contrast="high-contrast"] td,
html[data-contrast="high-contrast"] th,
html[data-contrast="high-contrast"] li,
html[data-contrast="high-contrast"] small,
html[data-contrast="high-contrast"] strong,
html[data-contrast="high-contrast"] b,
html[data-contrast="high-contrast"] em {
  color: #ffff00 !important;
}

/* High Contrast Buttons: Yellow Surface + Bold Pitch Black Text (Never Yellow-on-Yellow!) */
html[data-contrast="high-contrast"] .btn,
html[data-contrast="high-contrast"] .btn *,
html[data-contrast="high-contrast"] .btn span,
html[data-contrast="high-contrast"] .btn strong,
html[data-contrast="high-contrast"] .btn b,
html[data-contrast="high-contrast"] .btn-portal-entry-topbar,
html[data-contrast="high-contrast"] .btn-portal-entry-topbar *,
html[data-contrast="high-contrast"] .view-btn,
html[data-contrast="high-contrast"] .view-btn *,
html[data-contrast="high-contrast"] .md-fab,
html[data-contrast="high-contrast"] .md-fab *,
html[data-contrast="high-contrast"] button:not(.icon-btn):not(.tp-icon-btn):not(.a-top-icon-btn):not(.access-hamburg-btn):not(.access-drawer-close),
html[data-contrast="high-contrast"] button:not(.icon-btn):not(.tp-icon-btn):not(.a-top-icon-btn):not(.access-hamburg-btn):not(.access-drawer-close) * {
  background-color: #ffff00 !important;
  color: #000000 !important;
  border-color: #ffffff !important;
  font-weight: 900 !important;
}

html[data-contrast="high-contrast"] .btn:hover,
html[data-contrast="high-contrast"] .btn:hover *,
html[data-contrast="high-contrast"] .btn-portal-entry-topbar:hover,
html[data-contrast="high-contrast"] .btn-portal-entry-topbar:hover *,
html[data-contrast="high-contrast"] .md-fab:hover,
html[data-contrast="high-contrast"] .md-fab:hover * {
  background-color: #ffffff !important;
  color: #000000 !important;
}

/* Cards & Containers in High Contrast across Public, Talaba and Admin */
html[data-contrast="high-contrast"] .card,
html[data-contrast="high-contrast"] .dept-card,
html[data-contrast="high-contrast"] .dk-card,
html[data-contrast="high-contrast"] .dk-body,
html[data-contrast="high-contrast"] .a-card,
html[data-contrast="high-contrast"] .a-mcard,
html[data-contrast="high-contrast"] .dash-module,
html[data-contrast="high-contrast"] .dash-action-card,
html[data-contrast="high-contrast"] .a-stat,
html[data-contrast="high-contrast"] .a-action,
html[data-contrast="high-contrast"] .a-table-wrap,
html[data-contrast="high-contrast"] .tp-card,
html[data-contrast="high-contrast"] .tp-stat-box,
html[data-contrast="high-contrast"] .book-item-card,
html[data-contrast="high-contrast"] .quick-mod-btn,
html[data-contrast="high-contrast"] .a-top,
html[data-contrast="high-contrast"] .tp-topbar,
html[data-contrast="high-contrast"] .a-drawer,
html[data-contrast="high-contrast"] .tp-sidebar,
html[data-contrast="high-contrast"] dialog.md-dialog,
html[data-contrast="high-contrast"] .md-file {
  background: #000000 !important;
  border: 2px solid #ffff00 !important;
  color: #ffff00 !important;
  box-shadow: none !important;
}

/* Sidebar & Navigation in High Contrast (Student & Admin) */
html[data-contrast="high-contrast"] .tp-sidebar,
html[data-contrast="high-contrast"] .a-drawer {
  background: #000000 !important;
  border-right: 2px solid #ffff00 !important;
}
html[data-contrast="high-contrast"] .tp-sidebar .tp-brand-text h2,
html[data-contrast="high-contrast"] .tp-sidebar .tp-brand-text p,
html[data-contrast="high-contrast"] .a-drawer .a-brand .t1,
html[data-contrast="high-contrast"] .a-drawer .a-brand .t2 {
  color: #ffff00 !important;
}
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item,
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item.ai-btn,
html[data-contrast="high-contrast"] .a-drawer .a-nav a,
html[data-contrast="high-contrast"] .a-drawer .a-nav .nav-item,
html[data-contrast="high-contrast"] .cr-tab,
html[data-contrast="high-contrast"] .a-tab {
  background: #000000 !important;
  color: #ffff00 !important;
  border: 1.5px solid rgba(255, 255, 0, 0.4) !important;
}
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item span,
html[data-contrast="high-contrast"] .a-drawer .a-nav a span,
html[data-contrast="high-contrast"] .a-drawer .a-nav .nav-item span,
html[data-contrast="high-contrast"] .cr-tab span,
html[data-contrast="high-contrast"] .a-tab span {
  color: #ffff00 !important;
}
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item:hover,
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item.active,
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item.ai-btn.active,
html[data-contrast="high-contrast"] .a-drawer .a-nav a:hover,
html[data-contrast="high-contrast"] .a-drawer .a-nav a.active,
html[data-contrast="high-contrast"] .a-drawer .a-nav .nav-item.active,
html[data-contrast="high-contrast"] .cr-tab:hover,
html[data-contrast="high-contrast"] .cr-tab.active,
html[data-contrast="high-contrast"] .a-tab:hover,
html[data-contrast="high-contrast"] .a-tab.active {
  background: #ffff00 !important;
  color: #000000 !important;
  border: 2px solid #ffff00 !important;
}
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item:hover span,
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item.active span,
html[data-contrast="high-contrast"] .tp-sidebar .tp-nav-item.ai-btn.active span,
html[data-contrast="high-contrast"] .a-drawer .a-nav a:hover span,
html[data-contrast="high-contrast"] .a-drawer .a-nav a.active span,
html[data-contrast="high-contrast"] .a-drawer .a-nav .nav-item.active span,
html[data-contrast="high-contrast"] .cr-tab:hover span,
html[data-contrast="high-contrast"] .cr-tab.active span,
html[data-contrast="high-contrast"] .a-tab:hover span,
html[data-contrast="high-contrast"] .a-tab.active span {
  color: #000000 !important;
  font-weight: 900 !important;
}

/* ==========================================================================
   🏁 MONOCHROME (OQ-QORA MONOXROM REJIM)
   ========================================================================== */
html[data-contrast="monochrome"] {
  filter: grayscale(100%);
}

/* Language Switcher in Monochrome Mode */
html[data-contrast="monochrome"] .lang-switcher {
  border: 1.5px solid #0f172a !important;
  background: #f1f5f9 !important;
}
html[data-contrast="monochrome"] .lang-switcher a {
  color: #0f172a !important;
  font-weight: 700 !important;
}
html[data-contrast="monochrome"] .lang-switcher a:hover {
  background: rgba(0, 0, 0, 0.08) !important;
  color: #000000 !important;
}
html[data-contrast="monochrome"] .lang-switcher a.active {
  background: #0f172a !important;
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* When the header is Dark or when Dark Mode is active in Monochrome */
html[data-contrast="monochrome"][data-theme-mode="dark"] .lang-switcher,
html[data-contrast="monochrome"] .header .lang-switcher {
  border: 1.5px solid #ffffff !important;
  background: rgba(15, 23, 42, 0.9) !important;
}
html[data-contrast="monochrome"][data-theme-mode="dark"] .lang-switcher a,
html[data-contrast="monochrome"] .header .lang-switcher a {
  color: #ffffff !important;
  font-weight: 700 !important;
}
html[data-contrast="monochrome"][data-theme-mode="dark"] .lang-switcher a:hover,
html[data-contrast="monochrome"] .header .lang-switcher a:hover {
  background: rgba(255, 255, 255, 0.2) !important;
  color: #ffffff !important;
}
html[data-contrast="monochrome"][data-theme-mode="dark"] .lang-switcher a.active,
html[data-contrast="monochrome"] .header .lang-switcher a.active {
  background: #ffffff !important;
  color: #000000 !important;
  font-weight: 800 !important;
}

/* Sidebar & Tabs in Monochrome Mode */
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.active,
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.ai-btn.active,
html[data-contrast="monochrome"] .a-drawer .a-nav a.active,
html[data-contrast="monochrome"] .a-drawer .a-nav .nav-item.active,
html[data-contrast="monochrome"] .a-sidebar .a-nav a.active,
html[data-contrast="monochrome"] .cr-tab.active,
html[data-contrast="monochrome"] .a-tab.active {
  background: #0f172a !important;
  color: #ffffff !important;
}
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.active .left-group span,
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.active .left-group span:not(.material-symbols-outlined),
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.active span,
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.ai-btn.active .left-group span,
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.ai-btn.active .left-group span:not(.material-symbols-outlined),
html[data-contrast="monochrome"] .tp-sidebar .tp-nav-item.ai-btn.active span,
html[data-contrast="monochrome"] .a-drawer .a-nav a.active span,
html[data-contrast="monochrome"] .a-drawer .a-nav .nav-item.active span,
html[data-contrast="monochrome"] .a-sidebar .a-nav a.active span,
html[data-contrast="monochrome"] .cr-tab.active span,
html[data-contrast="monochrome"] .a-tab.active span {
  color: #ffffff !important;
  font-weight: 800 !important;
}

/* Sidebar & Tabs in Monochrome Dark Mode: White Pill + Pitch Black Text */
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-drawer .a-nav a.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-drawer .a-nav .nav-item.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-sidebar .a-nav a.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .cr-tab.active,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-tab.active {
  background: #ffffff !important;
  color: #000000 !important;
}
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active .left-group span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active .left-group span:not(.material-symbols-outlined),
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active .left-group span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active .left-group span:not(.material-symbols-outlined),
html[data-contrast="monochrome"][data-theme-mode="dark"] .tp-sidebar .tp-nav-item.ai-btn.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-drawer .a-nav a.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-drawer .a-nav .nav-item.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-sidebar .a-nav a.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .cr-tab.active span,
html[data-contrast="monochrome"][data-theme-mode="dark"] .a-tab.active span {
  color: #000000 !important;
  font-weight: 900 !important;
}

/* ==========================================================================
   🔄 INVERT (TESKARI RANGLAR)
   ========================================================================== */
html[data-contrast="invert"] {
  filter: invert(100%) hue-rotate(180deg);
}

/* ACCESSIBILITY TOP TOOLBAR */
.access-strip {
  background: #0f172a;
  color: #f8fafc;
  font-size: 13px;
  padding: 6px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
  z-index: 1000;
  position: relative;
}
.access-strip-left, .access-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.access-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #f8fafc;
  padding: 4px 9px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.2s ease;
}
.access-btn:hover, .access-btn.active {
  background: #3b82f6;
  border-color: #3b82f6;
  color: #ffffff;
}

/* VOICE AI MODAL & PULSING BUTTON */
.voice-ai-btn {
  background: linear-gradient(135deg, #2563eb, #7c3aed) !important;
  color: #ffffff !important;
  border: none !important;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
  animation: pulse-glow 2s infinite;
}
@keyframes pulse-glow {
  0% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(59, 130, 246, 0); }
  100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0); }
}

/* VOICE AI ACTIVE OVERLAY */
.voice-modal {
  position: fixed;
  bottom: 92px;
  right: 24px;
  background: #0f172a;
  color: #ffffff;
  padding: 18px 22px;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  border: 1px solid #3b82f6;
  z-index: 9999;
  display: none;
  max-width: 320px;
  animation: slideUp 0.3s ease;
}
/* Voice AI Floating Action Button (Compact FAB that expands gracefully without obscuring content) */
.voice-ai-floating-btn {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 9998;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  width: 50px;
  height: 50px;
  min-height: 50px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #fff;
  box-shadow: 0 8px 24px rgba(37, 99, 235, .38);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  transition: width .25s cubic-bezier(0.16, 1, 0.3, 1), padding .25s ease, border-radius .25s ease, transform .2s ease, box-shadow .2s ease, background .2s ease;
  overflow: hidden;
}
.voice-ai-floating-btn .voice-ai-floating-label {
  max-width: 0;
  opacity: 0;
  white-space: nowrap;
  transition: max-width .25s cubic-bezier(0.16, 1, 0.3, 1), opacity .2s ease, margin .25s ease;
  overflow: hidden;
  margin: 0;
}
.voice-ai-floating-btn:hover,
.voice-ai-floating-btn:focus-visible,
.voice-ai-floating-btn.is-listening {
  width: auto;
  min-width: 50px;
  padding: 0 16px;
  border-radius: 999px;
  gap: 8px;
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, .48);
}
.voice-ai-floating-btn:hover .voice-ai-floating-label,
.voice-ai-floating-btn:focus-visible .voice-ai-floating-label,
.voice-ai-floating-btn.is-listening .voice-ai-floating-label {
  max-width: 160px;
  opacity: 1;
}
.voice-ai-floating-btn .material-symbols-outlined {
  font-size: 22px;
  flex-shrink: 0;
}
.voice-ai-floating-btn.is-listening {
  background: linear-gradient(135deg, #dc2626, #be123c);
  box-shadow: 0 0 0 5px rgba(220, 38, 38, .18), 0 8px 24px rgba(190, 18, 60, .4);
}
.voice-ai-floating-btn:focus-visible {
  outline: 3px solid #facc15;
  outline-offset: 3px;
}
@media (max-width: 600px) {
  .voice-ai-floating-btn {
    right: 16px;
    bottom: 16px;
    width: 48px;
    height: 48px;
    min-height: 48px;
  }
  .voice-modal {
    right: 16px;
    bottom: 74px;
    max-width: min(320px, calc(100vw - 32px));
  }
}
@keyframes slideUp {
  from { transform: translateY(20px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.voice-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.voice-wave {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 24px;
}
.voice-wave span {
  width: 4px;
  height: 100%;
  background: #38bdf8;
  border-radius: 2px;
  animation: wave 1s infinite ease-in-out;
}
.voice-wave span:nth-child(2) { animation-delay: 0.2s; }
.voice-wave span:nth-child(3) { animation-delay: 0.4s; }
.voice-wave span:nth-child(4) { animation-delay: 0.6s; }
@keyframes wave {
  0%, 100% { height: 6px; }
  50% { height: 24px; }
}

/* STUDENT PORTAL HEADER BADGE */
.btn-student-login {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white !important;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  font-size: 13px;
  border: none;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}
.btn-student-login:hover {
  background: linear-gradient(135deg, #059669, #047857);
}

/* DUAL EDUCATION BADGE */
.dual-badge {
  background: #f59e0b;
  color: #000;
  font-weight: 700;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: uppercase;
}

/* ── ACCESSIBILITY HAMBURG DRAWER & ACCORDION MODULES ── */
.access-hamburg-btn {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.12) !important;
  color: var(--md-sys-color-primary, #2563eb) !important;
  border: 1.5px solid rgba(37, 99, 235, 0.3) !important;
  border-radius: 50% !important;
  width: 40px !important;
  height: 40px !important;
  cursor: pointer;
  margin-right: 6px;
  transition: all 0.2s ease !important;
}
.access-hamburg-btn:hover {
  background: var(--md-sys-color-primary, #2563eb) !important;
  color: #ffffff !important;
  border-color: var(--md-sys-color-primary, #2563eb) !important;
  transform: scale(1.06);
}

.btn-student-login-topbar {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  margin-right: 12px;
  transition: opacity 0.2s;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.25);
}
.btn-student-login-topbar:hover {
  opacity: 0.9;
}

/* PORTAL ENTRY DROPDOWN (KIRISH: TALABA & O'QITUVCHI) */
.portal-entry-wrap {
  position: relative;
  display: inline-block;
  margin-right: 12px;
}
.btn-portal-entry-topbar {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff !important;
  font-weight: 700;
  font-size: 12.5px;
  padding: 5px 13px;
  border-radius: 20px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  text-decoration: none;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: all 0.2s ease;
  font-family: inherit;
}
.btn-portal-entry-topbar:hover,
.btn-portal-entry-topbar[aria-expanded="true"] {
  background: linear-gradient(135deg, #059669, #047857);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.45);
  transform: translateY(-1px);
}
.portal-entry-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 280px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  padding: 8px;
  display: none;
  flex-direction: column;
  gap: 4px;
  z-index: 999999;
  animation: portalMenuFadeIn 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.portal-entry-menu.show {
  display: flex !important;
}
@keyframes portalMenuFadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}
.portal-entry-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  text-decoration: none;
  color: #0f172a !important;
  transition: background 0.18s ease, transform 0.15s ease;
}
.portal-entry-item:hover {
  background: #f1f5f9;
  transform: translateX(2px);
}
.portal-entry-item .pe-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.portal-entry-item .pe-icon.student {
  background: #ecfdf5;
  color: #059669;
}
.portal-entry-item .pe-icon.teacher {
  background: #eff6ff;
  color: #2563eb;
}
.portal-entry-item .pe-title {
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #0f172a;
}
.portal-entry-item .pe-desc {
  font-size: 11px;
  color: #64748b;
  margin-top: 2px;
}
.portal-entry-item .pe-arrow {
  font-size: 18px;
  color: #94a3b8;
  margin-left: auto;
}
.portal-entry-divider {
  height: 1px;
  background: #e2e8f0;
  margin: 2px 6px;
}
html[data-theme-mode="dark"] .portal-entry-menu {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.55);
}
html[data-theme-mode="dark"] .portal-entry-item {
  color: #f8fafc !important;
}
html[data-theme-mode="dark"] .portal-entry-item:hover {
  background: #334155;
}
html[data-theme-mode="dark"] .portal-entry-item .pe-title {
  color: #f8fafc;
}
html[data-theme-mode="dark"] .portal-entry-item .pe-desc {
  color: #94a3b8;
}
html[data-theme-mode="dark"] .portal-entry-divider {
  background: #334155;
}
html[data-theme-mode="dark"] .portal-entry-item .pe-icon.student {
  background: rgba(16, 185, 129, 0.2);
  color: #34d399;
}
html[data-theme-mode="dark"] .portal-entry-item .pe-icon.teacher {
  background: rgba(37, 99, 235, 0.2);
  color: #60a5fa;
}

/* SCRIM / OVERLAY */
.access-drawer-scrim {
  position: fixed !important;
  inset: 0 !important;
  background: rgba(15, 23, 42, 0.65) !important;
  backdrop-filter: blur(5px) !important;
  -webkit-backdrop-filter: blur(5px) !important;
  z-index: 999998 !important;
  display: none;
  opacity: 0;
  transition: opacity 0.2s ease !important;
}
.access-drawer-scrim.open {
  display: block !important;
  opacity: 1 !important;
  visibility: visible !important;
}

/* ── LUXURY MODERN ACCESS DRAWER (ADAPTIVE LIGHT & DARK) ── */
.access-drawer {
  position: fixed !important;
  top: 0 !important;
  bottom: 0 !important;
  right: 0 !important;
  width: 100% !important;
  max-width: 420px !important;
  background: #ffffff !important;
  color: #0f172a !important;
  z-index: 999999 !important;
  box-shadow: -10px 0 45px rgba(15, 23, 42, 0.16) !important;
  border-left: 1px solid #e2e8f0 !important;
  display: none;
  flex-direction: column !important;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
}
.access-drawer.open {
  display: flex !important;
  transform: translateX(0) !important;
  visibility: visible !important;
}

html[data-theme-mode="dark"] .access-drawer,
html[data-contrast="high-contrast"] .access-drawer {
  background: #0f172a !important;
  color: #f8fafc !important;
  border-left-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: -10px 0 50px rgba(0, 0, 0, 0.7) !important;
}

/* DRAWER HEAD */
.access-drawer-head {
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8fafc;
}
html[data-theme-mode="dark"] .access-drawer-head {
  background: #111e38;
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.access-drawer-head .title {
  font-size: 16.5px;
  font-weight: 800;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 8px;
}
html[data-theme-mode="dark"] .access-drawer-head .title {
  color: #f8fafc;
}
.access-drawer-head .sub {
  font-size: 12px;
  color: #64748b;
  margin-top: 3px;
}
html[data-theme-mode="dark"] .access-drawer-head .sub {
  color: #94a3b8;
}

.access-drawer-close {
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  color: #64748b;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  transition: all 0.2s;
}
.access-drawer-close:hover {
  background: #fee2e2;
  color: #ef4444;
  border-color: #fca5a5;
  transform: rotate(90deg);
}
html[data-theme-mode="dark"] .access-drawer-close {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.15);
  color: #cbd5e1;
}

/* QUICK NAV PILLS (TOP TABS) */
.access-nav-tabs {
  display: flex;
  gap: 6px;
  padding: 10px 18px;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
html[data-theme-mode="dark"] .access-nav-tabs {
  background: rgba(255, 255, 255, 0.03);
  border-bottom-color: rgba(255, 255, 255, 0.08);
}
.access-nav-tab {
  flex: 1;
  min-width: 75px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s;
  white-space: nowrap;
}
.access-nav-tab:hover {
  border-color: #3b82f6;
  color: #2563eb;
}
.access-nav-tab.active {
  background: #2563eb;
  color: #ffffff;
  border-color: #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}
html[data-theme-mode="dark"] .access-nav-tab {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

/* DRAWER BODY */
.access-drawer-body {
  padding: 18px 20px;
  overflow-y: auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* MODERN CARD WIDGETS */
.access-card {
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  border-radius: 18px;
  padding: 16px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.access-card:hover {
  border-color: #cbd5e1;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.04);
}
html[data-theme-mode="dark"] .access-card {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.1);
}
html[data-theme-mode="dark"] .access-card:hover {
  border-color: rgba(255, 255, 255, 0.2);
}

.access-card-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.access-card-badge {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.badge-blue { background: #dbeafe; color: #2563eb; }
.badge-amber { background: #fef3c7; color: #d97706; }
.badge-pink { background: #fce7f3; color: #db2777; }
.badge-emerald { background: #d1fae5; color: #059669; }

html[data-theme-mode="dark"] .badge-blue { background: rgba(37, 99, 235, 0.2); color: #60a5fa; }
html[data-theme-mode="dark"] .badge-amber { background: rgba(217, 119, 6, 0.2); color: #fbbf24; }
html[data-theme-mode="dark"] .badge-pink { background: rgba(219, 39, 119, 0.2); color: #f472b6; }
html[data-theme-mode="dark"] .badge-emerald { background: rgba(5, 150, 105, 0.2); color: #34d399; }

.access-card-title {
  font-size: 14px;
  font-weight: 800;
  color: #0f172a;
}
html[data-theme-mode="dark"] .access-card-title {
  color: #f8fafc;
}
.access-card-sub {
  font-size: 11.5px;
  color: #64748b;
  margin-top: 1px;
}
html[data-theme-mode="dark"] .access-card-sub {
  color: #94a3b8;
}

/* 1. TYPOGRAPHY WIDGET */
.access-preview-pill {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}
html[data-theme-mode="dark"] .access-preview-pill {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}
.preview-tag {
  font-size: 10px;
  font-weight: 800;
  background: #eff6ff;
  color: #2563eb;
  padding: 2px 6px;
  border-radius: 6px;
  letter-spacing: 0.5px;
}
html[data-theme-mode="dark"] .preview-tag {
  background: rgba(37, 99, 235, 0.25);
  color: #93c5fd;
}
.preview-text {
  font-size: 13.5px;
  color: #334155;
  font-weight: 600;
  transition: font-size 0.2s;
}
html[data-theme-mode="dark"] .preview-text {
  color: #e2e8f0;
}

/* STEPPER */
.access-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 4px;
  margin-bottom: 10px;
}
html[data-theme-mode="dark"] .access-stepper {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}
.access-stepper-btn {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  border: none;
  background: #f1f5f9;
  color: #0f172a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.access-stepper-btn:hover {
  background: #2563eb;
  color: #ffffff;
}
html[data-theme-mode="dark"] .access-stepper-btn {
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
}
html[data-theme-mode="dark"] .access-stepper-btn:hover {
  background: #3b82f6;
  color: #ffffff;
}
.access-stepper-val {
  font-size: 13.5px;
  font-weight: 800;
  color: #0f172a;
}
html[data-theme-mode="dark"] .access-stepper-val {
  color: #f8fafc;
}

/* SEGMENTED PRESET TRACK */
.access-segmented-track {
  display: flex;
  background: #e2e8f0;
  padding: 4px;
  border-radius: 12px;
  gap: 4px;
}
html[data-theme-mode="dark"] .access-segmented-track {
  background: rgba(255, 255, 255, 0.08);
}
.access-segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  transition: all 0.2s;
  text-align: center;
}
.access-segment-btn:hover {
  color: #0f172a;
}
.access-segment-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}
html[data-theme-mode="dark"] .access-segment-btn {
  color: #94a3b8;
}
html[data-theme-mode="dark"] .access-segment-btn:hover {
  color: #f8fafc;
}

/* 2. THEME & CONTRAST WIDGET */
.access-theme-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.access-theme-card {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 12px 10px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  transition: all 0.2s;
}
.access-theme-card:hover {
  border-color: #3b82f6;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}
.access-theme-card.active {
  border-color: #2563eb !important;
  background: #eff6ff !important;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.3);
}
.access-theme-card .tc-title {
  font-size: 13px;
  font-weight: 800;
  color: #0f172a;
}
.access-theme-card .tc-desc {
  font-size: 10.5px;
  color: #64748b;
}
html[data-theme-mode="dark"] .access-theme-card {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}
html[data-theme-mode="dark"] .access-theme-card.active {
  background: rgba(37, 99, 235, 0.2) !important;
  border-color: #60a5fa !important;
}
html[data-theme-mode="dark"] .access-theme-card .tc-title {
  color: #f8fafc;
}
html[data-theme-mode="dark"] .access-theme-card .tc-desc {
  color: #94a3b8;
}

/* 3. COLOR PALETTE GEMS */
.access-gems-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-bottom: 12px;
}
.access-gem-btn {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 12px;
  border: 2px solid transparent;
  cursor: pointer;
  position: relative;
  transition: transform 0.18s, box-shadow 0.18s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}
.access-gem-btn:hover {
  transform: scale(1.12);
}
.access-gem-btn.active {
  border-color: #ffffff;
  box-shadow: 0 0 0 3px #2563eb, 0 4px 12px rgba(0, 0, 0, 0.25);
  transform: scale(1.08);
}
.access-gem-btn.active::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-weight: 900;
  font-size: 16px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

.access-custom-color-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 8px 12px;
}
html[data-theme-mode="dark"] .access-custom-color-bar {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
}
.access-custom-color-bar span {
  font-size: 12.5px;
  font-weight: 700;
  color: #334155;
  display: flex;
  align-items: center;
  gap: 6px;
}
html[data-theme-mode="dark"] .access-custom-color-bar span {
  color: #e2e8f0;
}
.access-color-input {
  width: 36px;
  height: 30px;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 6px;
}

/* 4. AUDIO & TTS WIDGET */
.access-audio-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.access-live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 700;
  color: #059669;
  background: #d1fae5;
  padding: 4px 10px;
  border-radius: 20px;
}
html[data-theme-mode="dark"] .access-live-badge {
  background: rgba(5, 150, 105, 0.2);
  color: #34d399;
}
.access-test-voice-btn {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #ffffff;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
  transition: opacity 0.2s, transform 0.15s;
}
.access-test-voice-btn:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}

.access-speed-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 10px;
}
.access-speed-btn {
  flex: 1;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  padding: 7px 4px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 700;
  color: #475569;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.access-speed-btn:hover {
  border-color: #3b82f6;
  color: #2563eb;
}
.access-speed-btn.active {
  background: #2563eb !important;
  color: #ffffff !important;
  border-color: #2563eb !important;
}
html[data-theme-mode="dark"] .access-speed-btn {
  background: #0f172a;
  border-color: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}

.access-voice-ai-btn {
  width: 100%;
  margin-top: 10px;
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.1), rgba(14, 165, 233, 0.15));
  border: 1.5px solid #60a5fa;
  color: #2563eb;
  padding: 8px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s;
}
.access-voice-ai-btn:hover {
  background: linear-gradient(135deg, #2563eb, #0284c7);
  color: #ffffff;
}
html[data-theme-mode="dark"] .access-voice-ai-btn {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.4);
}

/* DRAWER FOOTER */
.access-drawer-foot {
  padding: 16px 22px;
  border-top: 1px solid #e2e8f0;
  background: #f8fafc;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
html[data-theme-mode="dark"] .access-drawer-foot {
  background: #111e38;
  border-top-color: rgba(255, 255, 255, 0.1);
}

.access-reset-link {
  background: none;
  border: none;
  color: #64748b;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: color 0.15s;
}
.access-reset-link:hover {
  color: #ef4444;
}
html[data-theme-mode="dark"] .access-reset-link {
  color: #94a3b8;
}

.access-done-btn {
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 10px 22px;
  border-radius: 12px;
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
  transition: all 0.2s;
}
.access-done-btn:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.45);
}
