:root {
  --bg: #f6f7fb; --card: #ffffff; --text: #1b1f2a; --muted: #667085; --line: #e4e7ee;
  --brand: #4f46e5; --brand-2: #6d5efc; --brand-soft: #eceafe; --ok: #12a05c; --ok-soft: #e3f7ec; --warn: #d98206; --warn-soft: #fff3df;
  --bad: #d92d20; --bad-soft: #fdeceb; --info-soft: #e8f1ff; --radius: 16px; --shadow: 0 1px 2px rgba(16,24,40,.05), 0 8px 24px rgba(16,24,40,.06); --hero-a: #4f46e5; --hero-b: #7c5cff;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --bg: #0e1120; --card: #171b2e; --text: #e8eaf3; --muted: #9aa3b8; --line: #2a3050; --brand: #8b83ff; --brand-2: #a39dff; --brand-soft: #25264a;
    --ok: #3ccf8e; --ok-soft: #123326; --warn: #f5a524; --warn-soft: #3a2a10; --bad: #ff6b60; --bad-soft: #3b1a1a; --info-soft: #172743; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25); --hero-a: #3a32a8; --hero-b: #6a45d6; color-scheme: dark; }
}
:root[data-theme="dark"] { --bg: #0e1120; --card: #171b2e; --text: #e8eaf3; --muted: #9aa3b8; --line: #2a3050; --brand: #8b83ff; --brand-2: #a39dff; --brand-soft: #25264a;
    --ok: #3ccf8e; --ok-soft: #123326; --warn: #f5a524; --warn-soft: #3a2a10; --bad: #ff6b60; --bad-soft: #3b1a1a; --info-soft: #172743; --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 6px 18px rgba(0,0,0,.25); --hero-a: #3a32a8; --hero-b: #6a45d6; color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 16px/1.55 Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif; -webkit-font-smoothing: antialiased; background: var(--bg); color: var(--text); }
h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.25rem; } h3 { font-size: 1.05rem; }
a { color: var(--brand); text-decoration: none; } a:hover { text-decoration: underline; }
p { margin: 0 0 .75em; }
small, .muted { color: var(--muted); }
button, input, select, textarea { font: inherit; color: inherit; }
.layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.sidebar { background: var(--card); border-right: 1px solid var(--line); padding: 18px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { font-weight: 800; font-size: 1.25rem; padding: 4px 10px 16px; color: var(--brand); display: flex; gap: 8px; align-items: center; }
.brand .logo { width: 30px; height: 30px; border-radius: 9px; background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; display: grid; place-items: center; font-size: 1rem; }
.nav a { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 10px; color: var(--text); margin-bottom: 2px; }
.nav a:hover { background: var(--brand-soft); text-decoration: none; }
.nav a.active { background: var(--brand-soft); color: var(--brand); font-weight: 650; }
.nav .sep { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 14px 12px 4px; }
.me { margin-top: 18px; padding: 12px; border-top: 1px solid var(--line); font-size: .9rem; }
.main { padding: 24px clamp(14px, 3vw, 36px) 60px; max-width: 1100px; width: 100%; }
.topbar { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); margin-bottom: 16px; }
.card.flat { box-shadow: none; }
.grid { display: grid; gap: 14px; } .g2 { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); } .g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); } .g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; } .between { justify-content: space-between; } .grow { flex: 1; }
.stack > * + * { margin-top: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; background: var(--brand); color: #fff; padding: 9px 16px; border-radius: 10px; cursor: pointer; font-weight: 600; min-height: 40px; }
.btn:hover { filter: brightness(1.06); } .btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.secondary { background: var(--card); color: var(--text); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--brand); } .btn.danger { background: var(--bad); }
.btn.sm { padding: 5px 10px; min-height: 30px; font-size: .88rem; } .btn.lg { padding: 13px 22px; font-size: 1.05rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-height: 40px; }
textarea { min-height: 120px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible { outline: 2px solid var(--brand); outline-offset: 1px; }
label { display: block; font-weight: 600; margin-bottom: 4px; font-size: .92rem; }
.field { margin-bottom: 12px; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.badge.ok { background: var(--ok-soft); color: var(--ok); } .badge.warn { background: var(--warn-soft); color: var(--warn); } .badge.bad { background: var(--bad-soft); color: var(--bad); } .badge.info { background: var(--info-soft); color: var(--brand); }
.pill-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1px solid var(--line); background: var(--card); padding: 8px 14px; border-radius: 999px; cursor: pointer; font-weight: 600; }
.pill.on { background: var(--brand); color: #fff; border-color: var(--brand); }
.bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; } .bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-2)); border-radius: 999px; transition: width .4s; }
.bar.ok > i { background: var(--ok); }
.stat { text-align: center; padding: 14px 8px; } .stat b { display: block; font-size: 1.6rem; } .stat span { color: var(--muted); font-size: .85rem; }
.big-level { font-size: 2.2rem; font-weight: 800; color: var(--brand); line-height: 1; }
.task { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--line); border-radius: 12px; margin-bottom: 8px; background: var(--card); color: inherit; }
.task:hover { border-color: var(--brand); text-decoration: none; }
.task .ico { width: 42px; height: 42px; border-radius: 12px; background: var(--brand-soft); display: grid; place-items: center; font-size: 1.25rem; flex: none; }
.task.done { opacity: .78; } .task.done .ico { background: var(--ok-soft); }
.alert { padding: 11px 14px; border-radius: 10px; margin-bottom: 10px; background: var(--info-soft); }
.alert.warn { background: var(--warn-soft); } .alert.bad { background: var(--bad-soft); } .alert.ok { background: var(--ok-soft); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 16px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 10px 14px; cursor: pointer; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--brand); border-bottom-color: var(--brand); }
.calendar { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.calendar .dow { text-align: center; font-size: .75rem; color: var(--muted); padding: 4px 0; }
.day { aspect-ratio: 1.15; border: 1px solid var(--line); border-radius: 10px; padding: 4px 6px; background: var(--card); cursor: pointer; text-align: left; position: relative; font-size: .85rem; min-height: 46px; }
.day.empty { background: transparent; border-color: transparent; cursor: default; }
.day.sel { outline: 2px solid var(--brand); } .day.today { border-color: var(--brand); font-weight: 700; }
.day.full { background: var(--ok-soft); } .day.part { background: var(--warn-soft); } .day.missed { background: var(--bad-soft); }
.day .dot { position: absolute; right: 6px; bottom: 5px; width: 7px; height: 7px; border-radius: 50%; background: var(--brand); }
.lesson { display: grid; grid-template-columns: 260px 1fr; gap: 18px; align-items: start; }
.steps { position: sticky; top: 14px; }
.step { display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: .92rem; border: 0; background: none; width: 100%; text-align: left; }
.step:hover { background: var(--brand-soft); } .step.cur { background: var(--brand-soft); font-weight: 650; color: var(--brand); }
.step .n { width: 24px; height: 24px; border-radius: 50%; background: var(--line); display: grid; place-items: center; font-size: .75rem; flex: none; }
.step.done .n { background: var(--ok); color: #fff; }
.slide { min-height: 200px; } .slide table { border-collapse: collapse; width: 100%; margin: 8px 0; } .slide th, .slide td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; } .slide th { background: var(--brand-soft); }
.slide ul { padding-left: 1.2em; } .slide li { margin-bottom: 4px; }
.q { padding: 12px 0; border-bottom: 1px solid var(--line); } .q:last-child { border-bottom: 0; }
.q .qt { font-weight: 600; margin-bottom: 8px; }
.opt { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; margin-bottom: 6px; cursor: pointer; background: var(--card); }
.opt:hover { border-color: var(--brand); } .opt input { width: auto; margin: 0; }
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.right { border-color: var(--ok); background: var(--ok-soft); } .opt.wrong { border-color: var(--bad); background: var(--bad-soft); }
.passage { background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; white-space: pre-wrap; line-height: 1.7; margin-bottom: 12px; max-height: 420px; overflow: auto; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; min-height: 40px; }
.chip { border: 1px solid var(--line); background: var(--card); padding: 6px 12px; border-radius: 10px; cursor: pointer; font-weight: 600; }
.chip.used { opacity: .35; } .chip.built { background: var(--brand-soft); border-color: var(--brand); }
.flash { text-align: center; padding: 26px 14px; } .flash .w { font-size: 2.1rem; font-weight: 800; } .flash .uz { font-size: 1.4rem; color: var(--brand); margin: 6px 0; } .flash .ex { color: var(--muted); font-style: italic; }
.result { border-radius: var(--radius); padding: 16px; margin-top: 14px; background: var(--info-soft); }
.result.good { background: var(--ok-soft); } .result.mid { background: var(--warn-soft); } .result.low { background: var(--bad-soft); }
.score { font-size: 2rem; font-weight: 800; }
.fb { white-space: pre-wrap; margin: 8px 0; }
.mis { padding: 6px 10px; border-left: 3px solid var(--bad); background: var(--card); border-radius: 6px; margin: 6px 0; font-size: .93rem; }
.mis.good { border-color: var(--ok); }
.chat { display: flex; flex-direction: column; gap: 10px; max-height: 55vh; overflow-y: auto; padding: 6px; }
.bubble { max-width: 82%; padding: 10px 14px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.bubble.me { align-self: flex-end; background: var(--brand-soft); border-color: transparent; }
.bubble .note { font-size: .82rem; color: var(--muted); margin-top: 6px; border-top: 1px dashed var(--line); padding-top: 5px; }
.persona { cursor: pointer; text-align: center; padding: 14px 10px; border: 2px solid var(--line); border-radius: 14px; background: var(--card); }
.persona:hover { border-color: var(--brand); } .persona.on { border-color: var(--brand); background: var(--brand-soft); }
.persona .em { font-size: 2.1rem; } .persona b { display: block; } .persona small { display: block; line-height: 1.3; }
.mic { width: 72px; height: 72px; border-radius: 50%; border: 0; background: var(--brand); color: #fff; font-size: 1.7rem; cursor: pointer; }
.mic.rec { background: var(--bad); animation: pulse 1.1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 12px rgba(217,45,32,.18); } }
table.t { width: 100%; border-collapse: collapse; } table.t th, table.t td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); } table.t th { color: var(--muted); font-weight: 600; font-size: .85rem; }
.auth { max-width: 440px; margin: 7vh auto; padding: 0 14px; }
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 50; }
.toast { background: #1b1f2a; color: #fff; padding: 11px 16px; border-radius: 10px; box-shadow: 0 6px 20px rgba(0,0,0,.25); max-width: 360px; }
.toast.err { background: var(--bad); }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--brand); border-radius: 50%; animation: spin .8s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 40px; text-align: center; color: var(--muted); }
svg text { fill: var(--muted); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 10px; font-size: .85rem; } .legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; }
@media (max-width: 860px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { position: fixed; inset: 0 auto 0 0; width: 260px; z-index: 30; transform: translateX(-100%); transition: transform .2s; height: 100%; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.35); }
  .topbar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
  .lesson { grid-template-columns: 1fr; } .steps { position: static; display: flex; overflow-x: auto; gap: 4px; }
  .step { white-space: nowrap; width: auto; }
}
@media print { .sidebar, .topbar, #toasts { display: none; } .layout { display: block; } }


/* ===== Design pass 2 ===== */
h1 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 1.9rem); letter-spacing: -.02em; } h2 { letter-spacing: -.01em; }
::selection { background: var(--brand); color: #fff; }
.main > * { animation: rise .28s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.card { transition: box-shadow .2s, border-color .2s; }
.card:not(.flat):hover { border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); }
.sidebar { box-shadow: 1px 0 0 var(--line); }
.brand .logo { box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 45%, transparent); }
.nav a { transition: background .15s, color .15s, transform .1s; position: relative; }
.nav a:active { transform: scale(.98); }
.nav a.active::before { content: ""; position: absolute; left: -12px; top: 9px; bottom: 9px; width: 4px; border-radius: 0 4px 4px 0; background: var(--brand); }
.btn { transition: filter .15s, transform .08s, box-shadow .15s; box-shadow: 0 1px 2px rgba(16,24,40,.12); }
.btn:hover:not(:disabled) { text-decoration: none; box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 35%, transparent); }
.btn:active:not(:disabled) { transform: translateY(1px) scale(.99); }
.btn.secondary { box-shadow: none; } .btn.secondary:hover:not(:disabled) { border-color: var(--brand); box-shadow: none; }
.btn.danger:hover:not(:disabled) { box-shadow: 0 4px 12px color-mix(in srgb, var(--bad) 35%, transparent); }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent); }
.bar { height: 10px; } .bar > i { transition: width .6s cubic-bezier(.2,.8,.2,1); }
.stat { border-radius: var(--radius); } .stat b { font-size: 1.75rem; letter-spacing: -.02em; }
.task { transition: transform .15s, border-color .15s, box-shadow .15s; }
.task:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.task .ico { background: linear-gradient(135deg, var(--brand-soft), color-mix(in srgb, var(--brand-soft) 50%, var(--card))); }
.badge { letter-spacing: .01em; }
.alert { border: 1px solid color-mix(in srgb, currentColor 8%, transparent); border-left: 4px solid var(--brand); }
.alert.warn { border-left-color: var(--warn); } .alert.bad { border-left-color: var(--bad); } .alert.ok { border-left-color: var(--ok); }
table.t tbody tr { transition: background .12s; } table.t tbody tr:hover { background: var(--brand-soft); }
.opt { transition: border-color .12s, background .12s, transform .08s; } .opt:active { transform: scale(.995); }
.day { transition: transform .12s, box-shadow .12s; } .day:not(.empty):hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.persona { transition: transform .15s, border-color .15s, box-shadow .15s; } .persona:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.toast { animation: rise .2s ease; border-left: 4px solid var(--brand-2); }
.bubble { box-shadow: var(--shadow); }
.loading .spinner { width: 30px; height: 30px; }

