/* FizikaUstoz — dizayn tizimi v2 (TZ 9.5).
   Oq asos + indigo/binafsha/havorang gradient urg'u; tun rejimi — chuqur ko'k-qora.
   Barcha ranglar faqat shu tokenlar orqali. */

:root,
[data-bs-theme="light"] {
  --fu-bg: #ffffff;
  --fu-bg-soft: #f6f7fb;
  --fu-surface: #ffffff;
  --fu-surface-2: #f2f3f9;
  --fu-border: #e5e7f0;
  --fu-border-strong: #d4d7e5;
  --fu-text: #0e1330;
  --fu-text-muted: #565c75;
  --fu-primary: #4f46e5;
  --fu-primary-rgb: 79, 70, 229;
  --fu-primary-hover: #4338ca;
  --fu-on-primary: #ffffff;
  --fu-accent: #0f766e;
  --fu-accent-rgb: 13, 148, 136;
  --fu-success: #15803d;
  --fu-success-bg: #e8f7ee;
  --fu-warning: #b45309;
  --fu-warning-bg: #fdf3e1;
  --fu-danger: #c81e1e;
  --fu-danger-bg: #fdecec;
  --fu-info: #0369a1;
  --fu-info-bg: #e6f3fb;
  --fu-focus: rgba(79, 70, 229, 0.45);
  --fu-paper: #ffffff;
  --fu-grid: rgba(79, 70, 229, 0.07);
  --fu-gradient: linear-gradient(120deg, #4f46e5 0%, #7c3aed 50%, #2563eb 100%);
  --fu-gradient-soft: linear-gradient(135deg, rgba(79, 70, 229, 0.10), rgba(14, 165, 233, 0.08));
  --fu-shadow-sm: 0 1px 2px rgba(14, 19, 48, 0.05);
  --fu-shadow: 0 1px 2px rgba(14, 19, 48, 0.04), 0 8px 24px -12px rgba(14, 19, 48, 0.14);
  --fu-shadow-lg: 0 24px 48px -24px rgba(79, 70, 229, 0.35);
  --fu-header-bg: rgba(255, 255, 255, 0.78);
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --fu-bg: #0a0e1f;
  --fu-bg-soft: #0d1226;
  --fu-surface: #121831;
  --fu-surface-2: #1a2142;
  --fu-border: #262f55;
  --fu-border-strong: #343e6b;
  --fu-text: #e7e9f6;
  --fu-text-muted: #9ea6c6;
  --fu-primary: #a5b4fc;
  --fu-primary-rgb: 165, 180, 252;
  --fu-primary-hover: #c7d2fe;
  --fu-on-primary: #0a0e1f;
  --fu-accent: #5eead4;
  --fu-accent-rgb: 45, 212, 191;
  --fu-success: #4ade80;
  --fu-success-bg: rgba(74, 222, 128, 0.12);
  --fu-warning: #fbbf24;
  --fu-warning-bg: rgba(251, 191, 36, 0.12);
  --fu-danger: #f87171;
  --fu-danger-bg: rgba(248, 113, 113, 0.13);
  --fu-info: #7dd3fc;
  --fu-info-bg: rgba(125, 211, 252, 0.12);
  --fu-focus: rgba(165, 180, 252, 0.55);
  --fu-paper: #f8fafc;
  --fu-grid: rgba(165, 180, 252, 0.06);
  --fu-gradient: linear-gradient(120deg, #818cf8 0%, #a78bfa 48%, #38bdf8 100%);
  --fu-gradient-soft: linear-gradient(135deg, rgba(129, 140, 248, 0.14), rgba(56, 189, 248, 0.08));
  --fu-shadow-sm: none;
  --fu-shadow: 0 0 0 1px rgba(255, 255, 255, 0.02), 0 12px 32px -18px rgba(0, 0, 0, 0.7);
  --fu-shadow-lg: 0 24px 60px -28px rgba(129, 140, 248, 0.45);
  --fu-header-bg: rgba(10, 14, 31, 0.78);
  color-scheme: dark;
}

/* JavaScript o'chirilgan bo'lsa ham tizim rejimiga ergashish */
@media (prefers-color-scheme: dark) {
  :root:not([data-bs-theme]) {
    --fu-bg: #0a0e1f; --fu-bg-soft: #0d1226; --fu-surface: #121831; --fu-surface-2: #1a2142;
    --fu-border: #262f55; --fu-text: #e7e9f6; --fu-text-muted: #9ea6c6; --fu-primary: #a5b4fc;
    --fu-primary-rgb: 165, 180, 252; --fu-on-primary: #0a0e1f; --fu-header-bg: rgba(10, 14, 31, .78);
    color-scheme: dark;
  }
}

/* Bootstrap o'zgaruvchilarini tokenlarga bog'lash */
:root,
[data-bs-theme] {
  --bs-body-bg: var(--fu-bg);
  --bs-body-color: var(--fu-text);
  --bs-emphasis-color: var(--fu-text);
  --bs-secondary-color: var(--fu-text-muted);
  --bs-secondary-bg: var(--fu-surface-2);
  --bs-tertiary-bg: var(--fu-surface);
  --bs-border-color: var(--fu-border);
  --bs-primary: var(--fu-primary);
  --bs-primary-rgb: var(--fu-primary-rgb);
  --bs-link-color: var(--fu-primary);
  --bs-link-color-rgb: var(--fu-primary-rgb);
  --bs-link-hover-color: var(--fu-primary-hover);
  --bs-focus-ring-color: var(--fu-focus);
  --bs-border-radius: .75rem;
  --bs-border-radius-lg: 1rem;
  --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
}

html { scroll-behavior: smooth; }
body {
  background: var(--fu-bg);
  color: var(--fu-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
main { flex: 1 0 auto; }
h1, h2, h3, h4, .h1, .h2, .h3, .h4, .display-4, .display-5, .display-6 { letter-spacing: -0.022em; font-weight: 700; }
h5, h6, .h5, .h6 { font-weight: 650; letter-spacing: -0.01em; }
a { text-underline-offset: .18em; text-decoration-thickness: 1px; }
::selection { background: rgba(var(--fu-primary-rgb), .22); }

.theme-switching *, .theme-switching *::before, .theme-switching *::after { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
:focus-visible { outline: 3px solid var(--fu-focus); outline-offset: 2px; border-radius: .375rem; }

.skip-link { position: absolute; left: -999px; top: 0; z-index: 2000; background: var(--fu-primary);
  color: var(--fu-on-primary); padding: .5rem 1rem; border-radius: .5rem; }
.skip-link:focus { left: 1rem; top: 1rem; }

/* ---------- Yordamchi uslublar ---------- */
.text-gradient { background: var(--fu-gradient); -webkit-background-clip: text; background-clip: text; color: transparent; }
.eyebrow { display: inline-flex; align-items: center; gap: .45rem; font-size: .78rem; font-weight: 600;
  letter-spacing: .08em; text-transform: uppercase; color: var(--fu-primary); }
.eyebrow::before { content: ""; width: 1.25rem; height: 2px; border-radius: 2px; background: var(--fu-gradient); }
.text-muted, .form-text { color: var(--fu-text-muted) !important; }
.bg-soft { background: var(--fu-bg-soft); }
.grid-paper {
  background-image:
    linear-gradient(var(--fu-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--fu-grid) 1px, transparent 1px);
  background-size: 28px 28px;
}
.page-head { padding: 2.25rem 0 1.5rem; background: var(--fu-bg-soft); border-bottom: 1px solid var(--fu-border); }
.page-head h1 { margin: .35rem 0 0; }

/* Ohanglar (bo'limlar va ikonkalar uchun) */
.tone-indigo { --tone: #4f46e5; --tone-2: #7c3aed; }
.tone-amber  { --tone: #f59e0b; --tone-2: #ef4444; }
.tone-sky    { --tone: #0ea5e9; --tone-2: #6366f1; }
.tone-rose   { --tone: #ec4899; --tone-2: #8b5cf6; }
.tone-teal   { --tone: #10b981; --tone-2: #0ea5e9; }
.icon-tile { width: 3rem; height: 3rem; flex-shrink: 0; display: grid; place-items: center; border-radius: .9rem;
  font-size: 1.35rem; color: #fff; background: linear-gradient(135deg, var(--tone, #4f46e5), var(--tone-2, #7c3aed));
  box-shadow: 0 10px 20px -10px var(--tone, #4f46e5); }
.icon-tile.sm { width: 2.25rem; height: 2.25rem; border-radius: .7rem; font-size: 1rem; }
.icon-tile.lg { width: 3.75rem; height: 3.75rem; border-radius: 1.1rem; font-size: 1.7rem; }

/* ---------- Sarlavha (shisha effekti) ---------- */
.site-header { position: sticky; top: 0; z-index: 1030; background: var(--fu-header-bg);
  -webkit-backdrop-filter: saturate(180%) blur(14px); backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--fu-border); }
.site-header .navbar-brand { font-weight: 700; color: var(--fu-text); letter-spacing: -0.02em; font-size: 1.15rem; }
.brand-mark { display: inline-grid; place-items: center; width: 2.1rem; height: 2.1rem; border-radius: .7rem;
  background: var(--fu-gradient); color: #fff; margin-right: .55rem; font-size: 1rem; box-shadow: var(--fu-shadow-lg); }
.site-header .nav-link { color: var(--fu-text-muted); font-weight: 500; padding: .5rem .9rem !important; border-radius: 999px; }
.site-header .nav-link:hover { color: var(--fu-text); background: var(--fu-surface-2); }
.site-header .nav-link.active, .site-header .nav-link[aria-current="page"] { color: var(--fu-primary);
  background: rgba(var(--fu-primary-rgb), .10); }
.icon-btn { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; border: 1px solid var(--fu-border); background: var(--fu-surface); color: var(--fu-text);
  transition: background .15s ease, border-color .15s ease; }
.icon-btn:hover { background: var(--fu-surface-2); border-color: var(--fu-border-strong); }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; display: inline-grid; place-items: center; font-weight: 700;
  font-size: .85rem; color: #fff; background: var(--fu-gradient); }
.dropdown-menu { --bs-dropdown-bg: var(--fu-surface); --bs-dropdown-border-color: var(--fu-border);
  --bs-dropdown-link-color: var(--fu-text); --bs-dropdown-link-hover-bg: var(--fu-surface-2);
  --bs-dropdown-link-hover-color: var(--fu-text); --bs-dropdown-link-active-bg: rgba(var(--fu-primary-rgb), .14);
  --bs-dropdown-link-active-color: var(--fu-primary); --bs-dropdown-border-radius: .9rem;
  --bs-dropdown-item-border-radius: .55rem; padding: .4rem; box-shadow: var(--fu-shadow); }
.dropdown-item { border-radius: .55rem; padding: .5rem .75rem; }
.offcanvas { --bs-offcanvas-bg: var(--fu-bg); --bs-offcanvas-color: var(--fu-text); }

/* ---------- Tugmalar ---------- */
.btn { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  font-weight: 600; border-radius: 999px; padding-left: 1.15rem; padding-right: 1.15rem;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; }
.btn-sm { min-height: 36px; padding-left: .85rem; padding-right: .85rem; }
.btn-lg { min-height: 52px; padding-left: 1.5rem; padding-right: 1.5rem; font-size: 1.05rem; }
.btn-primary {
  --bs-btn-bg: var(--fu-primary); --bs-btn-border-color: var(--fu-primary); --bs-btn-color: var(--fu-on-primary);
  --bs-btn-hover-bg: var(--fu-primary-hover); --bs-btn-hover-border-color: var(--fu-primary-hover);
  --bs-btn-hover-color: var(--fu-on-primary); --bs-btn-active-bg: var(--fu-primary-hover);
  --bs-btn-active-color: var(--fu-on-primary); --bs-btn-disabled-bg: var(--fu-primary);
  --bs-btn-disabled-border-color: var(--fu-primary); --bs-btn-disabled-color: var(--fu-on-primary);
  box-shadow: 0 8px 18px -10px rgba(var(--fu-primary-rgb), .9);
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-gradient { color: #fff; border: 0; background: var(--fu-gradient); background-size: 160% 100%;
  box-shadow: var(--fu-shadow-lg); }
[data-bs-theme="dark"] .btn-gradient { color: #0a0e1f; }
.btn-gradient:hover { color: #fff; background-position: 100% 0; transform: translateY(-1px); }
[data-bs-theme="dark"] .btn-gradient:hover { color: #0a0e1f; }
.btn-outline-primary { --bs-btn-color: var(--fu-primary); --bs-btn-border-color: rgba(var(--fu-primary-rgb), .45);
  --bs-btn-hover-bg: rgba(var(--fu-primary-rgb), .1); --bs-btn-hover-color: var(--fu-primary);
  --bs-btn-hover-border-color: var(--fu-primary); --bs-btn-active-bg: rgba(var(--fu-primary-rgb), .16);
  --bs-btn-active-color: var(--fu-primary); }
.btn-outline-secondary { --bs-btn-color: var(--fu-text); --bs-btn-border-color: var(--fu-border-strong);
  --bs-btn-bg: var(--fu-surface); --bs-btn-hover-bg: var(--fu-surface-2); --bs-btn-hover-color: var(--fu-text);
  --bs-btn-hover-border-color: var(--fu-border-strong); --bs-btn-active-bg: var(--fu-surface-2);
  --bs-btn-active-color: var(--fu-text); }

/* ---------- Kartochkalar ---------- */
.card, .fu-card {
  --bs-card-bg: var(--fu-surface); --bs-card-border-color: var(--fu-border); --bs-card-color: var(--fu-text);
  background: var(--fu-surface); border: 1px solid var(--fu-border); border-radius: 1.1rem; box-shadow: var(--fu-shadow);
}
.fu-card { padding: 1.35rem; }
.card-hover { transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease; }
.card-hover:hover { transform: translateY(-3px); box-shadow: var(--fu-shadow-lg); border-color: rgba(var(--fu-primary-rgb), .35); }
.card-glow { position: relative; overflow: hidden; }
.card-glow::after { content: ""; position: absolute; inset: auto -30% -60% auto; width: 60%; aspect-ratio: 1;
  border-radius: 50%; background: radial-gradient(closest-side, rgba(var(--fu-primary-rgb), .14), transparent); pointer-events: none; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--fu-border); background: var(--fu-bg); }
.hero::before { content: ""; position: absolute; inset: 0; background: var(--fu-gradient-soft); pointer-events: none; }
.hero .grid-paper { position: absolute; inset: 0; mask-image: radial-gradient(ellipse at 70% 40%, #000 25%, transparent 70%);
  -webkit-mask-image: radial-gradient(ellipse at 70% 40%, #000 25%, transparent 70%); pointer-events: none; }
.hero > .container { position: relative; }
.hero h1 { font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.08; letter-spacing: -0.035em; }
.hero .lead { font-size: 1.15rem; max-width: 36rem; }
.hero-badge { display: inline-flex; align-items: center; gap: .5rem; padding: .35rem .85rem .35rem .4rem; border-radius: 999px;
  background: var(--fu-surface); border: 1px solid var(--fu-border); font-size: .85rem; font-weight: 500; box-shadow: var(--fu-shadow-sm); }
.hero-badge .dot { padding: .1rem .55rem; border-radius: 999px; background: var(--fu-gradient); color: #fff; font-weight: 600; font-size: .75rem; }
[data-bs-theme="dark"] .hero-badge .dot { color: #0a0e1f; }

/* Atom orbitasi illyustratsiyasi */
.orbit-stage { position: relative; aspect-ratio: 1; max-width: 420px; margin-inline: auto; }
.orbit-stage svg { width: 100%; height: 100%; overflow: visible; }
.orbit-stage .ring { fill: none; stroke: rgba(var(--fu-primary-rgb), .35); stroke-width: 1.2; }
.orbit-stage .nucleus { fill: url(#nucleusGradient); }
.orbit-stage .electron { fill: var(--fu-accent); }
.orbit-stage .spin { transform-origin: 200px 200px; animation: orbit 14s linear infinite; }
.orbit-stage .spin.s2 { animation-duration: 20s; animation-direction: reverse; }
.orbit-stage .spin.s3 { animation-duration: 26s; }
@keyframes orbit { to { transform: rotate(360deg); } }
.formula-chip { position: absolute; padding: .45rem .8rem; border-radius: .8rem; background: var(--fu-surface);
  border: 1px solid var(--fu-border); box-shadow: var(--fu-shadow); font-weight: 600; font-size: .95rem;
  font-family: "Cambria Math", "Times New Roman", serif; font-style: italic; color: var(--fu-text);
  animation: float 6s ease-in-out infinite; white-space: nowrap; }
.formula-chip:nth-of-type(2) { animation-delay: -2s; }
.formula-chip:nth-of-type(3) { animation-delay: -4s; }
@keyframes float { 50% { transform: translateY(-8px); } }

/* Qadamlar (O'qish qanday ishlaydi) */
.steps { counter-reset: step; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.step { position: relative; padding: 1.35rem; border-radius: 1.1rem; background: var(--fu-surface); border: 1px solid var(--fu-border);
  box-shadow: var(--fu-shadow); }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 2.2rem; height: 2.2rem;
  border-radius: 50%; font-weight: 700; color: #fff; background: var(--fu-gradient); margin-bottom: .85rem; }
[data-bs-theme="dark"] .step::before { color: #0a0e1f; }

/* Bo'lim kartochkalari */
.section-card { display: flex; flex-direction: column; gap: .75rem; height: 100%; padding: 1.35rem; border-radius: 1.1rem;
  background: var(--fu-surface); border: 1px solid var(--fu-border); box-shadow: var(--fu-shadow); text-decoration: none; color: var(--fu-text); }
.section-card .meta { font-size: .85rem; color: var(--fu-text-muted); }
.section-card .bar { height: 6px; border-radius: 999px; background: var(--fu-surface-2); overflow: hidden; margin-top: auto; }
.section-card .bar span { display: block; height: 100%; border-radius: inherit;
  background: linear-gradient(90deg, var(--tone, #4f46e5), var(--tone-2, #7c3aed)); }

/* Kurs muqovasi (katalog) */
.course-cover { position: relative; height: 9rem; border-radius: .9rem; overflow: hidden; margin-bottom: 1rem;
  background: var(--fu-gradient); display: grid; place-items: center; }
.course-cover .grid-paper { position: absolute; inset: 0; --fu-grid: rgba(255, 255, 255, .14); }
.course-cover i { position: relative; font-size: 3rem; color: #fff; opacity: .95; }
.course-cover .cover-chip { position: absolute; left: .75rem; bottom: .75rem; padding: .2rem .6rem; border-radius: 999px;
  background: rgba(255, 255, 255, .22); color: #fff; font-size: .78rem; font-weight: 600; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

/* Kurs sahifasi banneri */
.course-banner { position: relative; overflow: hidden; border-radius: 1.4rem; padding: 2rem; color: var(--fu-text);
  background: var(--fu-surface); border: 1px solid var(--fu-border); box-shadow: var(--fu-shadow); }
.course-banner::before { content: ""; position: absolute; inset: 0; background: var(--fu-gradient-soft); pointer-events: none; }
.course-banner > * { position: relative; }

/* ---------- Formalar ---------- */
.form-control, .form-select { background-color: var(--fu-surface); color: var(--fu-text); border-color: var(--fu-border-strong);
  min-height: 46px; border-radius: .75rem; }
.form-control:focus, .form-select:focus { border-color: var(--fu-primary); box-shadow: 0 0 0 .22rem var(--fu-focus);
  background-color: var(--fu-surface); color: var(--fu-text); }
.form-control::placeholder { color: var(--fu-text-muted); opacity: .8; }
.form-label { font-weight: 500; font-size: .92rem; }
.form-check-input { border-color: var(--fu-text-muted); }
.form-check-input:checked { background-color: var(--fu-primary); border-color: var(--fu-primary); }

/* Kirish / ro'yxatdan o'tish */
.auth-shell { position: relative; overflow: hidden; padding: 3.5rem 0; }
.auth-shell::before, .auth-shell::after { content: ""; position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; pointer-events: none; }
.auth-shell::before { width: 360px; height: 360px; left: -80px; top: -60px; background: rgba(124, 58, 237, .28); }
.auth-shell::after { width: 320px; height: 320px; right: -60px; bottom: -80px; background: rgba(14, 165, 233, .25); }
.auth-card { position: relative; z-index: 1; padding: 2.25rem; border-radius: 1.4rem; }

/* ---------- Holat belgilari: rang + ikonka + matn (TZ 9.6) ---------- */
.status-badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .8rem; font-weight: 600;
  padding: .22rem .65rem; border-radius: 999px; white-space: nowrap; }
.status-locked { color: var(--fu-text-muted); background: var(--fu-surface-2); }
.status-available { color: var(--fu-primary); background: rgba(var(--fu-primary-rgb), .12); }
.status-in-progress { color: var(--fu-info); background: var(--fu-info-bg); }
.status-pending { color: var(--fu-warning); background: var(--fu-warning-bg); }
.status-completed { color: var(--fu-success); background: var(--fu-success-bg); }
.status-failed { color: var(--fu-danger); background: var(--fu-danger-bg); }
.status-icon-only { padding: 0; background: none; }

/* ---------- Progress ---------- */
.progress { --bs-progress-bg: var(--fu-surface-2); height: .55rem; border-radius: 999px; }
.progress-bar { background: var(--fu-gradient); border-radius: 999px; }
.progress-ring { position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.progress-ring svg { position: absolute; inset: 0; }
.progress-ring .ring-track { stroke: var(--fu-border-strong); opacity: .6; }
.progress-ring .ring-value { stroke: var(--fu-primary); transition: stroke-dashoffset .8s ease; }
.progress-ring .ring-label { position: relative; font-weight: 700; font-size: .95rem; font-variant-numeric: tabular-nums; }

/* ---------- Kurs daraxti (vaqt chizig'i) ---------- */
.course-tree { font-size: .93rem; }
.course-tree .section-title { display: flex; align-items: center; gap: .55rem; font-weight: 700; margin: 1.1rem 0 .35rem; }
.course-tree .section-title:first-child { margin-top: 0; }
.course-tree .module-title { color: var(--fu-text-muted); font-size: .72rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .07em; margin: .8rem 0 .2rem .35rem; }
.course-tree .topics { position: relative; margin-left: .85rem; padding-left: .65rem; border-left: 2px solid var(--fu-border); }
.course-tree a.topic-link, .course-tree span.topic-link {
  display: flex; align-items: center; gap: .55rem; padding: .45rem .55rem; border-radius: .65rem;
  color: var(--fu-text); text-decoration: none; min-height: 40px; position: relative; }
.course-tree a.topic-link:hover { background: var(--fu-surface-2); }
.course-tree .topic-link.current { background: rgba(var(--fu-primary-rgb), .12); font-weight: 600; }
.course-tree .topic-link.current::before { content: ""; position: absolute; left: calc(-.65rem - 2px); top: 20%; bottom: 20%;
  width: 2px; border-radius: 2px; background: var(--fu-primary); }
.course-tree .topic-link.is-locked { color: var(--fu-text-muted); }
.course-tree .topic-code { font-variant-numeric: tabular-nums; color: var(--fu-text-muted); font-size: .72rem; min-width: 3.5rem; }
.sidebar-sticky { position: sticky; top: 5.25rem; max-height: calc(100vh - 6.5rem); overflow-y: auto; scrollbar-width: thin; }

.lang-badge { font-size: .66rem; text-transform: uppercase; border: 1px solid var(--fu-border); border-radius: .3rem;
  padding: 0 .28rem; color: var(--fu-text-muted); font-weight: 600; }
.sample-badge { display: inline-flex; align-items: center; gap: .3rem; background: var(--fu-warning-bg); color: var(--fu-warning);
  font-size: .76rem; font-weight: 600; border-radius: 999px; padding: .18rem .6rem; }

/* ---------- Mavzu: faoliyatlar bosqichlari ---------- */
.activity-steps { position: relative; display: grid; gap: .75rem; }
.activity-steps::before { content: ""; position: absolute; left: 2.15rem; top: 1.5rem; bottom: 1.5rem; width: 2px;
  background: linear-gradient(var(--fu-border), var(--fu-border)); }
.activity-card { position: relative; display: flex; gap: 1rem; align-items: center; }
.activity-card .icon-tile { z-index: 1; }
.activity-card.is-done .icon-tile { background: linear-gradient(135deg, #16a34a, #0d9488); box-shadow: 0 10px 20px -10px #16a34a; }
.activity-card.is-blocked { opacity: .78; }
.activity-card .title-link { font-weight: 600; color: var(--fu-text); text-decoration: none; }
.activity-card .title-link:hover { color: var(--fu-primary); }
.activity-card a.stretched-link::after { border-radius: 1.1rem; }
.activity-icon { width: 3rem; height: 3rem; border-radius: .9rem; display: grid; place-items: center; font-size: 1.3rem;
  background: rgba(var(--fu-primary-rgb), .12); color: var(--fu-primary); flex-shrink: 0; }

.checklist { list-style: none; padding: 0; margin: 0; display: grid; gap: .45rem; }
.checklist li { display: flex; align-items: center; gap: .55rem; }
.checklist .bi-check-circle-fill { color: var(--fu-success); }
.checklist .bi-circle { color: var(--fu-text-muted); }

/* ---------- O'quv matni ---------- */
.prose { max-width: 72ch; font-size: 1.075rem; line-height: 1.75; }
.prose h2 { font-size: 1.55rem; margin-top: 2rem; }
.prose h3 { font-size: 1.22rem; margin-top: 1.6rem; font-weight: 650; }
.prose table { width: 100%; margin: 1.25rem 0; border-collapse: separate; border-spacing: 0; display: block; overflow-x: auto;
  border: 1px solid var(--fu-border); border-radius: .8rem; }
.prose th, .prose td { border-bottom: 1px solid var(--fu-border); padding: .6rem .85rem; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: var(--fu-surface-2); font-weight: 600; text-align: left; }
.prose .note, .prose .important { border: 1px solid transparent; border-left-width: 4px; padding: .9rem 1.1rem;
  border-radius: .8rem; margin: 1.25rem 0; }
.prose .note { border-color: rgba(3, 105, 161, .25); border-left-color: var(--fu-info); background: var(--fu-info-bg); }
.prose .important { border-color: rgba(180, 83, 9, .25); border-left-color: var(--fu-warning); background: var(--fu-warning-bg); }
.prose img, .content-figure img { max-width: 100%; height: auto; border-radius: .75rem; }
[data-bs-theme="dark"] .prose img:not(.no-paper), [data-bs-theme="dark"] .content-figure img:not(.no-paper) {
  background: var(--fu-paper); padding: .5rem; }
.prose iframe, .video-frame { width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: 1rem; }
.simulation-frame { background: #fff; border-radius: 1rem; padding: .25rem; }
.katex { font-size: 1.08em; color: inherit; }
.katex-display { overflow-x: auto; overflow-y: hidden; padding: .35rem 0; }
.reading-progress { position: fixed; top: 0; left: 0; height: 3px; width: 0; z-index: 1040; background: var(--fu-gradient); }

/* ---------- Test ---------- */
.question-card { scroll-margin-top: 6rem; }
.question-nav { display: grid; grid-template-columns: repeat(auto-fill, minmax(2.75rem, 1fr)); gap: .45rem; }
.question-nav a { display: grid; place-items: center; min-height: 44px; border-radius: .75rem; text-decoration: none;
  border: 1px solid var(--fu-border-strong); color: var(--fu-text); font-weight: 600; background: var(--fu-surface); }
.question-nav a.answered { background: var(--fu-primary); border-color: var(--fu-primary); color: var(--fu-on-primary); }
.question-nav a.flagged { box-shadow: inset 0 -3px 0 var(--fu-warning); }
.option-label { display: flex; gap: .8rem; align-items: flex-start; padding: .85rem 1.05rem; border: 1px solid var(--fu-border-strong);
  border-radius: .9rem; cursor: pointer; margin-bottom: .55rem; background: var(--fu-surface); min-height: 48px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease; }
.option-label:hover { border-color: rgba(var(--fu-primary-rgb), .55); background: rgba(var(--fu-primary-rgb), .04); }
.option-label:has(input:checked) { border-color: var(--fu-primary); background: rgba(var(--fu-primary-rgb), .08);
  box-shadow: 0 0 0 3px rgba(var(--fu-primary-rgb), .12); }
.option-label input { margin-top: .3rem; flex-shrink: 0; }
.option-label.correct { border-color: var(--fu-success); background: var(--fu-success-bg); }
.option-label.wrong { border-color: var(--fu-danger); background: var(--fu-danger-bg); }
.timer { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 1.35rem; }
.timer.warning { color: var(--fu-danger); }
.save-indicator { font-size: .82rem; color: var(--fu-text-muted); }
.save-indicator.error { color: var(--fu-danger); }
.sticky-quiz-bar { position: sticky; top: 5.25rem; z-index: 10; }
.feedback-box { border-radius: .85rem; padding: .8rem 1.05rem; margin-top: .85rem; }
.feedback-box.ok { background: var(--fu-success-bg); color: var(--fu-text); border: 1px solid var(--fu-success); }
.feedback-box.bad { background: var(--fu-danger-bg); color: var(--fu-text); border: 1px solid var(--fu-danger); }
.result-hero { position: relative; overflow: hidden; text-align: center; padding: 2.25rem 1.5rem; }
.result-hero::before { content: ""; position: absolute; inset: 0; background: var(--fu-gradient-soft); pointer-events: none; }
.result-hero > * { position: relative; }
.result-score { font-size: 3.4rem; font-weight: 800; line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.result-pass { color: var(--fu-success); }
.result-fail { color: var(--fu-danger); }

.lock-card { border: 1px dashed var(--fu-border-strong); background: var(--fu-bg-soft); border-radius: 1.1rem; padding: 1.5rem; }
.lock-card .bi-lock-fill { font-size: 1.6rem; color: var(--fu-primary); width: 3rem; height: 3rem; display: grid; place-items: center;
  border-radius: 50%; background: rgba(var(--fu-primary-rgb), .12); flex-shrink: 0; }

/* Kabinet */
.welcome-banner { position: relative; overflow: hidden; border-radius: 1.4rem; padding: 2rem; color: #fff; background: var(--fu-gradient); }
.welcome-banner .grid-paper { position: absolute; inset: 0; --fu-grid: rgba(255, 255, 255, .12); }
.welcome-banner > * { position: relative; }
.welcome-banner .text-white-75 { color: rgba(255, 255, 255, .88); }
[data-bs-theme="dark"] .welcome-banner { color: #0a0e1f; }
[data-bs-theme="dark"] .welcome-banner .text-white-75 { color: rgba(10, 14, 31, .82); }
.welcome-banner .btn-light { --bs-btn-bg: #fff; --bs-btn-color: #312e81; --bs-btn-border-color: #fff;
  --bs-btn-hover-bg: #eef2ff; --bs-btn-hover-color: #312e81; }
.list-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; padding: .7rem 0;
  border-bottom: 1px solid var(--fu-border); }
.list-row:last-child { border-bottom: 0; }

.table { --bs-table-bg: transparent; --bs-table-color: var(--fu-text); --bs-table-border-color: var(--fu-border);
  --bs-table-striped-bg: var(--fu-surface-2); --bs-table-hover-bg: var(--fu-surface-2); --bs-table-hover-color: var(--fu-text); }
.table > thead th { font-size: .78rem; text-transform: uppercase; letter-spacing: .05em; color: var(--fu-text-muted); font-weight: 600; }
.alert { border-radius: 1rem; border-width: 1px; }
.alert-success { --bs-alert-bg: var(--fu-success-bg); --bs-alert-color: var(--fu-text); --bs-alert-border-color: rgba(21, 128, 61, .3); }
.alert-danger, .alert-error { --bs-alert-bg: var(--fu-danger-bg); --bs-alert-color: var(--fu-text); --bs-alert-border-color: rgba(200, 30, 30, .3); }
.alert-warning { --bs-alert-bg: var(--fu-warning-bg); --bs-alert-color: var(--fu-text); --bs-alert-border-color: rgba(180, 83, 9, .3); }
.alert-info { --bs-alert-bg: var(--fu-info-bg); --bs-alert-color: var(--fu-text); --bs-alert-border-color: rgba(3, 105, 161, .25); }
.breadcrumb { --bs-breadcrumb-divider-color: var(--fu-text-muted); --bs-breadcrumb-item-active-color: var(--fu-text-muted); }
.breadcrumb a { text-decoration: none; }
.pagination { --bs-pagination-bg: var(--fu-surface); --bs-pagination-border-color: var(--fu-border);
  --bs-pagination-color: var(--fu-text); --bs-pagination-disabled-bg: var(--fu-surface-2);
  --bs-pagination-disabled-color: var(--fu-text-muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--fu-border); background: var(--fu-bg-soft); color: var(--fu-text-muted); }
.site-footer a { color: var(--fu-text-muted); text-decoration: none; }
.site-footer a:hover { color: var(--fu-primary); }
.site-footer .footer-title { color: var(--fu-text); font-weight: 600; font-size: .9rem; margin-bottom: .6rem; }

.stat-tile { padding: 1.1rem 1.3rem; }
.stat-tile .value { font-size: 1.85rem; font-weight: 700; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }
.stat-tile .label { color: var(--fu-text-muted); font-size: .86rem; }
.chart-box { position: relative; min-height: 260px; }

.matrix td, .matrix th { text-align: center; font-size: .8125rem; white-space: nowrap; }
.cell-published { background: var(--fu-success-bg); }
.cell-ready { background: var(--fu-info-bg); }
.cell-in_review, .cell-draft { background: var(--fu-warning-bg); }
.cell-missing { background: var(--fu-danger-bg); }

/* Sertifikat va chop etish — har doim ochiq rejim (TZ 9.8) */
.certificate { background: #fff; color: #0e1330; border: 1px solid #e5e7f0; padding: 3.5rem 3rem; border-radius: 1.4rem;
  box-shadow: 0 30px 60px -30px rgba(79, 70, 229, .45); position: relative; overflow: hidden; }
.certificate::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 8px; background: linear-gradient(120deg, #4f46e5, #7c3aed, #0ea5e9); }
@media print {
  :root, [data-bs-theme] { --fu-bg: #fff; --fu-text: #000; --fu-surface: #fff; --fu-border: #ccc; color-scheme: light; }
  .site-header, .site-footer, .no-print { display: none !important; }
  body { background: #fff; color: #000; }
}

@media (max-width: 575.98px) {
  .result-score { font-size: 2.5rem; }
  .fu-card { padding: 1.1rem; }
  .course-banner, .welcome-banner { padding: 1.4rem; border-radius: 1.1rem; }
  .auth-card { padding: 1.5rem; }
  .activity-steps::before { left: 1.85rem; }
}
.min-w-0 { min-width: 0; }
/* .navbar konteynerning yon bo'shlig'ini bekor qiladi — mobil uchun 16px chekka */
.site-header .navbar.container { padding-left: 1rem; padding-right: 1rem; }
