:root {
  --m-ink: #202820;
  --m-muted: #667069;
  --m-line: #dfe6df;
  --m-canvas: #f4f7f2;
  --m-surface: #fff;
  --m-forest: #163c32;
  --m-forest-2: #23624f;
  --m-green: #2f7d54;
  --m-green-soft: #e5f2e9;
  --m-purple: #7447b9;
  --m-purple-dark: #5b329a;
  --m-purple-soft: #f0eafa;
  --m-gold: #d39a24;
  --m-gold-soft: #fff4d7;
  --m-coral: #dc6d55;
  --m-shadow: 0 8px 28px rgba(31, 47, 37, .1);
  /* Exercise feedback. The session needs a right/wrong pair the rest of the
     app never had; both are drawn from the same family as the palette so a
     correct answer reads as the app's green rather than a system green. */
  --m-correct: #2f7d54;
  --m-correct-soft: #e5f2e9;
  --m-correct-line: #9ccbb1;
  --m-wrong: #c2452c;
  --m-wrong-soft: #fdece7;
  --m-wrong-line: #edab97;
}

.m-frame { min-height: 100dvh; margin: 0 auto; background: #f7f3ed; font-family: "DM Sans", sans-serif; }
.m-frame:not(.m-redesigned) { max-width: 480px; padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); }
.m-frame:not(.m-redesigned) > .m-content { padding: 0 20px 100px; }
.m-redesigned { width: 100%; max-width: none; background: var(--m-canvas); color: var(--m-ink); }
.m-redesigned > .m-content { min-height: 100dvh; padding: 0; }
.m-ui-icon { width: 20px; height: 20px; flex: 0 0 auto; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.m-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* Boot splash — shown while the app decides whether a visitor is a returning
   learner (their home) or a newcomer (the landing page). Deliberately quiet: it
   is a held breath, not a screen. */
.m-boot { min-height: 100dvh; display: grid; place-content: center; justify-items: center; gap: 20px; background: var(--m-canvas); }
.m-boot-mark { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: 0 4px 0 #d8a83a; font: 800 25px "Playfair Display", serif; }
.m-boot-spin { width: 22px; height: 22px; border: 2px solid var(--m-line); border-top-color: var(--m-forest); border-radius: 50%; animation: spin .8s linear infinite; }
@media (prefers-reduced-motion: reduce) { .m-boot-spin { animation-duration: 2.4s; } }

.m-app { min-height: 100dvh; background: var(--m-canvas); }
.m-rail { display: none; }
.m-page { min-width: 0; min-height: 100dvh; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.m-topbar { position: sticky; top: 0; z-index: 30; min-height: calc(62px + env(safe-area-inset-top)); padding: env(safe-area-inset-top) 16px 0; border-bottom: 1px solid rgba(208,219,210,.85); display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; background: rgba(244,247,242,.96); backdrop-filter: blur(16px); }
.m-top-brand { justify-self: center; display: flex; align-items: center; gap: 8px; color: var(--m-ink); font: 800 19px "Playfair Display", serif; }
.m-brand-mark { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: 0 3px 0 #d8a83a; font: 800 15px "Playfair Display", serif; }
.m-icon-button { width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: inline-grid; place-items: center; background: transparent; color: var(--m-ink); cursor: pointer; }
.m-icon-button:focus-visible, .m-nav-button:focus-visible, .m-action:focus-visible, .m-trail-node:focus-visible, .m-path-node:focus-visible { outline: 3px solid rgba(116,71,185,.35); outline-offset: 3px; }
.m-top-actions { position: relative; justify-self: end; display: flex; align-items: center; gap: 5px; }
.m-progress-chips { display: flex; align-items: center; gap: 5px; }
.m-chip { min-height: 40px; padding: 0 11px; border: 0; border-radius: 20px; display: inline-flex; align-items: center; gap: 5px; background: var(--m-surface); color: var(--m-ink); font: 700 13px "DM Mono", monospace; white-space: nowrap; }
button.m-chip { cursor: pointer; }
.m-chip .m-ui-icon { width: 18px; height: 18px; }
.m-chip.xp { background: var(--m-purple-soft); color: var(--m-purple-dark); }
.m-chip.streak { background: #fff0e7; color: #b64c31; }
.m-chip.medals { background: var(--m-gold-soft); color: #8b6214; }
.m-developer-menu-wrap { position: relative; }
.m-developer-more { width: 40px; height: 40px; background: white; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-developer-more.active { background: var(--m-forest); color: white; box-shadow: none; }
.m-developer-menu { position: absolute; top: calc(100% + 10px); right: 0; z-index: 70; width: 238px; padding: 7px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; background: white; box-shadow: 0 16px 40px rgba(20,45,34,.18); color: var(--m-ink); }
.m-developer-menu header { padding: 8px 9px 10px; border-bottom: 1px solid var(--m-line); display: grid; gap: 2px; }
.m-developer-menu header strong { font-size: 12px; }
.m-developer-menu header small { color: var(--m-muted); font-size: 9px; }
.m-developer-menu button { min-height: 39px; padding: 0 9px; border: 0; border-radius: 6px; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: transparent; color: var(--m-ink); font-size: 11px; text-align: left; cursor: pointer; }
.m-developer-menu button:hover:not(:disabled), .m-developer-menu button.current { background: var(--m-green-soft); color: var(--m-forest); }
.m-developer-menu button:disabled { opacity: .55; cursor: wait; }
.m-developer-menu button b { color: var(--m-muted); font: 700 9px "DM Mono", monospace; }
.m-developer-menu button.simulate { margin-bottom: 5px; border-bottom: 1px solid var(--m-line); border-radius: 6px 6px 0 0; color: var(--m-purple-dark); }
.m-developer-menu button.simulate b { color: var(--m-purple-dark); }

.m-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; height: calc(68px + env(safe-area-inset-bottom)); padding: 0 8px env(safe-area-inset-bottom); border-top: 1px solid var(--m-line); display: grid; grid-template-columns: repeat(4,1fr); background: rgba(255,255,255,.97); backdrop-filter: blur(16px); }
.m-bottom-nav button { min-width: 0; min-height: 58px; border: 0; display: grid; place-items: center; align-content: center; gap: 3px; background: transparent; color: #7b857e; font-size: 9px; font-weight: 600; cursor: pointer; }
.m-bottom-nav .m-ui-icon { width: 20px; height: 20px; }
.m-bottom-nav button.active { color: var(--m-purple-dark); }

.m-home { width: min(100%, 1160px); margin: 0 auto; padding: 28px 16px 44px; }
.m-secondary-content { width: min(100%,760px); min-height: calc(100dvh - 62px); margin: 0 auto; padding: 28px 16px 90px; }
.m-secondary-content.conversation { display: flex; flex-direction: column; }
.m-welcome { margin-bottom: 24px; }
.m-kicker { display: flex; align-items: center; gap: 8px; color: var(--m-green); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.m-kicker span + span { padding-left: 8px; border-left: 1px solid var(--m-line); color: var(--m-muted); }
.m-welcome h1, .m-section-heading h2, .m-profile-heading h1 { margin: 4px 0 0; font: 800 31px/1.08 "Playfair Display", serif; }
.m-welcome p { margin: 7px 0 0; color: var(--m-muted); font-size: 13px; line-height: 1.45; }
.m-dashboard { display: grid; gap: 24px; }
.m-column { min-width: 0; display: grid; align-content: start; gap: 24px; }
.m-section { min-width: 0; }
.m-section-heading { margin-bottom: 12px; display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.m-section-heading span { color: var(--m-green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.m-section-heading h2 { font-size: 23px; }
.m-section-heading button { min-height: 44px; border: 0; display: inline-flex; align-items: center; gap: 5px; background: transparent; color: var(--m-forest-2); font-size: 11px; font-weight: 700; cursor: pointer; }
.m-section-heading button .m-ui-icon { width: 15px; }

.m-learning-card { width: 100%; min-height: 166px; padding: 20px; border: 0; border-radius: 8px; display: grid; grid-template-columns: 48px minmax(0,1fr) 40px; grid-template-rows: auto auto; align-items: center; gap: 14px; background: var(--m-forest); color: #fff; text-align: left; box-shadow: var(--m-shadow); cursor: pointer; }
.m-learning-icon { width: 48px; height: 48px; border-radius: 8px; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); }
.m-learning-copy { min-width: 0; display: grid; gap: 3px; }
.m-learning-copy small { color: #b4cec3; font-size: 9px; font-weight: 700; text-transform: uppercase; }
.m-learning-copy strong { overflow: hidden; color: white; font: 800 17px "Playfair Display", serif; text-overflow: ellipsis; white-space: nowrap; }
.m-learning-copy span { color: #b4cec3; font-size: 10px; }
.m-learning-play { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,.12); }
.m-learning-progress { grid-column: 1 / -1; display: grid; gap: 7px; }
.m-learning-progress > span { display: flex; justify-content: space-between; color: #c8ddd4; font-size: 9px; }
.m-learning-track { height: 7px; border-radius: 5px; overflow: hidden; background: rgba(255,255,255,.14); }
.m-learning-track i { height: 100%; display: block; border-radius: inherit; background: #f6c65a; }

.m-dictionary-panel { padding: 17px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); box-shadow: 0 3px 14px rgba(31,47,37,.05); }
.m-dictionary-panel.focused { border-color: #d3ad4b; box-shadow: 0 0 0 3px rgba(211,154,36,.16),0 8px 24px rgba(31,47,37,.08); }
.m-dictionary-panel.focused .m-search { border-color: var(--m-gold); box-shadow: 0 0 0 3px rgba(211,154,36,.1); }
.m-segmented { padding: 3px; border-radius: 7px; display: grid; grid-template-columns: repeat(2,1fr); background: #e9eee9; }
.m-segmented button { min-height: 42px; padding: 0 6px; border: 0; border-radius: 5px; background: transparent; color: var(--m-muted); font-size: 10px; font-weight: 700; cursor: pointer; }
.m-segmented button.active { background: white; color: var(--m-forest); box-shadow: 0 2px 7px rgba(31,47,37,.08); }
.m-search { height: 54px; margin-top: 12px; padding: 0 7px 0 14px; border: 2px solid var(--m-line); border-radius: 8px; display: grid; grid-template-columns: 22px minmax(0,1fr) 42px; align-items: center; gap: 7px; background: white; }
.m-search:focus-within { border-color: var(--m-gold); }
.m-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--m-ink); font: 16px "DM Sans", sans-serif; }
.m-search button { width: 42px; height: 42px; border: 0; border-radius: 6px; display: grid; place-items: center; background: var(--m-gold); color: white; cursor: pointer; }
.m-browse { width: 100%; min-height: 58px; margin-top: 10px; padding: 8px 4px; border: 0; border-top: 1px solid var(--m-line); display: grid; grid-template-columns: 38px minmax(0,1fr) 24px; align-items: center; gap: 10px; background: transparent; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-browse > span { min-width: 0; display: grid; gap: 2px; }
.m-browse strong { font-size: 12px; }
.m-browse small { color: var(--m-muted); font-size: 9px; }
.m-dictionary-counts { padding-top: 12px; border-top: 1px solid var(--m-line); display: grid; grid-template-columns: repeat(3,1fr); }
.m-dictionary-counts span { display: grid; gap: 2px; text-align: center; }
.m-dictionary-counts b { color: var(--m-forest-2); font: 700 12px "DM Mono", monospace; }
.m-dictionary-counts small { color: var(--m-muted); font-size: 7px; text-transform: uppercase; }

.m-streak-band { min-height: 82px; padding: 15px 17px; border-radius: 8px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 11px; background: #fff0e7; color: #8f3f2c; }
.m-streak-band .icon { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: #dc6d55; color: white; }
.m-streak-band span { display: grid; }
.m-streak-band small { font-size: 8px; font-weight: 700; text-transform: uppercase; }
.m-streak-band strong { margin-top: 2px; font: 700 15px "DM Mono", monospace; }
.m-tool-grid { display: grid; gap: 8px; }
.m-tool { min-height: 75px; padding: 12px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; grid-template-columns: 44px minmax(0,1fr) 22px; align-items: center; gap: 11px; background: white; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-tool-icon { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; color: white; }
.m-tool.chat .m-tool-icon { background: #2388d8; }
.m-tool.live .m-tool-icon { background: #15978e; }
.m-tool > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.m-tool strong { font-size: 12px; }
.m-tool small { color: var(--m-muted); font-size: 9px; }
.m-word { position: relative; width: 100%; min-height: 154px; padding: 21px; border: 0; border-radius: 8px; overflow: hidden; display: grid; align-content: end; background-color: #37291f; background-image: linear-gradient(90deg,rgba(55,41,31,.96),rgba(55,41,31,.55)), url("assets/culture/capsules-2.jpg"); background-position: center; background-size: cover; color: white; text-align: left; cursor: pointer; }
.m-word small { color: #e2b950; font-size: 8px; font-weight: 700; text-transform: uppercase; }
.m-word strong { margin-top: 5px; font: 800 23px "Playfair Display", serif; }
.m-word b { margin-top: 3px; color: #f0c861; font: italic 600 16px "Playfair Display", serif; }

.m-course-layout { min-height: 100dvh; }
.m-course-level-rail { display: none; }
.m-course-main { min-width: 0; min-height: 100dvh; padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
.m-course-body { width: min(100%, 760px); margin: 0 auto; padding: 28px 16px 80px; }
.m-journey-heading { width: min(100%,680px); margin: 0 auto; padding-bottom: 8px; }
.m-level-kicker { margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.m-level-kicker span { color: var(--m-green); font-size: 12px; font-weight: 700; text-transform: uppercase; }
.m-level-kicker span + span { padding-left: 8px; border-left: 1px solid var(--m-line); color: var(--m-muted); }
.m-journey-heading h1 { margin: 0; font: 800 34px/1.08 "Playfair Display",serif; }
.m-journey-heading > p { max-width: 520px; margin: 8px 0 22px; color: var(--m-muted); font-size: 14px; line-height: 1.55; overflow-wrap: anywhere; }
.m-reward-horizon { min-height: 64px; padding: 10px 10px 10px 12px; border: 1px solid #edd59c; border-radius: 8px; display: grid; grid-template-columns: 42px minmax(0,1fr) auto; align-items: center; gap: 10px; background: var(--m-gold-soft); color: #6e5018; }
.m-reward-horizon.enriched { border-color: var(--m-gold); box-shadow: inset 4px 0 var(--m-gold); }
.m-reward-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f7cf6d; }
.m-reward-icon .m-ui-icon { width: 20px; }
.m-reward-horizon > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
.m-reward-horizon strong { font-size: 13px; }
.m-reward-horizon small { color: #8b6a2b; font-size: 11px; line-height: 1.35; white-space: normal; }
.m-reward-horizon .m-level-challenge { width: auto; min-width: 52px; min-height: 44px; margin: 0; padding: 0 8px; border: 0; display: inline-grid; grid-template-columns: 1fr; background: transparent; color: #6e5018; font-size: 12px; font-weight: 700; cursor: pointer; }

.m-path-wrap { position: relative; width: min(100%,760px); margin: 0 auto; }
.m-path-trail { position: relative; }
.m-path-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; }
.m-path-base, .m-path-progress { fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 12; }
.m-path-base { stroke: #d6dfd7; stroke-dasharray: 2 20; }
.m-path-progress { stroke: #7ab08c; transition: stroke-dasharray 500ms ease; }
.m-path-item { position: absolute; left: var(--x); top: var(--y); z-index: 2; transform: translate(-50%,-50%); }
.m-path-node { position: relative; width: 76px; height: 76px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--m-purple); color: white; box-shadow: 0 7px 0 var(--m-purple-dark),0 14px 28px rgba(91,50,154,.26); cursor: pointer; transition: transform 160ms ease,box-shadow 160ms ease; }
.m-path-node:hover:not(:disabled) { transform: translateY(-2px); }
.m-path-node .m-ui-icon { width: 29px; height: 29px; stroke-width: 2.2; }
.m-path-node.completed { background: var(--m-green); box-shadow: 0 7px 0 #1e6040,0 13px 24px rgba(42,73,56,.2); }
.m-path-node.current { animation: m-current-pulse 2.4s ease-in-out infinite; }
.m-path-item.just-completed .m-path-node.completed { animation: m-developer-complete 720ms cubic-bezier(.2,.9,.25,1.25) both; }
.m-path-item.just-unlocked .m-path-node.current { animation: m-developer-unlock 680ms cubic-bezier(.2,.9,.25,1.18) both,m-current-pulse 2.4s ease-in-out 680ms infinite; }
.m-path-node.locked { background: #e2e7e2; color: #929c95; box-shadow: 0 7px 0 #cbd3cc; cursor: default; }
.m-path-node.elargir-passed { box-shadow: 0 0 0 3px var(--m-canvas),0 0 0 8px #e0ad39,0 9px 0 8px #a97815,0 18px 28px rgba(112,77,10,.24); }
.m-path-node.reward { width: 64px; height: 64px; background: var(--m-gold); color: white; box-shadow: 0 6px 0 #a97713,0 12px 22px rgba(179,128,25,.2); }
.m-path-node.reward.available { animation: m-reward-bounce 1.8s ease-in-out infinite; }
.m-path-node.reward.locked { background: #e4e7e3; color: #a2aaa4; box-shadow: 0 6px 0 #cdd2ce; }
.medal-1 { --medal-face:#2f7d54; --medal-edge:#18563a; }
.medal-2 { --medal-face:#dc6d55; --medal-edge:#a94936; }
.medal-3 { --medal-face:#7447b9; --medal-edge:#4f2a8d; }
.medal-4 { --medal-face:#347b82; --medal-edge:#20565c; }
.medal-5 { --medal-face:#c48a18; --medal-edge:#8e5f09; }
.medal-6 { --medal-face:#163c32; --medal-edge:#08271f; }
.m-path-node.reward.milestone { width: 80px; height: 80px; border: 5px solid #ffe5a0; background: var(--medal-face); color: white; box-shadow: 0 7px 0 var(--medal-edge),0 15px 28px rgba(67,50,15,.24); }
.m-path-node.reward.milestone.available { animation: m-milestone-pulse 1.9s ease-in-out infinite; }
.m-path-node.reward.milestone.locked { border-color: #eef0ed; background: #d9ded9; color: #8b948e; box-shadow: 0 7px 0 #c2c9c3; }
.m-path-node.gate { width: 88px; height: 88px; background: var(--m-forest); box-shadow: 0 8px 0 #0c2921,0 16px 30px rgba(22,60,50,.25); }
.m-path-node.gate.locked { background: #d9ded9; color: #8b948e; box-shadow: 0 8px 0 #c2c9c3; }
.m-node-check { position: absolute; right: -3px; bottom: 1px; width: 24px; height: 24px; border: 3px solid var(--m-canvas); border-radius: 50%; display: grid; place-items: center; background: white; color: var(--m-green); }
.m-node-check .m-ui-icon { width: 14px; height: 14px; stroke-width: 3; }
.m-node-elargir { position: absolute; top: -8px; right: -8px; width: 27px; height: 27px; border: 3px solid var(--m-canvas); border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: #73500d; box-shadow: 0 3px 7px rgba(87,59,7,.2); }
.m-node-elargir .m-ui-icon { width: 13px; height: 13px; stroke-width: 2.7; }
.m-path-label { position: absolute; top: 50%; width: 138px; transform: translateY(-50%); pointer-events: none; }
.label-right .m-path-label { left: 92px; text-align: left; }
.label-left .m-path-label { right: 92px; text-align: right; }
.label-bottom .m-path-label { top: 92px; left: 50%; transform: translateX(-50%); text-align: center; }
.m-path-label strong,.m-path-label span { display: block; }
.m-path-label strong { color: var(--m-ink); font-size: 13px; line-height: 1.25; }
.m-path-label > span { margin-top: 4px; color: var(--m-muted); font-size: 11px; line-height: 1.3; }
.m-path-item.locked .m-path-label strong,.m-path-item.locked .m-path-label > span { color: #929b94; }
.m-path-item.current .m-path-label strong { color: var(--m-purple-dark); }
.m-current-tag { display: inline-flex !important; width: auto; margin-top: 6px !important; padding: 3px 7px; border-radius: 10px; background: var(--m-purple-soft); color: var(--m-purple-dark) !important; font-size: 9px !important; font-weight: 700; text-transform: uppercase; }

.m-level-drawer { position: fixed; inset: 0; z-index: 80; padding: 16px; display: grid; align-items: end; background: rgba(12,28,22,.48); }
.m-level-drawer > div { width: min(100%,520px); max-height: 84dvh; margin: 0 auto; padding: 14px 16px 22px; border-radius: 12px 12px 0 0; overflow-y: auto; background: white; }
.m-level-drawer header { min-height: 48px; display: flex; align-items: center; justify-content: space-between; }
.m-mobile-level-list { display: grid; gap: 8px; }
.m-mobile-level-list > button { width: 100%; min-height: 64px; padding: 10px 12px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; align-items: center; gap: 10px; background: white; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-mobile-level-list > button.active { border-color: #b79bd8; background: var(--m-purple-soft); }
.m-mobile-level-list > button:disabled { background: #edf1ed; color: #929b94; cursor: default; }
.m-mobile-level-list > button > span:nth-child(2) { min-width: 0; display: grid; gap: 3px; }
.m-mobile-level-list strong { font-size: 13px; }
.m-mobile-level-list small { color: var(--m-muted); font-size: 10px; }
.m-course-level-index { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #edf1ed; color: #667069; font: 700 12px "DM Mono",monospace; }

@keyframes m-current-pulse { 0%,100% { box-shadow:0 7px 0 var(--m-purple-dark),0 14px 28px rgba(91,50,154,.2),0 0 0 0 rgba(116,71,185,.2); } 50% { box-shadow:0 7px 0 var(--m-purple-dark),0 14px 28px rgba(91,50,154,.25),0 0 0 12px rgba(116,71,185,0); } }
@keyframes m-reward-bounce { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-5px); } }
@keyframes m-milestone-pulse { 0%,100% { transform:translateY(0); } 50% { transform:translateY(-4px); } }
@keyframes m-developer-complete { 0% { transform:scale(.82); } 55% { transform:scale(1.14); } 100% { transform:scale(1); } }
@keyframes m-developer-unlock { 0% { opacity:.35; transform:scale(.72) rotate(-8deg); } 70% { opacity:1; transform:scale(1.1) rotate(2deg); } 100% { opacity:1; transform:scale(1) rotate(0); } }
@keyframes m-gift-open { 0%,100% { transform:rotate(0) scale(1); } 25% { transform:rotate(-5deg) scale(1.04); } 50% { transform:rotate(5deg) scale(1.08); } 75% { transform:rotate(-3deg) scale(1.04); } }
.m-course-header h1 { margin: 4px 0 0; font: 800 34px/1.06 "Playfair Display", serif; }
.m-course-header p { margin: 8px 0 0; color: var(--m-muted); font-size: 12px; line-height: 1.45; }
.m-level-progress { margin-top: 20px; }
.m-progress-copy { margin-bottom: 7px; display: flex; justify-content: space-between; color: var(--m-muted); font-size: 10px; }
.m-progress-copy strong { color: var(--m-forest); font: 700 11px "DM Mono", monospace; }
.m-progress-track { height: 8px; border-radius: 5px; overflow: hidden; background: #dfe6df; }
.m-progress-track span { height: 100%; display: block; border-radius: inherit; background: var(--m-green); }
.m-level-tabs { margin: 23px 0 8px; display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.m-level-tabs button { min-width: 0; min-height: 44px; padding: 4px 2px; border: 1px solid var(--m-line); border-radius: 6px; display: grid; place-items: center; background: white; color: var(--m-muted); font: 700 10px "DM Mono", monospace; cursor: pointer; }
.m-level-tabs button.active { border-color: var(--m-purple); background: var(--m-purple-soft); color: var(--m-purple-dark); }
.m-level-tabs button.enriched { border-color: var(--m-gold); background: var(--m-gold-soft); color: #8a6109; box-shadow: inset 0 -3px 0 var(--m-gold); }
.m-level-tabs button:disabled { background: #edf1ed; color: #a0aaa3; cursor: default; }
.m-trail { position: relative; padding: 42px 0 30px; }
.m-trail::before { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 6px; border-radius: 4px; background: #dfe6df; transform: translateX(-50%); }
.m-trail-step { position: relative; z-index: 1; min-height: 126px; display: grid; grid-template-columns: 1fr 78px 1fr; align-items: center; }
.m-trail-step.left .m-node-copy { grid-column: 1; grid-row: 1; padding-right: 14px; text-align: right; }
.m-trail-step.right .m-node-copy { grid-column: 3; grid-row: 1; padding-left: 14px; }
.m-trail-node { grid-column: 2; grid-row: 1; width: 72px; height: 72px; border: 6px solid var(--m-canvas); border-radius: 50%; display: grid; place-items: center; background: var(--m-purple); color: white; box-shadow: 0 6px 0 var(--m-purple-dark), 0 12px 23px rgba(91,50,154,.18); cursor: pointer; }
.m-trail-node .m-ui-icon { width: 25px; height: 25px; }
.m-trail-node.completed { background: var(--m-green); box-shadow: 0 6px 0 #205d41; }
.m-trail-node.enriched { border-color: #f6d476; box-shadow: 0 0 0 3px var(--m-gold), 0 6px 0 #9d7118; }
.m-trail-node.locked { background: #d9e0db; color: #8d9991; box-shadow: 0 5px 0 #bac4bd; cursor: default; }
.m-node-copy { min-width: 0; display: grid; gap: 3px; }
.m-node-copy strong { font-size: 12px; line-height: 1.25; }
.m-node-copy span { color: var(--m-muted); font-size: 9px; }
.m-node-copy .current { justify-self: inherit; width: max-content; margin-top: 3px; padding: 3px 6px; border-radius: 4px; background: var(--m-purple-soft); color: var(--m-purple-dark); font-size: 7px; font-weight: 800; text-transform: uppercase; }
.m-trail-step.left .current { justify-self: end; }
.m-reward-step { position: relative; z-index: 2; min-height: 68px; display: grid; place-items: center; }
.m-reward-step button { width: 46px; height: 46px; border: 5px solid var(--m-canvas); border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: 0 4px 0 #c9962e; cursor: pointer; }
.m-reward-step button:disabled { background: #e3e8e4; color: #9aa39d; box-shadow: 0 4px 0 #c8d0ca; cursor: default; }
.m-level-finish { position: relative; z-index: 3; margin: 18px 0 34px; padding: 16px; border: 1px solid #ead9ab; border-radius: 8px; display: grid; grid-template-columns: 48px minmax(0,1fr) auto; align-items: center; gap: 12px; background: var(--m-gold-soft); }
.m-level-finish .medal { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: 0 4px 0 #c9962e; }
.m-level-finish strong, .m-level-finish small { display: block; }
.m-level-finish strong { font-size: 12px; }
.m-level-finish small { margin-top: 3px; color: #866a31; font-size: 9px; }
.m-level-finish.locked { border-color: var(--m-line); background: #edf1ed; color: #879189; }
.m-level-finish.enriched { border-color: var(--m-gold); box-shadow: inset 0 0 0 2px rgba(222,164,37,.14); }
.m-level-challenge { width: 100%; min-height: 68px; margin: -20px 0 42px; padding: 12px 14px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; grid-template-columns: 42px minmax(0,1fr) 18px; align-items: center; gap: 11px; background: white; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-level-challenge > span:first-child { width: 42px; height: 42px; border-radius: 6px; display: grid; place-items: center; background: var(--m-purple-soft); color: var(--m-purple); }
.m-level-challenge strong, .m-level-challenge small { display: block; }
.m-level-challenge strong { font-size: 12px; }
.m-level-challenge small { margin-top: 3px; color: var(--m-muted); font-size: 9px; line-height: 1.35; }
.m-level-challenge > .m-ui-icon { color: var(--m-muted); }
.m-level-challenge.enriched { border-color: #e2c064; background: var(--m-gold-soft); }
.m-level-challenge.enriched > span:first-child { background: #f6c65a; color: var(--m-forest); }
.m-level-challenge:disabled { background: #edf1ed; color: #879189; cursor: default; }
.m-level-challenge:disabled > span:first-child { background: #dfe5e0; color: #8c9790; }

.m-profile { width: min(100%, 760px); margin: 0 auto; padding: 28px 16px 60px; }
.m-profile-heading { display: flex; align-items: center; gap: 16px; }
.m-profile-avatar { width: 66px; height: 66px; flex: 0 0 auto; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: 0 5px 0 #d8a83a; font: 800 18px "Playfair Display", serif; }
.m-profile-heading h1 { font-size: 30px; }
.m-profile-heading p { margin: 5px 0 0; color: var(--m-muted); font-size: 12px; line-height: 1.4; }
.m-profile-stats { margin: 25px 0 35px; padding: 14px 0; border-top: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line); display: grid; grid-template-columns: repeat(3,1fr); }
.m-profile-stats div { min-width: 0; display: grid; grid-template-columns: 22px auto; grid-template-rows: auto auto; justify-content: center; align-items: center; gap: 0 5px; }
.m-profile-stats div + div { border-left: 1px solid var(--m-line); }
.m-profile-stats .m-ui-icon { grid-row: 1 / 3; width: 18px; color: var(--m-purple); }
.m-profile-stats strong { font: 700 14px "DM Mono", monospace; }
.m-profile-stats span { color: var(--m-muted); font-size: 8px; }
.m-collection { margin-bottom: 38px; }
.m-collection-heading { margin-bottom: 14px; display: flex; align-items: end; justify-content: space-between; }
.m-collection-heading span { color: var(--m-green); font-size: 9px; font-weight: 800; text-transform: uppercase; }
.m-collection-heading h2 { margin: 3px 0 0; font: 800 23px "Playfair Display", serif; }
.m-collection-heading > strong { color: var(--m-muted); font: 600 10px "DM Mono", monospace; }
.m-medal-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px; }
.m-medal { min-width: 0; min-height: 140px; padding: 14px 7px 10px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; justify-items: center; align-content: center; gap: 9px; background: white; color: var(--m-ink); font-family: inherit; text-align: center; cursor: pointer; }
.m-medal-icon { width: 57px; height: 57px; border: 5px solid #ffe5a0; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); box-shadow: inset 0 0 0 2px #d39a24, 0 4px 0 #d39a24; }
.m-medal.locked { background: #f0f3f0; color: #89938c; cursor: default; }
.m-medal.locked .m-medal-icon { border-color: #dfe5e0; background: #e7ece8; color: #9ca69f; box-shadow: inset 0 0 0 2px #cbd3cd, 0 4px 0 #cbd3cd; }
.m-medal.enriched { border-color: var(--m-gold); background: var(--m-gold-soft); }
.m-medal.enriched .m-medal-icon { box-shadow: inset 0 0 0 2px #d39a24, 0 0 0 3px var(--m-gold), 0 4px 0 #b47d13; }
.m-medal strong { font-size: 10px; line-height: 1.25; overflow-wrap: anywhere; }
.m-medal small { color: var(--m-muted); font-size: 8px; }

.m-ranking-tabs { margin-top: 15px; border-bottom: 1px solid var(--m-line); display: grid; grid-template-columns: repeat(2,1fr); }
.m-ranking-tabs button { min-height: 44px; border: 0; border-bottom: 3px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; background: transparent; color: var(--m-muted); font-size: 11px; font-weight: 700; cursor: pointer; }
.m-ranking-tabs button.active { border-bottom-color: var(--m-green); color: var(--m-forest); }
.m-ranking-empty { padding: 28px 12px; border-bottom: 1px solid var(--m-line); color: var(--m-muted); font-size: 11px; line-height: 1.5; text-align: center; }
.m-privacy { margin: 11px 0 0; display: flex; align-items: center; gap: 6px; color: var(--m-muted); font-size: 8px; }
.m-toggle-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--m-ink); font-size: 11px; }
.m-toggle-row input { width: 20px; height: 20px; }
.m-culture-tabs { display: grid; grid-template-columns: repeat(6,1fr); gap: 5px; }
.m-culture-tabs button { min-width: 0; min-height: 46px; border: 1px solid var(--m-line); border-radius: 6px; display: grid; place-items: center; background: white; color: var(--m-muted); font: 700 9px "DM Mono", monospace; cursor: pointer; }
.m-culture-tabs button.active { border-color: var(--m-purple); background: var(--m-purple-soft); color: var(--m-purple-dark); }
.m-culture-grid { margin-top: 12px; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px; }
.m-culture-card { min-width: 0; padding: 0; border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: white; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-culture-art { height: 104px; display: grid; place-items: center; background-color: #dbe5dc; background-position: center; background-size: cover; color: white; }
.m-culture-card.locked { color: #89938c; cursor: default; }
.m-culture-card.locked .m-culture-art { filter: grayscale(1); opacity: .55; }
.m-culture-copy { min-height: 66px; padding: 10px; display: grid; align-content: start; gap: 3px; }
.m-culture-copy strong { font-size: 10px; line-height: 1.25; }
.m-culture-copy small { color: var(--m-muted); font-size: 7px; }

.m-modal-scrim { position: fixed; inset: 0; z-index: 80; padding: 16px; display: grid; align-items: end; background: rgba(12,28,22,.45); }
.m-modal { position: relative; width: min(100%, 520px); max-height: min(86dvh,760px); margin: 0 auto; border-radius: 8px 8px 0 0; overflow-y: auto; background: white; box-shadow: 0 20px 60px rgba(20,45,34,.25); }
.m-modal-art { min-height: 210px; background-position: center; background-size: cover; }
.m-modal-body { padding: 20px; }
.m-modal-body h2 { margin: 6px 0 8px; font: 800 24px "Playfair Display", serif; }
.m-modal-body p { color: var(--m-muted); font-size: 12px; line-height: 1.55; }
.m-modal-actions { display: flex; gap: 8px; }
.m-modal-actions button, .m-modal-actions a { min-height: 46px; padding: 0 14px; border: 1px solid var(--m-line); border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; background: white; color: var(--m-forest); font-size: 11px; font-weight: 700; text-decoration: none; cursor: pointer; }
.m-trail-reward-modal { width: min(100%,460px); }
.m-gift-stage, .m-reward-reveal { min-height: 430px; padding: 28px 24px 24px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.m-gift-stage h2, .m-reward-reveal h2 { margin: 9px 0 0; font: 800 27px/1.15 "Playfair Display",serif; }
.m-gift-stage p, .m-reward-reveal p { max-width: 350px; margin: 10px auto 22px; color: var(--m-muted); font-size: 13px; line-height: 1.55; }
.m-reward-burst { width: 92px; height: 92px; margin: 0 auto 20px; border-radius: 50%; display: grid; place-items: center; background: var(--m-gold-soft); color: #b57d11; box-shadow: 0 0 0 12px rgba(255,244,215,.5); }
.m-reward-burst .m-ui-icon { width: 42px; height: 42px; }
.m-reward-burst.xp { margin-bottom: 28px; color: var(--m-purple-dark); background: var(--m-purple-soft); box-shadow: 0 0 0 12px rgba(240,234,250,.55); }
.m-gift-stage.opening .m-reward-burst { animation: m-gift-open 700ms ease-in-out infinite; }
.m-reward-primary, .m-reward-secondary { width: 100%; min-height: 48px; border-radius: 7px; font-size: 12px; font-weight: 800; cursor: pointer; }
.m-reward-primary { border: 0; background: var(--m-gold); color: white; box-shadow: 0 4px 0 #a97713; }
.m-reward-primary:disabled { opacity: .65; cursor: wait; }
.m-reward-secondary { margin-top: 9px; border: 1px solid var(--m-line); background: white; color: var(--m-forest); }
.m-reward-culture-art { width: calc(100% + 48px); height: 190px; margin: -28px -24px 22px; background-position: center; background-size: cover; }
.m-reward-earned { width: 100%; min-height: 68px; margin: 0 0 18px; padding: 10px 14px; border-radius: 8px; display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; background: var(--m-gold-soft); color: #835f18; text-align: left; }
.m-reward-earned .m-ui-icon { grid-row: 1 / 3; width: 22px; }
.m-reward-earned strong { font-size: 14px; }
.m-reward-earned small { color: #967636; font-size: 10px; }
.m-modal-close { position: absolute; z-index: 4; top: 18px; right: 18px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; display: grid; place-items: center; background: #f1f4f1; color: var(--m-ink); cursor: pointer; }
.m-modal-close .m-ui-icon { width: 21px; height: 21px; }
.m-modal-close.over-art { background: rgba(255,255,255,.92); box-shadow: 0 3px 14px rgba(16,40,30,.16); }
.m-lesson-preview { padding: 30px 44px 40px; }
.m-lesson-status { margin: 0 58px 14px 0; color: var(--m-purple-dark); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.m-lesson-status.gold { color: #987019; }
.m-lesson-preview-icon { width: 58px; height: 58px; margin-bottom: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--m-purple-soft); color: var(--m-purple-dark); }
.m-lesson-preview-icon .m-ui-icon { width: 28px; height: 28px; }
.m-lesson-preview h2, .m-challenge-brief h2, .m-milestone-stage h2 { margin: 0; font: 800 28px/1.12 "Playfair Display",serif; }
.m-lesson-preview > p { margin: 12px 0 20px; color: var(--m-muted); font-size: 15px; line-height: 1.55; }
.m-lesson-meta { margin-bottom: 24px; display: flex; flex-wrap: wrap; gap: 8px; }
.m-lesson-meta span { min-height: 36px; padding: 7px 10px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px; background: #f1f4f1; color: #4f5b53; font-size: 11px; font-weight: 700; }
.m-lesson-meta .m-ui-icon { width: 16px; height: 16px; }
.m-lesson-primary, .m-lesson-elargir, .m-developer-complete { width: 100%; min-height: 54px; border-radius: 8px; font-size: 15px; font-weight: 800; cursor: pointer; }
.m-lesson-primary { border: 0; background: var(--m-purple); color: white; box-shadow: 0 5px 0 var(--m-purple-dark); }
.m-lesson-primary:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--m-purple-dark); }
.m-lesson-primary:disabled { opacity: .62; cursor: wait; }
.m-developer-complete { margin-top: 12px; border: 1px solid #b9d3c1; display: flex; align-items: center; justify-content: center; gap: 8px; background: var(--m-green-soft); color: var(--m-forest); }
.m-developer-complete:disabled { opacity: .62; cursor: wait; }
.m-developer-complete .m-ui-icon { width: 18px; height: 18px; }
.m-lesson-elargir { margin-top: 12px; border: 1px solid #dfbd68; background: var(--m-gold-soft); color: #73500d; }
.m-lesson-eligibility { min-height: 52px; margin-top: 12px; display: grid; place-items: center; color: var(--m-muted); font-size: 12px; }
.m-challenge-brief { padding: 34px 44px 38px; text-align: center; }
.m-challenge-brief > p { margin: 10px auto 22px; max-width: 360px; color: var(--m-muted); font-size: 14px; line-height: 1.55; }
.m-challenge-emblem { width: 94px; height: 94px; margin: 8px auto 24px; border: 7px solid white; border-radius: 50%; display: grid; place-items: center; background: var(--m-green-soft); color: var(--m-green); box-shadow: 0 0 0 3px #bbd9c4,0 10px 24px rgba(35,98,79,.16); }
.m-challenge-emblem.enriched { background: #f6c65a; color: var(--m-forest); box-shadow: 0 0 0 3px #d39a24,0 10px 24px rgba(125,84,8,.18); }
.m-challenge-emblem .m-ui-icon { width: 40px; height: 40px; }
.m-challenge-metrics { width: 100%; margin: 0 0 24px; padding: 15px 0; border-top: 1px solid var(--m-line); border-bottom: 1px solid var(--m-line); display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); }
.m-challenge-metrics span { min-width: 0; display: grid; justify-items: center; gap: 3px; }
.m-challenge-metrics span + span { border-left: 1px solid var(--m-line); }
.m-challenge-metrics strong { font: 800 18px "DM Mono",monospace; color: var(--m-forest-2); }
.m-challenge-metrics small { color: var(--m-muted); font-size: 9px; text-transform: uppercase; }
.m-milestone-stage { min-height: 510px; padding: 34px 28px 28px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.m-milestone-stage > p { max-width: 355px; margin: 10px auto 18px; color: var(--m-muted); font-size: 14px; line-height: 1.5; }
.m-ceremony-medal { position: relative; width: 126px; height: 126px; margin: 2px auto 32px; display: grid; place-items: center; animation: m-medal-rise 520ms cubic-bezier(.2,.8,.2,1) both; }
.m-ceremony-medal::before, .m-ceremony-medal::after { content:""; position: absolute; z-index: 0; bottom: -19px; width: 34px; height: 60px; background: var(--medal-edge); clip-path: polygon(0 0,100% 0,100% 100%,50% 78%,0 100%); }
.m-ceremony-medal::before { left: 25px; transform: rotate(10deg); }
.m-ceremony-medal::after { right: 25px; transform: rotate(-10deg); }
.m-ceremony-medal > span { position: relative; z-index: 1; width: 112px; height: 112px; border: 8px solid #ffe5a0; border-radius: 50%; display: grid; place-items: center; background: var(--medal-face); color: white; box-shadow: inset 0 0 0 4px var(--medal-edge),0 7px 0 var(--medal-edge),0 15px 28px rgba(67,50,15,.2); }
.m-ceremony-medal .m-ui-icon { width: 46px; height: 46px; }
.m-milestone-stage.opening .m-ceremony-medal { animation: m-medal-turn 720ms ease-in-out infinite; }
.m-milestone-stage.revealed .m-ceremony-medal { animation: m-medal-reveal 650ms cubic-bezier(.2,.9,.25,1.25) both; }
.m-milestone-perks { width: 100%; margin: 0 0 20px; border-top: 1px solid #ead9ab; }
.m-milestone-perks > span { min-height: 56px; padding: 8px 4px; border-bottom: 1px solid #ead9ab; display: grid; grid-template-columns: 34px minmax(0,1fr); grid-template-rows: auto auto; align-items: center; color: #76561a; text-align: left; }
.m-milestone-perks .m-ui-icon { grid-row: 1/3; width: 21px; height: 21px; }
.m-milestone-perks strong { min-width: 0; overflow-wrap: anywhere; font-size: 12px; }
.m-milestone-perks small { margin-top: 2px; color: #917234; font-size: 10px; }
.m-milestone-perks.earned > span { border-color: #cfe0d4; color: var(--m-forest-2); }
.medal-action { background: var(--m-gold); color: #49330b; }
.m-culture-modal .m-modal-body { padding-top: 22px; }
.m-celebration { position: fixed; inset: 0; z-index: 120; overflow: hidden; pointer-events: none; }
.m-celebration span { position: absolute; top: -24px; width: 10px; height: 18px; border-radius: 2px; animation: m-confetti-fall 1.75s ease-in forwards; }
.m-developer-notice { position: fixed; z-index: 118; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); width: min(calc(100% - 32px),390px); min-height: 64px; padding: 11px 16px; border: 1px solid #b9d3c1; border-radius: 8px; display: grid; grid-template-columns: 36px minmax(0,1fr); align-items: center; gap: 11px; transform: translateX(-50%); background: var(--m-forest); color: white; box-shadow: 0 16px 38px rgba(20,45,34,.25); animation: m-developer-notice 280ms ease-out both; }
.m-developer-notice > .m-ui-icon { width: 24px; height: 24px; color: #f6c65a; }
.m-developer-notice span { min-width: 0; display: grid; gap: 2px; }
.m-developer-notice strong { overflow-wrap: anywhere; font-size: 12px; }
.m-developer-notice small { color: #c8ddd4; font-size: 10px; }

@keyframes m-confetti-fall { to { transform: translate3d(var(--drift),105dvh,0) rotate(540deg); } }
@keyframes m-developer-notice { from { opacity:0; transform:translate(-50%,14px); } to { opacity:1; transform:translate(-50%,0); } }
@keyframes m-medal-rise { from { opacity:0; transform:translateY(22px) scale(.8); } to { opacity:1; transform:translateY(0) scale(1); } }
@keyframes m-medal-turn { 0%,100% { transform:rotateY(0) scale(1); } 50% { transform:rotateY(180deg) scale(1.08); } }
@keyframes m-medal-reveal { 0% { opacity:0; transform:scale(.45) rotate(-12deg); } 70% { opacity:1; transform:scale(1.08) rotate(3deg); } 100% { opacity:1; transform:scale(1) rotate(0); } }

@media (min-width: 760px) {
  .m-course-layout, .m-app { display: grid; grid-template-columns: 274px minmax(0,1fr); }
  .m-course-level-rail { position: sticky; top: 0; height: 100dvh; padding: 24px 18px; display: flex; flex-direction: column; overflow-y: auto; background: var(--m-forest); color: white; }
  .m-course-brand { min-height: 44px; padding: 0; border: 0; display: flex; align-items: center; gap: 12px; background: transparent; color: white; font: 800 22px "Playfair Display",serif; cursor: pointer; }
  .m-course-rail-heading { margin: 34px 8px 14px; display: flex; justify-content: space-between; color: #a8c7ba; font-size: 11px; text-transform: uppercase; }
  .m-course-rail-heading strong { color: #f6c65a; }
  .m-course-level-rail nav { display: grid; gap: 5px; }
  .m-course-level { width: 100%; min-height: 62px; padding: 8px 10px; border: 0; border-radius: 8px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 10px; background: transparent; color: #d4e3dd; text-align: left; cursor: pointer; }
  .m-course-level:hover:not(:disabled) { background: rgba(255,255,255,.06); }
  .m-course-level:disabled { color: #78978a; cursor: default; }
  .m-course-level.active { background: white; color: var(--m-forest); }
  .m-course-level > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
  .m-course-level strong { overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
  .m-course-level small { overflow: hidden; color: #8fb0a2; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .m-course-level.active small { color: var(--m-muted); }
  .m-course-level .m-course-level-index { background: rgba(255,255,255,.1); color: #f6c65a; box-shadow: inset 0 0 0 1px rgba(246,198,90,.2); font-weight: 800; }
  .m-course-level.active .m-course-level-index { background: var(--m-purple); color: white; box-shadow: none; }
  .m-course-level.enriched { border: 1px solid rgba(246,198,90,.48); background: rgba(246,198,90,.1); color: white; }
  .m-course-level.enriched .m-course-level-index { background: #f6c65a; color: var(--m-forest); box-shadow: inset 0 0 0 2px var(--m-gold); }
  .m-course-level.enriched small { color: #c6ddd3; }
  .m-course-level.active.enriched { border-color: var(--m-gold); background: #fff9e9; color: var(--m-forest); box-shadow: inset 4px 0 var(--m-gold); }
  .m-course-level.active.enriched small { color: var(--m-muted); }
  .m-course-profile { width: 100%; min-height: 64px; margin-top: auto; padding: 12px 8px; border: 0; border-top: 1px solid rgba(255,255,255,.12); border-radius: 8px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 10px; background: transparent; color: white; text-align: left; cursor: pointer; }
  .m-course-profile:hover { background: rgba(255,255,255,.08); }
  .m-course-profile .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); font-size: 12px; font-weight: 700; }
  .m-course-profile > span:nth-child(2) { min-width: 0; display: grid; gap: 2px; }
  .m-course-profile strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
  .m-course-profile small { color: #a8c7ba; font: 500 10px "DM Mono",monospace; }
  .m-rail { position: sticky; top: 0; height: 100dvh; padding: 24px 18px; display: flex; flex-direction: column; background: var(--m-forest); color: white; overflow-y: auto; }
  .m-rail-brand { display: flex; align-items: center; gap: 12px; color: white; font: 800 22px "Playfair Display", serif; }
  .m-rail-label { margin: 34px 8px 12px; display: flex; justify-content: space-between; color: #a8c7ba; font-size: 9px; text-transform: uppercase; }
  .m-rail-label strong { color: #f6c65a; }
  .m-rail nav { display: grid; gap: 5px; }
  .m-nav-button { width: 100%; min-height: 52px; padding: 0 10px; border: 0; border-radius: 8px; display: grid; grid-template-columns: 24px minmax(0,1fr) auto; align-items: center; gap: 9px; background: transparent; color: #b6cec4; text-align: left; font-size: 11px; font-weight: 700; cursor: pointer; }
  .m-nav-button.active { background: white; color: var(--m-forest); }
  .m-nav-button .m-ui-icon { width: 17px; }
  .m-nav-button b { padding: 3px 5px; border-radius: 4px; background: rgba(255,255,255,.1); font: 600 8px "DM Mono", monospace; }
  .m-nav-button.active b { background: var(--m-green-soft); }
  .m-rail-account { margin-top: auto; display: grid; gap: 4px; }
  .m-rail-account-links { display: grid; }
  .m-rail-account-links button { min-height: 40px; padding: 0 9px; border: 0; border-radius: 7px; display: flex; align-items: center; gap: 9px; background: transparent; color: #a8c7ba; font: 700 10px "DM Sans", sans-serif; text-align: left; cursor: pointer; }
  .m-rail-account-links button:hover { background: rgba(255,255,255,.07); color: #fff; }
  .m-rail-account-links .m-ui-icon { width: 15px; height: 15px; }
  .m-rail-profile { width: 100%; min-height: 64px; margin-top: 0; padding: 10px 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 8px; display: grid; grid-template-columns: 38px minmax(0,1fr) 18px; align-items: center; gap: 9px; background: rgba(255,255,255,.05); color: white; text-align: left; cursor: pointer; }
  .m-rail-profile .avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); font-size: 10px; font-weight: 800; }
  .m-rail-profile span { min-width: 0; display: grid; gap: 2px; }
  .m-rail-profile strong { overflow: hidden; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .m-rail-profile small { color: #a8c7ba; font-size: 8px; }
  .m-page, .m-course-main { padding-bottom: 0; }
  .m-topbar { grid-column: 1 / -1; padding: 0 28px; display: flex; justify-content: flex-end; }
  .m-topbar > .m-icon-button, .m-top-brand { display: none; }
  .m-bottom-nav { display: none; }
  .m-home { padding: 38px 28px 58px; }
  .m-secondary-content { padding: 38px 28px 58px; }
  .m-welcome { display: flex; align-items: end; justify-content: space-between; gap: 24px; }
  .m-dashboard { grid-template-columns: minmax(0,1.5fr) minmax(300px,.8fr); gap: 30px; }
  .m-course-body, .m-profile { padding-top: 40px; }
  .m-journey-heading h1 { font-size: 40px; }
  .m-level-drawer { display: none; }
  .m-ranking-spotlight { grid-template-columns: minmax(0,1.2fr) minmax(210px,.8fr); }
  .m-modal-scrim { align-items: center; }
  .m-modal { border-radius: 8px; }
}

@media (max-width: 420px) {
  .m-top-brand strong { display: none; }
  .m-chip { min-height: 38px; padding: 0 7px; font-size: 11px; }
  .m-chip .m-ui-icon { width: 16px; height: 16px; }
  .m-progress-chips { gap: 3px; }
  .m-top-actions { gap: 3px; }
  .m-developer-more { width: 38px; height: 38px; }
  .m-medal-grid { gap: 6px; }
  .m-medal { min-height: 132px; padding-left: 4px; padding-right: 4px; }
  .m-trail-step { grid-template-columns: 1fr 72px 1fr; }
  .m-node-copy strong { font-size: 11px; }
  .m-course-body { padding-left: 12px; padding-right: 12px; }
  .m-journey-heading h1 { font-size: 31px; }
  .m-reward-horizon { grid-template-columns: 38px minmax(0,1fr) auto; }
  .m-reward-horizon small { max-width: none; }
  .m-path-node { width: 70px; height: 70px; }
  .m-path-node.reward { width: 60px; height: 60px; }
  .m-path-node.reward.milestone { width: 76px; height: 76px; }
  .label-right .m-path-label { left: 84px; }
  .label-left .m-path-label { right: 84px; }
  .m-path-label { width: 126px; }
  .m-lesson-preview, .m-challenge-brief { padding: 28px 22px calc(28px + env(safe-area-inset-bottom)); }
  .m-lesson-preview h2, .m-challenge-brief h2, .m-milestone-stage h2 { font-size: 26px; }
  .m-milestone-stage { min-height: 500px; padding-left: 20px; padding-right: 20px; }
}

/* ============================================================
   Public landing  (view: lang_select)
   The signed-out marketing page. Signed-in learners never see it —
   they resume on their language home, and switch language from the
   top bar, so this page is free to sell rather than to ask.
   ============================================================ */
.m-landing { background: var(--m-canvas); }

.m-landing-hero { position: relative; isolation: isolate; min-height: 92dvh; padding: env(safe-area-inset-top) 16px 22px; display: grid; grid-template-columns: minmax(0,1fr); grid-template-rows: auto 1fr auto; gap: 14px; overflow: hidden; }
.m-language-map { width: 100%; height: 320px; border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; }
/* The hero map is a backdrop, not a card: it fills the section and the
   wash sits over it so type stays legible on any tile. The wash must not
   swallow taps, or the map stops being interactive. */
.m-language-map.immersive { position: absolute; inset: 0; z-index: 0; height: 100%; border: 0; border-radius: 0; pointer-events: none; }
.m-landing-map-wash { position: absolute; inset: 0; z-index: 1; pointer-events: none; background: linear-gradient(180deg, rgba(244,247,242,.92) 0%, rgba(244,247,242,.74) 12%, rgba(244,247,242,.34) 26%, rgba(244,247,242,.12) 44%, rgba(244,247,242,.14) 66%, rgba(244,247,242,.62) 88%, rgba(244,247,242,.92) 100%); }
.m-landing-header, .m-landing-copy, .m-landing-map-picker { position: relative; z-index: 2; }

.m-landing-header { min-width: 0; min-height: 62px; padding: 8px 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.m-landing-brand { display: inline-flex; align-items: center; gap: 8px; color: var(--m-ink); font: 800 19px "Playfair Display", serif; }
.m-landing-header nav { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 6px; }
.m-landing-header nav button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent; color: var(--m-forest); font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-landing-header nav button.primary { background: var(--m-forest); color: #fff; box-shadow: var(--m-shadow); }
.m-landing-header nav button:disabled { opacity: .5; cursor: not-allowed; }

.m-landing-copy { min-width: 0; align-self: center; max-width: 640px; padding: 20px 18px 22px; border-radius: 10px; background: radial-gradient(120% 120% at 12% 40%, rgba(244,247,242,.94) 0%, rgba(244,247,242,.80) 55%, rgba(244,247,242,0) 100%); }
.m-landing-copy h1 { margin: 7px 0 0; color: var(--m-forest); font: 800 72px/.97 "Playfair Display", serif; letter-spacing: 0; }
.m-landing-copy > p { margin: 13px 0 0; max-width: 46ch; color: var(--m-ink); font-size: 15px; line-height: 1.5; }
.m-landing-actions { margin-top: 21px; display: flex; flex-wrap: wrap; gap: 10px; }
.m-landing-actions button { min-height: 52px; padding: 0 20px; border: 0; border-radius: 8px; display: inline-flex; align-items: center; gap: 9px; font: 800 14px "DM Sans", sans-serif; cursor: pointer; }
.m-landing-actions .primary { background: var(--m-forest); color: #fff; box-shadow: var(--m-shadow); }
.m-landing-actions .primary .m-ui-icon { width: 18px; height: 18px; }
.m-landing-actions .secondary { background: rgba(255,255,255,.92); color: var(--m-forest); box-shadow: inset 0 0 0 1px var(--m-line); }
.m-landing-actions button:disabled { opacity: .5; cursor: not-allowed; }



/* Selected language as one line under the tabs. The card this replaces was
   ~110px tall on a phone — the height the map needed to read as a continent. */
.m-landing-map-picker { display: grid; gap: 10px; }
.m-landing-map-caption { display: grid; gap: 7px; padding: 12px 14px; border-radius: 8px; background: rgba(255,255,255,.94); box-shadow: inset 0 0 0 1px var(--m-line); }
.m-landing-map-facts { min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 9px; }
.m-landing-map-facts strong { font: 800 17px "Playfair Display", serif; }
.m-landing-map-facts > span { color: var(--m-muted); font: 500 11px "DM Sans", sans-serif; }
.m-landing-map-caption > button { min-height: 42px; justify-self: start; margin-top: 2px; padding: 0 15px; border: 0; border-radius: 7px; display: inline-flex; align-items: center; gap: 7px; background: var(--m-forest); color: #fff; font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-landing-map-caption > button .m-ui-icon { width: 15px; height: 15px; }
.m-landing-map-blurb { margin: 0; color: var(--m-ink); font-size: 12px; line-height: 1.5; }
.m-landing-map-regions { margin: 0; color: var(--m-muted); font: 500 10px "DM Mono", monospace; }
.m-landing-foot { padding: 18px 16px calc(22px + env(safe-area-inset-bottom)); color: var(--m-muted); font-size: 12px; font-style: italic; text-align: center; }
/* Esri requires the credit; it must not compete with the hero. */
.m-language-map .leaflet-control-attribution { background: rgba(255,255,255,.55); color: var(--m-muted); font: 500 9px "DM Sans", sans-serif; padding: 1px 5px; }
.m-language-map .leaflet-control-attribution a { color: var(--m-muted); }
.m-landing-map-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.m-landing-map-tabs button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.92); color: var(--m-muted); font: 700 12px "DM Sans", sans-serif; cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-landing-map-tabs button i { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.m-landing-map-tabs button.active { background: var(--m-forest); color: #fff; box-shadow: none; }

.m-landing-dictionary { width: min(100%, 1160px); margin: 0 auto; padding: 0 16px calc(56px + env(safe-area-inset-bottom)); display: grid; gap: 13px; }
.m-landing-dictionary > header { display: flex; align-items: end; justify-content: space-between; gap: 12px; }
.m-landing-dictionary h2 { margin: 4px 0 0; font: 800 27px/1.08 "Playfair Display", serif; }
.m-landing-dict-close { width: 44px; height: 44px; border: 0; border-radius: 50%; display: grid; place-items: center; background: var(--m-surface); color: var(--m-ink); cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-landing-dict-langs { display: flex; flex-wrap: wrap; gap: 8px; }
.m-landing-dict-langs button { min-height: 44px; padding: 0 14px; border: 0; border-radius: 22px; background: var(--m-surface); color: var(--m-muted); font: 700 12px "DM Sans", sans-serif; cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-landing-dict-langs button.active { background: var(--m-forest); color: #fff; box-shadow: none; }
.m-landing-dictionary .m-search { margin-top: 0; }
.m-landing-dict-note { margin: 0; color: var(--m-muted); font-size: 12px; }
.m-landing-dict-results { border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: var(--m-surface); }
.m-landing-dict-row + .m-landing-dict-row { border-top: 1px solid var(--m-line); }
.m-landing-dict-row > button { width: 100%; min-height: 64px; padding: 12px 15px; border: 0; display: grid; grid-template-columns: minmax(0,1fr) 20px; align-items: center; gap: 12px; background: transparent; color: var(--m-ink); text-align: left; cursor: pointer; }
.m-landing-dict-row > button > span { min-width: 0; display: grid; gap: 3px; }
.m-landing-dict-row strong { font: 800 15px "Playfair Display", serif; }
.m-landing-dict-row small { color: var(--m-forest-2); font-size: 12px; font-weight: 500; }
.m-landing-dict-row.open > button > .m-ui-icon { transform: rotate(90deg); }
.m-landing-dict-row .m-landing-dict-note { padding: 0 15px 13px; }
.m-landing-dict-senses { padding: 0 15px 13px; display: grid; gap: 9px; }
.m-landing-sense { padding: 11px 13px; border-radius: 7px; background: var(--m-canvas); display: grid; gap: 7px; }
.m-landing-sense-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.m-landing-sense-head b { color: var(--m-forest-2); font: 700 16px "Playfair Display", serif; }
.m-landing-sense-example { display: grid; gap: 3px; }
.m-landing-sense-example i { color: var(--m-ink); font-size: 13px; line-height: 1.45; }
.m-landing-sense-example span { color: var(--m-muted); font-size: 12px; line-height: 1.4; }


/* ============================================================
   Lesson page  (view: lesson)
   Single column: material, then practice. StandardPage caps content
   at 760px, so a sidebar would leave the table under 400px — and
   "read it, then drill it" is the order the lesson is meant to run in.
   ============================================================ */
.m-lesson-workspace { display: grid; gap: 18px; }
.m-lesson-back { min-height: 44px; padding: 0 4px; border: 0; justify-self: start; display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--m-forest-2); font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-lesson-back .m-ui-icon { width: 17px; height: 17px; }

.m-lesson-heading h1 { margin: 5px 0 0; font: 800 30px/1.08 "Playfair Display", serif; }
.m-lesson-heading > p { margin: 8px 0 0; color: var(--m-muted); font-size: 13px; line-height: 1.5; }
.m-lesson-heading-meta { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.m-lesson-heading-meta span { min-height: 34px; padding: 0 11px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px; background: var(--m-surface); color: var(--m-muted); font: 700 11px "DM Mono", monospace; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-lesson-heading-meta .m-ui-icon { width: 15px; height: 15px; }
.m-lesson-heading-meta span.complete { background: var(--m-green-soft); color: var(--m-forest); box-shadow: none; }

.m-lesson-layout { display: grid; gap: 22px; }
.m-lesson-material { min-width: 0; display: grid; gap: 22px; align-content: start; }
.m-lesson-section { min-width: 0; }
.m-lesson-section h2 { margin: 0 0 10px; font: 800 19px "Playfair Display", serif; }
/* Phone: every entry is its own card, labelled from data-language. Desktop
   collapses the cards back into one bordered two-column table, below. */
.m-lesson-table { display: grid; gap: 10px; }
.m-lesson-table-head { display: none; }
.m-lesson-row { border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: var(--m-surface); box-shadow: 0 2px 10px rgba(31,47,37,.04); }
.m-lesson-pair { display: grid; }
.m-lesson-fr, .m-lesson-ln { min-width: 0; padding: 12px 14px; }
.m-lesson-fr { color: var(--m-ink); font-size: 14px; line-height: 1.5; }
.m-lesson-ln { border-top: 1px dashed var(--m-line); background: #fbfdfa; }
.m-lesson-fr::before, .m-lesson-ln::before { content: attr(data-language); display: block; margin-bottom: 5px; color: var(--m-muted); font: 800 8px "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
.m-lesson-example { padding: 11px 14px 13px; border-top: 1px dashed var(--m-line); display: grid; gap: 5px; background: var(--m-canvas); }
.m-lesson-example > div { color: var(--m-muted); font-size: 12px; font-style: italic; line-height: 1.5; }
.m-lesson-example > div:empty { display: none; }

.m-lesson-practice { min-width: 0; padding: 18px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); box-shadow: 0 3px 14px rgba(31,47,37,.05); }

/* Shared by the language switcher sheet (.m-language-sheet). These were
   written for the landing directory that has been removed; the sheet is
   now their only consumer. */
.m-language-grid { display: grid; gap: 10px; }
.m-language-entry { width: 100%; min-height: 86px; padding: 14px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; grid-template-columns: 52px minmax(0,1fr) 28px; align-items: center; gap: 13px; background: var(--m-surface); color: var(--m-ink); text-align: left; cursor: pointer; box-shadow: 0 3px 14px rgba(31,47,37,.05); }
.m-language-flag { width: 52px; height: 52px; border-radius: 8px; display: grid; place-items: center; background: var(--m-green-soft); font-size: 25px; }
.m-language-entry-copy { min-width: 0; display: grid; gap: 3px; }
.m-language-entry-copy small { color: var(--m-green); font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
.m-language-entry-copy strong { overflow: hidden; font: 800 16px "Playfair Display", serif; text-overflow: ellipsis; white-space: nowrap; }
.m-language-entry-copy > span { color: var(--m-muted); font-size: 11px; }
.m-language-entry-arrow { width: 28px; height: 28px; display: grid; place-items: center; color: var(--m-forest-2); }
.m-language-entry.current { border-color: var(--m-green); background: var(--m-green-soft); }
.m-language-entry.current .m-language-flag { background: #fff; }
.m-language-entry.current .m-language-entry-arrow { color: var(--m-forest); }
.m-language-sheet .m-modal-body { display: grid; gap: 14px; }
.m-language-sheet .m-language-grid { grid-template-columns: 1fr; }
.m-language-sheet .m-modal-body h2 { margin: 0; }

/* Sons et alphabet (lesson 1.1). Four accents carry the phonetic grouping —
   that coding is the lesson's teaching device, so it stays; the hues are the
   app palette rather than the retired Tailwind set. */
.m-alphabet { display: grid; gap: 4px; }
.m-alpha-section { min-width: 0; }
.m-alpha-label { margin: 18px 0 10px; color: var(--m-muted); font: 800 10px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.m-alpha-section:first-of-type .m-alpha-label { margin-top: 0; }
.m-alpha-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 8px; }
.m-alpha-grid.wide { grid-template-columns: repeat(2, minmax(0,1fr)); }
.m-alpha-grid.tones { grid-template-columns: repeat(2, minmax(0,1fr)); }
.m-alpha-tile { position: relative; min-height: 92px; padding: 13px 8px 11px; border: 1.5px solid var(--m-line); border-radius: 8px; display: grid; align-content: start; justify-items: center; gap: 3px; background: var(--m-surface); text-align: center; cursor: pointer; }
.m-alpha-tile:disabled, .m-alpha-tile.silent { opacity: .62; cursor: default; }
.m-alpha-letter { font: 800 26px/1 "Playfair Display", serif; }
.m-alpha-word { color: var(--m-ink); font-size: 12px; font-weight: 700; }
.m-alpha-meaning { color: var(--m-muted); font-size: 10px; line-height: 1.3; }
.m-alpha-desc { color: inherit; font: 800 9px "DM Mono", monospace; letter-spacing: .06em; text-transform: uppercase; }
.m-alpha-hint { color: var(--m-muted); font-size: 9px; font-style: italic; }
.m-alpha-play { position: absolute; top: 6px; right: 6px; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: currentColor; }
.m-alpha-play .m-ui-icon { width: 8px; height: 8px; fill: #fff; stroke: #fff; }
.m-alpha-tile.vowel { border-color: #e3c273; background: var(--m-gold-soft); }
.m-alpha-tile.vowel .m-alpha-letter, .m-alpha-tile.vowel .m-alpha-desc, .m-alpha-tile.vowel .m-alpha-play { color: #8b6214; }
.m-alpha-tile.consonant { border-color: #c3ade4; background: var(--m-purple-soft); }
.m-alpha-tile.consonant .m-alpha-letter, .m-alpha-tile.consonant .m-alpha-desc, .m-alpha-tile.consonant .m-alpha-play { color: var(--m-purple-dark); }
.m-alpha-tile.compound { border-color: #8fc4a5; background: var(--m-green-soft); }
.m-alpha-tile.compound .m-alpha-letter, .m-alpha-tile.compound .m-alpha-desc, .m-alpha-tile.compound .m-alpha-play { color: var(--m-forest); }
.m-alpha-tile.tone { border-color: #eda893; background: #fdece7; }
.m-alpha-tile.tone .m-alpha-letter, .m-alpha-tile.tone .m-alpha-desc, .m-alpha-tile.tone .m-alpha-play { color: #a8402a; }
.m-alpha-notice { margin: 0 0 14px; padding: 11px 14px; border: 1px solid #e3c273; border-radius: 8px; display: flex; gap: 9px; background: var(--m-gold-soft); color: #7a5610; font-size: 12px; line-height: 1.45; }
.m-alpha-note { margin: 20px 0 0; padding: 13px 16px; border: 1px solid var(--m-line); border-radius: 8px; background: var(--m-surface); color: var(--m-muted); font: 11px/1.65 "DM Sans", sans-serif; }
.m-alpha-note strong { color: var(--m-ink); }
.m-alpha-note b.vowel { color: #8b6214; }
.m-alpha-note b.consonant { color: var(--m-purple-dark); }
.m-alpha-note b.compound { color: var(--m-forest); }
.m-alpha-note b.tone { color: #a8402a; }

.m-conj-table { margin-bottom: 4px; border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: var(--m-surface); }
.m-conj-head { padding: 15px 17px 12px; border-bottom: 1px solid var(--m-line); }
.m-conj-head p { margin: 0; color: var(--m-green); font: 800 9px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.m-conj-head h3 { margin: 6px 0 0; font: 800 21px "Playfair Display", serif; }
.m-conj-head h3 span { color: var(--m-muted); font-size: 15px; font-weight: 500; }
/* Tenses scroll sideways INSIDE this strip only — the page itself must never scroll horizontally. */
.m-conj-tenses { padding: 11px 13px; border-bottom: 1px solid var(--m-line); display: flex; gap: 6px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.m-conj-tenses button { flex: 0 0 auto; min-height: 40px; padding: 0 14px; border: 0; border-radius: 20px; background: var(--m-canvas); color: var(--m-ink); font: 500 13px "DM Sans", sans-serif; white-space: nowrap; cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-conj-tenses button.active { background: var(--m-forest); color: #fff; font-weight: 700; box-shadow: none; }
.m-conj-row { padding: 11px 16px; display: flex; align-items: center; gap: 12px; }
.m-conj-row + .m-conj-row { border-top: 1px solid var(--m-line); }
.m-conj-row .fr { flex: 1; min-width: 0; color: var(--m-muted); font-size: 13px; line-height: 1.35; }
.m-conj-row .ln { color: var(--m-forest-2); font: 700 17px "Playfair Display", serif; text-align: right; }
/* The présent column was never recorded, so a third of the grid has no clip. */
.m-conj-noaudio { width: 36px; flex: 0 0 auto; }

.m-lesson-practice { display: grid; gap: 10px; }
.m-practice-action { width: 100%; min-height: 66px; padding: 14px 18px; border: 0; border-radius: 8px; display: grid; gap: 3px; justify-items: start; background: var(--m-surface); color: var(--m-ink); text-align: left; font-family: "DM Sans", sans-serif; cursor: pointer; }
.m-practice-action strong { display: inline-flex; align-items: center; gap: 8px; font: 800 15px "DM Sans", sans-serif; }
.m-practice-action strong .m-ui-icon { width: 16px; height: 16px; }
.m-practice-action span { color: inherit; font: 500 12px "DM Mono", monospace; opacity: .82; }
.m-practice-action.primary { background: var(--m-forest); color: #fff; box-shadow: var(--m-shadow); }
.m-practice-action.primary:disabled { background: #e4eae4; color: var(--m-muted); box-shadow: none; cursor: default; }
.m-practice-action.secondary { color: var(--m-purple-dark); box-shadow: inset 0 0 0 1.5px var(--m-purple); }
.m-practice-action.secondary:disabled { opacity: .6; cursor: default; }
.m-practice-action.locked { background: var(--m-canvas); color: var(--m-muted); box-shadow: inset 0 0 0 1.5px var(--m-line); cursor: default; }
.m-practice-note { margin: 2px 0 0; color: var(--m-muted); font-size: 12px; line-height: 1.5; text-align: center; }
.m-practice-status { min-height: 52px; margin: 0; padding: 13px 18px; border-radius: 8px; display: flex; align-items: center; justify-content: center; gap: 9px; background: var(--m-green-soft); color: var(--m-forest); font: 800 13px "DM Sans", sans-serif; }
.m-practice-status.pending { display: block; background: var(--m-canvas); color: var(--m-muted); font: 500 12px/1.5 "DM Sans", sans-serif; text-align: center; box-shadow: inset 0 0 0 1px var(--m-line); }

@media (min-width: 760px) {
  .m-landing-hero { padding: env(safe-area-inset-top) 32px 32px; gap: 22px; }
  .m-landing-map-caption { width: min(100%, 520px); }

  .m-lesson-heading h1 { font-size: 36px; }
  .m-alpha-grid { grid-template-columns: repeat(5, minmax(0,1fr)); }
  .m-alpha-grid.wide { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .m-alpha-grid.tones { grid-template-columns: repeat(4, minmax(0,1fr)); }
  .m-lesson-table { display: block; border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: var(--m-surface); }
  .m-lesson-row { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .m-lesson-row + .m-lesson-row { border-top: 1px solid var(--m-line); }
  .m-lesson-table-head { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--m-line); background: var(--m-green-soft); }
  .m-lesson-table-head span { padding: 9px 14px; color: var(--m-forest); font: 800 9px "DM Mono", monospace; letter-spacing: .09em; text-transform: uppercase; }
  .m-lesson-table-head span + span { border-left: 1px solid var(--m-line); }
  .m-lesson-pair { grid-template-columns: 1fr 1fr; }
  .m-lesson-ln { border-top: 0; border-left: 1px solid var(--m-line); background: transparent; }
  .m-lesson-fr::before, .m-lesson-ln::before { display: none; }
  .m-lesson-example { grid-template-columns: 1fr 1fr; gap: 0; padding: 11px 0 13px; }
  .m-lesson-example > div { padding: 0 14px; }
  .m-lesson-example > div + div { border-left: 1px solid var(--m-line); }
}

@media (max-width: 420px) {
  .m-landing-header nav button { padding: 0 10px; font-size: 11px; }
  .m-landing-brand { font-size: 17px; }
  .m-landing-copy h1 { font-size: 44px; }
  .m-landing-actions button { width: 100%; justify-content: center; }
  .m-language-entry { grid-template-columns: 44px minmax(0,1fr) 22px; gap: 11px; }
  .m-language-flag { width: 44px; height: 44px; font-size: 21px; }
}

@media (max-width: 560px) {
  .m-landing-hero { padding-right: 14px; padding-left: 14px; }
  .m-landing-header { flex-wrap: nowrap; }
  .m-landing-header nav { flex: 0 0 auto; }
  .m-landing-header nav button:not(.primary) { display: none; }
  .m-landing-copy { width: 100%; max-width: 100%; padding-right: 0; padding-left: 0; background: rgba(244,247,242,.82); }
  .m-landing-copy h1 { font-size: 48px; }
  .m-landing-copy > p { max-width: 100%; overflow-wrap: anywhere; }
  .m-language-entry-copy strong { white-space: normal; overflow-wrap: anywhere; }
}

/* ============================================================
   Settings, account controls and the weekly ranking
   ============================================================ */
/* The session runs edge-to-edge at 100dvh. Left unconstrained it stretched a
   two-column match-pairs board across a 2560px display; the padding grows with
   the viewport so the column stays readable while the background stays full
   bleed. Horizontal padding lives here, not inline, so it can respond. */
.m-session-shell { padding-inline: max(18px, calc((100% - 760px) / 2)) !important; }

.m-top-settings { background: white; box-shadow: inset 0 0 0 1px var(--m-line); }

.m-settings { display: grid; gap: 16px; }
.m-settings-heading h1 { margin: 4px 0 0; font: 800 31px/1.08 "Playfair Display", serif; }
.m-settings-heading > p { margin: 8px 0 0; color: var(--m-muted); font-size: 13px; line-height: 1.5; }
.m-settings-card { padding: 18px; border: 1px solid var(--m-line); border-radius: 8px; display: grid; gap: 13px; background: var(--m-surface); box-shadow: 0 3px 14px rgba(31,47,37,.05); }
.m-settings-card h2 { margin: 0; font: 800 17px "Playfair Display", serif; }
.m-settings-card.danger { border-color: #f0cfc6; background: #fdf6f4; }
.m-settings-hint { margin: -4px 0 0; color: var(--m-muted); font-size: 12px; }
.m-field { display: grid; gap: 5px; }
.m-field > span { color: var(--m-ink); font-size: 11px; font-weight: 700; }
.m-field input, .m-field select { min-height: 48px; padding: 0 13px; border: 1.5px solid var(--m-line); border-radius: 7px; background: white; color: var(--m-ink); font: 16px "DM Sans", sans-serif; }
.m-field input:focus, .m-field select:focus { border-color: var(--m-gold); outline: 0; }
.m-field small { color: var(--m-muted); font-size: 11px; line-height: 1.45; }
.m-field.readonly input { background: var(--m-canvas); color: var(--m-muted); cursor: not-allowed; }
.m-settings-card .m-toggle-row { min-height: 48px; display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12px; font-weight: 700; cursor: pointer; }
.m-settings-card .m-toggle-row input { width: 22px; height: 22px; accent-color: var(--m-forest); }
.m-settings-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.m-settings-row > span { display: grid; gap: 2px; }
.m-settings-row strong { font-size: 13px; }
.m-settings-row small { overflow: hidden; color: var(--m-muted); font-size: 11px; text-overflow: ellipsis; }
.m-settings-secondary { min-height: 46px; padding: 0 16px; border: 0; border-radius: 7px; justify-self: start; background: var(--m-canvas); color: var(--m-forest); font: 700 12px "DM Sans", sans-serif; cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-settings-secondary:disabled { opacity: .5; cursor: not-allowed; }
.m-settings-note { margin: 0; display: flex; align-items: center; gap: 7px; color: var(--m-muted); font-size: 11px; line-height: 1.45; }
.m-settings-note .m-ui-icon { width: 15px; height: 15px; flex: 0 0 auto; }
.m-settings-error { margin: 0; padding: 12px 14px; border: 1px solid #e7b6a8; border-radius: 7px; background: #fdeee9; color: #9c3a22; font-size: 12px; line-height: 1.45; }
.m-settings-save { min-height: 54px; border: 0; border-radius: 8px; background: var(--m-forest); color: #fff; font: 800 14px "DM Sans", sans-serif; cursor: pointer; box-shadow: var(--m-shadow); }
.m-settings-save:disabled { background: #e4eae4; color: var(--m-muted); box-shadow: none; cursor: not-allowed; }
.m-settings-signout { min-height: 46px; padding: 0 16px; border: 0; border-radius: 7px; display: inline-flex; align-items: center; gap: 8px; background: var(--m-coral); color: #fff; font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-settings-signout .m-ui-icon { width: 16px; height: 16px; }

.m-ranking { display: grid; gap: 12px; }
.m-ranking .m-collection-heading { margin-bottom: 0; }
.m-ranking-place { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 20px; background: var(--m-green-soft); color: var(--m-forest); font: 700 11px "DM Sans", sans-serif; }
.m-ranking-place .m-ui-icon { width: 14px; height: 14px; }
.m-ranking-spotlight { border-radius: 8px; overflow: hidden; display: grid; background: var(--m-forest); color: #fff; box-shadow: var(--m-shadow); }
.m-standing { padding: 17px; display: grid; grid-template-columns: 54px minmax(0,1fr); align-items: center; gap: 14px; }
.m-standing-icon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: #f6c65a; color: var(--m-forest); }
.m-standing-icon .m-ui-icon { width: 26px; height: 26px; }
.m-standing-copy { min-width: 0; display: grid; gap: 1px; }
.m-standing-copy small { color: #b4cec3; font-size: 9px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.m-standing-copy strong { font: 800 30px/1.05 "Playfair Display", serif; }
.m-standing-copy b { color: #c8ddd4; font-size: 11px; font-weight: 500; }
.m-standing-stats { margin: 0; padding: 15px 17px; border-top: 1px solid rgba(255,255,255,.12); display: grid; gap: 9px; }
.m-standing-stats > div { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.m-standing-stats dt { color: #b4cec3; font-size: 10px; font-weight: 700; }
.m-standing-stats dd { margin: 0; font: 700 16px "DM Mono", monospace; }
.m-standing-stats dd span { color: #b4cec3; font-size: 10px; }

.m-ranking-table { border: 1px solid var(--m-line); border-radius: 8px; overflow: hidden; background: var(--m-surface); }
.m-ranking-head { padding: 9px 14px; border-bottom: 1px solid var(--m-line); display: grid; grid-template-columns: 46px minmax(0,1fr) auto; gap: 11px; background: var(--m-canvas); color: var(--m-muted); font: 800 8px "DM Mono", monospace; letter-spacing: .1em; text-transform: uppercase; }
.m-ranking-head span:nth-child(2) { grid-column: 2 / 3; }
.m-ranking-row { padding: 11px 14px; display: grid; grid-template-columns: 46px 38px minmax(0,1fr) auto; align-items: center; gap: 11px; }
.m-ranking-row + .m-ranking-row { border-top: 1px solid var(--m-line); }
.m-ranking-row.me { background: var(--m-gold-soft); box-shadow: inset 3px 0 0 var(--m-gold); }
.m-rank { color: var(--m-muted); font: 700 12px "DM Mono", monospace; }
.m-rank-avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: var(--m-purple-soft); color: var(--m-purple-dark); font: 800 11px "DM Sans", sans-serif; }
.m-ranking-row.me .m-rank-avatar { background: #f6c65a; color: var(--m-forest); }
.m-rank-name { min-width: 0; display: grid; gap: 2px; }
.m-rank-name strong { display: flex; align-items: center; gap: 7px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.m-rank-you { padding: 2px 7px; border-radius: 5px; background: var(--m-gold); color: #fff; font: 800 8px "DM Mono", monospace; letter-spacing: .07em; text-transform: uppercase; }
.m-rank-name small { display: flex; align-items: center; gap: 4px; color: var(--m-muted); font-size: 10px; }
.m-rank-name small .m-ui-icon { width: 12px; height: 12px; color: var(--m-coral); }
.m-rank-score { font: 700 13px "DM Mono", monospace; white-space: nowrap; }
.m-rank-score span { color: var(--m-muted); font-size: 9px; }
.m-ranking-settings { min-height: 46px; border: 0; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; background: var(--m-canvas); color: var(--m-forest); font: 700 11px "DM Sans", sans-serif; cursor: pointer; box-shadow: inset 0 0 0 1px var(--m-line); }
.m-ranking-settings .m-ui-icon { width: 15px; height: 15px; }

@media (min-width: 760px) {
  .m-standing-stats { padding-top: 0; border-top: 0; }
  .m-ranking-spotlight { grid-template-columns: minmax(0,1fr) auto; align-items: center; }
  .m-standing-stats { grid-template-columns: repeat(2, auto); gap: 26px; padding-right: 20px; }
  .m-standing-stats > div { display: grid; gap: 2px; justify-items: end; }
}

/* Signed-out shell: a visitor browsing the free dictionary. Learner controls
   become a way in rather than an empty account. */
.m-rail-signin { width: 100%; min-height: 60px; padding: 11px 12px; border: 1px solid rgba(255,255,255,.16); border-radius: 8px; display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 10px; background: rgba(255,255,255,.07); color: #fff; text-align: left; cursor: pointer; }
.m-rail-signin span { min-width: 0; display: grid; gap: 2px; }
.m-rail-signin strong { font-size: 11px; }
.m-rail-signin small { color: #a8c7ba; font-size: 8px; }
.m-top-signin { min-height: 40px; padding: 0 15px; border: 0; border-radius: 20px; background: var(--m-forest); color: #fff; font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-dict-back { min-height: 44px; margin-bottom: 10px; padding: 0 4px; border: 0; justify-self: start; display: inline-flex; align-items: center; gap: 7px; background: transparent; color: var(--m-forest-2); font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-dict-back .m-ui-icon { width: 17px; height: 17px; }

/* ============================================================
   Login / signup / password reset  (view: auth)
   Signing out lands here, not on the marketing landing page.
   ============================================================ */
.m-auth { min-height: 100dvh; padding: calc(env(safe-area-inset-top) + 24px) 16px calc(env(safe-area-inset-bottom) + 32px); display: grid; background: var(--m-canvas); }
/* Auto margins, never justify-content: centre — a centred flex/grid box
   overflows in both directions once the content is taller than the viewport,
   and the top becomes unreachable. The signup form with an error is exactly
   that case on a small phone. */
.m-auth-card { width: min(100%, 460px); margin: auto; padding: 26px 22px 22px; border: 1px solid var(--m-line); border-radius: 10px; background: var(--m-surface); box-shadow: var(--m-shadow); }
.m-auth-brand { margin-bottom: 20px; padding: 0; border: 0; display: inline-flex; align-items: center; gap: 8px; background: transparent; color: var(--m-ink); font: 800 19px "Playfair Display", serif; cursor: pointer; }
.m-auth-card h1 { margin: 5px 0 0; font: 800 27px/1.1 "Playfair Display", serif; }
.m-auth-blurb { margin: 9px 0 0; color: var(--m-muted); font-size: 13px; line-height: 1.5; }
.m-auth-gate { margin: 14px 0 0; padding: 11px 13px; border-radius: 7px; background: var(--m-gold-soft); color: #7a5610; font-size: 12px; line-height: 1.45; }
.m-auth-modes { margin-top: 18px; padding: 3px; border-radius: 8px; display: grid; grid-template-columns: repeat(2,1fr); background: #e9eee9; }
.m-auth-modes button { min-height: 44px; border: 0; border-radius: 6px; background: transparent; color: var(--m-muted); font: 700 12px "DM Sans", sans-serif; cursor: pointer; }
.m-auth-modes button.active { background: white; color: var(--m-forest); box-shadow: 0 2px 7px rgba(31,47,37,.08); }
.m-auth-form { margin-top: 18px; display: grid; gap: 13px; }
.m-auth-message { padding: 11px 13px; border: 1px solid #e7b6a8; border-radius: 7px; background: #fdeee9; color: #9c3a22; font-size: 12px; font-weight: 600; line-height: 1.45; }
.m-auth-message.ok { border-color: #a9cdb7; background: var(--m-green-soft); color: var(--m-forest); }
.m-auth-submit { min-height: 54px; border: 0; border-radius: 8px; background: var(--m-forest); color: #fff; font: 800 14px "DM Sans", sans-serif; cursor: pointer; box-shadow: var(--m-shadow); }
.m-auth-submit:disabled { background: #e4eae4; color: var(--m-muted); box-shadow: none; cursor: not-allowed; }
.m-auth-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--m-line); display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.m-auth-links button { min-height: 44px; padding: 0; border: 0; background: transparent; color: var(--m-forest-2); font: 700 12px "DM Sans", sans-serif; text-decoration: underline; cursor: pointer; }
.m-settings-note.warn { color: #9c3a22; }
.m-settings-note.ok { color: var(--m-forest); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