/* hero greeting on the home page */
.hero { background: linear-gradient(135deg, var(--hero-a), var(--hero-b)); color: #fff; border-radius: 22px; padding: 22px 24px; margin-bottom: 16px; position: relative; overflow: hidden; box-shadow: 0 12px 30px color-mix(in srgb, var(--hero-a) 40%, transparent); }
.hero::after { content: ""; position: absolute; width: 260px; height: 260px; right: -70px; top: -110px; border-radius: 50%; background: rgba(255,255,255,.12); }
.hero h1 { margin: 2px 0 0; } .hero .muted, .hero small { color: rgba(255,255,255,.8); }
.hero .badge { background: rgba(255,255,255,.2); color: #fff; }
.hero .progress { margin-top: 14px; } .hero .bar { background: rgba(255,255,255,.25); } .hero .bar > i { background: #fff; }

/* theme toggle + mobile chrome */
.theme-btn { width: 100%; justify-content: flex-start; }
.scrim { display: none; }
.tabbar { display: none; }
@media (max-width: 860px) {
  .scrim.show { display: block; position: fixed; inset: 0; background: rgba(8,10,20,.5); z-index: 25; backdrop-filter: blur(2px); }
  .main { padding-bottom: 96px; }
  .tabbar { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; color: var(--muted); padding: 4px 2px; border-radius: 10px; text-decoration: none; }
  .tabbar a span { font-size: 1.3rem; line-height: 1.1; }
  .tabbar a.active { color: var(--brand); font-weight: 650; }
  .hero { border-radius: 18px; padding: 18px; }
  .grid.g4 { grid-template-columns: repeat(2, 1fr); }
  .card { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ===== Lingo the owl ===== */
.mascot { flex: none; user-select: none; }
.mascot svg { width: 100%; height: auto; overflow: visible; display: block; }
.mascot .m-body { animation: m-float 3.2s ease-in-out infinite; transform-origin: 100px 200px; transform-box: view-box; }
.mascot .m-shadow { animation: m-shadow 3.2s ease-in-out infinite; transform-origin: 100px 206px; transform-box: view-box; }
.mascot .m-eye { transition: transform .12s ease-out; }
.mascot .m-lid { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(0); animation: m-blink 4.6s infinite; }
.mascot .m-wing-r { transform-box: view-box; transform-origin: 150px 88px; }
.mascot .m-wing-l { transform-box: view-box; transform-origin: 50px 88px; animation: m-wing-l 3.2s ease-in-out infinite; }
.mascot .m-mouth { transform-box: fill-box; transform-origin: 50% 0; transform: scaleY(.2); }
.mascot.waving .m-wing-r { animation: m-wave .55s ease-in-out 4; }
.mascot.talking .m-mouth { animation: m-talk .22s ease-in-out infinite alternate; }
.mascot.thinking .m-body { animation: m-think 1.1s ease-in-out infinite; }
.mascot.cheer .m-body { animation: m-cheer .9s ease; }
@keyframes m-float { 50% { transform: translateY(-7px); } }
@keyframes m-shadow { 50% { transform: scaleX(.88); opacity: .1; } }
@keyframes m-blink { 0%, 92%, 100% { transform: scaleY(0); } 95% { transform: scaleY(1); } }
@keyframes m-wave { 50% { transform: rotate(-34deg); } }
@keyframes m-wing-l { 50% { transform: rotate(5deg); } }
@keyframes m-talk { to { transform: scaleY(1.9); } }
@keyframes m-think { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes m-cheer { 30% { transform: translateY(-26px) rotate(-4deg); } 60% { transform: translateY(-4px) rotate(3deg); } }

.buddy { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: end; }
.buddy .say { background: var(--card); border: 1px solid var(--line); border-radius: 18px 18px 18px 4px; padding: 12px 16px; position: relative; margin-bottom: 10px; box-shadow: var(--shadow); min-height: 54px; }
.buddy .say .uz { color: var(--muted); font-size: .9rem; margin-top: 4px; }
.buddy .say .fix { font-size: .85rem; margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--line); }
.buddy .log { max-height: 220px; overflow-y: auto; display: flex; flex-direction: column; gap: 6px; margin-bottom: 10px; }
.buddy .log .bubble { max-width: 92%; font-size: .93rem; padding: 7px 12px; }
.buddy .composer { display: flex; gap: 8px; align-items: center; }
.buddy .composer input { flex: 1; }
.buddy .sugg { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.typing i { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted); margin: 0 2px; animation: m-dot 1s infinite; } .typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes m-dot { 50% { transform: translateY(-4px); opacity: .4; } }
@media (max-width: 640px) { .buddy { grid-template-columns: 1fr; justify-items: center; } .buddy > div:last-child { width: 100%; } }

/* greeting show */
.mascot.m-enter { animation: m-drop 1s cubic-bezier(.3,1.5,.5,1) both; }
.mascot.bowing .m-body { animation: m-bow 1s ease-in-out 1; transform-origin: 100px 190px; }
.mascot.dancing .m-body { animation: m-dance .6s ease-in-out infinite alternate; transform-origin: 100px 190px; }
.mascot.spin svg { animation: m-spin 1s ease-in-out 1; }
@keyframes m-drop { 0% { transform: translateY(-260px) scale(.8); opacity: 0; } 60% { opacity: 1; } 100% { transform: none; } }
@keyframes m-bow { 0%, 100% { transform: rotate(0); } 45%, 65% { transform: rotate(16deg) translateY(4px); } }
@keyframes m-dance { from { transform: rotate(-7deg) translateY(0); } to { transform: rotate(7deg) translateY(-8px); } }
@keyframes m-spin { to { transform: rotateY(360deg); } }
.say-play { margin: 0 0 10px; animation: pulse2 1.4s infinite; }
@keyframes pulse2 { 50% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--brand) 22%, transparent); } }
.mic-sm.rec { background: var(--bad); color: #fff; border-color: var(--bad); animation: pulse 1.1s infinite; }

.weekbars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 12px; align-items: end; }
.wb { text-align: center; } .wb .col { height: 84px; display: flex; align-items: flex-end; background: var(--brand-soft); border-radius: 10px; overflow: hidden; }
.wb .col i { display: block; width: 100%; background: linear-gradient(180deg, var(--brand-2), var(--brand)); border-radius: 10px 10px 0 0; min-height: 0; transition: height .6s cubic-bezier(.2,.8,.2,1); }
.wb.today small { color: var(--brand); font-weight: 700; }
.row > input[type=text], .row > input[type=password] { flex: 1 1 220px; width: auto; min-width: 0; }


/* ===== Design pass 3: modern, glassy, colourful ===== */
:root { --accent: #ff7a59; --pink: #ec4899; --grad: linear-gradient(135deg, #5b4bff 0%, #8b5cf6 55%, #ec4899 120%); --glass: color-mix(in srgb, var(--card) 82%, transparent); --ring: color-mix(in srgb, var(--line) 85%, transparent); }
body { background: var(--bg); position: relative; }
body::before { content: ""; position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(52rem 34rem at 8% -8%, color-mix(in srgb, var(--brand) 20%, transparent), transparent 70%),
              radial-gradient(44rem 30rem at 104% 2%, color-mix(in srgb, var(--pink) 15%, transparent), transparent 70%),
              radial-gradient(40rem 30rem at 60% 112%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 70%); }
html { scroll-behavior: smooth; }
::-webkit-scrollbar { width: 10px; height: 10px; } ::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--muted) 40%, transparent); border-radius: 10px; border: 2px solid transparent; background-clip: content-box; }

