/* Mexatron — glass dizayn tizimi (Tajvid asosida, ko'k palitra) */
:root {
  --bg: #eef3fb;
  --bg-2: #e2eaf8;
  --ink: #0b1630;
  --ink-2: #4a5878;
  --ink-3: #7b88a3;
  --glass: rgba(255, 255, 255, .58);
  --glass-strong: rgba(255, 255, 255, .78);
  --glass-line: rgba(255, 255, 255, .85);
  --hair: rgba(11, 22, 48, .08);
  --brand: #2563eb;
  --brand-2: #4f46e5;
  --brand-ink: #ffffff;
  --brand-grad: linear-gradient(135deg, #3b82f6 0%, #4f46e5 100%);
  --brand-soft: rgba(37, 99, 235, .12);
  --gold: #f59e0b;
  --gold-grad: linear-gradient(135deg, #fcd34d, #f97316);
  --good: #10b981;
  --good-grad: linear-gradient(135deg, #34d399, #10b981);
  --bad: #f43f5e;
  --bad-grad: linear-gradient(135deg, #fb7185, #e11d48);
  --warn: #f59e0b;
  --shadow: 0 1px 1px rgba(11, 22, 48, .04), 0 8px 24px -6px rgba(11, 22, 48, .10), 0 24px 48px -24px rgba(11, 22, 48, .16);
  --shadow-lg: 0 30px 80px -30px rgba(30, 64, 175, .35);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .9);
  --orb-1: rgba(59, 130, 246, .32);
  --orb-2: rgba(99, 102, 241, .24);
  --orb-3: rgba(14, 165, 233, .18);
  --r: 22px;
  --r-sm: 14px;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ui: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.34, 1.56, .64, 1);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050a16; --bg-2: #081022; --ink: #eaf0fb; --ink-2: #9fb0cc; --ink-3: #6c7c99;
    --glass: rgba(255, 255, 255, .055); --glass-strong: rgba(255, 255, 255, .09); --glass-line: rgba(255, 255, 255, .10);
    --hair: rgba(255, 255, 255, .08); --brand: #60a5fa; --brand-2: #818cf8; --brand-ink: #030a1a;
    --brand-soft: rgba(96, 165, 250, .14);
    --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
    --shadow-lg: 0 30px 90px -30px rgba(59, 130, 246, .45);
    --inner: inset 0 1px 0 rgba(255, 255, 255, .07);
    --orb-1: rgba(37, 99, 235, .30); --orb-2: rgba(79, 70, 229, .24); --orb-3: rgba(14, 165, 233, .12);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050a16; --bg-2: #081022; --ink: #eaf0fb; --ink-2: #9fb0cc; --ink-3: #6c7c99;
  --glass: rgba(255, 255, 255, .055); --glass-strong: rgba(255, 255, 255, .09); --glass-line: rgba(255, 255, 255, .10);
  --hair: rgba(255, 255, 255, .08); --brand: #60a5fa; --brand-2: #818cf8; --brand-ink: #030a1a;
  --brand-soft: rgba(96, 165, 250, .14);
  --shadow: 0 1px 0 rgba(255, 255, 255, .04) inset, 0 20px 50px -20px rgba(0, 0, 0, .6);
  --shadow-lg: 0 30px 90px -30px rgba(59, 130, 246, .45);
  --inner: inset 0 1px 0 rgba(255, 255, 255, .07);
  --orb-1: rgba(37, 99, 235, .30); --orb-2: rgba(79, 70, 229, .24); --orb-3: rgba(14, 165, 233, .12);
  color-scheme: dark;
}

/* ---------- Asos ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.55;
  min-height: 100dvh; padding-bottom: calc(96px + env(safe-area-inset-bottom));
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--brand-soft); }

/* Fon: yumshoq yorug'lik dog'lari. Statik — harakatlansa, brauzer butun ekranni va
   ustidagi har bir shaffof qatlamni har kadrda qayta chizadi (GPU va kuller qiziydi). */
.bg { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none;
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg-2), transparent 60%), var(--bg); }
.orb { position: absolute; border-radius: 50%; opacity: .9; }
.o1 { width: 46vmax; height: 46vmax; left: -12vmax; top: -16vmax; background: radial-gradient(circle, var(--orb-1), transparent 70%); }
.o2 { width: 40vmax; height: 40vmax; right: -14vmax; top: 18vh; background: radial-gradient(circle, var(--orb-2), transparent 70%); }
.o3 { width: 34vmax; height: 34vmax; left: 25vw; bottom: -18vmax; background: radial-gradient(circle, var(--orb-3), transparent 70%); }

