/* Safar akademiya — qo'shimcha imkoniyatlar: pasport va XP, takrorlash, AI Ustoz, qidiruv, sertifikat, PWA. */

/* ---------- Topbar asboblari ---------- */
.topbar-tools { display: flex; align-items: center; gap: 4px; }
.tool-btn { font-size: 1.05rem; padding: 6px 8px; }
.tool-search { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); color: var(--muted); cursor: pointer; font: inherit; font-size: 0.85rem; transition: border-color 0.2s, color 0.2s; }
.tool-search:hover { border-color: var(--primary); color: var(--text); }
.tool-search kbd, .cmdk kbd { font: 600 0.7rem/1 ui-monospace, monospace; padding: 3px 5px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); }
.tool-search-label, .tool-search kbd { display: none; }
@media (min-width: 1500px) { .tool-search-label, .tool-search kbd { display: inline; } }
@media (max-width: 860px) {
  .topbar-tools { margin-left: auto; }
  .menu-toggle { margin-left: 0 !important; }
}
.row.center { justify-content: center; }
.check-row { display: flex; gap: 8px; align-items: center; margin: 4px 0 14px; cursor: pointer; font-size: 0.92rem; }
.offline-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 200; max-width: min(640px, calc(100% - 32px)); padding: 10px 16px; border-radius: 12px; background: #2b1d05; color: #fbe7bd; font-size: 0.88rem; box-shadow: 0 12px 30px -12px rgba(0, 0, 0, 0.5); animation: page-in 0.4s var(--ease-out); }

/* ---------- Qidiruv (Ctrl+K) ---------- */
.cmdk-overlay { position: fixed; inset: 0; z-index: 400; background: rgba(6, 20, 24, 0.45); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; animation: fadeIn 0.18s ease-out; }
@keyframes fadeIn { from { opacity: 0; } }
.cmdk { width: min(680px, 100%); max-height: 72vh; display: flex; flex-direction: column; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5); overflow: hidden; animation: cmdkIn 0.25s var(--ease-out); }
@keyframes cmdkIn { from { opacity: 0; transform: translateY(-12px) scale(0.98); } }
.cmdk-input { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--border); }
.cmdk-input input { flex: 1; border: 0; outline: none; background: transparent; font: inherit; font-size: 1.05rem; color: var(--text); padding: 4px 0; }
.cmdk-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 9px 12px; border-radius: 10px; cursor: pointer; }
.cmdk-item.sel { background: var(--primary-soft); }
.cmdk-item kbd { opacity: 0; }
.cmdk-item.sel kbd { opacity: 1; }
.cmdk-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; background: var(--surface-2); flex: none; }
.cmdk-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.cmdk-text b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-text small { color: var(--muted); font-size: 0.78rem; }
.cmdk-text mark { background: color-mix(in srgb, var(--accent) 35%, transparent); color: inherit; border-radius: 3px; }
.cmdk-empty { padding: 24px; text-align: center; color: var(--muted); }
.cmdk-foot { display: flex; gap: 16px; padding: 8px 16px; border-top: 1px solid var(--border); font-size: 0.75rem; color: var(--muted); flex-wrap: wrap; }
.cmdk-foot span { display: inline-flex; gap: 4px; align-items: center; }

