/* Kirish, rol, farzandlar, kurslar, yuqori panel va pastki panel.
   Egasi: shell agenti. Yangi dizayn (REDESIGN.md): chiziqsiz, yumshoq, katta yumaloq kartochkalar.
   Rang va o'lcham faqat style.css :root o'zgaruvchilaridan olinadi. */

/* ---------- yuqori panel ---------- */
.topbar { position: sticky; top: 0; z-index: 30; isolation: isolate; }
/* fon: yumshoq xira shisha, ostida chiziq o'rniga asta so'nadigan chet */
.topbar::before { content: ""; position: absolute; inset: 0 0 -14px; z-index: -1; background: color-mix(in srgb, var(--bg) 84%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(to bottom, #000 calc(100% - 14px), transparent); transition: background .2s; }
.topbar.lift::before { background: color-mix(in srgb, var(--bg) 94%, transparent); }
.topbar-in { max-width: 1080px; margin: 0 auto; padding: 10px 20px; min-height: 68px; display: flex; align-items: center; gap: 12px; }
body[data-screen="login"] .topbar, body[data-screen="quiz"] .topbar, body[data-screen="report"] .topbar { display: none; }

.tb-back { display: inline-flex; align-items: center; gap: 2px; min-height: 48px; padding: 0 20px 0 10px; background: var(--card); border: 0; border-radius: 999px; box-shadow: var(--sh-1); font: 800 17px/1 var(--font); color: var(--ink); cursor: pointer; }
.tb-back:active { transform: scale(.96); }
.tb-back .ico { width: 24px; height: 24px; stroke-width: 2.8; color: var(--brand-deep); }
.tb-back:not([hidden]) ~ .logo { display: none; }
.tb-crumb { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 800; font-size: 17px; color: var(--muted); }
.topbar .logo { font-size: 24px; }
.topbar .logo-mark { width: 34px; height: 34px; }

.user { position: relative; margin-left: auto; }
.user-btn { display: inline-flex; align-items: center; gap: 8px; min-width: 52px; height: 52px; padding: 4px; background: var(--card); border: 0; border-radius: 999px; box-shadow: var(--sh-1); font: 800 17px/1 var(--font); color: var(--ink); cursor: pointer; }
.user-btn:active { transform: scale(.96); }
.user-n { padding-left: 2px; }
.user-caret { width: 18px; height: 18px; margin-right: 8px; color: var(--muted); }
.av { width: 44px; height: 44px; flex: none; border-radius: 50%; object-fit: cover; background: var(--brand-soft); color: var(--brand-deep); display: inline-flex; align-items: center; justify-content: center; font: 800 20px/1 var(--font); }

/* menyu: oq yumaloq kartochka, yumshoq soya */
.menu { position: absolute; right: 0; top: calc(100% + 12px); width: min(300px, calc(100vw - 32px)); max-height: calc(100vh - 110px); max-height: calc(100dvh - 110px); overflow-y: auto; overscroll-behavior: contain; background: var(--card); border-radius: var(--r-lg); box-shadow: var(--sh-2); padding: 10px; z-index: 40; display: flex; flex-direction: column; gap: 4px; }
/* pastki paneldagi "Profil" ochsa, menyu panel tepasida chiqadi; gorizontal telefonda ekrandan chiqib ketmasligi uchun balandligi cheklanadi va aylantiriladi */
.menu.dock { position: fixed; top: auto; right: max(16px, calc(50vw - 170px)); bottom: calc(var(--dock) + env(safe-area-inset-bottom) + 6px); max-height: calc(100vh - var(--dock) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px); max-height: calc(100dvh - var(--dock) - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 18px); }
/* menyu ochiq turganda o'rnatish paneli yashiriladi: ular pastki panel tepasida bir joyni egallaydi (.app o'z qatlamida, shuning uchun menyu paneldan ustun bo'la olmaydi) */
body:has(.menu.dock:not([hidden])) .pwa-bar { visibility: hidden; }
.menu-who { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 14px 16px; margin-bottom: 4px; background: var(--soft); border-radius: var(--r-md); }
.menu-who strong { font-size: 19px; font-weight: 800; overflow-wrap: anywhere; }
.menu-who span:not(.chip) { font-weight: 600; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }
.menu-who .chip { margin-top: 4px; background: var(--card); color: var(--brand-deep); }
.menu-item { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; padding: 6px 12px 6px 8px; background: transparent; border: 0; border-radius: 20px; font: 800 18px/1.2 var(--font); color: var(--ink); text-align: left; cursor: pointer; }
.menu-item:hover, .menu-item:focus-visible { background: var(--soft); }
.mi-ic { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); }
.menu-item:last-child .mi-ic { background: var(--bad-bg); color: var(--bad-ink); }
.mi-ic .ico { width: 22px; height: 22px; }

/* ---------- pastki suzuvchi panel ---------- */
.tabbar { position: fixed; left: 50%; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; width: min(calc(100% - 32px), 340px); transform: translateX(-50%); display: flex; align-items: center; justify-content: space-between; padding: 8px; background: var(--navy); border-radius: 999px; box-shadow: 0 22px 38px -14px rgba(27, 26, 64, .7); animation: dock-up .3s ease both; }
@keyframes dock-up { from { transform: translate(-50%, 28px); opacity: 0; } to { transform: translate(-50%, 0); opacity: 1; } }
.dk { position: relative; width: 56px; height: 56px; flex: none; display: flex; align-items: center; justify-content: center; padding: 0; background: transparent; border: 0; border-radius: 50%; color: var(--brand-tint); cursor: pointer; transition: background .2s, color .2s, transform .15s, opacity .2s; }
.dk .ico { width: 26px; height: 26px; stroke-width: 2.3; }
.dk:hover { background: var(--navy-2); }
.dk:active { transform: scale(.9); }
.dk.on, .dk[aria-expanded="true"] { background: var(--peach); color: var(--navy); }
/* faolsiz tugma: shaffoflik emas, aniq rang (ikonka navy ustida ~5:1, fokus halqasi esa to'liq rangda qoladi) */
.dk.off { color: color-mix(in srgb, var(--brand-tint) 72%, var(--navy)); }
/* profil menyusi ochiq bo'lsa, faqat o'sha tugma ajralib turadi */
.tabbar:has([aria-expanded="true"]) .dk.on:not([aria-expanded="true"]) { background: transparent; color: var(--brand-tint); }
.dk .av { width: 40px; height: 40px; font-size: 18px; }
.tabbar .dk:focus-visible { outline: 3px solid var(--peach); outline-offset: 2px; }

/* ---------- umumiy sarlavhalar ---------- */
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head.center { align-items: center; text-align: center; }
.page-head h1, .soon-card h1 { margin: 0; font-weight: 800; font-size: 38px; line-height: 1.1; letter-spacing: -.025em; }
.lead { margin: 0; font-weight: 600; font-size: 18px; line-height: 1.45; color: var(--muted); max-width: 38ch; }
.hello { margin: 0; font-weight: 800; font-size: 21px; line-height: 1.2; color: var(--brand-deep); overflow-wrap: anywhere; }
.hello-head { position: relative; }
.hello-owl { position: absolute; right: -6px; top: -8px; width: 118px; height: 118px; pointer-events: none; }
/* matn boyqush tagiga kirib ketmasin: uzun ism keyingi qatorga o'tadi */
.hello-head > :not(.hello-owl) { position: relative; max-width: calc(100% - 118px); }
.hello-head h1 { overflow-wrap: anywhere; }
.hello-head .lead { max-width: min(24ch, calc(100% - 118px)); }
.h2.sec { margin: 0 0 8px; font-weight: 800; font-size: 28px; letter-spacing: -.02em; scroll-margin-top: 84px; }
.head-owl { width: 150px; height: 150px; }
.head-boy { height: 172px; width: auto; }
.setup { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }

/* bezak: boyqush yonidagi "yulduz" (faqat bezak) */
.burst { position: absolute; width: 92px; height: 92px; display: flex; align-items: center; justify-content: center; clip-path: polygon(50% 0%, 61.4% 14.8%, 79.4% 9.5%, 79.9% 28.3%, 97.6% 34.5%, 87% 50%, 97.6% 65.5%, 79.9% 71.7%, 79.4% 90.5%, 61.4% 85.2%, 50% 100%, 38.6% 85.2%, 20.6% 90.5%, 20.1% 71.7%, 2.4% 65.5%, 13% 50%, 2.4% 34.5%, 20.1% 28.3%, 20.6% 9.5%, 38.6% 14.8%); pointer-events: none; animation: bob 3.6s ease-in-out infinite; }
.burst b { font-weight: 800; font-size: 17px; line-height: 1; color: var(--navy); white-space: nowrap; transform: rotate(-12deg); }
.burst.b1 { background: var(--peach); }
.art-pad { position: relative; display: inline-flex; }
.art-pad .burst { width: 78px; height: 78px; left: -44px; top: 6px; }
.art-pad .burst b { font-size: 15px; }
.art-pad.has-boy .burst { left: -70px; top: 4px; }

/* ---------- yuklanish (server javobini kutayotganda bo'sh ekran o'rniga boyqush) ---------- */
.boot { min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); display: flex; align-items: center; justify-content: center; }
.boot-owl { width: 120px; height: 120px; }

/* ---------- kirish ---------- */
/* tartib (DOM ham shunday): belgi > bola sahnasi > sarlavha > izoh > kirish kartochkasi > afzalliklar. Kartochka sarlavhadan keyin darrov keladi (asosiy tugma birinchi ekranda).
   Bola balandligi --boy-h ekran balandligiga qarab o'zgaradi: kirish tugmasi kichik telefonda ham birinchi ekranda qoladi (o'rnatish paneli ochiq bo'lsa bola yana kichikroq; juda past ekranda sahifa aylanadi). */
:root { --vh: 100vh; }
@supports (height: 100svh) { :root { --vh: 100svh; } } /* svh: asboblar paneli ko'rinib turgandagi birinchi ekran balandligi (aylantirganda o'zgarmaydi) */
.login { --extra: 0px; --boy-h: clamp(150px, calc(var(--vh) - 530px - var(--extra)), 290px); display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "logo" "art" "title" "lead" "card" "perks"; row-gap: 18px; }
@media (max-width: 759px) {
  body.pwa-bar-on .login { --boy-h: clamp(100px, calc(var(--vh) - 624px - var(--extra)), 210px); }
  body.pwa-bar-on .login-card .muted-p { display: none; }
  body.pwa-bar-on .hero-prop.p4, body.pwa-bar-on .hero-prop.p5 { display: none; }
}
@media (max-width: 340px) { .login { --extra: 56px; } } /* 320 px: sarlavha va izoh ko'proq qatorga o'raladi */
@media (max-width: 340px) and (max-height: 800px) { .login { --extra: 28px; } }
.login-hero { display: contents; }
.login-hero .logo { grid-area: logo; font-size: 26px; }
.login-hero .lead { grid-area: lead; }
.login-card { grid-area: card; }
.perks { grid-area: perks; }
/* sahna: bola o'rtada, buyumlar uning ikki yonida (joylashuv bola o'lchamiga bog'liq) */
.hero-art { grid-area: art; position: relative; height: calc(var(--boy-h) + 14px); --pw: max(46px, min(calc(var(--boy-h) * .27), 130px)); --side: max(0px, calc(50% - var(--boy-h) * .26 - var(--pw))); }
.hero-glow { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; width: min(calc(var(--boy-h) * 1.08), 100%); aspect-ratio: 1 / 1; border-radius: 50%; background: radial-gradient(circle at 50% 42%, var(--card) 0%, var(--brand-soft) 58%, transparent 72%); }
.hero-boy, .hero-owl { position: absolute; left: 0; right: 0; bottom: 0; margin: 0 auto; }
.hero-boy { height: var(--boy-h); width: auto; }
.hero-owl { width: var(--boy-h); height: var(--boy-h); }
.hero-prop { position: absolute; z-index: 1; width: var(--pw); height: var(--pw); object-fit: contain; filter: drop-shadow(0 8px 8px rgba(58, 52, 140, .2)); animation: bob 4.4s ease-in-out infinite; }
.hero-prop.p1 { top: 0; right: var(--side); rotate: 8deg; animation-delay: -.8s; }
.hero-prop.p2 { top: max(34%, calc(var(--pw) + 6px)); left: var(--side); rotate: -8deg; animation-delay: -2.2s; }
.hero-prop.p3 { top: max(34%, calc(var(--pw) + 6px)); right: var(--side); width: auto; height: calc(var(--pw) * 1.35); animation-delay: -1.4s; }
.hero-prop.p4 { bottom: 8%; left: var(--side); rotate: -6deg; animation-delay: -3s; }
.hero-prop.p5 { bottom: 2%; right: var(--side); rotate: 6deg; animation-delay: -.2s; }
.hero-art .burst { z-index: 2; }
.hero-art .burst.b1 { top: 0; left: max(0px, calc(50% - var(--boy-h) * .26 - var(--pw))); width: var(--pw); height: var(--pw); }
.hero-art.no-boy .hero-prop { display: none; }
.hero-art .burst.b1 b { font-size: clamp(12px, calc(var(--boy-h) * .06), 22px); }
.login-hero h1 { grid-area: title; margin: 4px 0 0; font-weight: 800; font-size: clamp(36px, 11.6vw, 48px); line-height: 1.06; letter-spacing: -.03em; }
.login-hero h1 .hl { padding: .02em .2em .08em; }
.perks { list-style: none; margin: 4px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.perks li { display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.perks li > div { display: flex; flex-direction: column; gap: 2px; }
.perks strong { font-weight: 800; font-size: 16px; line-height: 1.2; }
.perks span:not(.perk-ic) { display: none; }
.perk-ic { width: 68px; height: 68px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--peach); color: var(--navy); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand-tint); margin: 5px 0 0; }
.perks li:nth-child(2) .perk-ic { background: var(--brand-soft); color: var(--brand-deep); }
.perks li:nth-child(3) .perk-ic { background: var(--sky); color: var(--navy-2); }
.perk-ic .ico { width: 30px; height: 30px; }
.login-card { align-items: stretch; gap: 14px; padding: 26px 22px 22px; text-align: center; box-shadow: var(--sh-2); }
.login-card .h2 { margin: 0; font-weight: 800; font-size: 30px; }
.login-card .muted-p { font-size: 17px; }
/* Google tugmasi: shaftoli hoshiya ichida (ilovaning asosiy tugmalari bilan bir xil rang), shunda oq kartochkada yo'qolib ketmaydi */
.g-box { display: flex; justify-content: center; align-items: center; min-height: 56px; padding: 6px; background: var(--peach); border-radius: 999px; box-shadow: var(--sh-peach); }
.fine { margin: 2px 0 0; display: flex; gap: 6px; align-items: center; justify-content: center; font-weight: 700; font-size: 15px; color: var(--muted); text-align: left; }
.fine .ico { width: 18px; height: 18px; stroke-width: 2.6; }
.dev-form { display: flex; flex-direction: column; gap: 10px; padding: 14px; background: var(--soft); border-radius: var(--r-md); text-align: left; }
.dev-note { display: flex; gap: 8px; align-items: flex-start; font-weight: 600; font-size: 14px; color: var(--muted); line-height: 1.35; }
.dev-note .ico { width: 18px; height: 18px; stroke-width: 2.6; margin-top: 1px; }
.dev-form .btn { height: 54px; font-size: 19px; }

/* ---------- rol ---------- */
.role-page { display: flex; flex-direction: column; gap: 22px; align-items: center; }
.role-grid { width: 100%; max-width: 560px; display: grid; grid-template-columns: 1fr; gap: 14px; }
.role-card { position: relative; display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ic t go" "ic d go"; column-gap: 16px; row-gap: 4px; align-items: center; padding: 18px 16px; text-align: left; background: var(--card); color: var(--ink); border: 0; border-radius: var(--r-lg); box-shadow: var(--sh-1); cursor: pointer; }
.role-card:hover { box-shadow: var(--sh-2); }
.role-card:active { transform: scale(.985); }
.role-card.on { box-shadow: inset 0 0 0 3px var(--brand), var(--sh-1); }
.role-card:disabled { opacity: .6; }
.role-ic { grid-area: ic; width: 68px; height: 68px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--peach); color: var(--navy); }
.role-card:nth-child(2) .role-ic { background: var(--brand-soft); color: var(--brand-deep); }
.role-card:nth-child(3) .role-ic { background: var(--sky); color: var(--navy-2); }
.role-ic .ico { width: 32px; height: 32px; }
.role-t { grid-area: t; align-self: end; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-weight: 800; font-size: 25px; line-height: 1.15; }
.role-d { grid-area: d; align-self: start; font-weight: 600; font-size: 16px; line-height: 1.35; color: var(--muted); }
.role-go { grid-area: go; width: 46px; height: 46px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy); color: var(--card); }
.role-go .ico { width: 22px; height: 22px; stroke-width: 2.4; }
.role-card.on .role-go { background: var(--brand); }