/* ---------- Glass ---------- */
/* «Shisha» ko'rinishi shaffof fon bilan beriladi. backdrop-filter (xiralashtirish) faqat yuqori va
   pastki panelda: har bir kartada bo'lsa, sahifa sekin aylanadi va qurilma qiziydi. */
.glass, .card {
  background: var(--glass); border: 1px solid var(--glass-line); border-radius: var(--r);
  box-shadow: var(--shadow), var(--inner);
}
.card { padding: 20px; display: block; color: inherit; }
a.card:hover, a.glass:hover { text-decoration: none; }

.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.flame { fill: url(#gGold); stroke: none; }
.ico.gold { fill: url(#gGold); stroke: none; }

/* ---------- Tipografiya ---------- */
h1 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); line-height: 1.15; letter-spacing: -.02em; margin: 2px 0 0; font-weight: 800; }
h2 { font-size: 1.08rem; letter-spacing: -.01em; margin: 0; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.eyebrow { font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin: 6px 0 18px; }
.lead { margin: -8px 0 18px; }
.muted { color: var(--ink-2); }
.small { font-size: .86rem; }
.err { color: var(--bad); }
.stack > * + * { margin-top: 12px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.row.center, .center { justify-content: center; }
.spacer { flex: 1; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 14px; }
.card-head h2 .ico { color: var(--brand); }

/* ---------- Tugmalar ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; overflow: hidden;
  border: 1px solid var(--glass-line); background: var(--glass-strong); color: var(--ink); border-radius: 14px;
  padding: 10px 18px; font-weight: 650; cursor: pointer; text-decoration: none; min-height: 46px;
  box-shadow: var(--inner); transition: transform .18s var(--ease), box-shadow .25s var(--ease), background .2s, filter .2s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow), var(--inner); }
.btn:active { transform: translateY(0) scale(.97); }
.btn.sm { min-height: 36px; padding: 6px 12px; font-size: .86rem; border-radius: 11px; }
.btn.sm .ico { width: 16px; height: 16px; }
.btn.primary { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 10px 30px -10px rgba(37, 99, 235, .7), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.primary:hover { filter: brightness(1.06) saturate(1.1); box-shadow: 0 16px 40px -12px rgba(37, 99, 235, .8), inset 0 1px 0 rgba(255, 255, 255, .35); }
.btn.big { width: 100%; padding: 15px 20px; font-size: 1.05rem; border-radius: 16px; }
.btn.good { background: var(--good-grad); color: #fff; border-color: transparent; box-shadow: 0 12px 30px -12px rgba(16, 185, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.bad { background: var(--bad-grad); color: #fff; border-color: transparent; box-shadow: 0 12px 30px -12px rgba(225, 29, 72, .7), inset 0 1px 0 rgba(255, 255, 255, .3); }
.btn.ghost { background: transparent; border-color: transparent; box-shadow: none; }
.btn.ghost:hover { background: var(--glass); }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn.google { background: var(--glass-strong); }
.shine::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .45), transparent); transform: skewX(-20deg);
  animation: shine 4.5s var(--ease) 2 1.2s; }
@keyframes shine { 0% { left: -60%; } 22%, 100% { left: 130%; } }
.icon-btn { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink-2); transition: all .2s var(--ease); }
.icon-btn:hover { color: var(--ink); transform: scale(1.06); }
.icon-btn.sm { width: 32px; height: 32px; border-radius: 10px; }
.icon-btn.sm .ico { width: 15px; height: 15px; }
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: .82rem; font-weight: 650;
  background: var(--brand-soft); color: var(--brand); }
.pill.gold { background: rgba(245, 158, 11, .14); color: var(--gold); }
.pill.gold .ico { fill: url(#gGold); stroke: none; width: 16px; height: 16px; }
.pill.warn { background: rgba(245, 158, 11, .14); color: var(--gold); }
.pill.good { background: var(--brand-soft); color: var(--brand); }
kbd { font-family: var(--ui); font-size: .72rem; border: 1px solid var(--hair); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: var(--glass-strong); }

/* ---------- Joylashuv: mobil ---------- */
.view { max-width: 760px; margin: 0 auto; padding: 14px 16px 24px; }
.topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top));
  background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hair);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); font-size: 1.02rem; letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand img { border-radius: 10px; box-shadow: 0 6px 16px -6px rgba(37, 99, 235, .6); }
.brand b { font-weight: 800; }
.streak-pill { display: flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink);
  padding: 5px 12px 5px 8px; border-radius: 999px; background: var(--glass); border: 1px solid var(--glass-line); }
