:root {
  --bg: #fff6e5;
  --card: #ffffff;
  --ink: #2a2733;
  --muted: #7a7386;
  --line: #efe3cc;
  --teal: #12a594;
  --teal-dark: #0c7d70;
  --orange: #ff8a3d;
  --orange-dark: #d96a1f;
  --pink: #ef5da8;
  --pink-dark: #c63f86;
  --yellow: #ffc83d;
  --green: #35b36b;
  --green-soft: #dff5e7;
  --amber-soft: #ffe9c7;
  --red: #e5484d;
  /* Noto Sans Malayalam joins conjuncts the way the textbook prints them.
     The fallbacks are system Malayalam fonts that also join them. */
  --ui: 'Noto Sans Malayalam', 'Noto Sans Devanagari', 'Malayalam Sangam MN', 'Devanagari Sangam MN', 'Nirmala UI', sans-serif;
  --read: var(--ui);
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--ui);
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
}

button,
a {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: 0;
  background: none;
  touch-action: manipulation;
}

button:disabled {
  cursor: default;
  opacity: 0.4;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 3px;
}

#app {
  max-width: 640px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: max(16px, env(safe-area-inset-top)) 16px max(20px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ---------- Home ---------- */

.hero {
  text-align: center;
  padding: 20px 16px 24px;
  border-radius: 32px;
  background: linear-gradient(180deg, #bfeee6 0%, #e4f8f3 70%);
  border: 2px solid #a8e2d8;
}

.hero-emoji {
  font-size: 84px;
  line-height: 1.1;
  animation: bob 3s ease-in-out infinite;
}

.eyebrow {
  margin: 4px 0 0;
  font-weight: 700;
  color: var(--teal-dark);
}

.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.35;
  font-weight: 800;
}

.menu {
  display: grid;
  gap: 14px;
}

.tile {
  --c: var(--teal);
  --d: var(--teal-dark);
  display: grid;
  grid-template-columns: 64px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 16px 18px;
  min-height: 92px;
  border-radius: 26px;
  background: var(--c);
  color: #fff;
  text-decoration: none;
  text-align: left;
  width: 100%;
  box-shadow: 0 6px 0 var(--d);
  transition: transform 0.08s, box-shadow 0.08s;
}

.tile:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--d);
}

.tile-speak {
  --c: var(--orange);
  --d: var(--orange-dark);
}

.tile-games {
  --c: var(--pink);
  --d: var(--pink-dark);
}

.tile-icon {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  font-size: 36px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 20px;
}

.tile b {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
}

.tile small {
  display: block;
  font-size: 15px;
  font-weight: 600;
  opacity: 0.9;
}

.stars {
  font-size: 22px;
  letter-spacing: 2px;
  color: var(--yellow);
  white-space: nowrap;
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.15);
}

.stars .off {
  color: rgba(255, 255, 255, 0.45);
  text-shadow: none;
}

.stars.dark .off {
  color: #e6dcc8;
}

.sticker {
  text-align: center;
  padding: 14px;
  border-radius: 24px;
  background: #fff3c4;
  border: 2px dashed var(--yellow);
  font-weight: 700;
  font-size: 20px;
}

.sticker span {
  font-size: 40px;
  display: block;
}

/* ---------- Top bar ---------- */

.bar {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.bar-left {
  display: flex;
  gap: 8px;
}

.bar h2 {
  margin: 0;
  text-align: center;
  font-size: clamp(16px, 4.6vw, 22px);
  font-weight: 800;
}

.chip {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  font-size: 24px;
  text-decoration: none;
}

.chip svg {
  width: 26px;
  height: 26px;
}

.chip.on {
  background: #d6f5ef;
  border-color: var(--teal);
  box-shadow: 0 3px 0 var(--teal);
}

/* ---------- Reading stage ---------- */

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 22px 16px;
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 32px;
  text-align: center;
  min-height: 300px;
}

.scene {
  font-size: 64px;
  line-height: 1.2;
  letter-spacing: 6px;
}

.sentence {
  margin: 0;
  font-family: var(--read);
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 600;
  line-height: 2;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 6px;
}

.w {
  padding: 0 8px;
  border-radius: 14px;
  font-family: var(--read);
  font-weight: 600;
  line-height: 1.7;
  transition: background 0.12s, transform 0.12s;
}

.w.on {
  background: var(--yellow);
  transform: scale(1.06);
}

.w.picked {
  background: #d6f5ef;
}

