* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg, #eefaf9); color: #21322e; min-height: 100vh;
}
button { font-family: inherit; cursor: pointer; }
#app { max-width: 560px; margin: 0 auto; padding: 14px 14px 90px; }
.card { background: #fff; border-radius: 18px; padding: 16px; margin: 12px 0; box-shadow: 0 2px 10px rgba(30,60,50,.08); }
h1 { font-size: 26px; margin: 6px 0; }
h2 { font-size: 20px; margin: 4px 0 10px; }
.big { font-size: 17px; line-height: 1.55; }
.mut { color: #5f7268; }
.btn { display: inline-block; border: none; border-radius: 999px; padding: 13px 22px; font-size: 17px; font-weight: 700; background: var(--accent, #0e7c7b); color: #fff; margin: 6px 4px; }
.btn.secondary { background: #eef3f1; color: #21322e; }
.btn:disabled { opacity: .45; }
.btn.small { padding: 9px 16px; font-size: 15px; }
header.top { display: flex; align-items: center; gap: 10px; }
.pill { background: #fff; border-radius: 999px; padding: 7px 13px; font-weight: 700; box-shadow: 0 1px 5px rgba(30,60,50,.12); font-size: 14px; }
.pill.warn { background: #ffe9a8; }
.pill.rest { background: #ffd9d9; }
.steps { display: flex; flex-direction: column; gap: 10px; }
.step { display: flex; align-items: center; gap: 12px; background: #fff; border-radius: 16px; padding: 13px 14px; box-shadow: 0 2px 8px rgba(30,60,50,.07); border: 3px solid transparent; text-align: left; width: 100%; font-size: 16px; }
.step.next { border-color: var(--accent, #0e7c7b); }
.step.done { opacity: .75; }
.step .n { width: 34px; height: 34px; border-radius: 50%; background: var(--accent, #0e7c7b); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; flex: none; }
.step.done .n { background: #43a35f; }
.step .t { font-weight: 700; }
.opt { display: block; width: 100%; text-align: left; background: #f4f8f7; border: 3px solid #dfe9e6; border-radius: 14px; padding: 13px 15px; font-size: 17px; margin: 8px 0; }
.opt.sel { border-color: var(--accent, #0e7c7b); background: #e8f6f5; }
.opt.right { border-color: #43a35f; background: #eafaf0; }
.opt.wrong { border-color: #e0655f; background: #fdeceb; }
textarea, input[type=text], input[type=number] { width: 100%; font-size: 17px; padding: 12px; border: 3px solid #dfe9e6; border-radius: 12px; font-family: inherit; }
.grid { display: grid; gap: 4px; margin: 12px auto; }
.cell { aspect-ratio: 1; border-radius: 8px; border: 2px solid rgba(0,0,0,.08); display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 800; user-select: none; touch-action: none; }
.badge-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.badge { text-align: center; background: #fff; border-radius: 14px; padding: 10px 4px; font-size: 12px; box-shadow: 0 1px 5px rgba(30,60,50,.08); }
.badge .e { font-size: 26px; }
.badge.off { opacity: .38; filter: grayscale(1); }
.shop { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.reward { background: #fff; border-radius: 16px; padding: 14px; box-shadow: 0 2px 8px rgba(30,60,50,.07); }
.reward .e { font-size: 30px; }
.reward .cost { font-weight: 800; color: var(--accent, #0e7c7b); }
nav.tabs { position: fixed; bottom: 0; left: 0; right: 0; background: #fff; display: flex; justify-content: space-around; padding: 8px 4px calc(8px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 12px rgba(30,60,50,.12); z-index: 10; }
nav.tabs button { background: none; border: none; font-size: 12px; font-weight: 700; color: #5f7268; display: flex; flex-direction: column; align-items: center; gap: 2px; }
nav.tabs button.on { color: var(--accent, #0e7c7b); }
nav.tabs .e { font-size: 21px; }
.confetti { text-align: center; font-size: 34px; }
.matchrow { display: flex; gap: 8px; align-items: center; margin: 8px 0; }
.matchrow .l { flex: 1; font-weight: 700; }
select { font-size: 16px; padding: 10px; border-radius: 10px; border: 3px solid #dfe9e6; flex: 1.2; background: #fff; }
.topicchip { display: inline-block; background: #eef3f1; border-radius: 999px; padding: 8px 13px; margin: 4px; font-weight: 600; border: 3px solid transparent; }
.topicchip.sel { border-color: var(--accent, #0e7c7b); background: #e8f6f5; }
.swatches { display: flex; gap: 10px; flex-wrap: wrap; }
.swatch { width: 52px; height: 52px; border-radius: 50%; border: 4px solid transparent; }
.swatch.sel { border-color: #21322e; }
.progressdots { letter-spacing: 3px; }
.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed #e2ebe8; }
.mascot { width: 110px; height: 110px; }
.small-note { font-size: 13px; color: #5f7268; }
/* ---- CSP-safe styles (style-src 'self' blocks every inline style="") ---- */
.mascot.sm { width: 52px; height: 52px; flex: none; }
.flex1 { flex: 1; }
.hname { font-weight: 800; font-size: 19px; }
.hsub { font-size: 13px; }
.center { text-align: center; }
.setup-top { text-align: center; padding-top: 18px; }
.rest-top { text-align: center; padding-top: 26px; }
.dinner { background: #fff7ea; }
.navrow { margin-top: 14px; }
.wallet-n { font-size: 34px; font-weight: 800; }
.ladder-w { text-align: center; letter-spacing: 4px; font-weight: 800; }
.ans-note { background: #fff7ea; border-radius: 10px; padding: 8px; }
.grid { max-width: 340px; }
.grid.g5 { grid-template-columns: repeat(5, 1fr); }
.grid.g6 { grid-template-columns: repeat(6, 1fr); }
.grid.g7 { grid-template-columns: repeat(7, 1fr); }
.cell.c0 { background: #ffd9d2; } .cell.c1 { background: #d2f0d9; }
.cell.c2 { background: #d2e4ff; } .cell.c3 { background: #fff3b0; }
.cell.c4 { background: #ecd9ff; } .cell.c5 { background: #ffe3f1; }
.cell.c6 { background: #d9f4f0; }
.cell.fixed { background: #e8eef7; }
.cell.plain { background: #fff; }
.cell.onpath { background: #bfe8df; }
/* theme swatches — real colours, one class per theme */
.sw-berry { background: #e75480; } .sw-ocean { background: #0e7c7b; }
.sw-sunny { background: #e8912d; } .sw-grape { background: #7c4dbd; }
.sw-leaf { background: #3d9970; }
/* avatar picker */
.avatars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.avataropt { background: #f4f8f7; border: 3px solid #dfe9e6; border-radius: 16px; padding: 10px 4px 8px; text-align: center; font-weight: 700; font-size: 14px; color: #21322e; }
.avataropt.sel { border-color: var(--accent, #0e7c7b); background: #e8f6f5; }
.avataropt svg { width: 64px; height: 64px; display: block; margin: 0 auto 4px; }
.buddy-big svg { width: 110px; height: 110px; }
/* parent-only helpers (parent.html styles moved here — inline <style> is CSP-blocked too) */
.pinpad { max-width: 300px; margin: 24px auto; text-align: center; }
.pinpad input { text-align: center; font-size: 28px; letter-spacing: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 6px 4px; border-bottom: 1px solid #e8efec; text-align: left; }
.bar { height: 10px; background: #eef3f1; border-radius: 6px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent, #0e7c7b); width: 0; }
.dash-h { font-size: 22px; }
.mt8 { margin-top: 8px; } .mt14 { margin-top: 14px; } .m4 { margin: 4px 0; }
.formcard { background: #f7faf9; }
.inl { display: inline-block; } .w70 { width: 70px; }
.blk { display: block; }
.wauto { width: auto; }
.writing { border-bottom: 1px dashed #e2ebe8; padding: 8px 0; }
.writing p { margin: 4px 0; }
/* per-question feedback cards */
.feedback { border-radius: 14px; padding: 14px; margin: 12px 0; border: 3px solid transparent; }
.feedback.good { background: #eafaf0; border-color: #43a35f; }
.feedback.oops { background: #fff7ea; border-color: #e8912d; }
.fb-head { font-size: 20px; font-weight: 800; margin-bottom: 6px; }
.feedback .kv { border-bottom-color: rgba(30,60,50,.15); }
.pairmark { font-weight: 800; flex: none; font-size: 18px; }
.opt[disabled], select[disabled], input[disabled] { opacity: 1; cursor: default; }
/* glossary tap-a-word */
.gterm { border-bottom: 3px dotted var(--accent, #0e7c7b); cursor: pointer; }
#glosspop { position: fixed; inset: 0; z-index: 40; }
.gloss-back { position: absolute; inset: 0; background: rgba(20,35,30,.38); }
.gloss-sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; margin: 0 auto; background: #fff; border-radius: 22px 22px 0 0; padding: 20px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: 0 -4px 24px rgba(30,60,50,.28); }
.gloss-term { font-size: 22px; font-weight: 800; text-transform: capitalize; margin-bottom: 6px; }
.gloss-x { position: absolute; top: 12px; right: 12px; background: #eef3f1; border: none; border-radius: 50%; width: 38px; height: 38px; font-size: 16px; }
.gloss-ex { background: #fff7ea; border-radius: 10px; padding: 8px 10px; }
/* Ask assistant chat */
.askq { background: #eefaf9; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 17px; }
.aska { background: #fff3d6; border-radius: 14px; padding: 10px 12px; margin: 10px 0; font-size: 17px; white-space: pre-line; }
.askrow { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.askrow input { flex: 1; }
.qchips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 4px; }
.qchip { border: 2px solid var(--accent, #0e7c7b); background: #fff; color: #21322e; border-radius: 999px; padding: 9px 14px; font-size: 16px; font-weight: 600; }