.streak-pill:hover { text-decoration: none; }
.streak-pill .ico { width: 18px; height: 18px; animation: flicker 2.4s ease-in-out 3; }
.streak-pill.cold .ico, .cold .ico.flame { filter: grayscale(1); opacity: .45; animation: none; }
@keyframes flicker { 0%, 100% { transform: scale(1) rotate(0); } 30% { transform: scale(1.08) rotate(-3deg); } 60% { transform: scale(.96) rotate(2deg); } }

.tabbar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); padding: 6px; border-radius: 24px;
  background: color-mix(in srgb, var(--bg) 60%, transparent); border: 1px solid var(--glass-line);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, .35), var(--inner);
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 7px 2px; border-radius: 18px;
  font-size: .68rem; font-weight: 650; color: var(--ink-3); transition: color .2s, background .25s var(--ease); }
.tabbar a:hover { text-decoration: none; }
.tabbar a .ico { width: 22px; height: 22px; transition: transform .3s var(--spring); }
.tabbar a.active { color: var(--brand); background: var(--brand-soft); }
.tabbar a.active .ico { transform: translateY(-1px) scale(1.08); }
body.in-session .tabbar { transform: translateY(140%); }
.tabbar { transition: transform .35s var(--ease); }

/* ---------- Joylashuv: desktop sidebar ---------- */
.sidebar { display: none; }
@media (min-width: 960px) {
  body { padding: 0 0 0 296px; }
  .topbar, .tabbar { display: none; }
  .view { max-width: 1060px; padding: 34px 40px 60px; }
  .sidebar {
    position: fixed; top: 16px; bottom: 16px; left: 16px; width: 264px; z-index: 20;
    display: flex; flex-direction: column; gap: 14px; padding: 20px 14px;
    background: var(--glass); border: 1px solid var(--glass-line); border-radius: 28px;
    box-shadow: var(--shadow), var(--inner);
  }
  .sidebar .brand { padding: 2px 8px 6px; font-size: 1.12rem; }
  .side-streak { display: grid; grid-template-columns: auto 1fr; gap: 4px 10px; align-items: center; padding: 14px; color: var(--ink); border-radius: 18px; }
  .side-streak:hover { text-decoration: none; }
  .side-streak .ico { width: 34px; height: 34px; grid-row: span 1; animation: flicker 2.4s ease-in-out 3; }
  .side-streak b { font-size: 1.3rem; font-weight: 800; }
  .side-streak small { color: var(--ink-2); font-size: .8rem; }
  .side-bar { grid-column: 1 / -1; height: 6px; border-radius: 6px; background: var(--hair); overflow: hidden; margin-top: 6px; }
  .side-bar span { display: block; height: 100%; width: 0; border-radius: 6px; background: var(--gold-grad); transition: width .8s var(--ease); }
  /* 11 ta band: past ekranda menyu o'zi aylanadi, pastdagi tugma va hisob joyida qoladi. */
  .side-nav { display: grid; gap: 2px; margin: 4px -14px 0; padding: 0 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; align-content: start; scrollbar-width: thin; }
  .side-nav a { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 14px; border-radius: 14px;
    color: var(--ink-2); font-weight: 650; transition: color .2s, background .25s var(--ease), transform .2s var(--ease); }
  .side-nav a:hover { text-decoration: none; color: var(--ink); background: var(--glass); transform: translateX(2px); }
  .side-nav a.active { color: var(--ink); background: var(--glass-strong); box-shadow: var(--inner), 0 8px 20px -12px rgba(0, 0, 0, .3); }
  .side-nav a.active::before { content: ""; position: absolute; left: -12px; top: 10px; bottom: 10px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand-grad); }
  .side-nav a.active .ico { color: var(--brand); }
  .side-cta { margin-top: auto; }
  .side-account { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 16px; color: var(--ink); border: 1px solid transparent; }
  .side-account:hover { text-decoration: none; background: var(--glass); border-color: var(--glass-line); }
  .side-account span { display: grid; min-width: 0; }
  .side-account b { font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .side-account small { color: var(--ink-3); font-size: .76rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.in-session .view { max-width: 820px; }
}

/* ---------- Sahifa animatsiyalari ---------- */
.view.enter > * { animation: rise .55s var(--ease) both; }
.view.enter > *:nth-child(2) { animation-delay: .05s; }
.view.enter > *:nth-child(3) { animation-delay: .1s; }
.view.enter > *:nth-child(4) { animation-delay: .15s; }
.view.enter > *:nth-child(5) { animation-delay: .2s; }
.view.enter > *:nth-child(n+6) { animation-delay: .25s; }
/* Element animatsiyalari faqat sahifaga kirganda (.enter) o'ynaydi — qayta chizishda emas. */
.view.enter .ring-val { animation: ringIn 1.2s var(--ease) both .15s; }
.view.enter .lcard { animation: rise .5s var(--ease) both; animation-delay: calc(var(--i, 0) * 18ms); }
.view.enter .letter-big { animation: pop .7s var(--spring) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Bosh sahifa ---------- */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 28px; align-items: center; padding: 26px; position: relative; overflow: hidden; box-shadow: var(--shadow-lg), var(--inner); }
.hero::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none;
  background: radial-gradient(600px 200px at 0% 0%, var(--brand-soft), transparent 70%); }