.w.good {
  background: var(--green-soft);
  color: #1c7a45;
}

.w.again {
  background: var(--amber-soft);
  color: #a35a00;
  text-decoration: underline wavy var(--orange);
  text-underline-offset: 8px;
}

.meaning {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 16px;
  border-radius: 999px;
  background: #eefaf7;
  color: var(--teal-dark);
  font-weight: 700;
  font-size: 20px;
}

.meaning:empty {
  visibility: hidden;
}

.meaning .en {
  font-family: system-ui, sans-serif;
  font-weight: 600;
  font-size: 17px;
  color: var(--muted);
}

.status {
  min-height: 34px;
  font-weight: 700;
  font-size: 20px;
  color: var(--muted);
}

.status .stars {
  font-size: 34px;
}

.dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
}

.dots i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #e9dcc2;
}

.dots i.done {
  background: var(--teal);
}

.dots i.here {
  background: var(--orange);
  transform: scale(1.3);
}

.controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding-bottom: 6px;
}

.round,
.big {
  --c: var(--card);
  --d: var(--line);
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--c);
  box-shadow: 0 5px 0 var(--d);
  transition: transform 0.08s, box-shadow 0.08s;
}

.round {
  width: 64px;
  height: 64px;
  border: 2px solid var(--line);
}

.big {
  --c: var(--teal);
  --d: var(--teal-dark);
  width: 96px;
  height: 96px;
  color: #fff;
}

.big.mic {
  --c: var(--orange);
  --d: var(--orange-dark);
}

.big.mic.rec {
  --c: var(--red);
  --d: #b0282d;
  animation: pulse 1.1s ease-in-out infinite;
}

.round:active:not(:disabled),
.big:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--d);
}

.round svg {
  width: 30px;
  height: 30px;
}

.big svg {
  width: 46px;
  height: 46px;
}

.spinner {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 5px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  animation: spin 0.8s linear infinite;
}

.cta {
  display: block;
  width: 100%;
  padding: 16px;
  border-radius: 22px;
  background: var(--teal);
  color: #fff;
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  text-decoration: none;
  box-shadow: 0 5px 0 var(--teal-dark);
}

.cta.alt {
  background: var(--card);
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
}

.cta:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--teal-dark);
}

.notice {
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--amber-soft);
  color: #7a4400;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.45;
}

/* ---------- Games ---------- */

.game-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.game-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 18px 10px 14px;
  border-radius: 26px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  text-decoration: none;
  text-align: center;
}

.game-tile:active {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--line);
}

.game-tile .ge {
  font-size: 44px;
  line-height: 1.2;
}

.game-tile b {
  /* Sized so the longest title fits on one line: a word must never be
     broken in the middle of a conjunct. */
  font-size: clamp(15px, 4.5vw, 20px);
  font-weight: 800;
  line-height: 1.5;
}

.game-tile small {
  font-family: system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
}

.progress {
  height: 14px;
  border-radius: 999px;
  background: #eadfc8;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--green);
  transition: width 0.3s;
}

.prompt {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 22px 16px;
  border-radius: 28px;
  background: var(--card);
  border: 2px solid var(--line);
  text-align: center;
}

.prompt-text {
  margin: 0;
  font-family: var(--read);
  font-weight: 700;
  font-size: clamp(26px, 7.5vw, 40px);
  line-height: 1.6;
}

.prompt-text.long {
  font-size: clamp(22px, 6vw, 28px);
}

.options {
  display: grid;
  gap: 12px;
}

.options.pictures {
  grid-template-columns: repeat(3, 1fr);
}

.opt {
  padding: 14px 12px;
  min-height: 72px;
  border-radius: 22px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 5px 0 var(--line);
  font-family: var(--read);
  font-weight: 700;
  font-size: clamp(21px, 5.8vw, 27px);
  line-height: 1.6;
  transition: transform 0.08s, box-shadow 0.08s;
}

.pictures .opt {
  font-size: 54px;
  min-height: 110px;
  line-height: 1.2;
}

.opt:active:not(:disabled) {
  transform: translateY(4px);
  box-shadow: 0 1px 0 var(--line);
}

.opt.right {
  background: var(--green-soft);
  border-color: var(--green);
  box-shadow: 0 5px 0 var(--green);
  opacity: 1;
  animation: pop 0.35s;
}