/* ---------- farzand qo'shish ---------- */
.child-form { padding: 22px 20px; }
.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.gchip { position: relative; height: 54px; padding: 0; background: var(--card); color: var(--ink); border: 0; border-radius: 18px; box-shadow: inset 0 0 0 2px var(--brand-soft); font: 800 22px/1 var(--font); cursor: pointer; }
.gchip:active { transform: scale(.94); }
.gchip.on { background: var(--brand); color: var(--card); box-shadow: var(--sh-1); }
.gdot { position: absolute; top: 6px; right: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--brand-deep); box-shadow: 0 0 0 2px var(--card); display: inline-block; }
.gchip.on .gdot { background: var(--card); box-shadow: 0 0 0 2px var(--brand); }
.legend-dot { margin: 0; font-weight: 700; font-size: 14px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.legend-dot .gdot { position: static; width: 12px; height: 12px; }
.form-actions { display: flex; flex-direction: column; gap: 10px; }
.child-form .btn { height: 60px; font-size: 21px; }
.child-form .btn.ghost { height: 56px; font-size: 18px; }

/* ---------- farzandlar ---------- */
/* kartochka: avatar | ism va sinf | foiz halqasi. Uzun ism so'z o'rtasidan uzilmasligi uchun 440px gacha halqa ism ostiga tushadi */
.kid-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 14px; }
.kid-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "av n r" "av g r"; column-gap: 16px; row-gap: 6px; align-items: center; padding: 16px 16px 16px 18px; min-height: 100px; text-align: left; background: var(--card); color: var(--ink); border: 0; border-radius: var(--r-lg); box-shadow: var(--sh-1); cursor: pointer; }
.kid-card:hover { box-shadow: var(--sh-2); }
.kid-card:active { transform: scale(.985); }
.kid-card.add { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av n"; background: color-mix(in srgb, var(--card) 55%, transparent); box-shadow: inset 0 0 0 2px var(--brand-tint); }
.kid-card.add .kc-n { color: var(--brand-deep); align-self: center; }
.kc-av, .ch-av { width: 64px; height: 64px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; color: var(--navy); font: 800 28px/1 var(--font); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand-tint); }
.kc-av { grid-area: av; }
.kc-av.plus { background: var(--brand); color: var(--card); box-shadow: none; }
.kc-av .ico { width: 28px; height: 28px; }
.kc-body { display: contents; }
.kc-n { grid-area: n; align-self: end; min-width: 0; padding-bottom: 2px; font-weight: 800; font-size: clamp(20px, 5.6vw, 25px); line-height: 1.12; letter-spacing: -.02em; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; line-clamp: 3; overflow: hidden; }
.kc-g { grid-area: g; align-self: start; justify-self: start; padding: 3px 14px; background: var(--soft); border-radius: 999px; color: var(--brand-deep); font-weight: 800; font-size: 16px; line-height: 1.3; }
.kid-card > .mini-ring, .kc-none { grid-area: r; }
.kc-none { max-width: 96px; padding: 7px 10px; background: var(--soft); border-radius: var(--r-sm); color: var(--muted); font-weight: 700; font-size: 14px; line-height: 1.2; text-align: center; }
.kc-go { grid-area: go; display: none; width: 46px; height: 46px; flex: none; align-items: center; justify-content: center; border-radius: 50%; background: var(--navy); color: var(--card); }
.kc-go .ico { width: 22px; height: 22px; stroke-width: 2.4; }

