[hidden] { display: none !important; }
/* Layout: one phone-width "app" column, one task per screen, big tap targets, Devanagari first. */
:root {
  --paper: #EEF5EC; --surface: #FFFFFF; --ink: #1D2140; --muted: #5A6078; --line: #D5E1D2;
  --leaf: #2C8752; --leaf-strong: #1F6B3F; --leaf-soft: #D9EFE0;
  --turmeric: #E9A81C; --turmeric-soft: #FBEDC6;
  --kumkum: #C23B2A; --kumkum-soft: #F7DCD6;
  --sky: #2F6FB3; --sky-soft: #DCE9F7;
  --on-accent: #FFFFFF; --hero-ink: #FFFFFF; --amber-ink: #8A5A00;
  --shadow: 0 2px 0 rgba(29,33,64,.12);
  --f-display: "Baloo 2", "Noto Sans Devanagari", system-ui, sans-serif;
  --f-read: "Noto Sans Devanagari", "Baloo 2", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #12152A; --surface: #1C2038; --ink: #EEF0F8; --muted: #A4A9C2; --line: #2D3352;
    --leaf: #5BC488; --leaf-strong: #7FD6A4; --leaf-soft: #1C3A2B;
    --turmeric: #F4C14E; --turmeric-soft: #3A3119; --kumkum: #F27C66; --kumkum-soft: #3F2220;
    --sky: #7DB2EC; --sky-soft: #1C2D45; --amber-ink: #F4C14E;
    --on-accent: #0F1424; --hero-ink: #0F1424; --shadow: 0 2px 0 rgba(0,0,0,.4); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #12152A; --surface: #1C2038; --ink: #EEF0F8; --muted: #A4A9C2; --line: #2D3352;
  --leaf: #5BC488; --leaf-strong: #7FD6A4; --leaf-soft: #1C3A2B;
  --turmeric: #F4C14E; --turmeric-soft: #3A3119; --kumkum: #F27C66; --kumkum-soft: #3F2220;
  --sky: #7DB2EC; --sky-soft: #1C2D45; --amber-ink: #F4C14E;
  --on-accent: #0F1424; --hero-ink: #0F1424; --shadow: 0 2px 0 rgba(0,0,0,.4); color-scheme: dark;
}
html, body { height: 100%; }
body {
  background: var(--paper); color: var(--ink); font-family: var(--f-display); font-size: 17px; line-height: 1.45;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
}
.app { max-width: 560px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; padding-block: 14px 28px; gap: 16px; }
button { font: inherit; color: inherit; cursor: pointer; }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid var(--turmeric); outline-offset: 2px; }
.deva { font-family: var(--f-read); }
.note { font-size: 13.5px; color: var(--muted); }
.proto-banner { font-size: 12.5px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 10px; padding: 6px 10px; }
h2.sec { margin: 4px 0 -4px; font-size: 22px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h2.sec .deva { font-size: 17px; color: var(--muted); font-weight: 600; }

/* Buttons */
.btn { border: 0; border-radius: 16px; padding: 14px 20px; font-weight: 700; font-size: 19px; background: var(--leaf); color: var(--on-accent); box-shadow: 0 4px 0 var(--leaf-strong); transition: transform .08s; }
.btn:active { transform: translateY(3px); box-shadow: 0 1px 0 var(--leaf-strong); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn.ghost { background: var(--surface); color: var(--ink); box-shadow: 0 3px 0 var(--line); border: 2px solid var(--line); }
.btn.wide { width: 100%; }
.hear { display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 16px; font-weight: 600; }
.hear svg { width: 20px; height: 20px; }
.idk { align-self: center; border: 0; background: transparent; color: var(--muted); font-weight: 700; font-size: 16px; text-decoration: underline; text-underline-offset: 4px; padding: 8px 14px; }

/* Card */
.card { background: var(--surface); border-radius: 22px; padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 14px; }

/* Sign up */
.form { display: flex; flex-direction: column; gap: 12px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.field input, .field select { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 14.5px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.err { color: var(--kumkum); font-size: 14px; font-weight: 600; }

/* Home hero */
.hero { background: var(--leaf); color: var(--hero-ink); border-radius: 24px; padding: 18px; display: flex; gap: 14px; align-items: center; position: relative; overflow: hidden; }
.hero::after { content: "अ आ इ ई क ख ग"; position: absolute; right: -10px; bottom: -18px; font-family: var(--f-read); font-size: 54px; font-weight: 700; opacity: .12; white-space: nowrap; pointer-events: none; }
.hero .parrot { width: 84px; height: 84px; animation: hop 2.8s ease-in-out infinite; }
@keyframes hop { 0%,100% { transform: translateY(0) rotate(0); } 45% { transform: translateY(-6px) rotate(-4deg); } 55% { transform: translateY(-6px) rotate(3deg); } }
.hero h1 { margin: 0; font-size: 28px; line-height: 1.1; }
.hero p { margin: 2px 0 0; font-size: 15px; opacity: .92; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.chip { background: rgba(255,255,255,.2); border-radius: 999px; padding: 2px 10px; font-size: 13.5px; font-weight: 700; font-variant-numeric: tabular-nums; }
:root[data-theme="dark"] .chip { background: rgba(0,0,0,.15); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chip { background: rgba(0,0,0,.15); } }
.parrot { width: 72px; height: 72px; flex: none; }

/* Daily card */
.daily { background: var(--turmeric-soft); border-radius: 24px; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.daily h2 { margin: 0; font-size: 24px; }
.rounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.round-chip { border-radius: 16px; padding: 10px 6px; text-align: center; background: var(--surface); }
.round-chip .sk { font-family: var(--f-read); font-size: 21px; font-weight: 700; display: block; }
.round-chip .en, .round-chip .min { font-size: 13px; color: var(--muted); }
.week { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.week-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.wd { width: 32px; height: 40px; border-radius: 10px; background: var(--surface); display: grid; place-items: center; font-size: 11px; color: var(--muted); }
.wd.lit { background: var(--turmeric); color: var(--ink); }
.wd svg { width: 16px; height: 18px; }
.done-check { font-size: 21px; font-weight: 800; color: var(--leaf-strong); background: var(--leaf-soft); border-radius: 16px; padding: 12px; text-align: center; }

/* Stories shelf */
.shelf { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scroll-snap-type: x mandatory; }
.story-card { flex: 0 0 168px; scroll-snap-align: start; border: 0; border-radius: 20px; padding: 14px; text-align: left; display: flex; flex-direction: column; gap: 4px; min-height: 170px; box-shadow: var(--shadow); }
.story-card .pic { font-size: 46px; line-height: 1.1; }
.story-card .t { font-family: var(--f-read); font-weight: 700; font-size: 19px; line-height: 1.3; }
.story-card .e { font-size: 13.5px; color: var(--muted); }
.story-card .tag { margin-top: auto; font-size: 12px; font-weight: 700; color: var(--muted); }
.tint-leaf { background: var(--leaf-soft); } .tint-tur { background: var(--turmeric-soft); } .tint-kum { background: var(--kumkum-soft); } .tint-sky { background: var(--sky-soft); }
.story-card.locked { opacity: .55; cursor: default; }

/* Two small cards */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mini { background: var(--surface); border-radius: 20px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.mini .lbl { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--leaf-strong); }
.mini .big { font-family: var(--f-read); font-size: 24px; font-weight: 700; line-height: 1.35; }
.mini .forms { display: flex; flex-wrap: wrap; gap: 4px; }
.mini .forms span { font-family: var(--f-read); background: var(--paper); border-radius: 8px; padding: 0 6px; font-size: 15px; }
.mini .mean { font-size: 14px; color: var(--muted); }
.mini .hear { align-self: flex-start; padding: 4px 12px; font-size: 14px; }

/* Play row */
.playrow { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.zt { text-align: left; border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 14px; box-shadow: 0 3px 0 var(--line); display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.zt .t { font-weight: 700; font-size: 18px; }
.zt .d { font-size: 13px; color: var(--muted); }
.zt .g { font-family: var(--f-read); font-size: 28px; font-weight: 600; color: var(--leaf-strong); }
.zt.locked { opacity: .55; cursor: default; }
.zt.locked .g { color: var(--muted); }
.zt.new { border-color: var(--turmeric); box-shadow: 0 3px 0 var(--turmeric); }

/* Links */
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.lk { display: flex; flex-direction: column; gap: 2px; background: var(--surface); border-radius: 16px; padding: 12px 14px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); min-width: 0; }
.lk .n { font-weight: 700; font-size: 16px; display: flex; justify-content: space-between; gap: 6px; }
.lk .n span:last-child { color: var(--muted); }
.lk .w { font-size: 13px; color: var(--muted); }
.lk .u { font-size: 12px; color: var(--sky); overflow-wrap: anywhere; }

/* Session top bar */
.topbar { display: flex; align-items: center; gap: 12px; }
.x { border: 0; background: transparent; font-size: 26px; line-height: 1; color: var(--muted); padding: 4px 6px; }
.prog { flex: 1; display: flex; gap: 6px; }
.seg { flex: 1; height: 14px; border-radius: 999px; background: var(--line); overflow: hidden; }
.seg i { display: block; height: 100%; width: 0; background: var(--leaf); border-radius: 999px; transition: width .3s; }
.pts { font-weight: 700; background: var(--turmeric-soft); padding: 4px 10px; border-radius: 999px; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Task area */
.task { display: flex; flex-direction: column; gap: 16px; flex: 1; }
.round-tag { font-size: 14px; color: var(--leaf-strong); font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.prompt { font-size: 22px; font-weight: 700; margin: 0; text-wrap: balance; line-height: 1.25; }
.big-word { font-family: var(--f-read); font-size: clamp(40px, 12vw, 60px); font-weight: 600; text-align: center; line-height: 1.3; }
.opts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.opt { border: 2px solid var(--line); background: var(--surface); border-radius: 18px; padding: 12px 8px; box-shadow: 0 3px 0 var(--line); font-family: var(--f-read); font-size: 24px; font-weight: 600; min-height: 68px; transition: transform .08s; min-width: 0; overflow-wrap: anywhere; }
.opt:active { transform: translateY(2px); }
.opt.good { border-color: var(--leaf); background: var(--leaf-soft); box-shadow: 0 3px 0 var(--leaf); }
.opt.bad { border-color: var(--kumkum); background: var(--kumkum-soft); box-shadow: 0 3px 0 var(--kumkum); }
.opt[disabled] { cursor: default; }
.opts.circles { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.opts.circles .opt { border-radius: 50%; aspect-ratio: 1; min-height: 0; padding: 0; font-size: clamp(30px, 9vw, 44px); animation: bob 2.6s ease-in-out infinite; }
.opts.circles .opt:nth-child(2) { animation-delay: .4s; } .opts.circles .opt:nth-child(3) { animation-delay: .9s; } .opts.circles .opt:nth-child(4) { animation-delay: 1.3s; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
.opts.pics .opt { font-size: 46px; min-height: 92px; font-family: system-ui, sans-serif; }
.opts.pics { grid-template-columns: repeat(3, 1fr); }
.opts.pics4 { grid-template-columns: repeat(4, 1fr); }
.opts.pics4 .opt { font-size: 38px; min-height: 80px; font-family: system-ui, sans-serif; }
.hint { text-align: center; color: var(--muted); font-size: 15px; margin: 0; }
.center { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }
.sylls { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.syl { font-family: var(--f-read); font-size: 34px; font-weight: 600; border: 2px solid var(--line); background: var(--surface); border-radius: 14px; padding: 6px 16px; box-shadow: 0 3px 0 var(--line); }
.syl.done { background: var(--turmeric-soft); border-color: var(--turmeric); box-shadow: 0 3px 0 var(--turmeric); }
.syl.small { font-size: 24px; padding: 2px 12px; }
.matra-eq { display: flex; align-items: center; justify-content: center; gap: 14px; font-family: var(--f-read); font-size: clamp(48px, 15vw, 76px); font-weight: 600; flex-wrap: wrap; }
.matra-eq .q { color: var(--muted); }
.matra-eq .res { color: var(--leaf-strong); }
.scene { font-size: 54px; text-align: center; line-height: 1; }
.sentence { font-family: var(--f-read); font-size: clamp(23px, 6.6vw, 31px); font-weight: 600; text-align: center; line-height: 1.6; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 10px; }
.blank { display: inline-block; min-width: 110px; border-bottom: 3px dashed var(--muted); color: var(--leaf-strong); }
.base { font-size: 15px; color: var(--muted); text-align: center; }
.base b { font-family: var(--f-read); color: var(--ink); font-size: 20px; }
.en { text-align: center; color: var(--muted); font-size: 16px; }
.slot { display: flex; justify-content: center; align-items: stretch; gap: 8px; flex-wrap: wrap; }
.slot .c { background: var(--surface); border-radius: 16px; padding: 8px 14px; box-shadow: var(--shadow); text-align: center; min-width: 84px; }
.slot .c b { font-family: var(--f-read); font-size: 30px; display: block; line-height: 1.3; }
.slot .c span { font-size: 12.5px; color: var(--muted); }
.slot .plus { align-self: center; font-size: 26px; color: var(--muted); font-weight: 700; }
.slot .c.ans b { color: var(--leaf-strong); }
.tray { min-height: 66px; border-bottom: 2px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 0; align-content: flex-start; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.tile { font-family: var(--f-read); font-size: 23px; font-weight: 600; border: 2px solid var(--line); background: var(--surface); border-radius: 12px; padding: 6px 14px; box-shadow: 0 3px 0 var(--line); }
.tile.used { visibility: hidden; }
.say-words .w { padding: 0 4px; border-radius: 8px; transition: background .15s; }
.say-words .w.on { background: var(--turmeric-soft); box-shadow: 0 0 0 3px var(--turmeric-soft); }

/* Typing */
.typebox { display: flex; flex-direction: column; gap: 8px; }
.typebox input { font: inherit; font-size: 22px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); width: 100%; box-sizing: border-box; font-family: var(--f-read); }
.preview { font-family: var(--f-read); font-size: clamp(34px, 10vw, 48px); font-weight: 600; text-align: center; min-height: 64px; color: var(--leaf-strong); overflow-wrap: anywhere; }
.preview.empty { color: var(--muted); font-size: 18px; font-family: var(--f-display); font-weight: 500; display: grid; place-items: center; }
.keyhelp { background: var(--surface); border-radius: 14px; padding: 10px; overflow-x: auto; }
.keyhelp table { border-collapse: collapse; width: 100%; font-size: 14px; }
.keyhelp td { padding: 3px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.keyhelp td b { font-family: var(--f-read); font-size: 18px; }
.keyhelp code { background: var(--paper); padding: 0 5px; border-radius: 5px; font-size: 14px; }

/* Feedback sheet */
.sheet { position: fixed; left: 0; right: 0; bottom: 0; padding: 16px max(16px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); animation: up .18s ease-out; z-index: 5; }
.sheet .in { max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 10px; }
.sheet.good { background: var(--leaf-soft); } .sheet.bad { background: var(--kumkum-soft); } .sheet.skip { background: var(--sky-soft); }
.sheet h3 { margin: 0; font-size: 24px; font-family: var(--f-read); }
.sheet.good h3 { color: var(--leaf-strong); } .sheet.bad h3 { color: var(--kumkum); } .sheet.skip h3 { color: var(--sky); }
.sheet p { margin: 0; font-size: 16px; }
.sheet .ans { font-family: var(--f-read); font-weight: 700; font-size: 20px; }
.sheet.bad .btn { background: var(--kumkum); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.sheet.skip .btn { background: var(--sky); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
@keyframes up { from { transform: translateY(100%); } to { transform: none; } }
.spacer { height: 180px; flex: none; }

/* Round splash */
.splash { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; animation: pop .35s ease-out; min-height: 300px; }
.splash .n { font-size: 15px; color: var(--muted); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.splash .sk { font-family: var(--f-read); font-size: 64px; font-weight: 700; color: var(--leaf-strong); line-height: 1.1; }
.splash .en { font-size: 20px; color: var(--ink); }
@keyframes pop { from { transform: scale(.85); opacity: .3; } to { transform: none; opacity: 1; } }

/* Done */
.done { align-items: center; text-align: center; position: relative; overflow: hidden; }
.lamp { width: 140px; height: 140px; }
.flame { transform-origin: 60px 58px; animation: flicker 1.6s ease-in-out infinite; }
@keyframes flicker { 0%,100% { transform: scale(1) rotate(-2deg); } 50% { transform: scale(1.06,1.1) rotate(2deg); } }
.done h2 { margin: 0; font-size: 34px; line-height: 1.1; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; }
.stat { background: var(--paper); border-radius: 14px; padding: 10px 6px; }
.stat b { display: block; font-size: 24px; font-variant-numeric: tabular-nums; }
.stat span { font-size: 13px; color: var(--muted); }
.confetti { position: absolute; top: -12px; width: 9px; height: 14px; border-radius: 2px; animation: fall 2.4s ease-in forwards; pointer-events: none; }
@keyframes fall { to { transform: translateY(560px) rotate(540deg); opacity: 0; } }

/* Story reader */
.reader { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.toggle { display: flex; background: var(--surface); border-radius: 999px; padding: 4px; gap: 4px; align-self: center; box-shadow: var(--shadow); }
.toggle button { border: 0; background: transparent; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: 15px; }
.toggle button[aria-pressed="true"] { background: var(--leaf); color: var(--on-accent); }
.page { background: var(--surface); border-radius: 24px; padding: 22px 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 12px; align-items: center; text-align: center; min-height: 280px; justify-content: center; }
.page .pic { font-size: 72px; line-height: 1; }
.page .sa { font-family: var(--f-read); font-size: clamp(23px, 6.5vw, 30px); font-weight: 600; line-height: 1.55; border: 0; background: transparent; padding: 4px; border-radius: 10px; }
.page .sa:hover { background: var(--turmeric-soft); }
.page .enl { font-size: 18px; color: var(--muted); }
.dots { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }
.dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.dots i.on { background: var(--leaf); }
.navrow { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.navrow .btn { padding-left: 10px; padding-right: 10px; }
@media (max-width: 420px) { .navrow .btn { font-size: 17px; } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
@media (max-width: 400px) {
  .opts.circles { grid-template-columns: repeat(2, 1fr); }
  .opts.circles .opt { width: 96px; justify-self: center; }
  .links, .duo { grid-template-columns: 1fr; }
  .row2 { grid-template-columns: 1fr; }
}

/* ===================== App additions (auth, forms, consoles) ===================== */
.topnav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; color: var(--leaf-strong); text-decoration: none; }
.brand .parrot { width: 40px; height: 40px; }
.linkbtn { border: 0; background: transparent; color: var(--sky); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 6px 4px; }
.landing-actions { display: grid; gap: 12px; }
.field textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 10px 12px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); min-height: 80px; }
.field .help { font-size: 13px; color: var(--muted); margin: 4px 0 0; }
.radio-row { display: flex; gap: 10px; flex-wrap: wrap; }
.radio-row label { display: flex; gap: 8px; align-items: center; border: 2px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--surface); font-weight: 600; font-size: 15px; }
.radio-row input { width: 18px; height: 18px; }
fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
legend { font-weight: 800; font-size: 18px; margin-bottom: 4px; padding: 0; }
.ok-msg { color: var(--leaf-strong); font-weight: 700; }
.otp { font-size: 30px !important; letter-spacing: .3em; text-align: center; font-variant-numeric: tabular-nums; }
.wide-app { max-width: 1100px; }
.tabs { display: flex; gap: 6px; flex-wrap: wrap; border-bottom: 2px solid var(--line); padding-bottom: 6px; }
.tabs button { border: 0; background: transparent; padding: 8px 12px; border-radius: 10px; font-weight: 700; color: var(--muted); }
.tabs button[aria-selected="true"] { background: var(--leaf-soft); color: var(--leaf-strong); }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--kumkum); color: #fff; font-size: 12px; text-align: center; margin-left: 4px; }
.tablewrap { overflow-x: auto; background: var(--surface); border-radius: 16px; box-shadow: var(--shadow); }
table.grid { border-collapse: collapse; width: 100%; font-size: 14.5px; font-family: var(--f-display); }
table.grid th, table.grid td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.grid th { font-size: 12.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); white-space: nowrap; }
table.grid td.num { font-variant-numeric: tabular-nums; text-align: right; }
.pill { display: inline-block; border-radius: 999px; padding: 1px 9px; font-size: 12.5px; font-weight: 700; white-space: nowrap; }
.pill.ok { background: var(--leaf-soft); color: var(--leaf-strong); }
.pill.warn { background: var(--turmeric-soft); color: var(--ink); }
.pill.bad { background: var(--kumkum-soft); color: var(--kumkum); }
.pill.info { background: var(--sky-soft); color: var(--sky); }
.reqcard { background: var(--surface); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.reqcard dl { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 0; font-size: 14.5px; }
.reqcard dt { color: var(--muted); }
.reqcard dd { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.sm { font-size: 15px; padding: 8px 14px; border-radius: 12px; }
.btn.danger { background: var(--kumkum); box-shadow: 0 4px 0 rgba(0,0,0,.25); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.inline-input { font: inherit; padding: 8px 10px; border-radius: 10px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); min-width: 0; }
.keychips { display: flex; flex-wrap: wrap; gap: 4px; }
.keychips span { font-family: var(--f-read); background: var(--paper); border-radius: 8px; padding: 0 6px; font-size: 13.5px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: 12px; font-weight: 700; z-index: 20; max-width: calc(100% - 32px); }
.picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.picker button { border: 2px solid var(--line); background: var(--surface); border-radius: 20px; padding: 18px 12px; box-shadow: 0 3px 0 var(--line); font-weight: 800; font-size: 20px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.picker .av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 26px; color: var(--on-accent); background: var(--leaf); }
.footer { text-align: center; font-size: 13px; color: var(--muted); padding-top: 12px; }
.footer a { color: var(--muted); }
.footer .feedback-cta { margin: 0 0 8px; font-size: 15px; color: var(--ink); }
.footer .feedback-cta a { color: var(--leaf-strong); font-weight: 700; display: inline-block; min-height: 32px; line-height: 32px; }

/* Content review (admin) */
.bookgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:12px}
.bookcard{display:flex;gap:10px;background:var(--surface);border-radius:14px;padding:10px;align-items:flex-start}
.bookcard img{width:72px;height:72px;object-fit:cover;border-radius:10px;flex:none}
.rvimg{width:180px;max-width:35%;border-radius:10px}
.rvline{display:grid;gap:4px}
.rvline .sa{font-size:20px}
@media (max-width:600px){.rvimg{max-width:100%;width:100%}}
.rvline textarea{background:var(--surface);color:var(--ink);border:2px solid var(--line);border-radius:10px;width:100%;text-align:left;resize:vertical;font:inherit;line-height:1.5;padding:8px 10px;box-sizing:border-box}
.rvline textarea.sa{font-size:20px}

/* Library */
.books{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:12px}
.book{display:flex;flex-direction:column;gap:6px;background:var(--surface);border:0;border-radius:16px;padding:8px;text-align:left;cursor:pointer;font:inherit;color:inherit;box-shadow:0 2px 0 rgba(0,0,0,.06)}
.book img{width:100%;aspect-ratio:1;object-fit:cover;border-radius:12px}
.book .t{font-size:18px;font-weight:600;line-height:1.3}
.book .tag{font-size:12px;align-self:flex-start;background:var(--paper);border-radius:8px;padding:2px 8px}
.book .tag.ch{background:var(--turmeric-soft)}.book .tag.ok{background:var(--leaf-soft)}
.bookreader .bookpic{width:100%;max-height:340px;object-fit:contain;border-radius:14px;background:#fff}
.bookreader .lines{list-style:none;margin:10px 0 0;padding:0;display:grid;gap:12px;text-align:left}
.bookreader .lines li{background:var(--surface);border-radius:14px;padding:10px 12px}
.bookreader .lines .sa{background:none;border:0;padding:0;font:inherit;font-size:clamp(22px,5.5vw,28px);line-height:1.55;color:var(--ink);text-align:left;cursor:pointer;font-family:'Noto Sans Devanagari',sans-serif}
.bookreader .lrow{display:flex;gap:14px;align-items:center;margin-top:4px}
.bookreader .hear.sm{font-size:14px;padding:4px 10px}
.bookreader .enl{margin-top:6px;font-size:17px;color:var(--muted)}
.bookreader .credit{font-size:12px;text-align:left}

/* Śloka corner */
.versecard{background:var(--surface);border-radius:18px;padding:14px 16px;display:grid;gap:10px}
.versecard .lbl{font-size:13px;color:var(--muted)}
.vlines{font-family:'Noto Sans Devanagari',sans-serif;font-size:clamp(19px,4.6vw,24px);line-height:1.7;color:var(--ink)}
.vlines.big{font-size:clamp(22px,5.5vw,30px);text-align:center;display:grid;gap:6px}
.vline{background:var(--surface);border:0;border-radius:12px;padding:8px;font:inherit;color:inherit;cursor:pointer}
.vline.on{background:var(--turmeric-soft)}
.vmeaning{background:var(--surface);border-radius:14px;padding:10px 14px;text-align:left}
.wchips{display:flex;flex-wrap:wrap;gap:8px}
.wchip{color:inherit;background:var(--surface);border:2px solid var(--line);border-radius:12px;padding:6px 10px;font:inherit;display:grid;gap:2px;cursor:pointer}
.wchip span{font-size:20px;font-family:'Noto Sans Devanagari',sans-serif}
.wchip small{font-size:13px;color:var(--muted)}
.vitem{color:inherit;display:grid;gap:2px;width:100%;text-align:left;background:var(--surface);border:0;border-radius:14px;padding:10px 14px;margin:6px 0;font:inherit;cursor:pointer}
.vitem .deva{font-size:18px}
.gap{display:inline-block;min-width:2.2em;border-bottom:3px solid var(--line);text-align:center;color:var(--muted)}
.gap.cur{border-color:var(--turmeric);color:var(--ink)}
.wedit{display:grid;gap:6px;margin-top:6px}
.wrow{grid-template-columns:1fr 1.4fr}

.todaystory{background:var(--surface);border-radius:18px;padding:14px 16px;display:grid;gap:6px;justify-items:start}
.todaystory .lbl{font-size:13px;color:var(--muted)}
.todaystory b{font-size:22px;font-family:'Noto Sans Devanagari',sans-serif}
.todaystory .btn{display:inline-flex;align-items:center;gap:6px;text-decoration:none}
.todaystory .btn svg{width:18px;height:18px}

/* Level 4 news */
.newscard{background:var(--surface);border-radius:18px;padding:12px;display:grid;gap:8px}
.newscard .vid{position:relative;padding-top:56.25%;border-radius:12px;overflow:hidden;background:#000}
.newscard iframe{position:absolute;inset:0;width:100%;height:100%;border:0}

/* Level 4 classic stories */
.classics{display:grid;grid-template-columns:repeat(auto-fill,minmax(200px,1fr));gap:10px}
.classic{display:grid;gap:4px;text-align:left;background:var(--surface);border:0;border-radius:16px;padding:12px 14px;font:inherit;color:inherit;cursor:pointer;box-shadow:0 2px 0 rgba(0,0,0,.06)}
.classic .t{font-size:20px;font-weight:600;font-family:'Noto Sans Devanagari',sans-serif}
.classic .e{font-size:14px}.classic .tag{font-size:12px;color:var(--muted)}
.classic-reader .lines li.verse{background:var(--turmeric-soft)}
.classic-reader .vtag{font-size:12px;color:var(--amber-ink);background:var(--turmeric-soft);border-radius:6px;padding:1px 6px}
.classic-reader .split{margin-top:6px;font-size:19px;color:var(--leaf-strong);font-family:'Noto Sans Devanagari',sans-serif}

/* Tap-a-word */
.tapwords{margin-top:6px}
.tapwords .wchip{font-size:19px}
.wordcard{flex-basis:100%;background:var(--turmeric-soft);border:2px solid var(--line);border-radius:12px;padding:8px 12px;display:grid;gap:2px;text-align:left}
.wordcard .w{font-size:22px;font-family:'Noto Sans Devanagari',sans-serif}
.wordcard .l{font-size:14px;color:var(--muted)}.wordcard .m{font-size:17px;font-weight:600}.wordcard .g{font-size:13px;color:var(--muted)}

/* Gītā chapter mode */
.chverse{background:var(--surface);border-radius:14px;padding:8px 12px;margin:8px 0;display:grid;gap:4px;position:relative}
.chverse .vno{position:absolute;top:8px;left:-4px;font-size:12px;color:var(--amber-ink);background:var(--turmeric-soft);border-radius:8px;padding:1px 6px}

/* Level 4: writing and plays */
.write .field{display:grid;gap:4px}.write .field input{background:var(--surface);color:var(--ink);font-size:18px;padding:8px 10px;border-radius:10px;border:2px solid var(--line)}
.wlines{list-style:decimal;padding-left:22px;display:grid;gap:10px}
.wline input{background:var(--surface);color:var(--ink);width:100%;font-size:17px;padding:8px 10px;border-radius:10px;border:2px solid var(--line);box-sizing:border-box}
.wprev{font-family:'Noto Sans Devanagari',sans-serif;font-size:21px;min-height:1.4em;color:var(--ink)}
.whints div{font-size:14px;color:var(--amber-ink);background:var(--turmeric-soft);border-radius:8px;padding:4px 8px;margin-top:4px}
.feedback{background:var(--leaf-soft);border-radius:10px;padding:8px 10px;margin-top:6px}
.mini.creative{border:0;cursor:pointer;text-align:left;font:inherit}
.script{list-style:none;padding:0;display:grid;gap:8px}
.script li{background:var(--surface);border-radius:12px;padding:8px 12px;display:grid;gap:4px}
.script li.mine{background:var(--turmeric-soft);border:2px solid var(--turmeric)}
.script li.dir{background:transparent;font-style:italic;color:var(--muted)}
.script .role{font-size:13px;font-weight:700;color:var(--amber-ink)}
.script .sa{font-size:20px;font-family:'Noto Sans Devanagari',sans-serif}

/* Level 5: metre syllables */
.msyl{display:inline-block;padding:0 3px;margin:0 1px;border-radius:6px}
.msyl.on{background:var(--turmeric-soft);outline:2px solid var(--turmeric)}

/* Course map */
.cmlevel summary{cursor:pointer;list-style:revert}
.cmrow{justify-content:space-between;border-top:1px solid var(--line);padding:6px 0;gap:10px}
.cmrow b{min-width:200px}

/* ===================== Phones and tablets (touch screens) ===================== */
/* Room for the iPhone home bar when Shuka is opened from the home screen. */
.app { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0px)); }
/* Every button a child taps is at least 44px, the size Apple and Google recommend for fingers. */
@media (pointer: coarse) {
  .x { min-width: 44px; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
  .hear, .toggle button, .linkbtn { min-height: 44px; }
  .linkbtn { display: inline-flex; align-items: center; }
  .check { align-items: center; min-height: 44px; }
  .check input { width: 24px; height: 24px; margin-top: 0; }
  button, a, input, select, label { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
}
/* No accidental zoom when a child taps a text box on iPhone (Safari zooms below 16px). */
@media (max-width: 600px) { input, select, textarea { font-size: max(16px, 1em); } }

/* Something is speaking: the tapped button (or verse line / word chip) shows it until the sound ends. */
.playing { box-shadow: 0 0 0 3px var(--leaf-soft), 0 0 0 5px var(--leaf); transition: box-shadow .15s; }
.hear.playing { border-color: var(--leaf); background: var(--leaf-soft); color: var(--leaf-strong); box-shadow: none; }
.hear.playing svg, .btn.playing svg { animation: shuka-talk .9s ease-in-out infinite; transform-origin: 30% 50%; }
.btn svg { width: 20px; height: 20px; flex: none; vertical-align: -4px; margin-right: 6px; }
@keyframes shuka-talk { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.22); } }
@media (prefers-reduced-motion: reduce) { .hear.playing svg, .btn.playing svg { animation: none; } }

/* ---------- App-wide navigation (nav.js): top bar, breadcrumbs, menu, search ---------- */
.appbar { position: sticky; top: 0; z-index: 20; max-width: 560px; margin: 0 auto; padding-top: env(safe-area-inset-top, 0px);
  background: var(--paper); border-bottom: 1px solid var(--line); }
body:has(#app.wide-app) .appbar { max-width: 1100px; }
body:has(#app .prog) .appbar { display: none; } /* a practice game is on: it has its own exit button */
.appbar-row { display: flex; align-items: center; gap: 6px; min-height: 52px; }
.appbar-gap { flex: 1; }
.appbar-home { display: inline-flex; align-items: center; gap: 8px; padding: 6px 10px 6px 4px; color: var(--leaf-strong); font-weight: 800; font-size: 20px; text-decoration: none; border-radius: 12px; min-height: 44px; }
.appbar-home svg { width: 24px; height: 24px; }
.appbar-btn { display: inline-flex; align-items: center; gap: 6px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); border-radius: 999px; padding: 6px 12px; font-weight: 700; font-size: 15px; min-height: 44px; }
.appbar-btn svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 380px) { .appbar-btn span { display: none; } .appbar-btn { padding: 6px 10px; } }
.appbar a:focus-visible, .appbar button:focus-visible { outline: 3px solid var(--sky); outline-offset: 2px; }
.crumbs { padding: 0 0 8px; font-size: 14px; }
.crumbs ol { list-style: none; margin: 0; padding: 0; display: flex; gap: 2px; overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.crumbs ol::-webkit-scrollbar { display: none; }
.crumbs li { display: inline-flex; align-items: center; color: var(--muted); }
.crumbs li + li::before { content: '›'; margin: 0 6px; color: var(--muted); }
.crumbs a { color: var(--leaf-strong); font-weight: 700; text-decoration: none; padding: 4px 0; }
.crumbs a:hover { text-decoration: underline; }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; max-width: 60vw; overflow: hidden; text-overflow: ellipsis; }

.navlayer { position: fixed; inset: 0; z-index: 40; }
.navscrim { position: absolute; inset: 0; background: rgba(15, 20, 36, .45); }
body.nav-open { overflow: hidden; }
.drawer { position: absolute; top: 0; right: 0; bottom: 0; width: min(320px, 86vw); background: var(--surface); color: var(--ink);
  padding: calc(12px + env(safe-area-inset-top, 0px)) 16px calc(16px + env(safe-area-inset-bottom, 0px)); overflow-y: auto;
  box-shadow: -8px 0 24px rgba(0,0,0,.18); animation: drawerin .18s ease-out; }
@keyframes drawerin { from { transform: translateX(30px); opacity: .4; } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; font-size: 22px; color: var(--leaf-strong); }
.drawer-who { margin: 0 0 8px; }
.drawer ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.drawer a { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 18px; min-height: 48px; }
.drawer a span { font-size: 22px; width: 28px; text-align: center; }
.drawer a:hover, .drawer a.on { background: var(--leaf-soft); color: var(--leaf-strong); }

.searchbox { position: absolute; left: 50%; transform: translateX(-50%); top: calc(10px + env(safe-area-inset-top, 0px)); width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 20px); display: flex; flex-direction: column; background: var(--surface); color: var(--ink); border-radius: 18px; padding: 12px; box-shadow: 0 12px 32px rgba(0,0,0,.25); }
.searchrow { display: flex; gap: 8px; align-items: center; }
.searchrow input { flex: 1; font: inherit; font-size: 18px; padding: 10px 14px; border: 2px solid var(--line); border-radius: 12px; background: var(--paper); color: var(--ink); min-width: 0; }
.searchrow input:focus { outline: none; border-color: var(--leaf); }
.searchhint { margin: 8px 2px; }
.results { overflow-y: auto; display: grid; gap: 6px; padding: 2px; }
.result { display: grid; grid-template-columns: auto 1fr auto; column-gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--paper); color: var(--ink); text-decoration: none; }
a.result:hover { border-color: var(--leaf); }
.result .rk { grid-row: span 2; font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em; color: var(--leaf-strong); background: var(--leaf-soft); border-radius: 999px; padding: 2px 8px; align-self: start; margin-top: 2px; }
.result .rt { font-family: var(--f-read); font-weight: 700; font-size: 18px; }
.result .rs { grid-column: 2; color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result .rs[lang="sa"] { font-family: var(--f-read); }
.result.word .hear { grid-column: 3; grid-row: 1 / span 2; }

/* Previous / next verse, and the "well done" panel after a book or story. */
.versenav { grid-template-columns: 1fr auto 1fr; align-items: center; margin-top: 4px; }
.versenav .vpos { color: var(--muted); font-size: 14px; text-align: center; }
.btn:disabled { opacity: .45; }
.btn.nudge { animation: nudge 1.4s ease-in-out 3; }
@keyframes nudge { 0%, 100% { transform: none; } 50% { transform: translateY(-3px); box-shadow: 0 7px 0 var(--leaf-strong); } }
.donepanel { background: var(--leaf-soft); border: 2px solid var(--leaf); border-radius: 18px; padding: 14px; text-align: center; display: grid; gap: 10px; }
.donepanel .dp-title { margin: 0; font-size: 21px; font-weight: 800; color: var(--leaf-strong); }
.donepanel .note { margin: 0; }
.donepanel .row { display: grid; gap: 8px; }
@media (prefers-reduced-motion: reduce) { .btn.nudge, .drawer { animation: none; } }
.drawer li { margin: 0; padding: 0; }