/* glass cards */
.card { background: var(--glass); backdrop-filter: blur(12px) saturate(140%); -webkit-backdrop-filter: blur(12px) saturate(140%); border: 1px solid var(--ring); border-radius: 22px; padding: 22px;
  box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 10px 30px -12px rgba(30,24,90,.22); }
.card.flat { box-shadow: none; background: color-mix(in srgb, var(--card) 70%, transparent); border-radius: 18px; }
.card:not(.flat):hover { border-color: color-mix(in srgb, var(--brand) 38%, var(--line)); box-shadow: 0 1px 0 rgba(255,255,255,.5) inset, 0 16px 40px -14px color-mix(in srgb, var(--brand) 40%, transparent); }
:root[data-theme="dark"] .card, :root:not([data-theme="light"]) .card { box-shadow: 0 1px 0 rgba(255,255,255,.04) inset, 0 12px 32px -14px rgba(0,0,0,.6); }
h2 { font-size: 1.3rem; font-weight: 750; }

/* sidebar */
.layout { grid-template-columns: 268px 1fr; }
.sidebar { background: var(--glass); backdrop-filter: blur(16px) saturate(150%); -webkit-backdrop-filter: blur(16px) saturate(150%); border-right: 1px solid var(--ring); padding: 22px 14px; }
.brand { font-size: 1.35rem; letter-spacing: -.02em; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.brand .logo { background: var(--grad); -webkit-text-fill-color: #fff; width: 36px; height: 36px; border-radius: 12px; font-weight: 800; box-shadow: 0 8px 18px -4px color-mix(in srgb, var(--brand) 65%, transparent); }
.nav a { padding: 9px 12px; border-radius: 14px; font-weight: 550; gap: 12px; }
.nav a .ni { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; font-size: 1.05rem; background: color-mix(in srgb, var(--brand) 9%, transparent); transition: transform .2s, background .2s; flex: none; }
.nav a:hover .ni { transform: scale(1.1) rotate(-4deg); }
.nav a.active { background: color-mix(in srgb, var(--brand) 12%, transparent); color: var(--brand); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 22%, transparent); }
.nav a.active .ni { background: var(--grad); box-shadow: 0 6px 14px -4px color-mix(in srgb, var(--brand) 60%, transparent); }
.nav a.active::before { display: none; }
.nav .sep { padding-top: 18px; }
.me { border-top: 0; margin-top: 14px; padding: 14px; border-radius: 18px; background: color-mix(in srgb, var(--brand) 7%, transparent); }
.me .who { display: flex; gap: 10px; align-items: center; }
.avatar { width: 40px; height: 40px; border-radius: 14px; background: var(--grad); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 1.1rem; flex: none; }

/* buttons & fields */
.btn { background: var(--grad); border-radius: 14px; min-height: 42px; padding: 9px 20px; font-weight: 650; letter-spacing: .005em; box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent); }
.btn:hover:not(:disabled) { filter: brightness(1.07) saturate(1.1); transform: translateY(-1px); box-shadow: 0 12px 26px -8px color-mix(in srgb, var(--brand) 75%, transparent); }
.btn.secondary { background: var(--glass); color: var(--text); border: 1px solid var(--ring); box-shadow: none; }
.btn.secondary:hover:not(:disabled) { border-color: var(--brand); color: var(--brand); transform: none; }
.btn.ghost { background: transparent; box-shadow: none; } .btn.danger { background: linear-gradient(135deg, #e11d48, #f43f5e); box-shadow: 0 8px 20px -8px rgba(225,29,72,.6); }
.btn.sm { border-radius: 11px; min-height: 32px; padding: 5px 12px; } .btn.lg { padding: 14px 26px; font-size: 1.05rem; border-radius: 16px; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], select, textarea { border-radius: 14px; border-color: var(--ring); background: color-mix(in srgb, var(--card) 90%, transparent); min-height: 44px; padding: 10px 14px; }
.badge { padding: 3px 11px; font-size: .76rem; }
.pill { border-radius: 999px; background: var(--glass); } .pill.on { background: var(--grad); border-color: transparent; box-shadow: 0 6px 16px -6px color-mix(in srgb, var(--brand) 70%, transparent); }
.tabs { gap: 6px; border: 0; background: color-mix(in srgb, var(--brand) 7%, transparent); padding: 5px; border-radius: 16px; width: max-content; max-width: 100%; }
.tabs button { border-radius: 12px; border: 0; padding: 8px 14px; } .tabs button.on { background: var(--card); color: var(--brand); box-shadow: 0 4px 12px -4px rgba(30,24,90,.25); border-bottom-color: transparent; }

/* hero */
.hero { background: var(--grad); border-radius: 28px; padding: 28px 30px; box-shadow: 0 24px 50px -20px color-mix(in srgb, var(--brand) 70%, transparent); }
.hero::before { content: ""; position: absolute; width: 220px; height: 220px; left: -60px; bottom: -120px; border-radius: 50%; background: rgba(255,255,255,.1); }
.hero::after { width: 300px; height: 300px; right: -80px; top: -140px; background: radial-gradient(circle, rgba(255,255,255,.28), rgba(255,255,255,.04) 70%); }
.hero h1 { font-size: clamp(1.7rem, 1.2rem + 1.6vw, 2.4rem); text-shadow: 0 2px 12px rgba(0,0,0,.18); }
.hero .progress { margin-right: 112px; } .hero .bar { height: 12px; }
.ring { position: absolute; right: 26px; bottom: 20px; width: 88px; height: 88px; z-index: 1; filter: drop-shadow(0 6px 14px rgba(0,0,0,.2)); }
.ring svg { width: 100%; height: 100%; } .ring b { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 1.15rem; }
.stat { padding: 18px 10px; } .stat b { font-size: 2rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.big-level { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 850; }
.task { border-radius: 18px; padding: 14px; background: color-mix(in srgb, var(--card) 80%, transparent); border-color: var(--ring); }
.task .ico { width: 48px; height: 48px; border-radius: 16px; font-size: 1.4rem; background: linear-gradient(135deg, color-mix(in srgb, var(--brand) 18%, var(--card)), color-mix(in srgb, var(--pink) 14%, var(--card))); }
.task:hover { border-color: var(--brand); box-shadow: 0 14px 30px -14px color-mix(in srgb, var(--brand) 55%, transparent); transform: translateY(-2px); }
.bar { background: color-mix(in srgb, var(--brand) 14%, transparent); } .bar > i { background: var(--grad); }

/* lesson + steps */
.step { border-radius: 14px; padding: 9px 12px; } .step.cur { background: color-mix(in srgb, var(--brand) 13%, transparent); box-shadow: inset 3px 0 0 var(--brand); }
.step .n { background: color-mix(in srgb, var(--brand) 14%, transparent); font-weight: 700; } .step.cur .n { background: var(--grad); color: #fff; }
.slide { font-size: 1.04rem; line-height: 1.7; } .slide th { background: color-mix(in srgb, var(--brand) 12%, transparent); }
.opt { border-radius: 14px; padding: 11px 14px; background: color-mix(in srgb, var(--card) 85%, transparent); }
.opt.sel { background: color-mix(in srgb, var(--brand) 12%, transparent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent); }
.result { border-radius: 22px; } .score { font-size: 2.6rem; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* persona cards */
.persona { border-radius: 22px; padding: 18px 12px; border: 1.5px solid var(--ring); background: var(--glass); position: relative; overflow: hidden; }
.persona .em { width: 68px; height: 68px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: radial-gradient(circle at 30% 25%, hsl(var(--h, 250) 95% 94%), hsl(var(--h, 250) 85% 82%)); box-shadow: 0 8px 18px -8px hsl(var(--h, 250) 70% 45% / .7); transition: transform .25s; }
.persona:hover .em { transform: scale(1.1) rotate(-6deg); }
.persona.on { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 10%, var(--card)); box-shadow: 0 16px 34px -16px color-mix(in srgb, var(--brand) 70%, transparent); }
.persona.on::after { content: "✓"; position: absolute; right: 10px; top: 10px; width: 24px; height: 24px; border-radius: 50%; background: var(--grad); color: #fff; font-size: .8rem; display: grid; place-items: center; font-weight: 800; }
.mic { background: var(--grad); box-shadow: 0 12px 26px -10px color-mix(in srgb, var(--brand) 80%, transparent); } .mic.rec { background: linear-gradient(135deg, #e11d48, #f43f5e); }

/* landing */
.auth-page { min-height: 100vh; }
.landing { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); min-height: 100vh; }
.landing-hero { background: var(--grad); color: #fff; padding: 44px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.landing-hero::before, .landing-hero::after { content: ""; position: absolute; border-radius: 50%; background: rgba(255,255,255,.1); }
.landing-hero::before { width: 420px; height: 420px; right: -140px; top: -120px; } .landing-hero::after { width: 300px; height: 300px; left: -90px; bottom: -100px; }
.landing-hero > * { position: relative; z-index: 1; }
.hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.4rem; margin-bottom: 8px; }
.hero-brand .logo { width: 38px; height: 38px; border-radius: 12px; background: rgba(255,255,255,.22); display: grid; place-items: center; }
.landing-hero .mascot { margin: 8px 0 6px; filter: drop-shadow(0 18px 24px rgba(20,10,80,.35)); }
.landing-hero h1 { font-size: clamp(1.7rem, 1.2rem + 1.8vw, 2.6rem); max-width: 18ch; text-shadow: 0 2px 14px rgba(0,0,0,.2); } .landing-hero p { max-width: 44ch; opacity: .92; font-size: 1.05rem; }
.perks { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 8px; } .perks li { background: rgba(255,255,255,.14); backdrop-filter: blur(6px); padding: 9px 14px; border-radius: 14px; font-weight: 550; max-width: 46ch; }
.landing-form { display: grid; place-content: center; padding: 32px clamp(18px, 4vw, 56px); }
.landing-form .card { width: min(440px, 100%); padding: 28px; }
.landing-form .card h2 { font-size: 1.6rem; }

/* confetti + skeleton */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 90; overflow: hidden; }
.confetti i { position: absolute; top: -20px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translate(var(--dx, 40px), 108vh) rotate(720deg); opacity: .9; } }
.skel { display: grid; gap: 10px; margin: 18px auto 0; max-width: 520px; }
.skel i { display: block; height: 16px; border-radius: 10px; background: linear-gradient(90deg, color-mix(in srgb, var(--brand) 8%, transparent) 25%, color-mix(in srgb, var(--brand) 18%, transparent) 50%, color-mix(in srgb, var(--brand) 8%, transparent) 75%); background-size: 200% 100%; animation: shimmer 1.2s infinite; }
.skel i:nth-child(2) { width: 80%; } .skel i:nth-child(3) { width: 55%; }
@keyframes shimmer { to { background-position: -200% 0; } }

@media (max-width: 860px) {
  .landing { grid-template-columns: 1fr; } .landing-hero { padding: 28px 22px 34px; } .landing-hero .mascot { width: 150px !important; } .perks { display: none; }
  .ring { display: none; } .hero .progress { margin-right: 0; } .layout { grid-template-columns: 1fr; }
  .tabs { width: auto; }
}