/* doiraviy foiz: to'q ko'k doira, atrofida periwinkle yoy */
.mini-ring { position: relative; flex: none; }
.mini-ring::before { content: ""; position: absolute; inset: 13%; border-radius: 50%; background: var(--navy); }
.mini-ring svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.rg-trk { stroke: var(--brand-soft); }
.rg-arc { stroke: var(--brand); }
.mini-ring span { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: calc(var(--s, 56px) * .27); letter-spacing: -.03em; color: var(--card); }

/* ---------- farzand sahifasi ---------- */
.child-layout { display: flex; flex-direction: column; gap: 22px; }
.child-side, .child-main { display: flex; flex-direction: column; gap: 22px; min-width: 0; }

/* yuqori kartochka: periwinkle, daraja o'lchagichi bilan (referensdagi "Level") */
.child-head.card { position: relative; overflow: hidden; display: grid; grid-template-columns: auto 1fr auto; align-items: center; column-gap: 14px; row-gap: 18px; padding: 20px 18px 22px; background: var(--brand); color: var(--card); box-shadow: var(--sh-2); }
.child-head.card::before { content: ""; position: absolute; right: -26px; top: -34px; width: 132px; height: 132px; background: var(--hl); clip-path: polygon(50% 0%, 61.4% 14.8%, 79.4% 9.5%, 79.9% 28.3%, 97.6% 34.5%, 87% 50%, 97.6% 65.5%, 79.9% 71.7%, 79.4% 90.5%, 61.4% 85.2%, 50% 100%, 38.6% 85.2%, 20.6% 90.5%, 20.1% 71.7%, 2.4% 65.5%, 13% 50%, 2.4% 34.5%, 20.1% 28.3%, 20.6% 9.5%, 38.6% 14.8%); pointer-events: none; }
.child-head > * { position: relative; }
.child-head .ch-av { width: 68px; height: 68px; font-size: 32px; box-shadow: 0 0 0 3px var(--brand), 0 0 0 5px var(--card); }
.ch-t { min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.ch-t h1 { margin: 0; font-weight: 800; font-size: clamp(23px, 6.6vw, 30px); line-height: 1.1; letter-spacing: -.02em; overflow-wrap: anywhere; text-wrap: balance; }
/* periwinkle fonda standart fokus halqasi (--brand-deep) ko'rinmaydi: oq halqa (fonga nisbatan 4:1) */
.child-head :focus-visible { outline-color: var(--card); outline-offset: 3px; }
.child-head .pill { background: var(--card); color: var(--brand-deep); box-shadow: none; padding: 4px 14px; font-size: 17px; font-weight: 800; }
.ch-actions { display: flex; gap: 8px; }
.icon-btn { width: 48px; height: 48px; display: flex; align-items: center; justify-content: center; padding: 0; background: var(--card); color: var(--ink); border: 0; border-radius: 50%; cursor: pointer; }
.icon-btn:active { transform: scale(.92); }
.icon-btn.danger { color: var(--bad-ink); }
.icon-btn .ico { width: 22px; height: 22px; }
.ch-level, .ch-note { grid-column: 1 / -1; }
.ch-level-t { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; font-weight: 700; font-size: 20px; line-height: 1.2; }
.ch-level-t strong { font-weight: 800; font-size: 30px; letter-spacing: -.02em; }
.ch-note { margin: 0; font-weight: 700; font-size: 20px; line-height: 1.3; }

.courses { min-width: 0; }
.course-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 40px 18px; padding-top: 26px; }
.course-card { position: relative; gap: 16px; padding: 22px 20px 20px; overflow: visible; }
.cc-owl { position: absolute; right: 10px; top: -34px; width: 118px; height: 118px; pointer-events: none; }
.cc-boy { position: absolute; right: 14px; top: -34px; height: 118px; width: auto; pointer-events: none; }
/* sarlavha yonida boyqush uchun joy; balandlik faqat boyqush bo'yi (kartochka tepasidan 84px) bilan cheklanadi */
.cc-head { min-height: 62px; padding-right: 104px; }
.cc-head h3 { margin: 0; font-weight: 800; font-size: clamp(23px, 6.6vw, 27px); line-height: 1.12; letter-spacing: -.02em; text-wrap: balance; }
.cc-head h3 .nw { white-space: nowrap; }
.cc-head .muted { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; margin-top: 8px; font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--muted); }
.cc-prog { display: flex; align-items: center; gap: 14px; padding: 12px 14px; background: color-mix(in srgb, var(--card) 72%, transparent); border-radius: var(--r-md); }
.cc-prog > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-prog strong { font-weight: 800; font-size: 20px; }
.cc-prog .muted { font-weight: 600; font-size: 15px; color: var(--muted); }
.cc-actions { display: flex; flex-direction: column; gap: 10px; }
.cc-actions .btn { height: 60px; }
.cc-actions .btn.ghost { height: 56px; font-size: 18px; }
.cc-actions .btn.ghost .ico { color: var(--brand-deep); }