/* ---------- XP va daraja tantanasi ---------- */
.xp-stack { position: fixed; right: 24px; bottom: 96px; z-index: 260; display: flex; flex-direction: column-reverse; gap: 8px; pointer-events: none; }
.xp-pop { padding: 8px 16px; border-radius: 999px; background: var(--grad-gold); color: #2a1c03; font-weight: 700; box-shadow: 0 10px 24px -10px rgba(120, 80, 10, 0.7); animation: xpUp 2.2s var(--ease-out) forwards; }
.xp-pop b { font-size: 1.1rem; }
@keyframes xpUp { 0% { opacity: 0; transform: translateY(20px) scale(0.6); } 15% { opacity: 1; transform: translateY(0) scale(1.08); } 25% { transform: scale(1); } 80% { opacity: 1; } 100% { opacity: 0; transform: translateY(-40px); } }
.levelup-overlay { position: fixed; inset: 0; z-index: 250; display: grid; place-items: center; padding: 16px; background: rgba(4, 18, 22, 0.6); backdrop-filter: blur(6px); animation: fadeIn 0.3s; }
.levelup-card { position: relative; overflow: hidden; width: min(420px, 100%); padding: 36px 28px 28px; border-radius: 24px; text-align: center; background: var(--surface); box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 0.6); animation: lvIn 0.6s var(--ease-out); }
@keyframes lvIn { from { opacity: 0; transform: scale(0.7) rotate(-4deg); } }
.levelup-rays { position: absolute; inset: -60%; background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--accent) 16%, transparent) 0 10deg, transparent 10deg 20deg); animation: spin 18s linear infinite; }
.levelup-card > *:not(.levelup-rays) { position: relative; }
.levelup-icon { font-size: 4.5rem; line-height: 1; margin-bottom: 8px; animation: bounceIn 0.9s var(--ease-out) 0.2s both; }
@keyframes bounceIn { 0% { transform: scale(0); } 60% { transform: scale(1.25); } 100% { transform: scale(1); } }
.levelup-card h2 { font-family: var(--font-display); font-size: 1.8rem; margin: 4px 0 8px; background: var(--grad-primary); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- Bosh sahifa: daraja halqasi ---------- */
.home-me { gap: 14px; }
.home-level { --p: 0; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; text-decoration: none; font-size: 1.6rem; background: conic-gradient(var(--accent) calc(var(--p) * 1%), var(--surface-2) 0); position: relative; }
.home-level::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.home-level span { position: relative; }

/* ---------- Safar pasporti ---------- */
.pp-cover { position: relative; overflow: hidden; display: grid; grid-template-columns: 1fr auto; gap: 24px; padding: 32px 32px 18px; border-radius: 24px; color: #f3e6c8; background: radial-gradient(120% 130% at 0% 0%, #0f5f67 0%, #0a3d43 55%, #06262a 100%); box-shadow: 0 30px 60px -30px rgba(5, 40, 46, 0.9), inset 0 0 0 1px rgba(240, 196, 106, 0.25); animation: page-in 0.5s var(--ease-out); }
.pp-guilloche { position: absolute; inset: 0; opacity: 0.18; background: repeating-radial-gradient(circle at 85% 30%, transparent 0 10px, rgba(240, 196, 106, 0.6) 10px 11px), repeating-linear-gradient(115deg, transparent 0 22px, rgba(255, 255, 255, 0.15) 22px 23px); pointer-events: none; }
.pp-cover-main { position: relative; display: grid; grid-template-columns: auto 1fr; gap: 6px 20px; align-items: center; }
.pp-emblem { grid-row: span 2; width: 92px; height: 92px; border-radius: 50%; display: grid; place-items: center; font-size: 3rem; background: radial-gradient(circle at 35% 30%, #f6d58a, #c8912a 70%); box-shadow: 0 0 0 6px rgba(240, 196, 106, 0.2), 0 12px 28px -10px rgba(0, 0, 0, 0.6); animation: emblem 6s ease-in-out infinite; }
@keyframes emblem { 50% { transform: rotate(8deg) scale(1.03); } }
.pp-title small { letter-spacing: 0.18em; font-size: 0.72rem; color: #e8c879; font-weight: 700; }
.pp-title h1 { margin: 4px 0 0; color: #fff; font-size: clamp(1.4rem, 3vw, 2.1rem); }
.pp-fields { margin: 6px 0 0; display: grid; grid-template-columns: repeat(4, minmax(0, auto)); gap: 4px 22px; }
.pp-fields div { min-width: 0; }
.pp-fields dt { font-size: 0.68rem; letter-spacing: 0.1em; text-transform: uppercase; color: rgba(243, 230, 200, 0.6); }
.pp-fields dd { margin: 0; font-weight: 600; color: #fff; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pp-level { position: relative; display: flex; align-items: center; gap: 16px; }
.pp-ring { --p: 0; width: 104px; height: 104px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#f0c46a calc(var(--p) * 1%), rgba(255, 255, 255, 0.12) 0); transition: --p 1.4s var(--ease-out); position: relative; }
.pp-ring::before { content: ""; position: absolute; inset: 8px; border-radius: 50%; background: #0a3d43; }
.pp-ring-icon { position: relative; font-size: 2.6rem; }
.pp-level-name { font-family: var(--font-display); font-size: 1.3rem; color: #fff; }
.pp-xp { font-size: 1.05rem; color: #f0c46a; }
.pp-xp b { font-size: 1.6rem; }
.pp-next { font-size: 0.82rem; color: rgba(243, 230, 200, 0.75); }
.pp-streak { display: flex; flex-direction: column; align-items: center; padding: 8px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.07); filter: grayscale(1); opacity: 0.6; }
.pp-streak.on { filter: none; opacity: 1; }
.pp-streak.on span { animation: flame 1.2s ease-in-out infinite alternate; display: inline-block; }
@keyframes flame { to { transform: scale(1.18) rotate(-6deg); } }
.pp-streak b { font-size: 1.3rem; color: #fff; }
.pp-streak small { font-size: 0.7rem; }
.pp-mrz { grid-column: 1 / -1; position: relative; font: 600 0.78rem/1.4 ui-monospace, "Courier New", monospace; letter-spacing: 0.22em; color: rgba(243, 230, 200, 0.45); white-space: nowrap; overflow: hidden; border-top: 1px dashed rgba(240, 196, 106, 0.3); padding-top: 10px; }
.pp-track { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 6px; margin: 18px 0 8px; }
.pp-step { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 4px; border-radius: 12px; background: var(--surface); border: 1px solid var(--border); text-align: center; opacity: 0.55; filter: grayscale(0.8); }
.pp-step.done { opacity: 1; filter: none; border-color: color-mix(in srgb, var(--accent) 60%, var(--border)); animation: pop 0.5s var(--ease-out) calc(var(--i) * 80ms) both; }
.pp-step span { font-size: 1.4rem; }
.pp-step b { font-size: 0.75rem; }
.pp-step small { font-size: 0.68rem; color: var(--muted); }
.pp-two { margin-top: 16px; align-items: start; }

.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 18px; padding: 22px; border-radius: 20px; background: repeating-linear-gradient(0deg, transparent 0 27px, color-mix(in srgb, var(--primary) 8%, transparent) 27px 28px), color-mix(in srgb, var(--accent) 6%, var(--surface)); border: 1px solid var(--border); }
.stamp { --c: hsl(var(--hue) 62% 38%); display: flex; flex-direction: column; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.stamp-ink { width: 120px; height: 120px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; border: 4px double var(--c); color: var(--c); transform: rotate(var(--rot)); position: relative; font-weight: 800; letter-spacing: 0.06em; }
.stamp-ink::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; border: 1.5px dashed var(--c); opacity: 0.7; }
.stamp-top, .stamp-bottom { font-size: 0.62rem; }
.stamp-icon { font-size: 2rem; }
.stamp.stamped .stamp-ink { background: radial-gradient(circle, color-mix(in srgb, var(--c) 10%, transparent), transparent 70%); animation: stampIn 0.55s cubic-bezier(0.2, 1.6, 0.4, 1) var(--d) both; mask-image: radial-gradient(circle at 30% 40%, #000 60%, rgba(0, 0, 0, 0.75) 61%, #000 75%); }
@keyframes stampIn { 0% { opacity: 0; transform: rotate(var(--rot)) scale(2.4); } 60% { opacity: 1; transform: rotate(var(--rot)) scale(0.92); } 100% { transform: rotate(var(--rot)) scale(1); } }
.stamp.st-partial .stamp-ink { opacity: 0.45; border-style: dashed; filter: grayscale(0.6); }
.stamp.st-empty .stamp-ink { opacity: 0.22; border-style: dashed; filter: grayscale(1); }
.stamp:hover .stamp-ink { opacity: 1; filter: none; }
.stamp-caption { font-size: 0.75rem; text-align: center; color: var(--muted); line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .stamp { --c: hsl(var(--hue) 70% 66%); } }
:root[data-theme="dark"] .stamp { --c: hsl(var(--hue) 70% 66%); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.badge-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 16px 12px; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); transition: transform 0.25s var(--ease-out), box-shadow 0.25s; }
.badge-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.badge-medal { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 1.9rem; margin-bottom: 6px; position: relative; }
.badge-card.earned .badge-medal { background: radial-gradient(circle at 35% 30%, #fff3cf, #e9b955 55%, #a8721a); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent), 0 10px 20px -10px rgba(168, 114, 26, 0.8); }
.badge-card.earned .badge-medal::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.7) 50%, transparent 70%); background-size: 250% 100%; animation: shine 3.2s ease-in-out infinite; }
@keyframes shine { 0%, 60% { background-position: 150% 0; } 100% { background-position: -100% 0; } }
.badge-card.locked .badge-medal { background: var(--surface-2); filter: grayscale(1); opacity: 0.5; }
.badge-card b { font-size: 0.9rem; }
.badge-card small { font-size: 0.75rem; line-height: 1.3; }
.badge-progress { width: 80%; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.badge-progress i { display: block; height: 100%; background: var(--grad-primary); border-radius: 3px; }

.heatmap-wrap { overflow-x: auto; padding-bottom: 4px; }
.heatmap { display: grid; grid-template-rows: repeat(7, 13px); grid-auto-flow: column; grid-auto-columns: 13px; gap: 3px; margin: 10px 0 8px; }
.hm-cell { width: 13px; height: 13px; border-radius: 3px; background: var(--hm0); display: inline-block; animation: fadeIn 0.4s ease-out var(--d, 0ms) both; }
.hm-cell.future { visibility: hidden; }
.hm-cell.l1 { background: var(--hm1); } .hm-cell.l2 { background: var(--hm2); } .hm-cell.l3 { background: var(--hm3); } .hm-cell.l4 { background: var(--hm4); }
:root { --hm0: #e9f0f1; --hm1: #b5e0e3; --hm2: #6fc0c7; --hm3: #2a9aa4; --hm4: #0b6e78; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --hm0: #1b2d32; --hm1: #1f4a50; --hm2: #23707a; --hm3: #3fa3ad; --hm4: #8fd8de; } }
:root[data-theme="dark"] { --hm0: #1b2d32; --hm1: #1f4a50; --hm2: #23707a; --hm3: #3fa3ad; --hm4: #8fd8de; }
.hm-legend { display: flex; align-items: center; gap: 4px; font-size: 0.75rem; color: var(--muted); }
.hm-legend .hm-cell { animation: none; }

.src-bars { display: grid; gap: 8px; margin: 10px 0 12px; }
.src-row { display: grid; grid-template-columns: 130px 1fr 48px; gap: 10px; align-items: center; font-size: 0.85rem; }
.src-row b { text-align: right; font-variant-numeric: tabular-nums; }
.src-track { height: 10px; border-radius: 0 4px 4px 0; background: var(--surface-2); overflow: hidden; }
.src-track i { display: block; height: 100%; width: var(--w); border-radius: 0 4px 4px 0; background: var(--primary); transform-origin: left; animation: grow 1s var(--ease-out) both; }
@keyframes grow { from { transform: scaleX(0); } }
.pp-rules { padding-left: 0; list-style: none; margin: 8px 0 0; }
.pp-rules li { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; border-bottom: 1px dashed var(--border); }

.lb-list { list-style: none; padding: 0; margin: 14px 0 8px; display: grid; gap: 6px; }
.lb-row { display: grid; grid-template-columns: 44px 1fr auto auto 90px; gap: 12px; align-items: center; padding: 10px 14px; border-radius: 12px; background: var(--surface-2); animation: page-in 0.4s var(--ease-out) calc(var(--i) * 40ms) both; }
.lb-row.me { background: var(--primary-soft); box-shadow: inset 0 0 0 2px var(--primary); }
.lb-row.top1 { background: linear-gradient(90deg, color-mix(in srgb, #f0c46a 35%, var(--surface-2)), var(--surface-2)); }
.lb-row.gap { margin-top: 14px; position: relative; }
.lb-row.gap::before { content: "⋯"; position: absolute; top: -18px; left: 50%; color: var(--muted); }
.lb-rank { font-weight: 800; font-size: 1.1rem; text-align: center; }
.lb-name { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-level { font-size: 0.85rem; }
.lb-xp { text-align: right; font-variant-numeric: tabular-nums; color: var(--primary); }
@media (max-width: 640px) { .lb-row { grid-template-columns: 34px 1fr 72px; } .lb-level, .lb-meta { display: none; } .pp-cover { grid-template-columns: 1fr; padding: 22px 18px 14px; } .pp-cover-main { grid-template-columns: 1fr; } .pp-emblem { grid-row: auto; width: 64px; height: 64px; font-size: 2rem; } .pp-fields { grid-template-columns: 1fr 1fr; } .pp-track { grid-template-columns: repeat(4, 1fr); } .src-row { grid-template-columns: 110px 1fr 40px; } }
.cert-req { list-style: none; padding: 0; display: grid; gap: 8px; }
.cert-req li { display: flex; gap: 8px; align-items: baseline; }
.cert-req li.ok { color: var(--ok); }
.cert-ready { background: linear-gradient(120deg, color-mix(in srgb, var(--accent) 16%, var(--surface)), var(--surface)); }

/* ---------- Kunlik takrorlash ---------- */
.srs-boxes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; margin-bottom: 18px; }
.srs-box { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; position: relative; overflow: hidden; }
.srs-box::before { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--primary); opacity: calc(0.15 + var(--o, 0)); }
.srs-box.b1 { --o: 0.15; } .srs-box.b2 { --o: 0.3; } .srs-box.b3 { --o: 0.5; } .srs-box.b4 { --o: 0.7; } .srs-box.b5 { --o: 0.85; }
.srs-box b { display: block; font-size: 1.5rem; }
.srs-box small { color: var(--muted); font-size: 0.72rem; }
.srs-wrap { max-width: 640px; margin: 0 auto; display: grid; gap: 12px; }
.srs-progress { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.srs-progress i { display: block; height: 100%; background: var(--grad-primary); transform-origin: left; transform: scaleX(0); transition: transform 0.4s var(--ease-out); }
.srs-stage { perspective: 1400px; min-height: 300px; }
.srs-card { position: relative; width: 100%; min-height: 300px; border: 0; padding: 0; background: none; cursor: pointer; transform-style: preserve-3d; transition: transform 0.6s var(--ease-out), opacity 0.35s, translate 0.35s; animation: cardIn 0.45s var(--ease-out); font: inherit; color: inherit; }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(0.96); } }
.srs-card.flipped { transform: rotateY(180deg); }
.srs-card.fly-right { translate: 60% 0; opacity: 0; }
.srs-card.fly-left { translate: -60% 0; opacity: 0; }
.srs-face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; border-radius: 22px; backface-visibility: hidden; text-align: center; box-shadow: 0 24px 50px -28px rgba(8, 50, 56, 0.6); }
.srs-face.front { background: radial-gradient(120% 120% at 0% 0%, #12a4a8, #0e7c86 45%, #0a4f56); color: #fff; }
.srs-face.back { background: var(--surface); border: 1px solid var(--border); transform: rotateY(180deg); }
.srs-topic { font-size: 0.8rem; opacity: 0.8; font-weight: 600; }
.srs-term { font-family: var(--font-display); font-size: clamp(1.4rem, 4vw, 2.1rem); line-height: 1.2; }
.srs-tap { font-size: 0.78rem; opacity: 0.7; }
.srs-def { font-size: 1rem; line-height: 1.55; max-height: 230px; overflow-y: auto; }
.srs-actions { display: flex; gap: 10px; }
.srs-actions .btn { flex: 1; justify-content: center; }
.srs-actions kbd { margin-left: 8px; font: 600 0.7rem/1 ui-monospace, monospace; padding: 2px 5px; border-radius: 4px; background: rgba(0, 0, 0, 0.12); }
.srs-again { border-color: var(--err) !important; color: var(--err) !important; }
.srs-done { text-align: center; padding: 32px; animation: pop 0.5s var(--ease-out); }
@media (max-width: 640px) { .srs-boxes { grid-template-columns: repeat(3, 1fr); } }

/* ---------- AI Ustoz ---------- */
.tutor-wrap { position: fixed; right: 24px; bottom: 96px; z-index: 120; }
.tutor-fab { width: 56px; height: 56px; border-radius: 50%; border: 0; cursor: pointer; font-size: 1.6rem; color: #fff; background: radial-gradient(circle at 35% 30%, #5fc4cc, #0e7c86 60%, #0a4f56); box-shadow: 0 14px 30px -12px rgba(8, 60, 66, 0.8); transition: transform 0.25s var(--ease-out); position: relative; }
.tutor-fab::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid #5fc4cc; animation: ripple 2.4s ease-out infinite; pointer-events: none; }
.tutor-fab:hover { transform: scale(1.08) rotate(-6deg); }
.tutor-wrap.open .tutor-fab::after { display: none; }
.tutor-panel { position: absolute; right: 0; bottom: 70px; width: min(400px, calc(100vw - 32px)); height: min(560px, calc(100vh - 200px)); display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--border); box-shadow: 0 30px 70px -24px rgba(0, 0, 0, 0.45); transform-origin: bottom right; transform: scale(0.85) translateY(10px); opacity: 0; pointer-events: none; transition: transform 0.3s var(--ease-out), opacity 0.2s; overflow: hidden; }
.tutor-wrap.open .tutor-panel { transform: none; opacity: 1; pointer-events: auto; }
.tutor-head { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 16px; color: #fff; background: linear-gradient(120deg, #0e7c86, #0a4f56); }
.tutor-head > div:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.tutor-head small { opacity: 0.75; font-size: 0.75rem; }
.tutor-head .icon-btn { color: rgba(255, 255, 255, 0.85); }
.tutor-head .icon-btn:hover { background: rgba(255, 255, 255, 0.15); color: #fff; }
.tutor-avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, 0.15); font-size: 1.2rem; }
.tutor-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.tutor-msg { max-width: 88%; padding: 10px 13px; border-radius: 16px; font-size: 0.9rem; line-height: 1.5; white-space: pre-wrap; animation: page-in 0.3s var(--ease-out); }
.tutor-msg.assistant { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.tutor-msg.user { align-self: flex-end; background: var(--primary); color: var(--primary-ink); border-bottom-right-radius: 4px; }
.tutor-msg.typing .tutor-text::after { content: "●●●"; letter-spacing: 3px; animation: blink 1s infinite; color: var(--muted); }
@keyframes blink { 50% { opacity: 0.3; } }
.tutor-chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 10px; }
.tutor-chips .chip { font-size: 0.78rem; text-align: left; cursor: pointer; }
.tutor-input { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--border); }
.tutor-input textarea { flex: 1; resize: none; border-radius: 12px; padding: 8px 10px; font: inherit; font-size: 0.9rem; }
.explain-btn { position: fixed; z-index: 150; padding: 7px 14px; border-radius: 999px; border: 0; cursor: pointer; font: inherit; font-size: 0.85rem; font-weight: 600; color: #fff; background: linear-gradient(120deg, #0e7c86, #5a46b8); box-shadow: 0 10px 24px -10px rgba(40, 30, 90, 0.7); opacity: 0; transform: translateY(6px) scale(0.9); pointer-events: none; transition: opacity 0.15s, transform 0.2s var(--ease-out); }
.explain-btn.show { opacity: 1; transform: none; pointer-events: auto; }
@media (max-width: 640px) { .tutor-wrap { right: 16px; bottom: 84px; } }

/* ---------- Sertifikat ---------- */
.certificate { position: relative; max-width: 1000px; aspect-ratio: 297 / 210; margin: 0 auto 20px; padding: 6% 8%; display: flex; flex-direction: column; align-items: center; text-align: center; color: #1d2b2e; background: radial-gradient(ellipse at 50% 0%, #fffdf6, #f6efdc 70%, #efe3c4); border-radius: 6px; box-shadow: 0 30px 70px -30px rgba(60, 40, 10, 0.55); overflow: hidden; animation: page-in 0.6s var(--ease-out); }
.cert-border { position: absolute; inset: 14px; border: 3px double #b8862b; pointer-events: none; }
.cert-border::after { content: ""; position: absolute; inset: 8px; border: 1px solid rgba(184, 134, 43, 0.5); }
.cert-corner { position: absolute; width: 70px; height: 70px; border: 3px solid #0e7c86; pointer-events: none; }
.cert-corner.tl { top: 30px; left: 30px; border-right: 0; border-bottom: 0; } .cert-corner.tr { top: 30px; right: 30px; border-left: 0; border-bottom: 0; }
.cert-corner.bl { bottom: 30px; left: 30px; border-right: 0; border-top: 0; } .cert-corner.br { bottom: 30px; right: 30px; border-left: 0; border-top: 0; }
.cert-brand { display: flex; align-items: center; gap: 8px; letter-spacing: 0.3em; font-weight: 800; font-size: clamp(0.65rem, 1.3vw, 0.9rem); color: #0e7c86; }
.cert-title { font-family: var(--font-display); font-size: clamp(1.8rem, 5.5vw, 3.6rem); letter-spacing: 0.18em; margin: 1.5% 0 0; background: linear-gradient(180deg, #c8912a, #8a5e12); -webkit-background-clip: text; background-clip: text; color: transparent; }
.cert-lead { margin: 1% 0 0; font-style: italic; color: #6a5a3a; font-size: clamp(0.75rem, 1.4vw, 1rem); }
.cert-name { font-family: "Georgia", "Times New Roman", serif; font-size: clamp(1.4rem, 4.2vw, 2.8rem); font-weight: 700; color: #0a4f56; margin: 1% 0 0; padding: 0 4% 0.5%; border-bottom: 2px solid #c8912a; }
.cert-org { margin: 1% 0 0; color: #5b6b6e; font-size: clamp(0.7rem, 1.3vw, 0.95rem); }
.cert-text { max-width: 80%; margin: 1.6% 0; font-size: clamp(0.72rem, 1.45vw, 1.02rem); line-height: 1.5; }
.cert-stats { display: flex; gap: clamp(10px, 3vw, 36px); justify-content: center; }
.cert-stats div { display: flex; flex-direction: column; }
.cert-stats b { font-size: clamp(1rem, 2.6vw, 1.7rem); color: #0e7c86; }
.cert-stats span { font-size: clamp(0.55rem, 1vw, 0.75rem); color: #6a5a3a; }
.cert-level { margin-top: 1.4%; font-size: clamp(0.72rem, 1.3vw, 0.95rem); }
.cert-foot { margin-top: auto; width: 100%; display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 12px; }
.cert-foot > div:not(.cert-seal) { display: flex; flex-direction: column; font-size: clamp(0.6rem, 1.1vw, 0.85rem); }
.cert-foot > div:first-child { text-align: left; } .cert-foot > div:last-child { text-align: right; }
.cert-foot span { color: #6a5a3a; }
.cert-seal { width: clamp(64px, 11vw, 110px); aspect-ratio: 1; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #fff; font-size: clamp(0.45rem, 0.9vw, 0.65rem); letter-spacing: 0.15em; font-weight: 800; background: radial-gradient(circle at 35% 30%, #f0c46a, #c8912a 55%, #8a5e12); box-shadow: 0 0 0 4px #f6efdc, 0 0 0 6px #c8912a, 0 10px 20px -8px rgba(80, 50, 5, 0.6); transform: rotate(-12deg); animation: sealIn 0.8s cubic-bezier(0.2, 1.6, 0.4, 1) 0.4s both; }
.cert-seal b { font-size: clamp(1.2rem, 2.6vw, 2rem); }
@keyframes sealIn { from { opacity: 0; transform: rotate(-12deg) scale(2.2); } }
.cert-verify { margin: 1% 0 0; font-size: clamp(0.5rem, 0.9vw, 0.7rem); color: #8a7a5a; }
.cert-actions { margin-bottom: 24px; }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
@media print {
  @page { size: A4 landscape; margin: 0; }
  .topbar, .footer, .results-board, .no-print, .xp-stack, .tutor-wrap, .notes-wrap { display: none !important; }
  body, main { background: #fff !important; padding: 0 !important; margin: 0 !important; }
  body::before, body::after { display: none !important; }
  .certificate { box-shadow: none; max-width: none; width: 297mm; height: 210mm; aspect-ratio: auto; border-radius: 0; animation: none; }
  .cert-seal { animation: none; }
}
.temp-pass { font-size: 1rem; font-weight: 700; letter-spacing: 0.06em; padding: 3px 8px; border-radius: 6px; background: var(--warn-soft); color: var(--warn); margin-right: 4px; user-select: all; }

/* ===== Geo-sayohat ===== */
.geo-intro { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding: 24px 0; }
.geo-intro h1 { font-size: clamp(2rem, 5vw, 3.2rem); margin: 10px 0; }
.geo-hero-art { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 3; box-shadow: 0 30px 60px -30px rgba(0, 0, 0, 0.5); position: relative; }
.geo-hero-art svg { width: 100%; height: 100%; display: block; }
.geo-hero-art::after { content: "📍"; position: absolute; left: 52%; top: 30%; font-size: 3rem; animation: geoDrop 1.6s cubic-bezier(.3,1.6,.5,1) 0.4s both, geoBob 2.4s ease-in-out 2s infinite; filter: drop-shadow(0 6px 6px rgba(0,0,0,.35)); }
@keyframes geoIn { from { opacity: 0; transform: translateY(10px); } }
@keyframes geoDrop { from { transform: translateY(-120px); opacity: 0; } }
@keyframes geoBob { 50% { transform: translateY(-8px); } }
.geo-steps { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0; }
.geo-step { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); animation: geoIn 0.5s ease-out both; animation-delay: calc(var(--i) * 0.12s + 0.2s); }
.geo-step span { font-size: 1.4rem; }
.geo-best { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 14px; padding: 10px 14px; border-radius: 12px; background: var(--accent-soft); }
.geo-play { display: grid; grid-template-columns: minmax(300px, 380px) 1fr; gap: 16px; min-height: calc(100vh - 160px); padding: 12px 0; }
.geo-side { display: flex; flex-direction: column; gap: 12px; }
.geo-round { font-weight: 700; }
.geo-total { font-weight: 800; color: var(--accent); font-variant-numeric: tabular-nums; }
.geo-dots { display: flex; gap: 6px; }
.geo-dots i { flex: 1; height: 6px; border-radius: 99px; background: var(--surface-2); transition: background 0.3s; }
.geo-dots i.now { background: var(--primary); animation: pulse 1.4s ease-in-out infinite; }
.geo-dots i.great { background: var(--ok); }
.geo-dots i.ok { background: var(--warn); }
.geo-dots i.far { background: var(--err); }
.geo-art-wrap { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; }
.geo-art { width: 100%; height: 100%; animation: geoIn 0.5s ease-out both; }
.geo-art svg { width: 100%; height: 100%; display: block; }
.geo-emoji { position: relative; display: grid; place-items: center; overflow: hidden; background: radial-gradient(circle at 30% 20%, hsl(var(--hue) 70% 72%), hsl(var(--hue) 55% 38%)); }
.geo-emoji span { font-size: 4.2rem; z-index: 1; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.3)); animation: geoBob 3s ease-in-out infinite; }
.geo-emoji i { position: absolute; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.25); width: 60%; aspect-ratio: 1; animation: geoRing 4s ease-out infinite; }
.geo-emoji i:nth-of-type(2) { animation-delay: 1.3s; }
.geo-emoji i:nth-of-type(3) { animation-delay: 2.6s; }
@keyframes geoRing { from { transform: scale(0.3); opacity: 1; } to { transform: scale(1.8); opacity: 0; } }
.geo-clue { font-size: 1.05rem; line-height: 1.55; margin: 0; }
.geo-hint:empty { display: none; }
.geo-hint { padding: 8px 12px; border-radius: 10px; background: var(--warn-soft); }
.geo-result:empty { display: none; }
.geo-answer { padding: 12px; border-radius: 14px; background: var(--surface-2); animation: geoIn 0.4s ease-out both; }
.geo-answer-name { font-weight: 800; font-size: 1.1rem; }
.geo-score-row { display: flex; justify-content: space-between; align-items: baseline; margin: 6px 0; }
.geo-pts { font-size: 1.6rem; color: var(--accent); font-variant-numeric: tabular-nums; }
.geo-bar { height: 8px; border-radius: 99px; background: var(--surface); overflow: hidden; }
.geo-bar i { display: block; height: 100%; width: var(--w); background: linear-gradient(90deg, var(--err), var(--warn), var(--ok)); background-size: 300px 100%; border-radius: inherit; animation: geoBar 0.9s ease-out both; }
@keyframes geoBar { from { width: 0; } }
.geo-fact { margin: 8px 0 0; font-size: 0.92rem; }
.geo-map-wrap { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--border); min-height: 420px; }
.geo-map { position: absolute; inset: 0; cursor: crosshair; }
.geo-map.recap { position: relative; height: 420px; border-radius: 18px; overflow: hidden; cursor: grab; }
.geo-map-tip { position: absolute; left: 50%; top: 12px; transform: translateX(-50%); z-index: 500; padding: 6px 14px; border-radius: 99px; background: rgba(10, 46, 51, 0.85); color: #fff; font-size: 0.85rem; pointer-events: none; }
.geo-pin { background: none; border: 0; }
.geo-pin span { display: block; font-size: 30px; line-height: 1; text-align: center; filter: drop-shadow(0 4px 4px rgba(0, 0, 0, 0.4)); animation: geoDrop 0.5s cubic-bezier(.3,1.6,.5,1) both; }
.geo-pin.target span { font-size: 32px; }
.geo-pin.small span { font-size: 22px; }
.geo-final { display: flex; flex-direction: column; gap: 16px; padding: 16px 0; }
.geo-final-head { display: grid; gap: 12px; justify-items: center; text-align: center; }
.geo-rank { display: flex; align-items: center; gap: 14px; }
.geo-rank h1 { margin: 0; }
.geo-rank-icon { font-size: 3.4rem; animation: geoDrop 0.8s cubic-bezier(.3,1.6,.5,1) both; }
.geo-final-score b { font-size: 3rem; color: var(--accent); }
.geo-final-body { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; }
.geo-recap { list-style: none; margin: 0; padding: 8px; display: flex; flex-direction: column; gap: 4px; }
.geo-recap li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; border-left: 4px solid var(--border); background: var(--surface-2); }
.geo-recap li.great { border-left-color: var(--ok); }
.geo-recap li.ok { border-left-color: var(--warn); }
.geo-recap li.far { border-left-color: var(--err); }
.geo-recap-emoji { font-size: 1.5rem; }
.geo-recap-pts { font-variant-numeric: tabular-nums; }
@media (max-width: 860px) {
  .geo-intro, .geo-final-body { grid-template-columns: 1fr; }
  .geo-play { grid-template-columns: 1fr; }
  .geo-map-wrap { min-height: 60vh; order: -1; }
  .geo-art-wrap { aspect-ratio: 21 / 9; }
}

/* ===== O'qituvchi paneli: bo'limlar galereyasi ===== */
.tp-toolbar { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 8px; }
.tp-search { flex: 1 1 260px; max-width: 420px; }
.tp-recent { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.tp-group { margin: 22px 0 6px; }
.tp-group-title { display: flex; align-items: center; gap: 10px; font-size: 1.05rem; margin: 26px 0 12px; }
.tp-group-title::after { content: ""; flex: 1; height: 2px; border-radius: 2px; background: linear-gradient(90deg, hsl(var(--hue) 60% 50% / 0.5), transparent); }
.tp-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tp-card { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px; border-radius: 18px; text-decoration: none; color: var(--text); background: linear-gradient(160deg, hsl(var(--hue) 70% 50% / 0.10), var(--surface) 55%); border: 1px solid hsl(var(--hue) 50% 50% / 0.22); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04); overflow: hidden; transition: transform 0.25s var(--ease-out, ease), box-shadow 0.25s, border-color 0.25s; animation: tpIn 0.45s ease-out both; animation-delay: calc(var(--i) * 35ms); }
.tp-card::before { content: ""; position: absolute; right: -40px; top: -40px; width: 120px; height: 120px; border-radius: 50%; background: hsl(var(--hue) 70% 55% / 0.12); transition: transform 0.4s; }
.tp-card:hover { transform: translateY(-4px); box-shadow: 0 18px 34px -20px hsl(var(--hue) 60% 30% / 0.55); border-color: hsl(var(--hue) 55% 50% / 0.5); }
.tp-card:hover::before { transform: scale(1.5); }
.tp-card:focus-visible { outline: 3px solid hsl(var(--hue) 60% 50%); outline-offset: 2px; }
.tp-card-icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 15px; font-size: 1.7rem; background: hsl(var(--hue) 65% 50% / 0.16); margin-bottom: 4px; transition: transform 0.3s; }
.tp-card:hover .tp-card-icon { transform: rotate(-6deg) scale(1.08); }
.tp-card-title { font-size: 1.02rem; }
.tp-card-desc { font-size: 0.86rem; color: var(--muted); line-height: 1.4; }
.tp-card-meta { margin-top: auto; padding-top: 6px; font-size: 0.78rem; font-weight: 600; color: hsl(var(--hue) 55% 38%); }
.tp-card-badge { position: absolute; top: 14px; right: 14px; padding: 3px 9px; border-radius: 99px; font-size: 0.72rem; font-weight: 700; background: var(--warn-soft); color: var(--warn); animation: pulse 2s ease-in-out infinite; }
.tp-card-go { position: absolute; right: 16px; bottom: 12px; opacity: 0; transform: translateX(-6px); transition: 0.25s; color: hsl(var(--hue) 55% 45%); font-weight: 800; }
.tp-card:hover .tp-card-go { opacity: 1; transform: none; }
@keyframes tpIn { from { opacity: 0; transform: translateY(14px) scale(0.98); } }
.tp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 18px; margin: 8px 0 18px; border-radius: 18px; background: linear-gradient(120deg, hsl(var(--hue) 70% 50% / 0.13), transparent 70%); border: 1px solid hsl(var(--hue) 50% 50% / 0.2); }
.tp-title { display: flex; align-items: center; gap: 12px; flex: 1; min-width: 220px; }
.tp-title h1 { margin: 0; font-size: clamp(1.3rem, 2.6vw, 1.8rem); }
.tp-icon { display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px; font-size: 1.6rem; background: hsl(var(--hue) 65% 50% / 0.18); }
.tp-switch { max-width: 280px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tp-card-meta { color: hsl(var(--hue) 60% 70%); } }
:root[data-theme="dark"] .tp-card-meta { color: hsl(var(--hue) 60% 70%); }
@media (max-width: 640px) { .tp-grid { grid-template-columns: 1fr 1fr; gap: 10px; } .tp-card { padding: 14px; } .tp-card-desc { display: none; } .tp-switch { max-width: none; width: 100%; } }
/* Bo'lim ichida: barcha bo'limlar plitkalar galereyasi (gorizontal aylantirishsiz) */
.tp-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 8px; margin: 0 0 18px; }
.tp-tile { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border-radius: 12px; text-decoration: none; color: var(--text); background: linear-gradient(135deg, hsl(var(--hue) 70% 50% / 0.08), var(--surface)); border: 1px solid hsl(var(--hue) 50% 50% / 0.2); font-size: 0.86rem; line-height: 1.2; transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s; animation: tpIn 0.35s ease-out both; }
.tp-tile span { display: grid; place-items: center; flex: none; width: 32px; height: 32px; border-radius: 9px; font-size: 1.05rem; background: hsl(var(--hue) 65% 50% / 0.15); }
.tp-tile b { font-weight: 600; }
.tp-tile:hover { transform: translateY(-2px); border-color: hsl(var(--hue) 55% 50% / 0.5); box-shadow: 0 10px 20px -14px hsl(var(--hue) 60% 30% / 0.6); }
.tp-tile.active { background: hsl(var(--hue) 60% 42%); border-color: transparent; color: #fff; box-shadow: 0 10px 22px -12px hsl(var(--hue) 60% 30% / 0.8); }
.tp-tile.active span { background: rgba(255, 255, 255, 0.22); }
.tp-tile.active b { font-weight: 800; }
@media (max-width: 640px) { .tp-tiles { grid-template-columns: 1fr 1fr; } .tp-tile { font-size: 0.8rem; padding: 8px; } }

/* ===== Tadqiqot arxivi ===== */
.arch-hero { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: center; background: linear-gradient(135deg, hsl(200 70% 50% / 0.10), var(--surface) 60%); }
.arch-hero h2 { margin-top: 0; }
.arch-kpis { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.arch-kpis div { padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); text-align: center; animation: tpIn 0.5s ease-out both; }
.arch-kpis div:nth-child(n) { animation-delay: calc(var(--i, 0) * 1ms); }
.arch-kpis b { display: block; font-size: 1.25rem; color: var(--primary); font-variant-numeric: tabular-nums; }
.arch-kpis span { font-size: 0.75rem; color: var(--muted); }
.arch-table th, .arch-table td { text-align: center; padding: 6px 8px; }
.arch-table td:first-child { text-align: left; }
.table td.num, .table th.center, .table td.center { font-variant-numeric: tabular-nums; }
.arch-line { stroke-dasharray: 600; stroke-dashoffset: 600; animation: archDraw 1.4s ease-out forwards; }
.arch-line[stroke-dasharray="6 6"] { stroke-dasharray: 6 6; stroke-dashoffset: 0; animation: none; opacity: 0.6; }
@keyframes archDraw { to { stroke-dashoffset: 0; } }
.arch-merge { border-left: 4px solid var(--primary); }
@media (max-width: 860px) { .arch-hero { grid-template-columns: 1fr; } .arch-kpis { grid-template-columns: repeat(2, 1fr); } }

/* ===== Ma'lumotlarni ko'chirish ===== */
.mg-card { max-width: 640px; }
.mg-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.mg-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--primary), var(--accent)); transition: width 0.4s ease; }
.mg-log { max-height: 180px; overflow: auto; font-size: 0.78rem; color: var(--muted); margin: 0; padding-left: 1.2em; }
.err-text { color: var(--err); font-weight: 600; }
