/* Kelma - Mediterranean limestone, sea blue and luzzu colours */
:root {
  --bg: #FAF5EA; --surface: #FFFFFF; --ink: #1E2A3A; --muted: #5E6B7A; --line: #E6DDCB;
  --sea: #1F5FA8; --sea-dark: #164780; --sun: #F2B705; --sun-dark: #C99600; --coral: #D33F49;
  --good: #1E8A6A; --good-bg: #E3F4EC; --bad: #C2333D; --bad-bg: #FBE6E6;
  --chip: #FFFFFF; --shadow: 0 2px 0 var(--line);
  --radius: 16px;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light dark;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111A26; --surface: #1A2533; --ink: #EEF1F5; --muted: #A2AEBD; --line: #2C3A4C;
  --sea: #4C8FDB; --sea-dark: #346FB3; --sun: #F5C431; --sun-dark: #C99A10; --coral: #F06A72;
  --good: #3FC497; --good-bg: #14332A; --bad: #F2737A; --bad-bg: #3A1D22; --chip: #1F2C3C;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #111A26; --surface: #1A2533; --ink: #EEF1F5; --muted: #A2AEBD; --line: #2C3A4C;
    --sea: #4C8FDB; --sea-dark: #346FB3; --sun: #F5C431; --sun-dark: #C99A10; --coral: #F06A72;
    --good: #3FC497; --good-bg: #14332A; --bad: #F2737A; --bad-bg: #3A1D22; --chip: #1F2C3C;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--ink); -webkit-tap-highlight-color: transparent; }
body { min-height: 100dvh; }
#app { max-width: 560px; margin: 0 auto; min-height: 100dvh; position: relative; }
button { font: inherit; color: inherit; cursor: pointer; }
button:disabled { cursor: default; }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.2; }
p { line-height: 1.5; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.center { text-align: center; }
.err { color: var(--bad); min-height: 1.4em; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }

.ic { display: inline-flex; width: 1.25em; height: 1.25em; vertical-align: -0.25em; }
.ic svg { width: 100%; height: 100%; }
.ic.huge { width: 72px; height: 72px; color: var(--sea); }
.logo { display: inline-flex; }

/* buttons */
.btn { display: block; width: 100%; border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700;
  font-size: 1.02rem; letter-spacing: .02em; margin: 10px 0 0; text-transform: uppercase; }
.btn.primary { background: var(--sea); color: #fff; box-shadow: 0 4px 0 var(--sea-dark); }
.btn.primary:disabled { background: var(--line); color: var(--muted); box-shadow: none; }
.btn.good { background: var(--good); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--good) 70%, #000); }
.btn.bad { background: var(--bad); color: #fff; box-shadow: 0 4px 0 color-mix(in srgb, var(--bad) 70%, #000); }
.btn.ghost { background: transparent; color: var(--sea); box-shadow: none; }
.btn.danger { color: var(--bad); }
.btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }

/* login */
.login, .center-screen { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 32px 24px; text-align: center; gap: 6px; }
.brand { font-size: 2.6rem; letter-spacing: .02em; margin: 12px 0 0; color: var(--sea); }
.tagline { color: var(--muted); margin-top: 0; }
.login-form { width: 100%; max-width: 340px; margin-top: 18px; }
.login-alt, .login > .btn.ghost { width: 100%; max-width: 340px; }
.login { position: relative; }
.lang-switch { position: absolute; top: calc(14px + env(safe-area-inset-top)); right: 16px; display: flex; gap: 4px;
  background: var(--surface); border: 2px solid var(--line); border-radius: 12px; padding: 3px; }
.lang-switch button { border: 0; background: none; padding: 6px 10px; border-radius: 9px; font-weight: 700; font-size: .85rem; color: var(--muted); }
.lang-switch button.sel { background: var(--sea); color: #fff; }
.seg.two { grid-template-columns: 1fr 1fr; }
.login-alt .or { margin: 14px 0 0; }
.btn.secondary { background: var(--surface); color: var(--sea); border: 2px solid var(--line); box-shadow: 0 4px 0 var(--line); }
.brand.small { font-size: 1.8rem; }
.login-form .forgot-link { margin-top: 4px; text-transform: none; font-weight: 600; font-size: .95rem; padding: 8px; }
.hint-line { margin: 0 0 4px; text-align: left; }
.login-form input, input.answer { width: 100%; font: inherit; font-size: 1.05rem; padding: 14px 16px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink); margin-bottom: 10px; }
.login-form input:focus, input.answer:focus { border-color: var(--sea); outline: none; }

/* shell */
.page { padding-bottom: 84px; }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px); border-bottom: 2px solid var(--line); }
.stat { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; font-size: 1.05rem; background: none; border: 0; padding: 6px 8px; border-radius: 10px; }
.stat.streak { color: var(--muted); }
.stat.streak.on { color: #E07B00; }
.stat.hearts { color: var(--coral); }
.stat.hearts.empty { color: var(--muted); }
.stat.goal { color: var(--ink); font-size: .95rem; }
.ring { display: inline-flex; }
.content { padding: 16px; }
.bottomnav { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 560px; z-index: 6;
  display: flex; background: var(--surface); border-top: 2px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.nav-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 10px;
  color: var(--muted); text-decoration: none; font-size: .75rem; font-weight: 700; position: relative; }
.nav-item .ic { width: 26px; height: 26px; }
.nav-item.active { color: var(--sea); }
.badge { position: absolute; top: 4px; left: calc(50% + 6px); background: var(--coral); color: #fff; font-size: .68rem;
  border-radius: 99px; padding: 1px 6px; }
.page-title { font-size: 1.5rem; }

/* path */
.unit-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; background: var(--uc); color: #fff;
  border-radius: var(--radius); padding: 14px 16px; margin: 18px 0 8px; box-shadow: 0 4px 0 color-mix(in srgb, var(--uc) 65%, #000);
  background-image: radial-gradient(circle at 100% 0, rgba(255,255,255,.18) 0 40px, transparent 41px); }
.unit-head small { opacity: .85; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; font-size: .72rem; }
.unit-head h2 { font-size: 1.3rem; margin: 2px 0 0; }
.unit-head p { margin: 0; opacity: .92; }
.guide-btn { display: inline-flex; align-items: center; gap: 6px; background: rgba(255,255,255,.16); border: 2px solid rgba(255,255,255,.4);
  color: #fff; border-radius: 12px; padding: 8px 12px; font-weight: 700; flex-shrink: 0; }
.nodes { display: flex; flex-direction: column; align-items: center; gap: 46px; padding: 40px 0 18px; }
.node-wrap { position: relative; display: flex; flex-direction: column; align-items: center; }
.node { position: relative; width: 74px; height: 74px; border: 0; background: none; padding: 0; display: grid; place-items: center; }
.node .tile { position: absolute; inset: 8px; transform: rotate(45deg); border-radius: 14px; background: var(--uc);
  box-shadow: 4px 4px 0 color-mix(in srgb, var(--uc) 60%, #000);
  background-image: radial-gradient(circle, rgba(255,255,255,.22) 0 6px, transparent 7px),
    linear-gradient(45deg, transparent 46%, rgba(255,255,255,.14) 46% 54%, transparent 54%),
    linear-gradient(-45deg, transparent 46%, rgba(255,255,255,.14) 46% 54%, transparent 54%); }
.node .node-ic { position: relative; color: #fff; }
.node .node-ic .ic { width: 30px; height: 30px; }
.node.locked .tile { background-color: var(--line); background-image: none; box-shadow: 4px 4px 0 color-mix(in srgb, var(--line) 75%, #000); }
.node.locked .node-ic { color: var(--muted); }
.node.done .tile { background-color: var(--sun); box-shadow: 4px 4px 0 var(--sun-dark); }
.node.done .node-ic { color: #5a4300; }
.node.current { animation: bob 2.4s ease-in-out infinite; }
.node.current .tile { outline: 4px solid color-mix(in srgb, var(--uc) 30%, transparent); outline-offset: 6px; }
.node:active .tile { transform: rotate(45deg) translate(2px, 2px); box-shadow: none; }
@keyframes bob { 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .node.current { animation: none; } }
.node-label { font-size: .78rem; color: var(--muted); font-weight: 600; margin-top: 6px; max-width: 120px; text-align: center; }
.bubble { position: absolute; top: -34px; background: var(--surface); color: var(--uc); border: 2px solid var(--line); font-weight: 800;
  font-size: .75rem; letter-spacing: .06em; padding: 4px 10px; border-radius: 10px; white-space: nowrap; z-index: 1; }
.bubble::after { content: ""; position: absolute; left: 50%; bottom: -7px; width: 10px; height: 10px; background: var(--surface);
  border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.unit-done { text-align: center; font-weight: 700; color: var(--good); }
.path-end { text-align: center; margin: 24px 0; }

/* sheets */
.sheet-wrap { position: fixed; inset: 0; z-index: 20; }
.sheet-back { position: absolute; inset: 0; background: rgba(10, 20, 35, .45); opacity: 0; transition: opacity .2s; }
.sheet { position: absolute; left: 50%; bottom: 0; width: 100%; max-width: 560px; max-height: 88dvh; overflow: auto;
  background: var(--surface); border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  transform: translate(-50%, 100%); transition: transform .22s ease-out; }
.sheet-wrap.open .sheet-back { opacity: 1; }
.sheet-wrap.open .sheet { transform: translate(-50%, 0); }
.sheet-unit { color: var(--uc); font-weight: 800; text-transform: uppercase; font-size: .75rem; letter-spacing: .06em; margin-bottom: 4px; }
.tip { background: color-mix(in srgb, var(--sun) 16%, var(--surface)); border-left: 4px solid var(--sun); padding: 12px 14px; border-radius: 10px; }
.hearts-row { display: flex; gap: 6px; justify-content: center; margin: 8px 0; }
.hearts-row .ic { width: 34px; height: 34px; }
.hearts-row .full { color: var(--coral); }
.hearts-row .lost { color: var(--line); }

/* vocab lists */
.vocab { list-style: none; padding: 0; margin: 12px 0; }
.vocab li { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line); }
.vocab li b { min-width: 40%; }
.vocab li span:not(.speak):not(.ic) { color: var(--muted); flex: 1; }
.vocab .miss { color: var(--bad); font-weight: 700; }

/* speaker buttons */
.speak { display: inline-flex; gap: 8px; }
.spk { border: 0; background: var(--sea); color: #fff; border-radius: 10px; width: 36px; height: 36px; display: grid; place-items: center;
  box-shadow: 0 3px 0 var(--sea-dark); flex-shrink: 0; }
.spk .ic { width: 22px; height: 22px; }
.spk.slow { background: var(--surface); color: var(--sea); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); }
.speak.big .spk { width: 76px; height: 76px; border-radius: 20px; }
.speak.big .spk .ic { width: 42px; height: 42px; }
.speak.big .spk.slow { width: 56px; height: 56px; align-self: flex-end; }
.speak.big .spk.slow .ic { width: 30px; height: 30px; }

/* exercise screen */
.exercise { min-height: 100dvh; display: flex; flex-direction: column; }
.ex-top { display: flex; align-items: center; gap: 12px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px; }
.icon-btn { border: 0; background: none; color: var(--muted); padding: 4px; display: grid; }
.icon-btn .ic { width: 28px; height: 28px; }
.pbar { flex: 1; height: 16px; background: var(--line); border-radius: 99px; overflow: hidden; }
.pfill { height: 100%; background: var(--sun); border-radius: 99px; transition: width .35s ease;
  background-image: linear-gradient(to bottom, rgba(255,255,255,.35) 0 35%, transparent 35%); }
.ex-top .stat.hearts.low { animation: pulse 1s infinite; }
.ex-top .stat.hearts.hit { animation: shake .4s; }
@keyframes pulse { 50% { opacity: .55; } }
.tag { background: color-mix(in srgb, var(--sea) 15%, var(--surface)); color: var(--sea); font-weight: 800; font-size: .8rem; padding: 5px 10px; border-radius: 8px; }
.ex-body { flex: 1; padding: 8px 18px 24px; }
.ex-title { font-size: 1.4rem; margin: 10px 0 16px; }
.new-tag { display: inline-block; color: #7A3FB5; font-weight: 800; font-size: .75rem; letter-spacing: .06em; margin-top: 8px; }
.prompt-mt { display: flex; align-items: center; gap: 12px; font-size: 1.9rem; font-weight: 700; margin: 6px 0 22px; }
.prompt-mt.sentence { font-size: 1.35rem; padding: 14px; border: 2px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.prompt-es { font-size: 1.3rem; font-weight: 600; margin: 4px 0 20px; }
.listen-box { display: flex; justify-content: center; margin: 12px 0 26px; }
.options { display: grid; gap: 10px; }
.option { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 14px 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); font-size: 1.08rem; font-weight: 600; }
.option .key { display: grid; place-items: center; width: 26px; height: 26px; border: 2px solid var(--line); border-radius: 8px;
  font-size: .8rem; color: var(--muted); flex-shrink: 0; }
.option.sel { border-color: var(--sea); background: color-mix(in srgb, var(--sea) 10%, var(--surface)); box-shadow: 0 3px 0 var(--sea); color: var(--sea); }
.option.right { border-color: var(--good); background: var(--good-bg); color: var(--good); box-shadow: 0 3px 0 var(--good); }
.option.wrong { border-color: var(--bad); background: var(--bad-bg); color: var(--bad); box-shadow: 0 3px 0 var(--bad); }
input.answer.right { border-color: var(--good); }
input.answer.wrong { border-color: var(--bad); }
/* text box + Maltese letter row as one box */
.type-box { border: 2px solid var(--line); border-radius: 14px; background: var(--surface); overflow: hidden; }
.type-box:focus-within { border-color: var(--sea); }
.type-box input.answer { border: 0; border-radius: 0; margin: 0; background: transparent; padding: 16px; }
.type-box input.answer:focus { outline: none; }
.type-box:has(input.right) { border-color: var(--good); }
.type-box:has(input.wrong) { border-color: var(--bad); }
.sk-label { margin: 8px 2px 0; font-size: .82rem; color: var(--muted); }
.special-keys { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; padding: 8px; border-top: 2px solid var(--line);
  background: color-mix(in srgb, var(--sea) 5%, var(--surface)); }
.sk { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 2px 5px; border-radius: 10px;
  border: 2px solid var(--line); background: var(--surface); box-shadow: 0 3px 0 var(--line); touch-action: manipulation; }
.sk-letter { font-weight: 800; font-size: 1.35rem; line-height: 1.1; color: var(--sea); }
.sk-sound { font-size: .7rem; color: var(--muted); white-space: nowrap; }
.sk:active { transform: translateY(2px); box-shadow: none; }

.build-line { min-height: 112px; display: flex; flex-wrap: wrap; align-content: flex-start; gap: 8px; padding: 10px 0;
  border-bottom: 2px solid var(--line); background-image: linear-gradient(transparent 52px, var(--line) 52px 54px, transparent 54px); margin-bottom: 22px; }
.bank { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.chip { padding: 10px 14px; border-radius: 12px; border: 2px solid var(--line); background: var(--chip); box-shadow: 0 3px 0 var(--line);
  font-size: 1.05rem; font-weight: 600; }
.chip.used { color: transparent; background: var(--line); box-shadow: none; pointer-events: none; }

.match { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mcol { display: grid; gap: 10px; align-content: start; }
.match .option { justify-content: center; text-align: center; min-height: 58px; font-size: 1rem; }
.match .option.paired { opacity: .35; border-color: var(--good); box-shadow: none; }
.shake { animation: shake .4s; border-color: var(--bad) !important; }
@keyframes shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

.ex-foot { position: sticky; bottom: 0; padding: 12px 18px calc(16px + env(safe-area-inset-bottom)); border-top: 2px solid var(--line); background: var(--bg); }
.ex-foot .btn { margin: 0; }
.helpers { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.help-btn { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 2px solid var(--line);
  box-shadow: 0 3px 0 var(--line); border-radius: 12px; padding: 8px 14px; font-weight: 700; color: var(--sea); }
.help-btn.hint { color: var(--sun-dark); }
.help-btn:disabled { opacity: .4; box-shadow: none; }
.help-btn:active:not(:disabled) { transform: translateY(2px); box-shadow: none; }
.option.gone { opacity: .25; text-decoration: line-through; box-shadow: none; }
.feedback.help { background: color-mix(in srgb, var(--sea) 12%, var(--bg)); color: var(--sea); }
.feedback.help .fb-answer { color: var(--sea); }
.feedback { margin: -12px -18px calc(-16px - env(safe-area-inset-bottom)); padding: 16px 18px calc(16px + env(safe-area-inset-bottom)); animation: up .2s ease-out; }
.feedback.ok { background: var(--good-bg); color: var(--good); }
.feedback.no { background: var(--bad-bg); color: var(--bad); }
.feedback p { margin: 4px 0; color: var(--ink); }
.feedback .fb-answer { font-weight: 700; font-size: 1.1rem; color: var(--bad); }
.feedback .fb-meaning { color: var(--muted); }
.fb-row { display: flex; align-items: center; gap: 10px; }
.fb-row h3 { flex: 1; margin: 0; font-size: 1.3rem; }
.fb-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: currentColor; }
.fb-ic .ic { color: #fff; width: 22px; height: 22px; }
.feedback .btn { margin-top: 12px; }
@keyframes up { from { transform: translateY(30px); opacity: 0; } }

/* results */
.result h2 { font-size: 1.7rem; margin-top: 14px; color: var(--sea); }
.streak-msg { color: #E07B00; font-weight: 800; font-size: 1.1rem; display: flex; gap: 6px; align-items: center; }
.result-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; width: 100%; max-width: 380px; margin: 14px 0; }
.rt { border: 2px solid; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; }
.rt small { color: #fff; font-weight: 800; font-size: .72rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px; }
.rt b { padding: 12px 4px; font-size: 1.3rem; background: var(--surface); display: flex; gap: 4px; justify-content: center; align-items: center; }
.rt.xp { border-color: var(--sun-dark); } .rt.xp small { background: var(--sun-dark); }
.rt.acc { border-color: var(--good); } .rt.acc small { background: var(--good); }
.rt.str { border-color: #E07B00; } .rt.str small { background: #E07B00; } .rt.str .ic { color: #E07B00; }
.result .btn { max-width: 380px; }
.center-screen .btn { max-width: 380px; }

/* progress */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.tile-stat { background: var(--surface); border: 2px solid var(--line); border-radius: 14px; padding: 12px; display: grid;
  grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; }
.tile-stat .ic { grid-row: span 2; width: 28px; height: 28px; }
.tile-stat b { font-size: 1.35rem; }
.tile-stat small { color: var(--muted); }
.t-streak .ic, .t-best .ic { color: #E07B00; } .t-xp .ic { color: var(--sun-dark); } .t-words .ic { color: var(--sea); }
.card { background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card h2 { font-size: 1.1rem; }
.chart-wrap { position: relative; }
svg.week { width: 100%; height: auto; display: block; }
svg.week .bar { fill: color-mix(in srgb, var(--sea) 55%, var(--surface)); }
svg.week .bar.today { fill: var(--sea); }
svg.week .axis { stroke: var(--line); stroke-width: 1; }
svg.week .lbl { fill: var(--muted); font-size: 11px; }
svg.week .lbl.strong { fill: var(--ink); font-weight: 700; }
svg.week .val { fill: var(--ink); font-size: 11px; font-weight: 700; }
svg.week .hit { fill: transparent; outline: none; }
.chart-tip { position: absolute; top: 0; transform: translateX(-50%); background: var(--ink); color: var(--bg); font-size: .8rem;
  padding: 4px 8px; border-radius: 6px; pointer-events: none; white-space: nowrap; }
.units-progress { list-style: none; padding: 0; margin: 0; }
.units-progress li { display: grid; grid-template-columns: 1fr 90px 34px; align-items: center; gap: 10px; padding: 6px 0; font-size: .92rem; }
.ubar { height: 10px; background: var(--line); border-radius: 99px; overflow: hidden; }
.ubar span { display: block; height: 100%; background: var(--uc); border-radius: 99px; }
.empty { text-align: center; padding: 40px 10px; }

/* lesson levels (stars) */
.stars { display: inline-flex; gap: 1px; margin-top: 4px; }
.stars .ic { width: 15px; height: 15px; }
.stars .on { color: var(--sun-dark); }
.stars .off { color: var(--line); }
.sheet-level { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); margin: 4px 0 2px; }
.sheet-level .stars { margin: 0; }
.sheet-level .stars .ic { width: 20px; height: 20px; }

/* tap a word to see its meaning */
.gl { position: relative; border: 0; background: none; padding: 0; font: inherit; color: inherit; cursor: pointer;
  border-bottom: 2px dotted color-mix(in srgb, var(--sea) 55%, transparent); }
.gl:disabled { cursor: pointer; opacity: 1; }
.gl-pop { position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg);
  font-size: .82rem; font-weight: 600; padding: 5px 9px; border-radius: 8px; white-space: nowrap; z-index: 5; animation: up .15s ease-out; }
.gl-pop::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--ink); }
.tap-hint { margin: -12px 0 14px; }

/* complete the sentence */
.fill-sentence { line-height: 1.9; }
.fill-text { white-space: normal; }
.blank { display: inline-block; min-width: 4.5em; border-bottom: 3px solid var(--sea); margin: 0 4px; text-align: center; color: var(--sea); }
.blank.filled { background: color-mix(in srgb, var(--sea) 10%, transparent); border-radius: 6px 6px 0 0; padding: 0 6px; }

/* unit intro card */
.tip-card .tip-unit { font-size: 1.6rem; color: var(--uc); margin: 0 0 12px; }
.tip-card .tip { font-size: 1.05rem; line-height: 1.6; }

/* feedback note */
.feedback .fb-note { display: flex; gap: 6px; align-items: flex-start; font-size: .92rem; color: var(--ink);
  background: color-mix(in srgb, var(--sun) 18%, transparent); border-radius: 10px; padding: 8px 10px; margin-top: 8px; }
.feedback .fb-note .ic { color: var(--sun-dark); flex-shrink: 0; }

/* personalisation */
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 800; flex-shrink: 0;
  box-shadow: 0 3px 0 rgba(0,0,0,.18); }
.greeting { display: flex; align-items: center; gap: 12px; margin: 4px 0 6px; }
.greeting p { margin: 0; }
.greeting .hello { font-size: 1.25rem; font-weight: 800; }
.mt { margin-top: 16px; }
.field { width: 100%; font: inherit; font-size: 1rem; padding: 12px 14px; border-radius: 12px; border: 2px solid var(--line);
  background: var(--bg); color: var(--ink); }
.field:focus { border-color: var(--sea); outline: none; }
.inline-form { display: flex; gap: 10px; align-items: stretch; }
.inline-form .field { flex: 1; }
.small-btn { width: auto; margin: 0; padding: 10px 16px; font-size: .9rem; }
.pw-form { display: grid; gap: 10px; }
.pw-form .btn { margin-top: 4px; }
.form-msg { margin: 6px 0 0; min-height: 1.2em; color: var(--bad); font-size: .92rem; }
.form-msg.ok { color: var(--good); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { width: 40px; height: 40px; border-radius: 50%; border: 3px solid transparent; display: grid; place-items: center; color: #fff; }
.swatch.sel { border-color: var(--ink); }
.swatch .ic { width: 20px; height: 20px; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; background: var(--bg); padding: 4px; border-radius: 12px; border: 2px solid var(--line); }
.seg-btn { border: 0; background: none; padding: 9px 4px; border-radius: 9px; font-weight: 700; color: var(--muted); }
.seg-btn.sel { background: var(--surface); color: var(--sea); box-shadow: 0 2px 0 var(--line); }

/* profile */
.profile-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.profile-head h1 { margin: 0; }
.profile-head p { margin: 0; }
.goal-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goal-opts .option { flex-direction: column; align-items: flex-start; gap: 2px; }
.goal-opts small { color: var(--muted); font-weight: 500; }
.switch { display: flex; align-items: center; gap: 12px; font-weight: 600; }
.switch input { width: 22px; height: 22px; accent-color: var(--sea); }
.alphabet { display: grid; grid-template-columns: 48px 1fr; gap: 6px 10px; margin: 0; }
.alphabet dt { font-weight: 800; font-size: 1.15rem; color: var(--sea); }
.alphabet dd { margin: 0; color: var(--muted); align-self: center; }