.hero-text { position: relative; display: grid; gap: 10px; }
.hero-text p { margin: 0; }
.hero-sub a { font-weight: 650; }
.ring { width: 150px; height: 150px; position: relative; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.ring-track { fill: none; stroke: var(--hair); stroke-width: 11; }
.ring-val { fill: none; stroke: url(#gBrand); stroke-width: 11; stroke-linecap: round; stroke-dashoffset: var(--off);
  filter: drop-shadow(0 4px 10px rgba(59, 130, 246, .45)); }
.ring-val.done { stroke: url(#gGold); filter: drop-shadow(0 4px 12px rgba(245, 158, 11, .5)); }
@keyframes ringIn { from { stroke-dashoffset: var(--full); } }
.ring .lbl { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1.05; }
.ring .lbl b { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; }
.ring .lbl span { color: var(--ink-2); font-size: .85rem; font-weight: 600; }
.streak-big { display: flex; align-items: center; gap: 8px; font-size: 1.15rem; color: var(--ink-2); }
.streak-big b { font-size: 2.6rem; color: var(--ink); font-weight: 800; letter-spacing: -.03em; }
.streak-big .ico { width: 40px; height: 40px; animation: flicker 2.4s ease-in-out 3; filter: drop-shadow(0 6px 12px rgba(249, 115, 22, .45)); }
.stats3 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
.stat { display: grid; gap: 2px; padding: 16px; color: var(--ink); transition: transform .25s var(--ease); }
.stat:hover { transform: translateY(-3px); text-decoration: none; }
.stat .ico { color: var(--brand); width: 22px; height: 22px; margin-bottom: 6px; }
.stat b { font-size: 1.45rem; font-weight: 800; letter-spacing: -.02em; }
.heat { display: grid; grid-template-rows: repeat(7, 1fr); grid-auto-flow: column; gap: 4px; justify-content: start; overflow-x: auto; padding-bottom: 4px; }
.heat i { width: 15px; height: 15px; border-radius: 4px; background: var(--hair); display: block; transition: transform .2s; }
.heat i:hover { transform: scale(1.3); }
.heat i.l1 { background: rgba(59, 130, 246, .35); }
.heat i.l2 { background: rgba(59, 130, 246, .65); }
.heat i.l3 { background: var(--brand-grad); box-shadow: 0 0 10px rgba(59, 130, 246, .5); }
.heat i.today { outline: 2px solid var(--gold); outline-offset: 1px; }
.banner { display: flex; align-items: center; gap: 14px; margin-top: 16px; color: var(--ink); }
.banner > span:first-child { font-size: 1.6rem; }
.banner .ico { margin-left: auto; color: var(--ink-3); transition: transform .2s; }
.banner:hover .ico { transform: translateX(4px); }
section.card + section.card, .card + h2 { margin-top: 16px; }

/* ---------- Forma elementlari ---------- */
.field { display: grid; gap: 6px; }
.field label { font-weight: 650; font-size: .92rem; }
select, input[type="number"], input[type="time"], input[type="email"], input[type="password"], input[type="text"], input[type="search"], input:not([type]), textarea {
  font: inherit; color: inherit; background: var(--glass-strong); border: 1px solid var(--glass-line); border-radius: 13px;
  padding: 11px 14px; min-height: 46px; width: 100%; box-shadow: var(--inner); transition: border-color .2s, box-shadow .2s;
}
select:focus, input:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip { border: 1px solid var(--glass-line); background: var(--glass); padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 650; min-height: 40px;
  transition: all .25s var(--spring); }
.chip:hover { transform: translateY(-1px); }
.chip[aria-pressed="true"] { background: var(--brand-grad); color: #fff; border-color: transparent; box-shadow: 0 8px 20px -8px rgba(37, 99, 235, .7); }
.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.toggle input { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 999px; flex: none; position: relative; cursor: pointer;
  background: var(--hair); border: 1px solid var(--glass-line); transition: background .25s; }
.toggle input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .3s var(--spring); }
.toggle input:checked { background: var(--brand-grad); }
.toggle input:checked::after { transform: translateX(18px); }
.pool-preview { direction: rtl; font-family: var(--ar); font-size: 1.6rem; letter-spacing: .12em; color: var(--brand); }
.settings-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; margin-top: 14px; align-items: start; }
.settings-grid > .card + .card { margin-top: 0; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: .82rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--hair); }

/* ---------- Profil ---------- */
.avatar { position: relative; width: 36px; height: 36px; border-radius: 50%; display: inline-grid; place-items: center; flex: none; overflow: hidden;
  background: var(--brand-grad); color: #fff; font-weight: 800; box-shadow: 0 0 0 2px var(--glass-line); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.avatar.guest { background: var(--glass-strong); color: var(--ink-3); }
.avatar.guest .ico { width: 55%; height: 55%; }
.avatar.xl { width: 76px; height: 76px; font-size: 1.9rem; box-shadow: 0 0 0 3px var(--glass-line), 0 12px 30px -10px rgba(37, 99, 235, .6); }
.acct-link { position: relative; display: inline-flex; border-radius: 50%; }
.acct-link.dirty::after, .dot { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.acct-link.dirty::after { position: absolute; top: 0; right: 0; border: 2px solid var(--bg); }
.dot.ok { background: var(--good); box-shadow: 0 0 8px var(--good); }
.dot.busy { background: var(--brand-2); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .3; } }
.profile { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 22px; }
.profile-info { display: grid; gap: 2px; min-width: 0; }
.profile-name { font-size: 1.3rem; font-weight: 800; letter-spacing: -.01em; }
.sync-line { display: flex; align-items: center; gap: 6px; color: var(--ink-2); margin-top: 4px; }
.sync-line.err { color: var(--bad); }
.profile-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.auth { display: grid; grid-template-columns: 1fr 1fr; gap: 26px; padding: 26px; }
.auth-intro { display: grid; gap: 14px; align-content: start; }
.auth-intro h2 { font-size: 1.4rem; }
.auth-intro p { margin: 6px 0 0; }

/* ---------- Mashq ---------- */
.session { display: flex; flex-direction: column; min-height: calc(100dvh - 120px); max-width: 760px; margin: 0 auto; }
.session-top { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; }
.counter { font-size: 1.1rem; font-weight: 800; min-width: 54px; text-align: right; }
.counter span { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.session-title { text-align: center; margin: 10px 0 0; min-height: 1.5em; }
.progress { height: 10px; background: var(--hair); border-radius: 10px; overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 10px; background: var(--brand-grad); transition: width .5s var(--ease);
  box-shadow: 0 0 12px rgba(37, 99, 235, .6); position: relative; }
@keyframes goodOut { 0% { transform: none; } 40% { transform: scale(1.03); } 100% { transform: translateX(40px) rotate(3deg) scale(.96); opacity: 0; } }
@keyframes badOut { 0%, 100% { transform: none; } 15% { transform: translateX(-12px); } 30% { transform: translateX(10px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(4px); opacity: 1; }
  100% { transform: translateX(-30px) rotate(-3deg) scale(.96); opacity: 0; } }
.answer { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.answer .btn { min-height: 66px; font-size: 1.1rem; border-radius: 20px; }
.answer .btn .ico { width: 24px; height: 24px; stroke-width: 2.6; }
.keys { display: flex; justify-content: center; align-items: center; gap: 10px; margin-top: 10px; min-height: 36px; }
@media (hover: none) { .hide-touch { display: none; } }

.result { max-width: 640px; margin: 10px auto 0; padding: 30px 22px; display: grid; gap: 14px; justify-items: center; }
.result > * { margin: 0; }
.result .btn.big { max-width: 420px; }
.result-emoji { font-size: 3rem; animation: pop .8s var(--spring) both .1s; }
.result-big { font-size: 3.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1;
  background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-ring { width: 170px; height: 170px; }
.list-table { width: 100%; border-collapse: collapse; }
.list-table td { padding: 8px 6px; border-bottom: 1px solid var(--hair); }
.list-table tr:last-child td { border-bottom: 0; }
.list-table td
/* ---------- Toast va konfetti ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px) scale(.96);
  padding: 12px 18px; border-radius: 16px; opacity: 0; pointer-events: none; z-index: 40; max-width: calc(100% - 32px); font-weight: 600;
  background: color-mix(in srgb, var(--bg) 70%, transparent); color: var(--ink); border: 1px solid var(--glass-line);
  box-shadow: var(--shadow-lg);
  transition: opacity .3s var(--ease), transform .4s var(--spring);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
@media (min-width: 960px) { .toast { bottom: 28px; left: calc(50% + 148px); } }
.fx { position: fixed; inset: 0; pointer-events: none; z-index: 50; overflow: hidden; }
.fx i { position: absolute; top: 62%; width: 9px; height: 14px; border-radius: 2px; transform: scale(var(--s));
  animation: confetti var(--d) cubic-bezier(.15, .6, .35, 1) forwards; }
@keyframes confetti {
  0% { transform: translate(0, 0) rotate(0) scale(var(--s)); opacity: 1; }
  45% { transform: translate(calc(var(--dx) * .8), var(--dy)) rotate(calc(var(--r) * .5)) scale(var(--s)); opacity: 1; }
  100% { transform: translate(var(--dx), 50vh) rotate(var(--r)) scale(var(--s)); opacity: 0; }
}

dialog { border-radius: var(--r) !important; animation: cardIn .35s var(--spring); }
dialog::backdrop { background: rgba(3, 8, 20, .45); backdrop-filter: blur(6px); }

@media (min-width: 960px) and (max-height: 860px) {
  .sidebar { gap: 10px; padding-top: 16px; padding-bottom: 14px; }
  .side-nav a { padding: 5px 14px; }
  .side-streak { padding: 10px 14px !important; }
}

/* ---------- Ma'lumot ---------- */
.info-h { margin: 30px 0 12px; }
.info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 14px; }
.info-grid .card h2 { margin-top: 0; }
.info-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; margin: 6px 0 18px; }
.info-stats div { display: grid; gap: 0; padding: 12px 14px; border-radius: 16px; background: var(--glass); border: 1px solid var(--glass-line); }
.info-stats b { font-size: 1.5rem; font-weight: 800; letter-spacing: -.02em; }
.info-stats span { font-size: .78rem; color: var(--ink-2); font-weight: 600; }
.docs { display: grid; gap: 2px; margin: 0; }
.docs dt { font-weight: 700; margin-top: 10px; display: flex; align-items: center; gap: 8px; }
.docs dt a { color: var(--ink); }
.docs dt .ico { width: 18px; height: 18px; color: var(--brand); }
.docs dd { margin: 0 0 0 26px; color: var(--ink-2); font-size: .93rem; }
.src-list { display: grid; gap: 12px; margin: 0; padding: 0; list-style: none; }
.src-list li { display: grid; gap: 2px; }
.src-list .small { color: var(--ink-2); }
.link-list { display: grid; gap: 8px; }
.link-list a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--glass); border: 1px solid var(--glass-line); color: var(--ink); }
.link-list a:hover { text-decoration: none; border-color: var(--brand); }
.link-list a .ico { color: var(--brand); flex: none; }
.link-list a span { flex: 1; }
.link-list a small { display: block; color: var(--ink-3); font-size: .76rem; word-break: break-all; }
.tips { margin: 0; padding-left: 18px; color: var(--ink-2); }
.tips li { margin: 4px 0; }

/* ---------- Kichik ekranlar ---------- */
@media (max-width: 720px) {
  .stats3 { grid-template-columns: repeat(2, 1fr); }
  .auth { grid-template-columns: 1fr; gap: 18px; padding: 20px; }
  .auth-intro { grid-template-columns: auto 1fr; align-items: center; }
  .profile { grid-template-columns: auto 1fr; }
  .profile-actions { grid-column: 1 / -1; justify-content: flex-start; }
}
@media (max-width: 520px) {
  .hero { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 22px 18px; gap: 18px; }
  .hero-text { justify-items: center; }
  .streak-big { justify-content: center; }
  .ring { width: 136px; height: 136px; }
  .word { font-size: 1.7rem; }
  .letters { grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
  .lcard .g { font-size: 2.5rem; }
  .settings-grid { grid-template-columns: 1fr; }
  .flash { min-height: 260px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
.stack > .btn:not(.big) { display: flex; width: 100%; }
.stack > .row .btn { width: auto; }


/* =================== Mexatron komponentlari =================== */
.pill.subj { background: color-mix(in srgb, var(--c) 14%, transparent); color: var(--c); }
.en { font-style: italic; letter-spacing: .01em; }
.sec-h { margin: 26px 0 12px; }
.bad-text { color: var(--bad); } .good-text { color: var(--good); } .warn-text { color: var(--gold); }
.bar { height: 8px; border-radius: 99px; background: var(--hair); overflow: hidden; }
.bar span { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--brand-grad)); }
.module .bar { margin: -4px 0 14px; }

/* Bosh sahifa */
.next-lesson { display: grid; gap: 4px; }
.next-lesson b { font-size: 1.12rem; letter-spacing: -.01em; }

/* Bosqichlar */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0 0 16px; }
.step { display: flex; align-items: center; gap: 8px; padding: 9px 12px; border-radius: 14px; color: var(--ink-2);
  background: var(--glass); border: 1px solid var(--glass-line); font-weight: 650; font-size: .9rem; }
.step:hover { text-decoration: none; color: var(--ink); }
.step i { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-style: normal; font-size: .8rem;
  background: var(--hair); color: var(--ink-2); flex: none; }
.step i .ico { width: 14px; height: 14px; stroke-width: 3; }
.step.ok i { background: var(--good-grad); color: #fff; }
.step.cur { border-color: var(--brand); color: var(--ink); box-shadow: 0 0 0 3px var(--brand-soft); }
.step .pcount { font-weight: 700; color: var(--ink-3); }
.steps.mini { margin: 6px 0 2px; gap: 6px; }
.steps.mini .step { padding: 6px 8px; font-size: .78rem; border-radius: 11px; }
.steps.mini .step i { width: 20px; height: 20px; }

/* Yo'l xaritasi */
.mnum { display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 6px; border-radius: 9px;
  background: var(--brand-grad); color: #fff; font-size: .85rem; }
.module.soon .mnum { background: var(--hair); color: var(--ink-2); }
.module + .module { margin-top: 14px; }
.ml-list { display: grid; gap: 6px; margin-bottom: 8px; }
.ml { display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px;
  color: var(--ink); border: 1px solid transparent; transition: background .2s; }
a.ml:hover { background: var(--glass-strong); text-decoration: none; border-color: var(--glass-line); }
.ml .n { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--hair);
  font-weight: 800; font-size: .85rem; color: var(--ink-2); }
.ml .t { display: grid; gap: 3px; min-width: 0; }
.ml .t small { color: var(--ink-3); display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ml .t .pill { padding: 1px 8px; font-size: .72rem; }
.ml > .ico { color: var(--ink-3); }
.ml.done .n { background: var(--good-grad); color: #fff; }
.ml.cur .n { background: var(--brand-grad); color: #fff; }
.ml.soon { opacity: .55; }
.chips.plan .chip { cursor: default; font-size: .8rem; }

/* Dars */
.lesson-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 4px; flex-wrap: wrap; }
.lesson-top a { display: inline-flex; align-items: center; gap: 6px; }
.goals ul { margin: 10px 0 0; padding-left: 20px; }
.goals li + li { margin-top: 4px; }
.lesson { margin: 14px 0; padding: 24px 26px; }
.prose { line-height: 1.7; overflow-wrap: break-word; }
.prose > :first-child { margin-top: 0; } .prose > :last-child { margin-bottom: 0; }
.prose h2 { font-size: 1.28rem; margin: 30px 0 10px; display: block; }
.prose h3 { font-size: 1.06rem; margin: 22px 0 8px; }
.prose p { margin: 10px 0; }
.prose ul, .prose ol { padding-left: 22px; margin: 10px 0; }
.prose li + li { margin-top: 4px; }
.prose code { font-family: var(--mono); font-size: .86em; padding: 1px 6px; border-radius: 6px; background: var(--hair); }
.prose strong { font-weight: 750; }
.prose .katex { font-size: 1.06em; }
.prose .katex-display { overflow-x: auto; overflow-y: hidden; padding: 6px 0; margin: 12px 0; }
.tbl { overflow-x: auto; margin: 12px 0; }
.tbl table { border-collapse: collapse; width: 100%; font-size: .92rem; }
.tbl th, .tbl td { padding: 8px 10px; border-bottom: 1px solid var(--hair); text-align: left; vertical-align: top; }
.tbl th { font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); font-weight: 700; }
.callout { margin: 16px 0; padding: 14px 16px; border-radius: 16px; border: 1px solid; border-left-width: 4px;
  --cc: var(--brand); border-color: color-mix(in srgb, var(--cc) 30%, transparent); border-left-color: var(--cc);
  background: color-mix(in srgb, var(--cc) 7%, transparent); }
.callout .c-h { font-weight: 750; margin-bottom: 6px; color: var(--cc); }
.c-warn { --cc: #f59e0b; } .c-eng { --cc: #6366f1; } .c-lab { --cc: #06b6d4; } .c-example { --cc: #64748b; } .c-note { --cc: #3b82f6; }
.terms td:first-child { white-space: nowrap; } .terms td.en { color: var(--brand); font-style: italic; white-space: nowrap; }
.src { margin: 10px 0 14px; padding-left: 20px; font-size: .9rem; color: var(--ink-2); }
.src li + li { margin-top: 6px; }
section.card + section.card, .glass.card + .glass.card { margin-top: 14px; }
.lesson-cta { margin-top: 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.lesson-cta .btn.big { width: auto; }
.lesson-cta .muted { display: inline-flex; gap: 6px; align-items: center; }
.lesson-nav { margin-top: 14px; }

/* Test */
.qprog { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; font-weight: 700; font-size: .9rem; }
.qprog .progress { flex: 1; height: 8px; border-radius: 99px; background: var(--hair); overflow: hidden; }
.qprog .progress span { display: block; height: 100%; background: var(--brand-grad); border-radius: inherit; transition: width .4s var(--ease); }
.question .q { font-size: 1.08rem; font-weight: 600; margin-bottom: 16px; }
.opts { display: grid; gap: 10px; }
.opt { display: flex; gap: 12px; align-items: center; text-align: left; padding: 13px 14px; border-radius: 15px; cursor: pointer;
  background: var(--glass-strong); border: 1px solid var(--glass-line); font: inherit; color: var(--ink); transition: transform .15s, border-color .2s, background .2s; }
.opt:hover:not(:disabled) { border-color: var(--brand); transform: translateY(-1px); }
.opt:disabled { cursor: default; }
.opt.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 13%, transparent); }
.opt.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 12%, transparent); }
.opt.dim { opacity: .55; }
.explain { margin: 14px 0; padding: 12px 14px; border-radius: 14px; background: var(--hair); }
.explain.ok b { color: var(--good); } .explain.bad b { color: var(--bad); }
.question .row { margin-top: 6px; }
.review-q .prose { font-weight: 600; }
.result h2 { justify-content: center; }
.result-big { font-size: 3rem; font-weight: 800; background: var(--brand-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* Masalalar */
.fmt-help { margin: 0 0 12px; } .fmt-help code { font-family: var(--mono); font-size: .85em; }
.problem.solved { border-color: color-mix(in srgb, var(--good) 45%, transparent); }
.ans-row { display: flex; gap: 8px; align-items: center; margin: 14px 0 10px; flex-wrap: wrap; }
.ans-row input { flex: 1; min-width: 140px; font-family: var(--mono); font-size: 1.02rem; }
.ans-row .unit { font-weight: 700; color: var(--ink-2); }
.hint { display: flex; gap: 10px; padding: 10px 12px; margin: 8px 0; border-radius: 13px; background: color-mix(in srgb, var(--gold) 11%, transparent); }
.hint > .ico { color: var(--gold); margin-top: 3px; }
details.solution { margin: 10px 0; padding: 10px 14px; border-radius: 14px; background: var(--hair); }
details.solution summary { cursor: pointer; font-weight: 700; }
details.solution[open] summary { margin-bottom: 8px; }
.problem .row { margin-top: 6px; }
.done-banner .btn { margin-left: auto; }

/* Natijalar */
.bars { display: grid; grid-template-columns: repeat(14, 1fr); gap: 6px; align-items: end; height: 170px; }
.bcol { display: grid; grid-template-rows: 1fr auto auto; justify-items: center; height: 100%; gap: 2px; font-size: .72rem; }
.bstack { position: relative; width: 100%; max-width: 30px; height: 100%; display: flex; align-items: flex-end; gap: 2px; }
.bstack i { flex: 1; display: block; border-radius: 6px 6px 2px 2px; min-height: 2px; }
.b-les { background: var(--brand-grad); } .b-act { background: color-mix(in srgb, var(--brand-2) 35%, transparent); }
.bcol.ok small:first-of-type { color: var(--gold); font-weight: 800; }
.legend { gap: 16px; margin-top: 10px; } .legend span { display: inline-flex; gap: 6px; align-items: center; }
.lg { width: 12px; height: 12px; border-radius: 3px; display: inline-block; } .lg.ok { background: var(--gold-grad); }
.subj-bars { display: grid; gap: 10px; }
.sb { display: grid; grid-template-columns: 110px 1fr 48px 64px; gap: 10px; align-items: center; font-size: .9rem; }
.score { font-weight: 800; } .score.ok { color: var(--good); } .score.low { color: var(--gold); }
.list-table tr.muted td { color: var(--ink-3); }
.list-table td a { color: var(--ink); font-weight: 600; }

dialog#flagDlg { width: min(520px, calc(100% - 32px)); color: var(--ink); background: var(--bg); }
dialog#flagDlg textarea { width: 100%; }

@media (max-width: 520px) {
  .steps .step span { font-size: .78rem; } .step { padding: 8px; gap: 6px; }
  .lesson { padding: 18px 16px; }
  .sb { grid-template-columns: 84px 1fr 42px; } .sb small { display: none; }
  .bars { gap: 3px; height: 140px; }
  .ml { grid-template-columns: 34px 1fr auto; gap: 10px; } .ml .n { width: 34px; height: 34px; }
}