.soon-card { align-items: center; text-align: center; gap: 14px; padding: 28px 22px; max-width: 640px; margin: 0 auto; width: 100%; }
.soon-card h1 { font-size: 32px; }
.soon-card .h2 { font-size: 27px; line-height: 1.15; margin: 0; letter-spacing: -.02em; }
.soon-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; text-align: left; }
.soon-list li { display: flex; gap: 12px; align-items: center; font-weight: 700; font-size: 17px; line-height: 1.3; }
.soon-list .ico { width: 30px; height: 30px; padding: 6px; flex: none; border-radius: 50%; background: var(--brand-soft); color: var(--brand-deep); }

.soon { display: flex; flex-direction: column; gap: 10px; padding: 22px 20px 24px; background: var(--sky); border-radius: var(--r-lg); }
.soon .muted-p { font-size: 17px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 4px; }
.int-chip { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 8px 18px 8px 14px; background: var(--card); color: var(--ink); border: 0; border-radius: 999px; box-shadow: var(--sh-1); font: 800 17px/1.2 var(--font); cursor: pointer; }
.int-chip:active { transform: scale(.96); }
.int-chip .ico { width: 20px; height: 20px; color: var(--brand-deep); }
.int-chip.on { background: var(--navy); color: var(--card); box-shadow: none; }
.int-chip.on .ico { color: var(--peach); }

