/* Parla for the web: the Sole theme ("Parla Theme Directions → 3 · Sole"), as in the Mac app.
   Chunky surfaces: a 2px ink outline and a hard offset shadow. Phone first. */

@font-face { font-family: "Outfit"; font-weight: 500; src: url(fonts/Outfit-500.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Outfit"; font-weight: 600; src: url(fonts/Outfit-600.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Outfit"; font-weight: 700; src: url(fonts/Outfit-700.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "Outfit"; font-weight: 800; src: url(fonts/Outfit-800.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "DM Sans"; font-weight: 400; src: url(fonts/DMSans-400.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "DM Sans"; font-weight: 500; src: url(fonts/DMSans-500.ttf) format("truetype"); font-display: swap; }
@font-face { font-family: "DM Sans"; font-weight: 700; src: url(fonts/DMSans-700.ttf) format("truetype"); font-display: swap; }

:root {
  --paper: #FFFBEF;
  --ink: #1F1A14;
  --muted: #5B5143;
  --sun: #FFC933;
  --track: #F1E6C3;
  --white: #FFFFFF;
  --leaf: #0F5B3A;
  --leaf-light: #DDF3E4;
  --leaf-ink: #0A3F29;
  --leaf-text: #1F3D2D;
  --tomato: #D63A1C;
  --amber: #B7791F;
  --display: "Outfit", system-ui, sans-serif;
  --body: "DM Sans", system-ui, sans-serif;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}
#app { height: 100dvh; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: var(--display); font-weight: 800; letter-spacing: -0.02em; margin: 0 0 8px; line-height: 1.1; }
h1 { font-size: clamp(26px, 6vw, 34px); }
h2 { font-size: 24px; }
h3 { font-size: 19px; font-weight: 700; margin-top: 4px; }
p { margin: 0 0 12px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.lead { font-size: 17px; max-width: 520px; }
.error { color: var(--tomato); font-weight: 500; margin-top: 12px; }
.eyebrow { font-weight: 700; font-size: 13px; color: var(--leaf); margin-bottom: 6px; }
.mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-weight: 600; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
s { text-decoration-color: var(--tomato); text-decoration-thickness: 2px; }

/* ------------------------------------------------------------- buttons */

.btn {
  --fill: var(--tomato); --text: #fff; --depth: 5px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 50px; padding: 0 22px;
  border: 2px solid var(--ink); border-radius: 999px;
  background: var(--fill); color: var(--text);
  font: 700 17px var(--display);
  box-shadow: 0 var(--depth) 0 var(--ink);
  transform: translateY(0);
  transition: transform .08s ease, box-shadow .08s ease, opacity .2s;
  white-space: nowrap;
}
.btn:active:not(:disabled) { transform: translateY(var(--depth)); box-shadow: 0 0 0 var(--ink); }
.btn:disabled { opacity: .45; }
.btn.go { --fill: var(--leaf); }
.btn.sun { --fill: var(--sun); --text: var(--ink); }
.btn.quiet { --fill: var(--white); --text: var(--ink); --depth: 3px; min-height: 44px; font-size: 15px; padding: 0 16px; }
.btn.wide { min-width: 240px; }
.btn.big { min-height: 60px; font-size: 20px; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin: 12px 0; }
.link { background: none; border: 0; padding: 0; color: var(--leaf); font-weight: 700; font-size: 13px; text-decoration: underline; }

.icon-btn {
  width: 44px; height: 40px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white);
  box-shadow: 0 3px 0 var(--ink); font-size: 24px; line-height: 1; display: grid; place-items: center; flex: none;
}
.icon-btn.small { width: 32px; height: 30px; font-size: 14px; border-radius: 10px; }
.icon-btn.ghost { visibility: hidden; }
.round-btn {
  width: 56px; height: 56px; border-radius: 50%; border: 2px solid var(--ink); background: var(--white);
  box-shadow: 0 3px 0 var(--ink); font-size: 22px; display: grid; place-items: center; flex: none;
}
.round-btn.active { background: var(--sun); }
.round-btn:disabled { opacity: .4; }

/* ------------------------------------------------------------- cards and fields */

.card {
  background: var(--white); border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 0 4px 0 var(--ink); padding: 14px 16px; margin-bottom: 12px;
}
.card.note { margin: 16px 0; }
.field {
  width: 100%; min-height: 50px; padding: 0 16px;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--white);
  box-shadow: 0 3px 0 var(--ink); font: 500 17px var(--body); color: var(--ink); outline: none;
}
.field:focus { box-shadow: 0 3px 0 var(--ink), 0 0 0 4px rgba(255, 201, 51, .55); }
.field.big { font-size: 22px; min-height: 60px; margin-top: 8px; }
.field.slim { width: 200px; min-height: 40px; font-size: 15px; }
.field.area { min-height: 120px; padding: 12px 16px; resize: vertical; line-height: 1.4; margin-top: 8px; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; margin-top: 6px;
  border: 1.5px solid var(--ink); border-radius: 999px; background: rgba(255, 201, 51, .5);
  font-weight: 700; font-size: 13px;
}
.pill.out { background: rgba(214, 58, 28, .15); }

/* ------------------------------------------------------------- choices */

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; margin-top: 12px; }
.stack { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.choice {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 0 4px 0 var(--ink);
  transition: transform .1s ease, background .15s;
}
.choice:active { transform: translateY(2px); }
.choice.selected { background: var(--sun); }
.choice-emoji { font-size: 24px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: var(--track); flex: none; }
.choice-text { display: flex; flex-direction: column; min-width: 0; }
.choice-text b { font-family: var(--display); font-weight: 700; font-size: 17px; }
.choice-text small { color: var(--muted); font-size: 13px; }
.check { margin-left: auto; width: 24px; height: 24px; border: 2px solid var(--ink); border-radius: 7px; display: grid; place-items: center; font-weight: 800; flex: none; background: var(--white); }
.choice.selected .check { background: var(--leaf); color: #fff; }
.voice-row { display: flex; gap: 10px; align-items: center; }
.voice-row .choice { flex: 1; }

/* ------------------------------------------------------------- full-page messages */

.center-page {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  padding: 32px var(--gutter); gap: 10px; max-width: 640px; margin: 0 auto; width: 100%;
}
.big-emoji { font-size: 64px; }
.brand { font-size: 40px; }
.key-row { display: flex; gap: 10px; width: 100%; max-width: 480px; margin: 8px 0; }
.key-row .btn { flex: none; min-width: 120px; }
.hello-wrap { height: clamp(64px, 18vw, 96px); overflow: hidden; }
.hello-cycle { display: flex; flex-direction: column; animation: hellos 16s steps(1) infinite; }
.hello-cycle span {
  display: block; height: clamp(64px, 18vw, 96px); overflow: hidden; /* each greeting clips its own descenders */
  font: 800 clamp(56px, 16vw, 88px)/clamp(64px, 18vw, 96px) var(--display); letter-spacing: -0.03em;
}
@keyframes hellos {
  0% { transform: translateY(0); } 12.5% { transform: translateY(-12.5%); } 25% { transform: translateY(-25%); } 37.5% { transform: translateY(-37.5%); }
  50% { transform: translateY(-50%); } 62.5% { transform: translateY(-62.5%); } 75% { transform: translateY(-75%); } 87.5% { transform: translateY(-87.5%); }
}

/* ------------------------------------------------------------- onboarding */

.onb { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.onb-top { display: flex; align-items: center; gap: 14px; padding: 14px var(--gutter) 6px; max-width: 760px; width: 100%; margin: 0 auto; }
.track { flex: 1; height: 14px; border-radius: 999px; background: var(--track); overflow: hidden; }
.track i { display: block; height: 100%; background: var(--leaf); border-radius: 999px; transition: width .4s ease; }
.onb-body { flex: 1; overflow-y: auto; padding: 18px var(--gutter) 24px; max-width: 760px; width: 100%; margin: 0 auto; }
.onb-foot {
  display: flex; justify-content: flex-end; gap: 12px; padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
  border-top: 2px solid var(--track); background: var(--paper); flex-wrap: wrap;
}
.onb-foot .btn.go { min-width: 160px; }
.dots-row { display: flex; gap: 6px; margin-bottom: 14px; }
.dots-row i { width: 10px; height: 10px; border-radius: 50%; background: var(--track); border: 1.5px solid var(--ink); }
.dots-row i.done { background: var(--leaf); }
.dots-row i.now { background: var(--sun); width: 22px; border-radius: 6px; }

.result { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.result .two { width: 100%; text-align: left; }
.result .card { text-align: left; width: 100%; }
.card ul { margin: 6px 0 0; padding-left: 18px; }
.card.good { background: var(--leaf-light); }
.card.work { background: #FFF1C9; }
.card.fixes { background: var(--leaf-light); }
.level-badge {
  width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center;
  background: var(--sun); border: 3px solid var(--ink); box-shadow: 0 5px 0 var(--ink); font: 800 38px var(--display);
}
.level-badge.small { width: 52px; height: 52px; font-size: 19px; border-width: 2px; box-shadow: 0 3px 0 var(--ink); flex: none; }

/* ------------------------------------------------------------- home */

.home { flex: 1; display: flex; flex-direction: column-reverse; min-height: 0; }
.tabs {
  display: flex; justify-content: space-around; background: var(--sun); border-top: 2px solid var(--ink);
  padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
}
.tabs .logo { display: none; }
.tab { display: flex; flex-direction: column; align-items: center; gap: 2px; border: 0; background: none; padding: 6px 12px; border-radius: 14px; min-width: 64px; }
.tab span { font-size: 20px; }
.tab small { font-weight: 700; font-size: 12px; }
.tab.on { background: var(--ink); color: var(--sun); }
.page { flex: 1; overflow-y: auto; padding: 20px var(--gutter) 32px; }
.page > * { max-width: 820px; margin-left: auto; margin-right: auto; }
section { margin: 22px auto 0; }
.hero .hello { font-size: clamp(40px, 11vw, 60px); margin-bottom: 4px; }
.two { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 16px; }
.stat { display: flex; gap: 14px; align-items: center; margin: 0; }
.stat b { display: block; font-family: var(--display); font-weight: 700; }
.stat small { display: block; color: var(--muted); font-size: 13px; }
.ring { --p: 0; width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-size: 20px; flex: none;
  background: radial-gradient(closest-side, var(--white) 70%, transparent 72% 100%), conic-gradient(var(--tomato) calc(var(--p) * 100%), var(--track) 0); border: 2px solid var(--ink); }
.big-num { font: 800 36px var(--display); width: 52px; text-align: center; flex: none; }
.lang-btn {
  display: flex; align-items: center; gap: 10px; width: 100%; max-width: 420px; padding: 12px 16px; font-size: 18px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 0 4px 0 var(--ink); text-align: left;
}
.lang-btn .chev { margin-left: auto; font-weight: 800; }
.lang-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 6px; margin-top: 10px; max-height: 280px; overflow-y: auto; padding: 4px; }
.lang-list button { text-align: left; border: 1.5px solid var(--ink); border-radius: 12px; background: var(--white); padding: 8px 10px; }
.lang-list button.on { background: var(--sun); }
.topics { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.topic {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 12px; text-align: left;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 0 4px 0 var(--ink);
}
.topic span { font-size: 22px; }
.topic b { font-family: var(--display); font-weight: 700; }
.topic small { font-size: 11px; font-weight: 700; color: var(--leaf); }
.topic.selected { background: var(--ink); color: var(--white); }
.topic.selected small { color: var(--sun); }
.settings-card { padding: 4px 16px; }
.toggle-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px; width: 100%; padding: 12px 0;
  border: 0; border-bottom: 1.5px solid var(--track); background: none; text-align: left;
}
.toggle-row:last-child { border-bottom: 0; }
.toggle-row span:first-child { display: flex; flex-direction: column; min-width: 0; }
.toggle-row small { color: var(--muted); font-size: 13px; }
.toggle-row.column { flex-direction: column; align-items: flex-start; }
.switch { width: 50px; height: 30px; border-radius: 999px; border: 2px solid var(--ink); background: var(--track); position: relative; flex: none; transition: background .2s; }
.switch i { position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; border-radius: 50%; background: var(--white); border: 2px solid var(--ink); transition: left .2s; }
.switch.on { background: var(--leaf); }
.switch.on i { left: 22px; }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.seg button { border: 1.5px solid var(--ink); border-radius: 10px; background: var(--white); padding: 5px 10px; font-size: 13px; font-weight: 600; }
.seg button.on { background: var(--leaf); color: #fff; }
.seg.left { justify-content: flex-start; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white); padding: 6px 12px; font-size: 14px; }
.chip.on { background: var(--sun); font-weight: 700; }
.start-row { display: flex; justify-content: center; margin-top: 26px; }
.empty { text-align: center; padding: 40px 0; }
.history-row { display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; margin: 0; }
.h-icon { font-size: 26px; width: 44px; height: 44px; display: grid; place-items: center; background: var(--track); border-radius: 50%; flex: none; }
.h-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.h-text small { color: var(--muted); font-size: 13px; }
.clip { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 14px; }
.chev { font-size: 22px; font-weight: 800; }
.review-head { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.review-head h1 { margin: 0; }
.news { background: var(--leaf-light); margin-top: 14px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 170px; padding-bottom: 8px; }
.bar { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 4px; }
.bar i { display: block; width: 100%; min-height: 3px; background: var(--leaf); border: 1.5px solid var(--ink); border-radius: 8px 8px 3px 3px; }
.bar small { font-size: 10px; color: var(--muted); white-space: nowrap; }
.assess { display: flex; gap: 12px; align-items: center; margin: 0; }
.assess b { display: block; font-size: 14px; }
.assess small { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------- conversation */

.session { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.s-head { display: flex; align-items: center; gap: 12px; padding: 12px var(--gutter); border-bottom: 2px solid var(--track); }
.s-title { display: flex; flex-direction: column; min-width: 0; }
.s-title small { font-weight: 700; color: var(--leaf); font-size: 12px; }
.s-title b { font: 800 20px var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.s-progress { flex: 1; display: flex; align-items: center; gap: 8px; min-width: 0; }
.s-progress small { font-weight: 700; font-size: 12px; white-space: nowrap; }
.s-pill { text-align: center; padding-top: 6px; }
.chat { flex: 1; overflow-y: auto; padding: 16px var(--gutter); display: flex; flex-direction: column; gap: 14px; }
.chat > * { max-width: 760px; width: 100%; margin: 0 auto; }
.chat.review { overflow: visible; padding: 12px 0; }
.msg { display: flex; flex-direction: column; gap: 6px; }
.msg.student { align-items: flex-end; }
.msg.tutor { align-items: flex-start; }
.bubble {
  max-width: min(86%, 560px); padding: 12px 16px; border: 2px solid var(--ink); border-radius: 22px;
  box-shadow: 0 4px 0 var(--ink); font: 600 18px/1.35 var(--body); white-space: pre-wrap; overflow-wrap: anywhere;
}
.bubble.tutor { background: var(--white); border-bottom-left-radius: 6px; }
.bubble.student { background: var(--sun); border-bottom-right-radius: 6px; }
.bubble.typing { align-self: flex-start; }
.english { color: var(--muted); font-size: 14px; margin: 0 4px; max-width: 86%; }
.mini-row { display: flex; gap: 8px; }
.mini { border: 1.5px solid var(--ink); border-radius: 999px; background: var(--white); padding: 4px 12px; font-size: 13px; font-weight: 700; box-shadow: 0 2px 0 var(--ink); }
.fix-card {
  max-width: min(92%, 560px); background: var(--leaf-light); border: 2px solid var(--ink); border-radius: 20px;
  box-shadow: 0 4px 0 var(--ink); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.fix-title { font: 700 15px var(--display); color: var(--leaf-ink); }
.fix-text { margin: 0; font: 700 18px/1.35 var(--body); color: var(--leaf-ink); }
.fix-row { font-size: 15px; color: var(--leaf-text); }
.fix-row small { display: block; color: var(--leaf-text); font-size: 13px; }
.praise { margin: 0; font: 700 15px var(--display); color: var(--leaf); }
.unclear { margin: 0; font-weight: 700; color: var(--amber); font-size: 14px; }
.s-foot { padding: 8px var(--gutter) calc(10px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; align-items: center; gap: 8px; border-top: 2px solid var(--track); }
.status { margin: 0; color: var(--tomato); font-weight: 500; text-align: center; font-size: 14px; max-width: 560px; }
.type-row { display: flex; gap: 8px; width: 100%; max-width: 620px; }
.type-row .btn { flex: none; }
.controls { display: flex; align-items: center; gap: 18px; }
.talk {
  --fill: var(--tomato); --text: #fff;
  display: flex; align-items: center; gap: 12px; min-width: 210px; height: 66px; padding: 0 22px 0 12px;
  border: 2px solid var(--ink); border-radius: 999px; background: var(--fill); color: var(--text);
  box-shadow: 0 5px 0 var(--ink); font: 700 17px var(--display); transition: transform .08s, box-shadow .08s, background .2s;
}
.talk:active:not(:disabled) { transform: translateY(5px); box-shadow: 0 0 0 var(--ink); }
.talk.go { --fill: var(--leaf); }
.talk.sun { --fill: var(--sun); --text: var(--ink); }
.talk.live { animation: breathe 1.6s ease-in-out infinite; }
.talk-icon { width: 44px; height: 44px; border-radius: 50%; background: rgba(255, 255, 255, .92); display: grid; place-items: center; font-size: 20px; color: var(--ink); flex: none; }
.hint { margin: 0; font-size: 12px; color: var(--muted); text-align: center; }
@keyframes breathe { 0%, 100% { box-shadow: 0 5px 0 var(--ink), 0 0 0 0 rgba(15, 91, 58, .35); } 50% { box-shadow: 0 5px 0 var(--ink), 0 0 0 10px rgba(15, 91, 58, 0); } }

.wave { display: inline-flex; align-items: center; gap: 2px; height: 22px; }
.wave i { width: 3px; height: 30%; background: currentColor; border-radius: 2px; transition: height .08s; }
.dots { display: inline-flex; gap: 4px; align-items: center; }
.dots i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; animation: dot 1s infinite ease-in-out; }
.dots i:nth-child(2) { animation-delay: .15s; }
.dots i:nth-child(3) { animation-delay: .3s; }
.dots.big i { width: 12px; height: 12px; }
@keyframes dot { 0%, 100% { transform: translateY(0); opacity: .5; } 40% { transform: translateY(-5px); opacity: 1; } }


/* ------------------------------------------------------------- Today and Learn */

.today-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.chips-row { display: flex; gap: 8px; }
.stat-chip { border: 2px solid var(--ink); border-radius: 999px; background: var(--white); padding: 4px 12px; font: 800 16px var(--display); box-shadow: 0 3px 0 var(--ink); }
.hero-card { padding: 18px; margin-top: 12px; }
.lesson-card { background: var(--sun); }
.lesson-meta { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-weight: 700; font-size: 14px; margin-bottom: 10px; }
.pill-small { border: 1.5px solid var(--ink); border-radius: 999px; padding: 1px 10px; font-size: 12px; font-weight: 700; background: var(--white); white-space: nowrap; }
.lesson-title { font-size: clamp(30px, 8vw, 44px); margin-bottom: 4px; }
.lesson-card .btn { margin-top: 8px; }
.quest { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1.5px solid var(--track); }
.quest:last-child { border-bottom: 0; }
.q-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--track); display: grid; place-items: center; flex: none; font-weight: 800; }
.quest.done .q-icon { background: var(--leaf); color: #fff; }
.q-text { flex: 1; display: flex; flex-direction: column; gap: 6px; }
.q-text .track { height: 10px; }
.quest small { font-weight: 700; color: var(--muted); }
.practice-card { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; margin: 0; width: 100%; }
.practice-card span { font-size: 26px; }
.practice-card b { font-family: var(--display); font-size: 17px; }
.practice-card small { color: var(--muted); font-size: 13px; }
.practice-card:disabled { opacity: .5; }
.talk-card { display: flex; align-items: center; gap: 12px; }
.talk-card div { flex: 1; display: flex; flex-direction: column; }
.big-emoji.small { font-size: 34px; }
h3 small { font: 600 13px var(--body); margin-left: 6px; }
.unit { margin-top: 26px; }
.unit-head { display: flex; gap: 12px; align-items: center; margin-bottom: 4px; }
.unit-head h3 { margin: 0; }
.unit-emoji { font-size: 30px; width: 54px; height: 54px; border-radius: 50%; background: var(--sun); border: 2px solid var(--ink); display: grid; place-items: center; flex: none; }
.lesson-row {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px;
  border: 2px solid var(--ink); border-radius: 18px; background: var(--white); box-shadow: 0 3px 0 var(--ink);
}
.lesson-row:disabled { opacity: .5; box-shadow: none; }
.lesson-row.next { background: var(--sun); }
.l-dot { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--ink); display: grid; place-items: center; flex: none; background: var(--white); font-size: 14px; }
.lesson-row.done .l-dot { background: var(--leaf); color: #fff; }
.l-text { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.l-text b { font-family: var(--display); font-size: 17px; }
.l-text small { color: var(--muted); font-size: 13px; }
.stars { color: var(--amber); font-size: 16px; letter-spacing: 1px; white-space: nowrap; }

/* ------------------------------------------------------------- a lesson */

.lesson { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.l-head { display: flex; align-items: center; gap: 14px; padding: 14px var(--gutter) 6px; max-width: 820px; width: 100%; margin: 0 auto; }
.track.big { height: 16px; }
.combo { font: 800 17px var(--display); color: var(--tomato); white-space: nowrap; }
.xp { font: 800 17px var(--display); white-space: nowrap; }
.l-body { flex: 1; overflow-y: auto; padding: 18px var(--gutter) 28px; }
.l-inner { max-width: 680px; margin: 0 auto; }
.l-inner h1 { margin-bottom: 12px; }
.eyebrow.red { color: var(--tomato); }
.l-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px var(--gutter) calc(14px + env(safe-area-inset-bottom)); border-top: 2px solid var(--track); background: var(--paper);
  transition: background .2s;
}
.l-foot.good { background: var(--leaf-light); border-top-color: var(--leaf); }
.l-foot.bad { background: #FBE2DA; border-top-color: var(--tomato); }
.l-foot .btn { min-width: 150px; margin-left: auto; }
.l-foot .hint { margin-left: auto; font-size: 13px; color: var(--muted); }
.verdict { display: flex; flex-direction: column; min-width: 0; }
.verdict b { font: 800 19px var(--display); }
.l-foot.good .verdict b { color: var(--leaf); }
.l-foot.bad .verdict b { color: var(--tomato); }
.verdict small { font-size: 14px; }
.option {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; min-height: 54px;
  border: 2px solid var(--ink); border-radius: 16px; background: var(--white); box-shadow: 0 3px 0 var(--ink); font-weight: 600; font-size: 17px;
}
.option .key { width: 24px; height: 24px; border: 1.5px solid var(--muted); border-radius: 7px; display: grid; place-items: center; font-size: 12px; color: var(--muted); flex: none; }
.option.right { background: var(--leaf-light); border-color: var(--leaf); }
.option.wrong { background: #FBE2DA; border-color: var(--tomato); }
.option.dim { opacity: .5; }
.pictures { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.picture {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 16px 6px; border: 2px solid var(--ink); border-radius: 18px;
  background: var(--white); box-shadow: 0 4px 0 var(--ink);
}
.picture span { font-size: 40px; }
.picture b { font-family: var(--display); font-weight: 700; font-size: 15px; text-align: center; }
.picture.right { background: var(--leaf-light); }
.picture.wrong { background: #FBE2DA; }
.picture.dim { opacity: .5; }
.word-card { text-align: center; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 4px; }
.w-emoji { font-size: 54px; }
.w-target { font-size: clamp(38px, 10vw, 54px); margin: 0; }
.example { display: flex; align-items: center; gap: 12px; background: var(--leaf-light); }
.example div { flex: 1; display: flex; flex-direction: column; }
.example small { color: var(--muted); }
.listen-row { display: flex; align-items: center; gap: 14px; margin: 10px 0 16px; }
.round-btn.big { width: 76px; height: 76px; font-size: 30px; }
.round-btn.go { background: var(--leaf); color: #fff; }
.revealed { font: 700 19px var(--display); }
.accents { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.built { min-height: 62px; border: 2px dashed var(--muted); border-radius: 16px; padding: 8px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0 14px; }
.tiles { display: flex; flex-wrap: wrap; gap: 8px; }
.tile { border: 2px solid var(--ink); border-radius: 12px; background: var(--white); padding: 8px 14px; font-weight: 700; font-size: 17px; box-shadow: 0 3px 0 var(--ink); }
.tile.ghost { border-color: var(--track); background: var(--track); color: transparent; box-shadow: none; }
.table-card { overflow-x: auto; }
.table-card table { border-collapse: collapse; width: 100%; font-size: 15px; }
.table-card th, .table-card td { border-bottom: 1.5px solid var(--track); padding: 7px 8px; text-align: left; }
.table-card th { font-family: var(--display); }
.example-row { padding: 6px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.gap .blank { display: inline-block; min-width: 80px; border-bottom: 3px solid var(--ink); text-align: center; color: var(--leaf); }
.heard { font: 700 20px var(--display); }
.heard .ok { color: var(--leaf); }
.heard .miss { color: var(--tomato); text-decoration: underline wavy; }
.story { display: flex; flex-direction: column; gap: 10px; margin: 10px 0; }
.s-line { display: flex; align-items: flex-end; gap: 8px; }
.s-line.right { flex-direction: row-reverse; }
.s-line .bubble { display: flex; flex-direction: column; font-size: 17px; }
.s-line .bubble small { font-size: 11px; color: var(--muted); font-weight: 700; }
.s-line .bubble small.en { font-size: 13px; font-weight: 500; margin-top: 2px; }
.who { width: 32px; height: 32px; border-radius: 50%; border: 2px solid var(--ink); background: var(--track); display: grid; place-items: center; font: 800 14px var(--display); flex: none; }
.intro-row { display: flex; gap: 12px; padding: 8px 0; border-bottom: 1.5px solid var(--track); font-size: 20px; }
.intro-row:last-child { border-bottom: 0; }
.intro-row span { display: flex; flex-direction: column; font-size: 15px; }
.intro-row small { color: var(--muted); }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.match-col { display: flex; flex-direction: column; gap: 10px; }
.match-card { min-height: 54px; padding: 8px; border: 2px solid var(--ink); border-radius: 14px; background: var(--white); box-shadow: 0 3px 0 var(--ink); font-weight: 700; font-size: 15px; }
.match-card.picked { background: var(--sun); }
.match-card.done { background: var(--leaf-light); border-color: var(--leaf); opacity: .6; box-shadow: none; }
.match-card.miss { background: #FBE2DA; animation: shake .3s; }
@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.combo-banner {
  position: absolute; left: 50%; bottom: 104px; transform: translateX(-50%); pointer-events: none;
  background: var(--sun); border: 2px solid var(--ink); border-radius: 999px; box-shadow: 0 6px 0 var(--ink);
  padding: 12px 26px; font: 800 26px var(--display); white-space: nowrap;
}
.recap { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.big-stars { font-size: 44px; color: var(--amber); letter-spacing: 6px; }
.big-stars .dim { color: var(--track); }
.xp-big { font: 800 34px var(--display); }
.recap-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; width: 100%; }
.recap-grid .card { margin: 0; display: flex; flex-direction: column; align-items: flex-start; }
.recap-grid b { font: 800 30px var(--display); }
.recap-grid small { color: var(--muted); font-size: 12px; }
.quest-done { background: var(--leaf-light); width: 100%; text-align: left; }
.row.center { justify-content: center; }
.mission-goal { margin: 0; padding: 6px var(--gutter); font-weight: 700; color: var(--tomato); font-size: 14px; text-align: center; }
.settings-title { margin-top: 30px; }
@media (min-width: 760px) { .recap-grid { grid-template-columns: repeat(4, 1fr); } }

/* ------------------------------------------------------------- motion */

.enter { animation: enter .35s cubic-bezier(.2, .8, .3, 1) both; }
.pop { animation: pop .4s cubic-bezier(.3, 1.4, .5, 1) both; }
@keyframes enter { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { opacity: 0; transform: scale(.85); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .enter, .pop, .talk.live, .hello-cycle, .dots i { animation: none; }
}

/* ------------------------------------------------------------- wider screens */

@media (min-width: 760px) {
  :root { --gutter: 32px; }
  .home { flex-direction: row; }
  .tabs { flex-direction: column; justify-content: flex-start; gap: 10px; width: 104px; border-top: 0; border-right: 2px solid var(--ink); padding: 20px 10px; }
  .tabs .logo { display: block; font: 800 22px var(--display); text-align: center; margin-bottom: 12px; }
  .two { grid-template-columns: 1fr 1fr; }
  .topics { grid-template-columns: repeat(4, 1fr); }
  .page { padding-top: 32px; }
}

/* Small phones */
@media (max-width: 400px) {
  .s-head { gap: 8px; }
  .s-progress small { display: none; }
  .controls { gap: 10px; width: 100%; justify-content: center; }
  .talk { min-width: 0; flex: 1; padding-right: 14px; font-size: 15px; }
  .round-btn { width: 48px; height: 48px; font-size: 19px; }
  .bubble { font-size: 17px; }
}