.opt.wrong {
  background: #f3ece0;
  color: var(--muted);
  box-shadow: none;
  animation: shake 0.3s;
}

.result {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  text-align: center;
}

.result .trophy {
  font-size: 96px;
  animation: pop 0.5s;
}

.result .stars {
  font-size: 54px;
}

.result p {
  margin: 0;
  font-size: 26px;
  font-weight: 800;
}

.stack {
  display: grid;
  gap: 12px;
}

@keyframes bob {
  50% {
    transform: translateY(-6px) rotate(-3deg);
  }
}

@keyframes pulse {
  50% {
    transform: scale(1.08);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes pop {
  40% {
    transform: scale(1.12);
  }
}

@keyframes shake {
  25% {
    transform: translateX(-6px);
  }
  75% {
    transform: translateX(6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}

/* ---------- Lesson index ---------- */

.book-head {
  text-align: center;
  padding: 18px 16px 20px;
  border-radius: 32px;
  background: linear-gradient(180deg, #bfeee6 0%, #e4f8f3 70%);
  border: 2px solid #a8e2d8;
}

.book-head h1 {
  margin: 0;
  font-size: clamp(24px, 7vw, 32px);
  line-height: 1.5;
  font-weight: 800;
}

.lesson-list {
  display: grid;
  gap: 10px;
}

.lesson-row {
  display: grid;
  grid-template-columns: 34px 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 76px;
  padding: 10px 14px;
  border-radius: 22px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  text-decoration: none;
}

a.lesson-row:active {
  transform: translateY(3px);
  box-shadow: 0 1px 0 var(--line);
}

.lesson-row .num {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
  font-size: 17px;
}

.lesson-row .le {
  font-size: 30px;
  line-height: 1;
  text-align: center;
}

.lesson-row .lt b {
  display: block;
  font-size: clamp(17px, 4.8vw, 21px);
  font-weight: 700;
  line-height: 1.5;
}

.lesson-row .lt small {
  display: block;
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.5;
  color: var(--muted);
}

.lesson-row .stars {
  font-size: 18px;
  letter-spacing: 1px;
}

.lesson-row.locked {
  background: #faf2e2;
  box-shadow: none;
  color: #6f6879;
}

.lesson-row.locked .num {
  background: #c9bda6;
}

.lesson-row.locked .le {
  filter: grayscale(1);
  opacity: 0.55;
}

.lesson-row .lock {
  font-size: 20px;
  opacity: 0.7;
}

.hero,
.book-head {
  position: relative;
}

/* z-index keeps the button above the animated emoji, which otherwise
   covers it and swallows the tap. */
.hero-back {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
}

/* ---------- Example line and speaker label ---------- */

.model {
  margin: 0;
  padding: 4px 14px;
  border-radius: 999px;
  background: #eefaf7;
  color: var(--teal-dark);
  font-weight: 600;
  font-size: clamp(16px, 4.6vw, 20px);
  line-height: 1.7;
}

.speaker {
  padding: 2px 16px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #8a4b00;
  font-weight: 700;
  font-size: 18px;
  line-height: 1.7;
}

/* ---------- Who is studying ---------- */

.who {
  display: grid;
  gap: 16px;
}

.who-card {
  --c: var(--teal);
  --d: var(--teal-dark);
  position: relative;
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 30px;
  background: var(--c);
  color: #fff;
  text-decoration: none;
  box-shadow: 0 6px 0 var(--d);
  transition: transform 0.08s, box-shadow 0.08s;
}

.who-card:active {
  transform: translateY(4px);
  box-shadow: 0 2px 0 var(--d);
}

.who-aromal {
  --c: #3f51b5;
  --d: #2c3a8c;
}

.who-face {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  font-size: 52px;
  line-height: 1;
}

.who-card b {
  display: block;
  font-size: 32px;
  font-weight: 800;
  line-height: 1.4;
}

.who-card small {
  display: block;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  font-weight: 600;
  opacity: 0.92;
}

.who-books {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.who-books i {
  padding: 1px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.9;
  white-space: nowrap;
}

.who-stars {
  position: absolute;
  top: 14px;
  right: 16px;
  font-family: system-ui, sans-serif;
  font-size: 15px;
  font-weight: 800;
  color: var(--yellow);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

.bar-gap {
  width: 48px;
}

/* ---------- Aromal's pages: calmer and denser than Kani's ---------- */

:root[data-who='aromal'] {
  --bg: #f3f5fb;
  --ink: #1b2136;
  --muted: #5d667d;
  --line: #dfe4f0;
  --teal: #3f51b5;
  --teal-dark: #2c3a8c;
  /* Latin text in the system font; Malayalam meanings fall through to Noto. */
  --ui: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans Malayalam', sans-serif;
}

[data-who='aromal'] body {
  font-size: 17px;
}

[data-who='aromal'] .hero,
[data-who='aromal'] .book-head {
  background: linear-gradient(160deg, #232b63 0%, #3f51b5 100%);
  border-color: #232b63;
  color: #fff;
}

[data-who='aromal'] .hero-emoji {
  font-size: 56px;
  animation: none;
}

[data-who='aromal'] .eyebrow {
  color: #cdd5ff;
  font-size: 15px;
}

[data-who='aromal'] .hero h1,
[data-who='aromal'] .book-head h1 {
  font-size: clamp(24px, 6.5vw, 30px);
  line-height: 1.25;
}

.hero-sub {
  margin: 4px 0 0;
  font-weight: 600;
  opacity: 0.9;
}

[data-who='aromal'] .lesson-row .lt b {
  line-height: 1.35;
}

[data-who='aromal'] .lesson-row.locked {
  background: #eaedf6;
}

[data-who='aromal'] .lesson-row.locked .num {
  background: #b3bad0;
}

[data-who='aromal'] .stars.dark .off {
  color: #d3d9e8;
}

[data-who='aromal'] .progress {
  background: #dfe4f0;
}

[data-who='aromal'] .tile {
  grid-template-columns: 52px 1fr auto;
  min-height: 74px;
  padding: 12px 16px;
  border-radius: 20px;
  box-shadow: 0 4px 0 var(--d);
}

[data-who='aromal'] .tile-icon {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  font-size: 28px;
}

[data-who='aromal'] .tile b {
  font-size: 20px;
}

[data-who='aromal'] .tile small {
  font-size: 14px;
}

[data-who='aromal'] .tile .stars {
  font-size: 17px;
  letter-spacing: 1px;
}

.t-notes {
  --c: #3f51b5;
  --d: #2c3a8c;
}

.t-time {
  --c: #0e8a7d;
  --d: #0a665c;
}

.t-words {
  --c: #b45309;
  --d: #8a3f06;
}

.t-quiz {
  --c: #b8377a;
  --d: #8f2a5e;
}

.t-exam {
  --c: #5b3fc4;
  --d: #432d96;
}

[data-who='aromal'] .cta {
  padding: 14px;
  border-radius: 16px;
  font-size: 18px;
  box-shadow: 0 4px 0 var(--teal-dark);
}

[data-who='aromal'] .cta.alt {
  box-shadow: 0 4px 0 var(--line);
}

.bigq {
  padding: 14px 18px;
  border-radius: 20px;
  background: var(--card);
  border: 2px solid var(--line);
}

.bigq h3,
.tl-group h3,
.review h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.bigq ol {
  margin: 0;
  padding-left: 22px;
  display: grid;
  gap: 6px;
  font-size: 16px;
  line-height: 1.45;
}

/* Rows: note cards, quiz rounds, exam questions */

.s-list {
  display: grid;
  gap: 10px;
}

.s-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 18px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line);
  text-decoration: none;
}

.s-row:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 var(--line);
}

.s-row .se {
  font-size: 26px;
  line-height: 1;
  text-align: center;
}

.s-row .num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.s-row b {
  display: block;
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.35;
}

.s-row small {
  display: block;
  margin-top: 2px;
  font-size: 13.5px;
  line-height: 1.4;
  color: var(--muted);
}

.s-row .stars {
  font-size: 16px;
  letter-spacing: 1px;
}

.mark {
  font-size: 20px;
  font-weight: 800;
  color: var(--green);
}

.mark.again {
  color: var(--orange-dark);
}

.q-count {
  margin: 0;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--muted);
}

/* A note card, also used for an exam answer */

.note {
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 24px;
  background: var(--card);
  border: 2px solid var(--line);
}

.note-top {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
}

.note-emoji {
  font-size: 40px;
  line-height: 1;
}

.note h3 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
  line-height: 1.3;
}

.note small {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}

.points {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.points li {
  position: relative;
  padding: 10px 12px 10px 30px;
  border-radius: 14px;
  background: var(--bg);
  font-size: 16.5px;
  line-height: 1.5;
  transition: background 0.15s;
}

.points li::before {
  content: '';
  position: absolute;
  left: 12px;
  top: 19px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal);
}

.points li.on {
  background: #fff1b8;
}

.remember,
.extra {
  margin: 0;
  padding: 10px 14px;
  border-radius: 14px;
  border-left: 4px solid var(--yellow);
  background: #fff8dd;
  font-size: 15.5px;
  line-height: 1.5;
}

.extra {
  border-left-color: var(--teal);
  background: #eef1fb;
}

.remember b,
.extra b {
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.exam-q {
  font-size: 19px !important;
  line-height: 1.4 !important;
}

.think {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.5;
}

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Timeline */

.tl {
  margin: 0;
  padding: 0 0 0 14px;
  list-style: none;
  display: grid;
  gap: 8px;
  border-left: 3px solid var(--line);
}

.tl li {
  position: relative;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 16px;
  line-height: 1.4;
}

.tl li::before {
  content: '';
  position: absolute;
  left: -27px;
  top: 12px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--teal);
  border: 4px solid var(--bg);
}

.tl b {
  font-weight: 800;
  color: var(--teal-dark);
  font-variant-numeric: tabular-nums;
}

/* Quiz */

.q-text {
  margin: 0;
  font-size: clamp(19px, 5.2vw, 23px);
  font-weight: 700;
  line-height: 1.4;
}

[data-who='aromal'] .prompt {
  padding: 18px 16px;
  border-radius: 20px;
}

[data-who='aromal'] .options {
  gap: 10px;
}

[data-who='aromal'] .opt {
  min-height: 54px;
  padding: 12px 16px;
  border-radius: 16px;
  box-shadow: 0 3px 0 var(--line);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.4;
  text-align: left;
}

[data-who='aromal'] .opt.right {
  box-shadow: 0 3px 0 var(--green);
}

[data-who='aromal'] .opt.wrong {
  background: #fdecec;
  border-color: var(--red);
  color: var(--ink);
  opacity: 1;
}

.why {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--green-soft);
  font-size: 16px;
  line-height: 1.5;
}

.why.bad {
  background: #fdecec;
}

.why b {
  display: block;
}

[data-who='aromal'] .result {
  flex: none;
  padding: 12px 0;
}

[data-who='aromal'] .result .trophy {
  font-size: 64px;
}

[data-who='aromal'] .result .stars {
  font-size: 40px;
}

.review {
  display: grid;
  gap: 8px;
}

.review-item {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 15.5px;
  line-height: 1.45;
}

.review-item span {
  color: #1c7a45;
  font-weight: 700;
}

.review-item small {
  color: var(--muted);
  font-size: 14.5px;
}

/* Key words */

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--line);
}