/* qanday ishlaydi */
.how-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 16px; }
.how-steps li { display: flex; gap: 14px; align-items: flex-start; font-weight: 600; font-size: 16px; line-height: 1.4; color: var(--muted); }
.how-steps li strong { display: block; margin-bottom: 2px; color: var(--ink); font-weight: 800; font-size: 19px; }
.how-n { width: 42px; height: 42px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: var(--peach); color: var(--navy); font-weight: 800; font-size: 20px; }

/* ---------- kenglikka qarab ---------- */
@media (max-width: 520px) {
  .grades { grid-template-columns: repeat(4, 1fr); }
  .user-n, .user-caret { display: none; }
  .tb-crumb { display: none; }
  .topbar .logo span { display: none; }
  .topbar .logo-mark { width: 40px; height: 40px; }
}
@media (max-width: 519px) {
  /* telefon: yuqorida avatar va tugmalar, ism butun kenglikda (uzun ism so'z o'rtasidan uzilmaydi) */
  .child-head.card { grid-template-columns: auto 1fr; grid-template-areas: "av act" "t t" "lvl lvl"; row-gap: 14px; }
  .child-head .ch-av { grid-area: av; }
  .child-head .ch-actions { grid-area: act; justify-self: end; }
  .child-head .ch-t { grid-area: t; }
  .child-head .ch-level, .child-head .ch-note { grid-area: lvl; }
}
@media (max-width: 440px) {
  /* farzand kartochkasi: ism butun kenglikda, sinf va foiz halqasi uning ostida yonma-yon */
  .kid-card { grid-template-columns: auto auto minmax(0, 1fr); grid-template-areas: "av n n" "av g r"; }
  .kid-card > .mini-ring, .kc-none { justify-self: end; }
}
@media (max-width: 380px) {
  .topbar-in { padding-left: 16px; padding-right: 16px; }
  .role-card { column-gap: 12px; padding: 16px 14px; }
  .role-ic { width: 56px; height: 56px; }
  .role-ic .ico { width: 28px; height: 28px; }
  .role-t { font-size: 23px; }
  .role-go { display: none; }
  .kid-card { column-gap: 12px; padding-left: 16px; }
  .kc-av, .ch-av { width: 56px; height: 56px; font-size: 24px; }
  .child-head .ch-av { width: 60px; height: 60px; font-size: 28px; }
  .cc-head { padding-right: 92px; }
  .hello-owl { width: 80px; height: 80px; top: 6px; right: -4px; }
  .hello-head > :not(.hello-owl) { max-width: calc(100% - 84px); }
  .hello { font-size: 19px; }
  .hello-head h1 { font-size: 30px; }
  .cc-owl { width: 104px; height: 104px; right: 6px; }
  .cc-boy { height: 104px; right: 10px; }
  .head-boy { height: 150px; }
  .perk-ic { width: 60px; height: 60px; }
  .page-head h1, .soon-card h1 { font-size: 34px; }
}
/* qisqa telefonlar: asosiy "Kirish" tugmasi birinchi ekranga sig'sin (boyqush va sarlavha ixchamlashadi) */
@media (max-width: 759px) and (max-height: 800px) {
  .login { gap: 18px; --boy-h: clamp(150px, calc(var(--vh) - 495px - var(--extra)), 290px); }
  body.pwa-bar-on .login { --boy-h: clamp(100px, calc(var(--vh) - 587px - var(--extra)), 210px); }
  .login-hero .logo { font-size: 24px; }
  .login-hero h1 { margin-top: 0; font-size: clamp(32px, 10vw, 42px); }
  .login-hero .lead { font-size: 17px; }
  .login-card { padding: 22px 18px 18px; gap: 12px; }
  .login-card .h2 { font-size: 27px; }
}
@media (max-width: 759px) and (max-height: 720px) {
  .login { gap: 14px; --boy-h: clamp(150px, calc(var(--vh) - 380px - var(--extra)), 290px); }
  body.pwa-bar-on .login { --boy-h: clamp(100px, calc(var(--vh) - 506px - var(--extra)), 210px); }
  .login-hero h1 { font-size: clamp(28px, 9vw, 36px); }
  .login-hero .lead { font-size: 16px; }
  .login-card .muted-p { display: none; }
  .login-card { padding: 18px 16px 16px; }
}
@media (min-width: 760px) {
  .topbar-in { padding-left: 28px; padding-right: 28px; }
  .page-head h1, .soon-card h1 { font-size: 46px; }
  /* planshet: bitta ustun, o'rtada (ikki ustun 1100 px dan boshlanadi) */
  .login { max-width: 640px; margin: 0 auto; width: 100%; row-gap: 20px; --boy-h: clamp(220px, calc(var(--vh) - 520px), 380px); }
  .login-hero h1 { font-size: 56px; }
  .perk-ic { margin: 5px; }
  .login-card { padding: 34px 30px 28px; }
  .role-grid { max-width: 1000px; grid-template-columns: repeat(3, 1fr); }
  .role-card { grid-template-columns: 1fr auto; grid-template-areas: "ic go" "t t" "d d"; row-gap: 8px; min-height: 250px; align-content: start; padding: 24px; }
  .role-card .role-go { display: flex; align-self: start; }
  .role-t { align-self: start; margin-top: 10px; }
  .how-steps { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .course-grid { gap: 44px 22px; }
}
@media (min-width: 1100px) {
  #screen-login.screen.wide { max-width: 1240px; }
  .login { max-width: none; margin: 0; width: auto; grid-template-columns: minmax(0, 500px) minmax(0, 1fr); grid-template-areas: "logo art" "title art" "lead art" "card art" "perks art"; column-gap: 72px; align-content: center; align-items: start; min-height: calc(100vh - 140px); min-height: calc(100dvh - 140px); --boy-h: clamp(380px, calc(var(--vh) - 160px), 600px); }
  .login-hero h1 { font-size: 64px; }
  .hero-art { align-self: center; }
}
/* qisqa ekran (gorizontal telefon, past noutbuk oynasi): bola kichrayadi, sahifa aylanadi */
/* 900-1099 px (landshaft planshet, kichik noutbuk oynasi): ikki ustun, bola kattaroq */
@media (min-width: 900px) and (max-width: 1099px) and (min-height: 600px) {
  .login { max-width: none; margin: 0; width: auto; grid-template-columns: minmax(0, 420px) minmax(0, 1fr); grid-template-areas: "logo art" "title art" "lead art" "card art" "perks art"; column-gap: 40px; align-content: center; align-items: start; --boy-h: clamp(300px, calc(var(--vh) - 300px), 400px); }
  .login-hero h1 { font-size: 52px; }
  .hero-art { align-self: center; }
}
/* gorizontal telefon: matn va kirish chapda, bola o'ngda (tugma birinchi ekranga yaqin) */
@media (min-width: 640px) and (max-height: 520px) {
  .login { max-width: none; margin: 0; width: auto; grid-template-columns: minmax(0, 1fr) minmax(0, 340px); grid-template-areas: "logo art" "title art" "lead art" "card art" "perks art"; column-gap: 32px; row-gap: 12px; align-content: center; align-items: start; min-height: 0; --boy-h: clamp(170px, calc(var(--vh) - 110px), 260px); }
  .login-hero h1 { font-size: 36px; }
  .login-card .muted-p, .perks { display: none; }
  .login-card { padding: 18px 20px 16px; }
  .hero-art { align-self: center; }
}
/* kichik telefon: pastki buyumlar tushadi, sahna toza qoladi */
@media (max-width: 759px) and (max-height: 700px) {
  .hero-prop.p4, .hero-prop.p5 { display: none; }
}
@media (min-width: 900px) {
  .kc-go { display: flex; }
  .kid-card { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "av n r go" "av g r go"; }
  .kid-card.add { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "av n"; }
  .child-layout { display: grid; grid-template-columns: 340px 1fr; gap: 28px; align-items: start; }
  .child-side { position: sticky; top: 84px; }
  .child-side .child-head.card { grid-template-columns: 1fr; justify-items: center; text-align: center; padding: 26px 20px 24px; }
  .child-side .ch-t { align-items: center; }
  .child-side .ch-level { width: 100%; text-align: left; }
}
/* gorizontal telefon: yuqori va pastki panel ekranning yarmini egallamasin */
@media (max-height: 480px) {
  body.has-tabbar { --dock: 72px; }
  .topbar { position: relative; } /* yopishqoq emas: ekran bilan birga ketadi */
  .topbar-in { min-height: 56px; padding-top: 6px; padding-bottom: 6px; }
  .tabbar { bottom: calc(8px + env(safe-area-inset-bottom)); padding: 6px; }
  .dk { width: 48px; height: 48px; }
  .dk .ico { width: 24px; height: 24px; }
  .dk .av { width: 36px; height: 36px; font-size: 16px; }
  .child-side { top: 12px; }
}

/* ---------- 3D rasmlar (public/art/*.webp): rol, afzallik, tugma ---------- */
.art-img { display: block; flex: none; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.role-card .role-ic.has-art { width: 84px; height: 84px; overflow: hidden; background: var(--brand-soft); box-shadow: 0 0 0 3px var(--card), 0 0 0 5px var(--brand-tint); }
.role-card:nth-child(2) .role-ic.has-art { background: var(--sky); }
.role-art { width: 100%; height: 100%; object-fit: cover; object-position: 50% 6%; }
.perk-ic.has-art { background: var(--brand-soft); overflow: hidden; }
.perk-art { width: 80%; height: 80%; object-fit: contain; }
.btn .btn-art { width: 36px; height: 36px; margin: -6px 0; object-fit: contain; }
@media (max-width: 380px) {
  .role-card .role-ic.has-art { width: 68px; height: 68px; }
}

/* juda uzun (probelsiz) ism yuqori panelni toshirmasin */
.user-n { max-width: 34vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
