/*
 * Seekho design system.
 * One brand, two modes:
 *   .mode-kid    playful, illustrated, big touch targets (Baloo 2)
 *   .mode-parent calm, clear, information-first (Plus Jakarta Sans)
 * Urdu uses Noto Nastaliq Urdu in both. Layout: parents get a bottom tab bar on phones and a sidebar
 * from 900px. Kids get full-screen views.
 */
:root {
  --green: #1f8a5b; --green-dark: #146b45; --green-soft: #e3f4ea;
  --mango: #ffb020; --mango-dark: #d68a00; --mango-soft: #fff3d6;
  --coral: #e5484d; --coral-soft: #fdecec;
  --sky: #4aa8ff; --sky-dark: #2b7fd0; --sky-soft: #e6f3ff;
  --ink: #14213d; --ink-2: #4a5568; --ink-3: #6b7588;
  --paper: #f6f5f1; --card: #ffffff; --line: #e7e4dc; --line-2: #f0eee8;
  --kid-bg: #fff7e8; --kid-sky: #cdeeff;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  --radius: 18px;
  --display: 'Baloo 2', system-ui, sans-serif;
  --ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --urdu: 'Noto Nastaliq Urdu', 'Jameel Noori Nastaleeq', 'Urdu Typesetting', serif;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font-family: var(--ui); font-size: 16px; line-height: 1.5; -webkit-font-smoothing: antialiased; }