.seg a {
  padding: 8px 6px;
  border-radius: 12px;
  text-align: center;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  color: var(--muted);
}

.seg a.on {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(27, 33, 54, 0.15);
}

.flash {
  width: 100%;
  min-height: 260px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 24px 18px;
  border-radius: 24px;
  background: var(--card);
  border: 2px solid var(--line);
  box-shadow: 0 4px 0 var(--line);
  text-align: center;
}

.flash .term {
  font-size: clamp(26px, 7vw, 34px);
  font-weight: 800;
  line-height: 1.3;
}

.flash .mean {
  font-size: 18px;
  line-height: 1.5;
}

/* Malayalam always in Noto Sans Malayalam, which joins conjuncts the way
   they are printed; the system font may not. */
.flash .ml {
  font-family: 'Noto Sans Malayalam', 'Malayalam Sangam MN', 'Nirmala UI', sans-serif;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.9;
  color: var(--teal-dark);
}

.flash .tap {
  font-size: 14.5px;
  color: var(--muted);
}

/* The back button sits on a dark header here: keep its arrow dark, and keep
   the book title clear of it. */
[data-who='aromal'] .chip {
  color: var(--ink);
}

[data-who='aromal'] .book-head {
  padding-top: 24px;
}

[data-who='aromal'] .book-head .eyebrow {
  margin: 0 0 22px;
}

/* Step-by-step sequences (the policy cycle and the like) */

.seq {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.seq li {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
  border: 2px solid var(--line);
  font-size: 15.5px;
  line-height: 1.45;
}

.seq .num {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
}

.seq b {
  display: block;
  font-size: 16.5px;
}

.seq-note {
  margin: 8px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}

.tl-group + .tl-group {
  margin-top: 6px;
}