html[lang="ur"] body { font-family: var(--urdu), var(--ui); line-height: 2; }
html[lang="ur"] :is(input, textarea, button, select) { font-family: var(--urdu), var(--ui); }
textarea[lang="en"], input[dir="ltr"] { font-family: var(--ui); }
textarea[lang="ur"] { font-family: var(--urdu); line-height: 2; }
.ltr { direction: ltr; unicode-bidi: isolate; font-family: var(--ui); }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; letter-spacing: -.01em; text-wrap: balance; }
html[lang="ur"] :is(h1, h2, h3, h4) { line-height: 1.9; letter-spacing: 0; }
p { margin: 0; }
a { color: var(--green); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; border-radius: 8px; }
[hidden] { display: none !important; }
.muted { color: var(--ink-3); }
.small { font-size: .85rem; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.error { color: var(--coral); }
.ic { flex: none; display: block; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 14px; font-weight: 700; font-size: .95rem; cursor: pointer; text-decoration: none;
  background: var(--card); color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line);
  transition: transform .08s ease, background .15s ease, box-shadow .15s ease;
}
.btn:hover { background: #faf9f6; }
.btn:active { transform: translateY(1px) scale(.99); }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.btn.primary { background: var(--green); color: #fff; box-shadow: 0 3px 0 var(--green-dark); }
.btn.primary:hover { background: #1c7f53; }
.btn.dark { background: var(--ink); color: #fff; box-shadow: none; }
.btn.mango { background: var(--mango); color: var(--ink); box-shadow: 0 3px 0 var(--mango-dark); }
.btn.ghost { background: transparent; box-shadow: none; color: var(--ink-2); }
.btn.ghost:hover { background: var(--line-2); }
.btn.danger { background: transparent; box-shadow: inset 0 0 0 1.5px #f3c7c8; color: var(--coral); }
.btn.small { min-height: 36px; padding: 0 12px; font-size: .85rem; border-radius: 11px; }
.btn.block { width: 100%; }
.btn.icon { width: 44px; padding: 0; }
.btn.icon.small { width: 36px; }
.link { background: none; border: 0; color: var(--green); font-weight: 700; cursor: pointer; padding: 0; text-decoration: none; font-size: .9rem; }

/* ---------- Form controls ---------- */
label.field { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: .9rem; }
.hint { font-weight: 500; font-size: .82rem; color: var(--ink-3); }
input:not([type=radio]):not([type=checkbox]), textarea, select {
  width: 100%; min-height: 46px; padding: 10px 14px; font-size: 1rem; font-family: inherit; color: var(--ink);
  background: var(--card); border: 1.5px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--green); box-shadow: 0 0 0 4px rgba(31, 138, 91, .14); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 20px) 50%, calc(100% - 15px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-inline-end: 38px; }
html[dir="rtl"] select { background-position: 20px 50%, 15px 50%; }
textarea { min-height: 80px; resize: vertical; }

/* Segmented control and choice tiles share one pattern: hidden radio + styled span. */
.seg { display: flex; padding: 4px; background: var(--line-2); border-radius: 14px; gap: 4px; }
.seg label { flex: 1; position: relative; }
.seg input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.seg span { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 0 10px; border-radius: 11px; font-weight: 700; font-size: .9rem; color: var(--ink-2); text-align: center; }
.seg input:checked + span { background: var(--card); color: var(--ink); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid var(--sky); }

.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.tile { position: relative; }
.tile input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.tile span { display: grid; place-items: center; aspect-ratio: 1; border-radius: 16px; background: var(--card); border: 2px solid var(--line); transition: border-color .15s, transform .1s; }
.tile input:checked + span { border-color: var(--green); background: var(--green-soft); }
.tile input:focus-visible + span { outline: 3px solid var(--sky); }
.tile .age { font-size: 1.4rem; font-weight: 800; }

.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: #d5d2c8; transition: background .2s; }
.switch span::after { content: ''; position: absolute; top: 3px; inset-inline-start: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch input:checked + span { background: var(--green); }
.switch input:checked + span::after { transform: translateX(20px); }
html[dir="rtl"] .switch input:checked + span::after { transform: translateX(-20px); }

/* ---------- Cards, lists, tags ---------- */
.card { background: var(--card); border-radius: var(--radius); border: 1px solid var(--line); padding: 16px; }
.card.pad-lg { padding: 20px; }
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-h h3 { font-size: 1.02rem; font-weight: 800; }
.list { display: flex; flex-direction: column; }
.list-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line-2); text-decoration: none; color: inherit; min-height: 56px; }
.list-row:first-child { border-top: 0; }
a.list-row:hover, button.list-row:hover { background: #fbfaf7; }
button.list-row { width: 100%; border: 0; background: none; text-align: start; cursor: pointer; border-top: 1px solid var(--line-2); padding-inline: 0; }
.list-row b { display: block; font-size: .98rem; }
.list-row .sub { font-size: .82rem; color: var(--ink-3); font-weight: 600; }
.list-row .chev { color: #b9b5aa; }
html[dir="rtl"] .chev { transform: scaleX(-1); }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .74rem; font-weight: 800; padding: 3px 9px; border-radius: 99px; white-space: nowrap; }
.tag.ok { background: var(--green-soft); color: var(--green-dark); }
.tag.go { background: var(--mango-soft); color: #8a5300; }
.tag.new { background: #eef0f4; color: var(--ink-2); }
.tag.info { background: var(--sky-soft); color: #1d5f9c; }
.stars-inline { display: inline-flex; gap: 1px; color: var(--mango); }
.stars-inline .off { color: #e4e0d5; }
.empty { text-align: center; padding: 28px 16px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty h3 { font-size: 1.1rem; }
.notice { display: flex; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--sky-soft); color: #1d4f80; font-size: .9rem; }
.notice.warn { background: #fff4d6; color: #6b4e00; }
.notice .ic { margin-top: 2px; }
.banner { position: sticky; top: 0; z-index: 30; background: #fff4d6; color: #6b4e00; text-align: center; padding: 6px 16px; font-size: .85rem; font-weight: 600; }

/* ---------- Parent shell ---------- */
.mode-parent { min-height: 100vh; }
.p-shell { min-height: 100vh; padding-bottom: calc(86px + var(--safe-b)); }
.p-top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 10px; padding: 12px max(16px, env(safe-area-inset-left)) 12px max(16px, env(safe-area-inset-right));
  background: rgba(246, 245, 241, .92); backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid transparent; }
.p-top.scrolled { border-bottom-color: var(--line); }
.p-top h1 { font-size: 1.35rem; font-weight: 800; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.p-top .eyebrow { display: block; font-size: .78rem; font-weight: 600; color: var(--ink-3); }
.p-main { max-width: 760px; margin: 0 auto; padding: 4px 16px 32px; display: flex; flex-direction: column; gap: 14px; }
.p-nav { position: fixed; z-index: 25; inset-inline: 0; bottom: 0; display: flex; justify-content: space-around; padding: 8px 6px calc(8px + var(--safe-b));
  background: #fff; border-top: 1px solid var(--line); }
.p-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; border-radius: 12px; text-decoration: none; color: var(--ink-3); font-size: .72rem; font-weight: 700; }
.p-nav a.on { color: var(--green); }
.p-nav a.on .ic { stroke-width: 2.6; }
.p-nav .brand-side, .p-nav .side-only { display: none; }
@media (min-width: 900px) {
  .p-shell { padding-bottom: 0; padding-inline-start: 248px; }
  .p-nav { inset: 0 auto 0 0; width: 248px; flex-direction: column; justify-content: flex-start; gap: 4px; padding: 20px 14px; border-top: 0; border-inline-end: 1px solid var(--line); background: #fbfaf7; }
  html[dir="rtl"] .p-nav { inset: 0 0 0 auto; }
  .p-nav .brand-side { display: flex; align-items: center; gap: 10px; padding: 4px 10px 18px; font-family: var(--display); font-size: 1.6rem; font-weight: 800; color: var(--ink); text-decoration: none; }
  .p-nav .side-only { display: flex; }
  .p-nav a { flex: none; flex-direction: row; gap: 12px; padding: 11px 12px; font-size: .95rem; }
  .p-nav a.on { background: var(--green-soft); }
  .p-nav .spacer { flex: 1; }
  .p-top { padding-inline: 32px; }
  .p-main { padding: 8px 32px 48px; margin: 0; max-width: 880px; }
}

/* Child switcher chips */
.kid-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: none; }
.kid-chips::-webkit-scrollbar { display: none; }
.kid-chip { display: flex; align-items: center; gap: 8px; padding: 5px 14px 5px 5px; border-radius: 99px; background: #fff; border: 1.5px solid var(--line); font-weight: 700; font-size: .9rem; white-space: nowrap; text-decoration: none; color: var(--ink); cursor: pointer; }
html[dir="rtl"] .kid-chip { padding: 5px 5px 5px 14px; }
.kid-chip.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.kid-chip.add { padding: 5px 14px; color: var(--ink-2); border-style: dashed; }

/* Dashboard */
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.stat b { display: block; font-size: 1.6rem; font-weight: 800; letter-spacing: -.02em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat b small { font-size: .9rem; font-weight: 700; }
.stat span { font-size: .78rem; color: var(--ink-3); font-weight: 600; }
.next-card { display: flex; align-items: center; gap: 14px; padding: 16px; border-radius: var(--radius); background: var(--ink); color: #fff; }
.next-card .art { width: 56px; height: 56px; border-radius: 16px; background: rgba(255,255,255,.1); display: grid; place-items: center; flex: none; }
.next-card .eyebrow { font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; opacity: .7; font-weight: 700; }
html[lang="ur"] .next-card .eyebrow { letter-spacing: 0; text-transform: none; font-size: .8rem; }
.next-card b { display: block; font-size: 1.05rem; }
.next-card .sub { font-size: .82rem; opacity: .75; }
.goal-row .ring { flex: none; color: var(--ink); }
.insight { display: flex; gap: 12px; align-items: flex-start; }
.insight .badge { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; flex: none; background: var(--sky-soft); color: var(--sky-dark); }
.insight p { font-size: .92rem; color: var(--ink-2); }
.insight b { color: var(--ink); }
.mistake { display: inline-block; font-size: .8rem; font-weight: 700; padding: 2px 8px; margin: 2px; border-radius: 8px; background: var(--coral-soft); color: #8f2226; direction: ltr; font-family: var(--ui); }
.mistake s { opacity: .7; }
.goal-hero { display: flex; align-items: center; gap: 16px; }
.goal-hero .ring { color: var(--ink); }
.danger-zone { border-color: #f3d3d4; }
.sticky-actions { position: sticky; bottom: calc(78px + var(--safe-b)); z-index: 15; display: flex; gap: 10px; justify-content: flex-end; padding: 12px; margin-top: 4px;
  background: rgba(255,255,255,.95); backdrop-filter: blur(8px); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
@media (min-width: 900px) { .sticky-actions { bottom: 16px; } }
details.more { border-top: 1px solid var(--line-2); padding-top: 12px; }
details.more summary { cursor: pointer; font-weight: 800; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--green); }
details.more summary::-webkit-details-marker { display: none; }
details.more[open] summary .ic { transform: rotate(90deg); }
.form { display: flex; flex-direction: column; gap: 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .form-grid { grid-template-columns: 1fr; } }
.skill-list { display: flex; flex-direction: column; gap: 8px; }
.skill { position: relative; display: block; }
.skill input { position: absolute; opacity: 0; inset: 0; cursor: pointer; z-index: 1; }
.skill .box { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border: 2px solid var(--line); border-radius: 16px; background: #fff; }
.skill .check { width: 24px; height: 24px; border-radius: 8px; border: 2px solid #cfcabd; display: grid; place-items: center; flex: none; margin-top: 2px; color: #fff; }
.skill input:checked + .box { border-color: var(--green); background: #f6fbf8; }
.skill input:checked + .box .check { background: var(--green); border-color: var(--green); }
.skill input:disabled + .box { opacity: .6; }
.skill input:focus-visible + .box { outline: 3px solid var(--sky); }
.skill b { display: block; }
.skill .sub { font-size: .84rem; color: var(--ink-3); }
.stepper { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0; }
.stepper li { flex: 1; display: flex; flex-direction: column; gap: 6px; font-size: .78rem; font-weight: 700; color: var(--ink-3); }
.stepper li::before { content: ''; height: 5px; border-radius: 3px; background: var(--line); }
.stepper li.done::before, .stepper li.on::before { background: var(--green); }
.stepper li.on { color: var(--ink); }
.setting { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line-2); }
.setting:first-child { border-top: 0; }
.setting .grow b { display: block; font-size: .95rem; }
.setting .grow span { font-size: .82rem; color: var(--ink-3); }
.setting select { width: auto; min-width: 150px; }
.rec-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 0; }
.rec-row .lbl { min-width: 64px; font-weight: 700; }
.btn.recording { background: var(--coral); color: #fff; box-shadow: none; animation: pulse 1s infinite; }
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: .88rem; }
th, td { padding: 10px 12px; text-align: start; border-bottom: 1px solid var(--line-2); vertical-align: top; }
th { font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-3); background: #fbfaf7; }
.admin-setting { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line-2); }
.admin-setting:first-child { border-top: 0; }
.admin-setting .grow b { display: block; font-size: .92rem; }
.admin-setting input, .admin-setting select { width: 130px; min-height: 40px; }
.budget-input { width: 110px !important; min-height: 38px !important; }

/* ---------- Sign-in, gate ---------- */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(circle at 15% 10%, #d8f0ff 0, transparent 40%), radial-gradient(circle at 90% 90%, #fff0cc 0, transparent 45%), var(--paper); }
.auth-card { width: min(420px, 100%); background: #fff; border-radius: 28px; padding: 28px 24px; box-shadow: 0 20px 60px rgba(20,33,61,.1); display: flex; flex-direction: column; gap: 16px; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; }
.wordmark { font-family: var(--display); font-weight: 800; font-size: 2.1rem; line-height: 1; color: var(--ink); }
.wordmark .ur { font-family: var(--urdu); font-size: 1.3rem; color: var(--green); font-weight: 700; margin-inline-start: 6px; }
.auth h1 { font-size: 1.3rem; text-align: center; }
.auth .lead { text-align: center; color: var(--ink-2); font-size: .95rem; }
.btn.google { background: #fff; box-shadow: inset 0 0 0 1.5px var(--line); min-height: 50px; }
.or { display: flex; align-items: center; gap: 10px; color: var(--ink-3); font-size: .85rem; }
.or::before, .or::after { content: ''; flex: 1; border-top: 1px solid var(--line); }
.top-mini { position: fixed; top: 12px; inset-inline-end: 12px; display: flex; gap: 8px; z-index: 30; }
.chip-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 0; background: rgba(255,255,255,.9); box-shadow: 0 2px 0 rgba(20,33,61,.1), inset 0 0 0 1.5px var(--line); font-weight: 700; font-size: .9rem; cursor: pointer; color: var(--ink); text-decoration: none; }
.chip-btn.icon { width: 40px; padding: 0; justify-content: center; }
.gate-q { font-size: 2rem; font-weight: 800; text-align: center; direction: ltr; font-family: var(--ui); }

/* ---------- Kid mode ---------- */
.mode-kid { font-family: var(--display); background: var(--kid-bg); min-height: 100vh; }
html[lang="ur"] .mode-kid { font-family: var(--urdu), var(--display); }
.k-top { display: flex; align-items: center; gap: 10px; padding: 14px 16px 0; }
.k-btn { width: 48px; height: 48px; border-radius: 16px; background: #fff; border: 0; display: grid; place-items: center; box-shadow: 0 4px 0 rgba(20,33,61,.12); cursor: pointer; color: var(--ink); flex: none; text-decoration: none; }
.k-btn:active { transform: translateY(2px); box-shadow: 0 2px 0 rgba(20,33,61,.12); }
.k-pill { display: inline-flex; align-items: center; gap: 6px; height: 44px; padding: 0 14px; border-radius: 99px; background: #fff; font-weight: 800; font-size: 1.15rem; box-shadow: 0 4px 0 rgba(20,33,61,.12); border: 0; cursor: pointer; color: var(--ink); }
.k-pill .ic { color: var(--mango); }
.kid-hero { background: linear-gradient(var(--kid-sky), #eaf7ff); padding-bottom: 22px; border-radius: 0 0 36px 36px; }
.bubble-row { display: flex; align-items: flex-end; gap: 10px; padding: 14px 18px 0; max-width: 720px; margin: 0 auto; }
.bubble { position: relative; background: #fff; border-radius: 22px 22px 22px 6px; padding: 12px 16px; font-size: 1.2rem; font-weight: 700; line-height: 1.3; box-shadow: 0 6px 0 rgba(20,33,61,.07); border: 0; text-align: start; color: var(--ink); cursor: pointer; display: flex; gap: 10px; align-items: center; }
html[dir="rtl"] .bubble { border-radius: 22px 22px 6px 22px; }
html[lang="ur"] .bubble { line-height: 2; font-size: 1.1rem; }
.bubble .ic { color: var(--green); }
.mynah { flex: none; }
.mynah.bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-5px); } }

/* Who is learning */
.picker { max-width: 760px; margin: 0 auto; padding: 22px 18px 120px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; }
.kid-tile { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 20px 12px 16px; border-radius: 28px; background: #fff; box-shadow: 0 6px 0 rgba(20,33,61,.08); text-decoration: none; color: var(--ink); transition: transform .12s; }
.kid-tile:active { transform: translateY(3px); box-shadow: 0 3px 0 rgba(20,33,61,.08); }
.kid-tile b { font-size: 1.4rem; line-height: 1.2; }
.kid-tile .k-stars { display: inline-flex; align-items: center; gap: 4px; font-weight: 800; color: var(--ink-2); }
.kid-tile .k-stars .ic { color: var(--mango); }
.grownups { position: fixed; bottom: calc(18px + var(--safe-b)); inset-inline: 0; display: flex; justify-content: center; }
.grownups a { display: inline-flex; align-items: center; gap: 8px; padding: 10px 18px; border-radius: 99px; background: rgba(255,255,255,.9); box-shadow: inset 0 0 0 1.5px var(--line); color: var(--ink-2); text-decoration: none; font-family: var(--ui); font-weight: 700; font-size: .9rem; }
html[lang="ur"] .grownups a { font-family: var(--urdu); }

/* Journey path */
.journey { max-width: 520px; margin: 0 auto; padding: 18px 18px 60px; }
.j-goal { margin: 22px 0 6px; display: flex; }
.j-flag { display: inline-flex; align-items: center; gap: 8px; padding: 6px 16px; border-radius: 14px; color: #fff; font-weight: 800; font-size: 1.05rem; background: var(--green); box-shadow: 0 4px 0 var(--green-dark); }
.j-flag.c1 { background: var(--sky); box-shadow: 0 4px 0 var(--sky-dark); }
.j-flag.c2 { background: #a46cff; box-shadow: 0 4px 0 #7b48d6; }
.j-flag.done { background: var(--mango); box-shadow: 0 4px 0 var(--mango-dark); color: var(--ink); }
.j-nodes { display: flex; flex-direction: column; }
.j-node { --x: 0px; display: flex; flex-direction: column; align-items: center; gap: 8px; width: 140px; margin: 14px 0 0 calc(50% - 70px + var(--x)); text-decoration: none; color: var(--ink); position: relative; }
html[dir="rtl"] .j-node { margin: 14px calc(50% - 70px - var(--x)) 0 0; }
.j-node:nth-child(4n+2) { --x: 70px; }
.j-node:nth-child(4n+4) { --x: -70px; }
.j-node + .j-node::before { content: ''; position: absolute; top: -18px; left: 50%; width: 6px; height: 16px; margin-left: -3px; border-radius: 3px; background: #e9dfc6; }
.j-dot { width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; background: #fff; color: var(--ink-3); font-size: 1.6rem; font-weight: 800; box-shadow: 0 7px 0 #e1d8c2; transition: transform .1s; }
.j-node:active .j-dot { transform: translateY(4px); box-shadow: 0 3px 0 #e1d8c2; }
.j-node.done .j-dot { background: var(--mango); color: #fff; box-shadow: 0 7px 0 var(--mango-dark); }
.j-node.now .j-dot { width: 100px; height: 100px; background: var(--green); color: #fff; box-shadow: 0 9px 0 var(--green-dark), 0 0 0 10px rgba(31,138,91,.16); animation: pulse 2s ease-in-out infinite; }
.j-label { font-weight: 800; font-size: 1rem; text-align: center; line-height: 1.2; }
html[lang="ur"] .j-label { line-height: 1.8; font-size: .95rem; }
.j-stars { display: flex; gap: 1px; color: var(--mango); margin-top: -4px; }
.j-stars .off { color: #e4dccb; }
@keyframes pulse { 50% { transform: scale(1.04); } }

/* Lesson player */
.player { display: flex; flex-direction: column; height: 100vh; height: 100dvh; max-width: 760px; margin: 0 auto; }
.pl-top { display: flex; align-items: center; gap: 12px; padding: 12px 14px 0; }
.segs { flex: 1; display: flex; gap: 4px; direction: ltr; }
html[dir="rtl"] .segs { direction: rtl; }
.segs i { flex: 1; height: 12px; border-radius: 6px; background: #ece5d3; transition: background .3s; }
.segs i.on { background: var(--mango); }
.segs i.cur { background: var(--green); }
.stage { flex: 1; min-height: 0; margin: 14px 14px 0; border-radius: 30px; position: relative; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 18px 12px 70px;
  background: linear-gradient(var(--kid-sky) 0, #eaf8ff 72%, #bfe8a8 72%, #a6db8c 100%); }
.stage .cloud { position: absolute; background: #fff; border-radius: 40px; opacity: .85; }
.stage .mascot { position: absolute; inset-inline-start: 12px; bottom: 8px; }
.stage .hint-btn { position: absolute; top: 12px; inset-inline-end: 12px; }
.stage.icon-stage { background: linear-gradient(var(--kid-sky), #f3fbff); padding-bottom: 18px; }
.scene { display: flex; flex-direction: column; align-items: center; gap: 12px; z-index: 1; width: 100%; }
.groups { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 10px; }
.group { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 320px; padding: 8px; border-radius: 22px; background: rgba(255,255,255,.55); }
.op { font-size: 2.6rem; font-weight: 800; color: var(--ink); }
.item { position: relative; display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; animation: pop .35s both; }
.item.new { background: rgba(74,168,255,.18); }
.item.gone { opacity: .3; filter: grayscale(1); }
.item.gone::after { content: ''; position: absolute; width: 60px; height: 5px; border-radius: 3px; background: var(--coral); transform: rotate(-35deg); opacity: 1; filter: none; }
.item.lit { transform: translateY(-6px) scale(1.08); transition: transform .2s; }
.item.lit .obj { filter: drop-shadow(0 0 10px rgba(255,176,32,.95)); }
.item .num { position: absolute; top: -10px; inset-inline-end: -8px; min-width: 28px; height: 28px; border-radius: 14px; background: var(--ink); color: #fff; border: 3px solid #fff; display: grid; place-items: center; font-size: .95rem; font-weight: 800; font-family: var(--ui); }
@keyframes pop { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.equation { font-family: var(--display); font-size: 2.8rem; font-weight: 800; letter-spacing: 3px; direction: ltr; color: var(--ink); line-height: 1.1; }
.equation.big { font-size: 3.4rem; color: var(--green-dark); }
.concept-art { animation: bob 2.4s ease-in-out infinite; }
.say { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 20px 0; font-size: 1.5rem; font-weight: 700; line-height: 1.25; text-align: center; }
html[lang="ur"] .say { font-size: 1.35rem; line-height: 2; }
.say .k-btn { width: 40px; height: 40px; border-radius: 12px; }
.pl-bottom { padding: 14px 14px calc(18px + var(--safe-b)); display: flex; gap: 12px; }
.big-btn { flex: 1; min-height: 64px; border-radius: 20px; border: 0; background: var(--green); color: #fff; font-family: inherit; font-size: 1.5rem; font-weight: 800; display: flex; align-items: center; justify-content: center; gap: 10px; box-shadow: 0 6px 0 var(--green-dark); cursor: pointer; text-decoration: none; }
.big-btn:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--green-dark); }
.big-btn.mango { background: var(--mango); color: var(--ink); box-shadow: 0 6px 0 var(--mango-dark); }
.big-btn.white { background: #fff; color: var(--ink); box-shadow: 0 6px 0 rgba(20,33,61,.12); }
.big-btn.pulse { animation: pulse 1.3s ease-in-out infinite; }
.k-sq { width: 64px; min-height: 64px; border-radius: 20px; flex: none; }
.options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 14px 14px 0; direction: ltr; }
@media (max-width: 520px) { .options { grid-template-columns: repeat(2, 1fr); } }
.option, .key { font-family: var(--display); font-size: 2.1rem; font-weight: 800; min-height: 72px; border-radius: 20px; cursor: pointer; background: #fff; color: var(--ink); border: 3px solid #ece5d3; box-shadow: 0 5px 0 #e3dac3; }
.option:active, .key:active { transform: translateY(3px); box-shadow: 0 2px 0 #e3dac3; }
.option.right { background: var(--green); border-color: var(--green); color: #fff; box-shadow: 0 5px 0 var(--green-dark); animation: pop .3s; }
.option.wrong { background: var(--coral-soft); border-color: #f3b9bb; color: #b0272c; box-shadow: none; animation: shake .4s; }
.typed { font-family: var(--display); font-size: 2.4rem; font-weight: 800; min-width: 150px; min-height: 64px; margin: 14px auto 0; padding: 4px 16px; display: grid; place-items: center; border-radius: 20px; background: #fff; border: 3px solid var(--green); direction: ltr; }
.typed.right { background: var(--green); color: #fff; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 12px 14px 0; max-width: 360px; margin: 0 auto; width: 100%; direction: ltr; }
.key { min-height: 58px; font-size: 1.7rem; }
.key.ok { background: var(--green); color: #fff; border-color: var(--green); box-shadow: 0 5px 0 var(--green-dark); display: grid; place-items: center; }
.key.back { display: grid; place-items: center; }
.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }

/* Feedback sheet (slides up from the bottom, like a card on a table) */
.sheet { position: fixed; z-index: 40; inset-inline: 0; bottom: 0; padding: 18px 18px calc(22px + var(--safe-b)); border-radius: 28px 28px 0 0; animation: slideup .25s ease-out; }
.sheet .inner { max-width: 720px; margin: 0 auto; display: flex; align-items: center; gap: 14px; }
.sheet h3 { font-size: 1.6rem; font-weight: 800; }
html[lang="ur"] .sheet h3 { font-size: 1.4rem; line-height: 1.9; }
.sheet p { font-size: 1.1rem; font-weight: 700; }
.sheet.good { background: #dff3e7; color: var(--green-dark); }
.sheet.bad { background: #fde8e8; color: #9b2227; }
@keyframes slideup { from { transform: translateY(100%); } }

/* Explanation overlay and dialogs */
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(20,33,61,.5); display: grid; place-items: center; padding: 16px; animation: fade .2s; }
@keyframes fade { from { opacity: 0; } }
.overlay-card { width: min(680px, 100%); max-height: 94vh; overflow: auto; background: var(--kid-bg); border-radius: 30px; padding-bottom: 16px; display: flex; flex-direction: column; }
.overlay-card .stage { min-height: 300px; flex: none; }
.overlay-card .controls { display: flex; justify-content: center; padding: 14px 16px 0; }
.dialog { background: #fff; border-radius: 22px; padding: 22px; width: min(440px, 100%); display: flex; flex-direction: column; gap: 16px; font-family: var(--ui); box-shadow: 0 20px 60px rgba(20,33,61,.25); }
html[lang="ur"] .dialog { font-family: var(--urdu); }
.dialog p { font-size: 1rem; color: var(--ink); }
.dialog .row { justify-content: flex-end; }

/* Result */
.result { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.result h2 { font-size: 2.2rem; font-weight: 800; }
.result .big-stars { display: flex; gap: 6px; color: var(--mango); }
.result .big-stars .off { color: #eadfc6; }
.result .score { font-size: 1.3rem; font-weight: 700; color: var(--ink-2); }
.confetti { position: fixed; inset: 0; pointer-events: none; overflow: hidden; z-index: 60; }
.confetti i { position: absolute; top: -20px; width: 10px; height: 14px; border-radius: 3px; animation: fall 2.8s linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(600deg); } }

/* Toasts and loading */
.toast { position: fixed; z-index: 70; left: 50%; transform: translateX(-50%); bottom: calc(100px + var(--safe-b)); max-width: min(92vw, 460px); padding: 12px 16px; border-radius: 14px;
  background: var(--ink); color: #fff; font-weight: 600; font-size: .92rem; box-shadow: 0 10px 30px rgba(20,33,61,.25); display: flex; gap: 10px; align-items: center; animation: toastin .2s ease-out; }
.toast.good .ic { color: #7ee2a8; }
.toast.bad { background: #9b2227; }
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
.loading { min-height: 100vh; display: grid; place-items: center; }
.loading .mynah { animation: bob 1.2s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}

/* ---------- Refinements after review ---------- */
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span:first-child { font-weight: 700; font-size: .9rem; display: flex; align-items: center; gap: 6px; }
.p-top h1 { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 1.25rem; }
.list-row .ltr, .list-row b.ltr { overflow-wrap: anywhere; }
@media (max-width: 560px) {
  .setting { flex-wrap: wrap; }
  .setting select, .setting .seg { width: 100%; min-width: 0; }
  .danger-zone .row { flex-direction: column; align-items: stretch; }
}
.j-dot .obj { width: 44px; height: 44px; }
