:root {
  --saffron: #f4ad26;
  --saffron-deep: #df8c14;
  --sun: #ffd76f;
  --navy: #13273f;
  --navy-soft: #1d3854;
  --cream: #fff6de;
  --paper: #fffaf0;
  --ink: #1d2b37;
  --muted: #6e6558;
  --turquoise: #2f8b84;
  --turquoise-pale: #d9eee8;
  --danger: #b84f45;
  --danger-pale: #f8dfda;
  --line: rgba(19, 39, 63, 0.14);
  --shadow: 0 18px 45px rgba(71, 47, 8, 0.17);
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  font-family: Inter, ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--saffron);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html { min-height: 100%; background: var(--saffron); }

body {
  min-width: 280px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  background: linear-gradient(160deg, #ffd26a 0%, var(--saffron) 42%, #e99616 100%);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; }

.app-backdrop {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 87% 8%, rgba(255, 249, 203, 0.85) 0 7%, transparent 7.2%),
    radial-gradient(ellipse at 80% 24%, rgba(255, 244, 184, 0.35), transparent 34%),
    linear-gradient(to bottom, transparent 68%, rgba(83, 88, 48, 0.11));
}

.app-backdrop::before,
.app-backdrop::after {
  content: "";
  position: absolute;
  left: -15%;
  right: -15%;
  height: 65px;
  bottom: 78px;
  border-radius: 50%;
  background: rgba(67, 86, 51, 0.09);
  transform: rotate(-2deg);
}

.app-backdrop::after { bottom: 32px; transform: rotate(2deg); opacity: 0.7; }

.app-shell {
  position: relative;
  width: 100%;
  max-width: 560px;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 12px) 16px calc(92px + var(--safe-bottom));
}

.app-header {
  display: flex;
  align-items: center;
  gap: 11px;
  min-height: 52px;
  margin-bottom: 18px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border: 1px solid rgba(255,255,255,0.56);
  border-radius: 14px 14px 14px 5px;
  background: var(--navy);
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 23px;
  box-shadow: 0 7px 18px rgba(19,39,63,0.2);
}

.brand-copy { min-width: 0; }
.brand-copy h1 { margin: 1px 0 0; font-size: 18px; line-height: 1.1; letter-spacing: -0.02em; }

.eyebrow {
  margin: 0;
  color: rgba(255,255,255,0.86);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow--dark { color: var(--turquoise); }

.icon-button {
  display: grid;
  width: 40px;
  height: 40px;
  margin-left: auto;
  padding: 9px;
  place-items: center;
  border: 1px solid rgba(19,39,63,0.13);
  border-radius: 50%;
  background: rgba(255,255,255,0.32);
  cursor: pointer;
}

.icon-button svg { width: 21px; fill: none; stroke: var(--navy); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-button:active { transform: scale(0.95); }

.startup-state {
  display: grid;
  min-height: 58vh;
  padding: 40px 24px;
  place-items: center;
  align-content: center;
  text-align: center;
}

.startup-state h2 { margin: 22px 0 8px; color: var(--navy); font-size: 24px; letter-spacing: -0.03em; }
.startup-state p { max-width: 310px; margin: 0; color: rgba(29,43,55,0.72); line-height: 1.5; }
.startup-state .button { margin-top: 22px; }
.state-icon { display: grid; width: 64px; height: 64px; place-items: center; border-radius: 50%; background: rgba(255,255,255,0.5); color: var(--navy); font-size: 35px; }

.loader {
  width: 44px;
  height: 44px;
  border: 4px solid rgba(19,39,63,0.13);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.85s linear infinite;
}

.loader--small { width: 25px; height: 25px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.view { display: none; animation: rise 0.25s ease both; }
.view.is-active { display: block; }
@keyframes rise { from { transform: translateY(5px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.welcome-row,
.view-title-row,
.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.welcome-row { margin: 6px 2px 14px; }
.welcome-row h2, .view-title-row h2 { margin: 3px 0 0; color: var(--navy); font-size: clamp(25px, 7vw, 32px); line-height: 1.04; letter-spacing: -0.045em; }
.view-title-row { margin: 6px 2px 14px; }

.day-badge,
.week-badge {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid rgba(19,39,63,0.09);
  border-radius: 11px;
  background: rgba(255,255,255,0.42);
  color: var(--navy);
  font-size: 12px;
  font-weight: 750;
  box-shadow: 0 5px 14px rgba(71,47,8,0.06);
}

.mission-card {
  position: relative;
  overflow: hidden;
  padding: 20px;
  border-radius: 27px 27px 27px 9px;
  background: var(--navy);
  color: var(--cream);
  box-shadow: var(--shadow);
}

.mission-card::after {
  content: "";
  position: absolute;
  width: 170px;
  height: 170px;
  top: -80px;
  right: -65px;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 50%;
  box-shadow: 0 0 0 28px rgba(255,255,255,0.025), 0 0 0 60px rgba(255,255,255,0.018);
  pointer-events: none;
}

.mission-card__topline { position: relative; z-index: 1; display: flex; align-items: center; gap: 9px; }
.mission-number { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 9px; background: var(--saffron); color: var(--navy); font-size: 12px; font-weight: 900; }
.mission-kind { color: rgba(255,246,222,0.64); font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; }

.mission-prompt { position: relative; z-index: 1; margin: 20px 0 16px; font-size: clamp(18px, 5vw, 22px); font-weight: 720; line-height: 1.34; letter-spacing: -0.02em; }

.phrase-panel {
  position: relative;
  z-index: 1;
  padding: 17px 18px;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 19px;
  background: rgba(255,255,255,0.075);
}

.phrase-kalmyk { margin: 0; color: var(--sun); font-family: Georgia, "Times New Roman", serif; font-size: clamp(29px, 9vw, 40px); line-height: 1.1; letter-spacing: -0.025em; }
.phrase-translation { margin: 8px 0 0; color: rgba(255,246,222,0.72); font-size: 14px; }

.audio-row { position: relative; z-index: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-top: 13px; }
.audio-button { display: flex; min-height: 56px; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid rgba(255,255,255,0.12); border-radius: 15px; background: rgba(255,255,255,0.08); color: var(--cream); text-align: left; cursor: pointer; }
.audio-button__icon { display: grid; width: 30px; height: 30px; flex: 0 0 30px; place-items: center; border-radius: 50%; background: var(--turquoise); color: white; font-size: 11px; }
.audio-button strong, .audio-button small { display: block; }
.audio-button strong { font-size: 12px; }
.audio-button small { margin-top: 2px; color: rgba(255,246,222,0.57); font-size: 9px; }
.audio-button.is-playing { border-color: var(--sun); background: rgba(255,215,111,0.13); }
.audio-button:active { transform: translateY(1px); }

.editorial-note { position: relative; z-index: 1; display: flex; gap: 7px; margin: 15px 2px 0; color: rgba(255,246,222,0.5); font-size: 10px; line-height: 1.4; }
.editorial-note span { color: var(--sun); }

.result-panel,
.settings-card {
  margin-top: 14px;
  padding: 19px;
  border: 1px solid rgba(255,255,255,0.48);
  border-radius: 24px;
  background: rgba(255,250,240,0.79);
  box-shadow: 0 12px 28px rgba(71,47,8,0.11);
  backdrop-filter: blur(8px);
}

.section-heading h3 { margin: 2px 0 0; color: var(--navy); font-size: 21px; letter-spacing: -0.03em; }
.saved-label { padding: 5px 8px; border-radius: 9px; background: var(--turquoise-pale); color: #286a65; font-size: 11px; font-weight: 800; }
.outcome-list { display: grid; gap: 8px; margin-top: 14px; }
.outcome-button { display: flex; width: 100%; min-height: 58px; align-items: center; gap: 11px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); text-align: left; cursor: pointer; transition: 0.18s ease; }
.outcome-button__mark { display: grid; width: 35px; height: 35px; flex: 0 0 35px; place-items: center; border-radius: 12px; background: rgba(19,39,63,0.08); color: var(--navy); font-weight: 900; }
.outcome-button strong, .outcome-button small { display: block; }
.outcome-button strong { color: var(--navy); font-size: 14px; }
.outcome-button small { margin-top: 2px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.outcome-button--done .outcome-button__mark { background: var(--turquoise-pale); color: var(--turquoise); }
.outcome-button.is-selected { border-color: var(--turquoise); background: #edf7f2; box-shadow: 0 0 0 2px rgba(47,139,132,0.1); }
.outcome-button:disabled { cursor: wait; opacity: 0.62; }
.muted-note, .view-intro, .privacy-hint { margin: 13px 2px 0; color: rgba(29,43,55,0.63); font-size: 11px; line-height: 1.45; }

.progress-count { display: flex; align-items: baseline; color: var(--navy); }
.progress-count strong { font-size: 26px; }
.progress-count span { margin-left: 2px; color: rgba(19,39,63,0.56); font-size: 12px; }
.progress-track { height: 5px; overflow: hidden; margin: -4px 2px 16px; border-radius: 5px; background: rgba(19,39,63,0.13); }
.progress-track span { display: block; width: 5%; height: 100%; border-radius: inherit; background: var(--navy); transition: width 0.25s ease; }

.inline-state { display: grid; min-height: 180px; place-items: center; align-content: center; gap: 12px; padding: 30px; text-align: center; }
.inline-state p { margin: 0; color: rgba(29,43,55,0.69); }
.text-button { padding: 4px; border: 0; border-bottom: 1px solid currentColor; background: transparent; color: var(--navy); font-weight: 750; cursor: pointer; }

.mosaic-card {
  overflow: hidden;
  padding: 20px;
  border-radius: 27px 27px 27px 9px;
  background: var(--navy);
  color: var(--cream);
  box-shadow: var(--shadow);
}

.mosaic-card__prompt span { color: rgba(255,246,222,0.56); font-size: 10px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; }
.mosaic-card__prompt h3 { margin: 7px 0 18px; font-size: clamp(24px, 7.5vw, 34px); line-height: 1.15; letter-spacing: -0.04em; }

.answer-zone { min-height: 94px; padding: 12px; border: 1.5px dashed rgba(255,215,111,0.42); border-radius: 17px; background: rgba(255,255,255,0.055); outline: none; }
.answer-zone:focus-visible { box-shadow: 0 0 0 3px rgba(255,215,111,0.2); }
.answer-placeholder { margin: 21px 4px; color: rgba(255,246,222,0.42); font-size: 12px; text-align: center; }
.answer-tokens { display: flex; flex-wrap: wrap; gap: 7px; }
.answer-token { padding: 8px 10px; border: 1px solid rgba(255,255,255,0.1); border-radius: 11px; background: var(--turquoise); color: #fff; font-size: 14px; font-weight: 700; cursor: pointer; }

.mosaic-tools { display: flex; justify-content: flex-end; gap: 14px; margin: 9px 3px 14px; }
.tool-button { padding: 3px; border: 0; background: transparent; color: rgba(255,246,222,0.66); font-size: 10px; cursor: pointer; }
.tool-button:disabled { opacity: 0.28; cursor: default; }
.tool-button span { margin-right: 3px; font-size: 14px; }
.word-bank { display: flex; flex-wrap: wrap; gap: 9px; min-height: 48px; align-content: flex-start; }
.word-chip { min-height: 43px; padding: 9px 14px; border: 1px solid rgba(19,39,63,0.08); border-bottom-width: 3px; border-radius: 13px; background: var(--cream); color: var(--navy); font-size: 14px; font-weight: 750; box-shadow: 0 3px 0 rgba(0,0,0,0.06); cursor: pointer; }
.word-chip:active { border-bottom-width: 1px; transform: translateY(2px); }

/* Telegram's iOS WebView can interpret quick repeated taps as double-tap zoom.
   Keep the mosaic tappable and scrollable while suppressing that gesture and
   the long-press magnifier on the word controls themselves. */
.word-chip,
.answer-token,
.tool-button {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.mosaic-feedback { display: flex; align-items: flex-start; gap: 10px; margin-top: 16px; padding: 12px; border-radius: 15px; background: rgba(255,255,255,0.08); }
.mosaic-feedback.is-correct { background: rgba(47,139,132,0.23); }
.mosaic-feedback.is-error { background: rgba(184,79,69,0.2); }
.feedback-icon { display: grid; width: 27px; height: 27px; flex: 0 0 27px; place-items: center; border-radius: 50%; background: var(--turquoise); color: white; font-weight: 900; }
.is-error .feedback-icon { background: var(--danger); }
.mosaic-feedback strong { font-size: 13px; }
.mosaic-feedback p { margin: 3px 0 0; color: rgba(255,246,222,0.66); font-size: 11px; line-height: 1.4; }

.button { min-height: 48px; padding: 12px 18px; border: 0; border-radius: 15px; font-weight: 800; cursor: pointer; transition: transform 0.14s ease, opacity 0.14s ease; }
.button:active { transform: translateY(1px) scale(0.995); }
.button:disabled { cursor: wait; opacity: 0.55; }
.button--wide { width: 100%; }
.button--navy { background: var(--navy); color: var(--cream); box-shadow: 0 8px 20px rgba(19,39,63,0.18); }
.button--cream { background: var(--cream); color: var(--navy); box-shadow: 0 7px 18px rgba(0,0,0,0.12); }
.button--ghost { background: rgba(19,39,63,0.08); color: var(--navy); }
.button--danger { background: var(--danger); color: white; }
.mosaic-card > .button { margin-top: 14px; }

.mosaic-finish { padding: 38px 24px; border-radius: 27px 27px 27px 9px; background: var(--navy); color: var(--cream); text-align: center; box-shadow: var(--shadow); }
.finish-medal { display: grid; width: 62px; height: 62px; margin: 0 auto 20px; place-items: center; border: 1px solid rgba(255,255,255,0.22); border-radius: 50%; background: var(--saffron); color: var(--navy); font-size: 32px; }
.mosaic-finish h3 { margin: 6px 0 8px; font-size: 26px; }
.mosaic-finish p:not(.eyebrow) { margin: 0 0 20px; color: rgba(255,246,222,0.66); font-size: 13px; }

.view-intro { max-width: 450px; margin: -4px 2px 15px; font-size: 12px; }
.leaderboard-card { overflow: hidden; border: 1px solid rgba(255,255,255,0.5); border-radius: 24px; background: rgba(255,250,240,0.82); box-shadow: 0 12px 28px rgba(71,47,8,0.11); backdrop-filter: blur(8px); }
.leaderboard-period { padding: 12px 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; text-align: center; }
.leaderboard-list { margin: 0; padding: 7px 12px 12px; list-style: none; counter-reset: places; }
.leaderboard-item { display: grid; grid-template-columns: 39px minmax(0,1fr) auto; align-items: center; gap: 9px; min-height: 58px; padding: 8px 3px; border-bottom: 1px solid rgba(19,39,63,0.08); }
.leaderboard-item:last-child { border-bottom: 0; }
.leaderboard-item.is-current { margin: 4px -4px; padding-right: 7px; padding-left: 7px; border: 0; border-radius: 14px; background: var(--turquoise-pale); }
.rank { display: grid; width: 32px; height: 32px; place-items: center; border-radius: 11px; background: rgba(19,39,63,0.07); color: var(--navy); font-size: 12px; font-weight: 900; }
.leaderboard-item:nth-child(1) .rank { background: #f2c44d; }
.leaderboard-item:nth-child(2) .rank { background: #dfe2df; }
.leaderboard-item:nth-child(3) .rank { background: #dba677; }
.leaderboard-name { min-width: 0; }
.leaderboard-name strong { display: block; overflow: hidden; color: var(--navy); font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-name small { display: block; margin-top: 2px; color: var(--muted); font-size: 9px; }
.leaderboard-score { text-align: right; }
.leaderboard-score strong { display: block; color: var(--navy); font-size: 17px; }
.leaderboard-score small { color: var(--muted); font-size: 9px; }
.empty-state { padding: 42px 24px; text-align: center; }
.empty-state > span { color: var(--turquoise); font-size: 37px; }
.empty-state h3 { margin: 11px 0 4px; color: var(--navy); }
.empty-state p { margin: 0; color: var(--muted); font-size: 12px; }
.privacy-hint { padding: 0 2px; text-align: center; }

.profile-avatar { display: grid; width: 48px; height: 48px; place-items: center; border: 2px solid rgba(255,255,255,0.52); border-radius: 16px 16px 16px 5px; background: var(--navy); color: var(--cream); font-size: 17px; font-weight: 850; box-shadow: 0 7px 18px rgba(19,39,63,0.18); }
.settings-card { margin-top: 0; }
.field-label { display: block; margin-bottom: 6px; color: var(--navy); font-size: 13px; font-weight: 850; }
.field-help { margin: 0 0 9px; color: var(--muted); font-size: 10px; line-height: 1.4; }
.input-wrap { display: flex; height: 49px; align-items: center; gap: 3px; padding: 0 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); }
.input-wrap:focus-within { border-color: var(--turquoise); box-shadow: 0 0 0 3px rgba(47,139,132,0.1); }
.input-wrap span { color: var(--turquoise); font-weight: 850; }
.input-wrap input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--navy); font-size: 15px; font-weight: 700; }
.input-wrap--large { height: 56px; }
.input-wrap--large input { font-size: 17px; }
.field-error { margin: 6px 2px 0; color: var(--danger); font-size: 10px; font-weight: 650; }

.toggle-row { position: relative; display: flex; min-height: 68px; align-items: center; gap: 12px; margin-top: 16px; padding: 13px 54px 13px 0; border-top: 1px solid var(--line); cursor: pointer; }
.toggle-row > span:first-child { min-width: 0; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { color: var(--navy); font-size: 12px; line-height: 1.35; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.toggle-input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-ui { position: absolute; right: 0; width: 43px; height: 25px; border-radius: 20px; background: rgba(19,39,63,0.17); transition: background 0.18s ease; }
.toggle-ui::after { content: ""; position: absolute; width: 19px; height: 19px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 2px 5px rgba(0,0,0,0.18); transition: transform 0.18s ease; }
.toggle-input:checked + .toggle-ui { background: var(--turquoise); }
.toggle-input:checked + .toggle-ui::after { transform: translateX(18px); }
.toggle-input:focus-visible + .toggle-ui { outline: 3px solid rgba(47,139,132,0.2); outline-offset: 2px; }

.hour-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 17px; padding: 11px 0 0; border-top: 1px solid var(--line); }
.hour-row label { color: var(--navy); font-size: 11px; font-weight: 750; }
.hour-row select { min-width: 82px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 11px; outline: none; background: var(--paper); color: var(--navy); font-weight: 750; }
.hour-row select:disabled { opacity: 0.45; }
.form-status { min-height: 15px; margin: 8px 2px 0; color: var(--turquoise); font-size: 10px; text-align: center; }
.form-status.is-error-text { color: var(--danger); }
.profile-links { display: grid; gap: 10px; margin: 14px 0 0; padding: 0 5px; }
.profile-links a, .danger-link { display: flex; width: 100%; justify-content: space-between; padding: 11px 3px; border: 0; border-bottom: 1px solid rgba(19,39,63,0.1); background: transparent; color: var(--navy); font-size: 12px; font-weight: 700; text-decoration: none; cursor: pointer; }
.danger-link { color: var(--danger); text-align: left; }

.hub-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 5px 2px 14px;
}
.hub-welcome h2 { margin: 4px 0 2px; color: var(--navy); font-size: clamp(27px, 8vw, 36px); line-height: 1.05; letter-spacing: -0.045em; }
.hub-welcome > div:first-child > p:last-child { margin: 0; color: rgba(29,43,55,0.66); font-size: 11px; font-weight: 700; }
.hub-streak { display: grid; width: 61px; height: 61px; flex: 0 0 61px; place-items: center; align-content: center; border: 1px solid rgba(255,255,255,0.54); border-radius: 19px 19px 19px 7px; background: rgba(255,250,240,0.76); color: var(--navy); box-shadow: 0 8px 20px rgba(71,47,8,0.1); }
.hub-streak strong { font-size: 22px; line-height: 1; }
.hub-streak span { margin-top: 3px; color: var(--muted); font-size: 8px; font-weight: 800; text-transform: uppercase; }

.hub-hero { position: relative; display: grid; width: 100%; min-height: 191px; overflow: hidden; align-content: end; padding: 21px; border: 0; border-radius: 28px 28px 28px 9px; background: linear-gradient(105deg, rgba(19,39,63,0.99), rgba(19,39,63,0.78)), url("/assets/steppe-hero.png") 78% 58% / cover; color: var(--cream); text-align: left; box-shadow: var(--shadow); cursor: pointer; }
.hub-hero::after { content: ""; position: absolute; top: -80px; right: -40px; width: 190px; height: 190px; border: 1px solid rgba(255,255,255,0.12); border-radius: 50%; box-shadow: 0 0 0 32px rgba(255,255,255,0.03); }
.hub-hero > * { position: relative; z-index: 1; }
.hub-hero__label { color: rgba(255,246,222,0.65); font-size: 9px; font-weight: 850; letter-spacing: 0.12em; text-transform: uppercase; }
.hub-hero > strong { margin-top: 8px; color: var(--sun); font-family: Georgia, serif; font-size: clamp(32px, 10vw, 45px); line-height: 1; }
.hub-hero > span:not(.hub-hero__label) { max-width: 360px; margin-top: 8px; color: rgba(255,246,222,0.75); font-size: 12px; line-height: 1.4; }
.hub-hero > b { margin-top: 15px; font-size: 11px; }
.hub-hero:active { transform: translateY(1px); }

.hub-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; margin-top: 12px; }
.hub-card { display: grid; min-height: 132px; align-content: space-between; gap: 10px; padding: 15px; border: 1px solid rgba(255,255,255,0.5); border-radius: 21px 21px 21px 7px; background: rgba(255,250,240,0.82); color: var(--navy); text-align: left; box-shadow: 0 9px 24px rgba(71,47,8,0.09); cursor: pointer; backdrop-filter: blur(7px); }
.hub-card--wide { grid-column: 1 / -1; grid-template-columns: 43px minmax(0,1fr) auto; min-height: 82px; align-items: center; align-content: center; }
.hub-card--sun { background: linear-gradient(120deg, #ffe3a0, rgba(255,250,240,0.92)); }
.hub-card__icon { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 13px; background: var(--navy); color: var(--sun); font-family: Georgia, serif; font-size: 18px; font-weight: 900; }
.hub-card > span:nth-child(2) { align-self: end; }
.hub-card strong, .hub-card small { display: block; }
.hub-card strong { font-size: 14px; line-height: 1.18; }
.hub-card small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.hub-card > b { align-self: center; font-size: 18px; }
.hub-card:active { transform: translateY(1px); }
.editorial-strip { margin: 13px 5px 0; color: rgba(29,43,55,0.58); font-size: 9px; line-height: 1.45; text-align: center; }

.learning-header { display: flex; align-items: center; gap: 12px; margin: 5px 2px 4px; }
.learning-header h2 { margin: 3px 0 0; color: var(--navy); font-size: clamp(25px, 7vw, 32px); line-height: 1.05; letter-spacing: -0.04em; }
.learning-back { display: grid; width: 42px; height: 42px; flex: 0 0 42px; place-items: center; border: 1px solid rgba(19,39,63,0.12); border-radius: 14px; background: rgba(255,250,240,0.68); color: var(--navy); font-size: 21px; cursor: pointer; }
.learning-intro { margin: 8px 4px 15px; color: rgba(29,43,55,0.66); font-size: 12px; line-height: 1.45; }
.learning-content { display: grid; gap: 11px; }
.learning-panel, .quiz-card, .complete-card { padding: 19px; border: 1px solid rgba(255,255,255,0.5); border-radius: 24px 24px 24px 8px; background: rgba(255,250,240,0.84); color: var(--navy); box-shadow: 0 11px 28px rgba(71,47,8,0.1); backdrop-filter: blur(8px); }
.learning-panel--navy, .quiz-card { border-color: rgba(255,255,255,0.1); background: var(--navy); color: var(--cream); }
.learning-panel h3, .complete-card h3 { margin: 0; font-size: 21px; letter-spacing: -0.03em; }
.learning-panel p, .complete-card p { margin: 8px 0 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.learning-panel--navy p { color: rgba(255,246,222,0.68); }
.learning-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.learning-tag { padding: 6px 9px; border-radius: 9px; background: var(--turquoise-pale); color: #286a65; font-size: 9px; font-weight: 850; }
.learning-panel--navy .learning-tag, .quiz-card .learning-tag { background: rgba(255,255,255,0.11); color: var(--sun); }

.learning-list { display: grid; gap: 9px; }
.learning-list-button { display: grid; width: 100%; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 10px; min-height: 66px; padding: 13px 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); color: var(--navy); text-align: left; cursor: pointer; }
.learning-list-button strong, .learning-list-button small { display: block; }
.learning-list-button strong { font-size: 13px; }
.learning-list-button small { margin-top: 4px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.learning-list-button > b { color: var(--turquoise); font-size: 18px; }
.learning-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.learning-actions .button { flex: 1 1 130px; }

.word-review-list { display: grid; gap: 9px; }
.learning-word-card { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 12px; align-items: center; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); }
.learning-word-card span:first-child { color: var(--navy); font-family: Georgia, serif; font-size: 18px; font-weight: 750; }
.learning-word-card span:last-child { color: var(--muted); font-size: 11px; text-align: right; }

.quiz-progress { height: 5px; overflow: hidden; margin: 0 0 17px; border-radius: 5px; background: rgba(255,255,255,0.12); }
.quiz-progress span { display: block; height: 100%; border-radius: inherit; background: var(--sun); transition: width 0.2s ease; }
.quiz-prompt { margin: 6px 0 18px; color: var(--cream); font-size: clamp(21px, 6vw, 28px); line-height: 1.25; letter-spacing: -0.03em; }
.quiz-options { display: grid; gap: 9px; }
.quiz-option { width: 100%; min-height: 53px; padding: 11px 13px; border: 1px solid rgba(19,39,63,0.09); border-bottom-width: 3px; border-radius: 15px; background: var(--cream); color: var(--navy); font-size: 13px; font-weight: 780; text-align: left; cursor: pointer; }
.quiz-option.is-correct { border-color: var(--turquoise); background: var(--turquoise-pale); }
.quiz-option.is-wrong { border-color: var(--danger); background: var(--danger-pale); }
.quiz-option:disabled { cursor: default; opacity: 0.76; }
.quiz-feedback { margin-top: 13px; padding: 11px 12px; border-radius: 13px; background: rgba(47,139,132,0.22); color: var(--cream); font-size: 11px; line-height: 1.4; }
.quiz-feedback.is-wrong { background: rgba(184,79,69,0.22); }
.quiz-card > .button { margin-top: 11px; }

.topic-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.topic-button { min-height: 83px; padding: 13px; border: 1px solid rgba(255,255,255,0.5); border-radius: 18px 18px 18px 6px; background: rgba(255,250,240,0.84); color: var(--navy); text-align: left; box-shadow: 0 7px 19px rgba(71,47,8,0.08); cursor: pointer; }
.topic-button strong, .topic-button small { display: block; }
.topic-button strong { font-size: 12px; line-height: 1.25; }
.topic-button small { margin-top: 7px; color: var(--muted); font-size: 9px; }

.picture-frame { display: grid; min-height: 210px; overflow: hidden; margin: 2px 0 16px; place-items: center; border-radius: 18px; background: var(--paper); }
.picture-frame img { display: block; width: 100%; max-height: 300px; object-fit: contain; }
.picture-russian { margin: -5px 0 14px; color: rgba(255,246,222,0.66); font-size: 12px; text-align: center; }

.grammar-body { margin-top: 15px; color: var(--ink); font-size: 12px; line-height: 1.58; white-space: pre-line; }
.extra-card-list { display: grid; gap: 7px; margin-top: 14px; }
.extra-card { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 11px; }
.extra-card strong { color: var(--navy); }
.extra-card span { color: var(--muted); text-align: right; }

.progress-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.progress-stat { min-height: 91px; padding: 14px; border-radius: 17px; background: var(--paper); border: 1px solid var(--line); }
.progress-stat strong, .progress-stat span { display: block; }
.progress-stat strong { color: var(--navy); font-size: 27px; line-height: 1; }
.progress-stat span { margin-top: 7px; color: var(--muted); font-size: 9px; font-weight: 750; }
.level-options { display: grid; gap: 8px; margin-top: 13px; }
.level-button { display: flex; width: 100%; min-height: 51px; align-items: center; justify-content: space-between; padding: 11px 13px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--navy); font-size: 12px; font-weight: 780; text-align: left; cursor: pointer; }
.level-button.is-active { border-color: var(--turquoise); background: var(--turquoise-pale); }
.complete-card { padding: 30px 21px; text-align: center; }
.complete-mark { display: grid; width: 62px; height: 62px; margin: 0 auto 17px; place-items: center; border-radius: 50%; background: var(--turquoise); color: white; font-size: 30px; font-weight: 900; }

.bottom-nav {
  position: fixed;
  z-index: 20;
  left: 50%;
  bottom: 0;
  display: grid;
  width: min(100%, 560px);
  grid-template-columns: repeat(5, 1fr);
  padding: 7px 10px calc(7px + var(--safe-bottom));
  border-top: 1px solid rgba(255,255,255,0.44);
  background: rgba(255,250,240,0.93);
  box-shadow: 0 -12px 30px rgba(71,47,8,0.11);
  backdrop-filter: blur(16px);
  transform: translateX(-50%);
}

.nav-button { display: grid; min-height: 54px; place-items: center; align-content: center; gap: 3px; border: 0; border-radius: 13px; background: transparent; color: rgba(19,39,63,0.5); cursor: pointer; }
.nav-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.nav-button span { font-size: 9px; font-weight: 750; }
.nav-button.is-active { background: rgba(47,139,132,0.11); color: var(--navy); }

.onboarding {
  position: fixed;
  z-index: 50;
  inset: 0;
  overflow: auto;
  background: var(--saffron);
}

.onboarding__art {
  position: relative;
  min-height: min(42vh, 340px);
  background:
    linear-gradient(to bottom, rgba(244,173,38,0.06), rgba(244,173,38,0.18) 62%, var(--saffron) 100%),
    url("/assets/steppe-hero.png") center 56% / cover no-repeat;
}

.onboarding__art::after {
  content: "Хальмг кел";
  position: absolute;
  top: calc(var(--safe-top) + 20px);
  left: 20px;
  padding: 8px 12px;
  border-radius: 12px 12px 12px 4px;
  background: var(--navy);
  color: var(--cream);
  font-family: Georgia, serif;
  font-size: 17px;
  box-shadow: 0 8px 20px rgba(19,39,63,0.2);
}

.onboarding__sheet {
  position: relative;
  width: min(100%, 560px);
  min-height: 58vh;
  margin: -34px auto 0;
  padding: 25px 20px calc(28px + var(--safe-bottom));
  border-radius: 29px 29px 0 0;
  background: var(--paper);
  box-shadow: 0 -12px 36px rgba(71,47,8,0.13);
}

.onboarding__sheet h2 { margin: 5px 0 9px; color: var(--navy); font-size: clamp(27px, 8vw, 38px); line-height: 1.04; letter-spacing: -0.05em; }
.onboarding__intro { margin: 0 0 20px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.check-row { position: relative; display: grid; grid-template-columns: 25px 1fr; gap: 10px; margin-top: 14px; cursor: pointer; }
.check-row input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.check-ui { display: grid; width: 24px; height: 24px; place-items: center; border: 1.5px solid rgba(19,39,63,0.23); border-radius: 8px; background: white; color: transparent; font-size: 14px; font-weight: 900; }
.check-row input:checked + .check-ui { border-color: var(--turquoise); background: var(--turquoise); color: white; }
.check-row input:focus-visible + .check-ui { outline: 3px solid rgba(47,139,132,0.2); outline-offset: 2px; }
.check-row strong, .check-row small { display: block; }
.check-row strong { color: var(--navy); font-size: 12px; line-height: 1.35; }
.check-row small { margin-top: 3px; color: var(--muted); font-size: 9px; line-height: 1.4; }
.hour-row--onboarding { margin: 13px 0; padding: 11px; border: 1px solid var(--line); border-radius: 13px; }
.onboarding .button { margin-top: 19px; }
.legal-note { margin: 10px 0 0; color: var(--muted); font-size: 9px; text-align: center; }
.legal-note a { color: var(--turquoise); }

.confirm-dialog { width: calc(100% - 40px); max-width: 390px; padding: 0; border: 0; border-radius: 24px; background: var(--paper); color: var(--ink); box-shadow: 0 25px 70px rgba(0,0,0,0.3); }
.confirm-dialog::backdrop { background: rgba(19,39,63,0.7); backdrop-filter: blur(3px); }
.confirm-dialog form { padding: 24px; text-align: center; }
.dialog-icon { display: grid; width: 45px; height: 45px; margin: 0 auto 14px; place-items: center; border-radius: 50%; background: var(--danger-pale); color: var(--danger); font-weight: 900; }
.confirm-dialog h2 { margin: 0 0 7px; color: var(--navy); font-size: 22px; }
.confirm-dialog p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 20px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: calc(86px + var(--safe-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 11px 15px; border-radius: 13px; background: var(--navy); color: var(--cream); font-size: 11px; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,0.25); transform: translateX(-50%); animation: toast-in 0.2s ease both; }
@keyframes toast-in { from { transform: translate(-50%, 7px); opacity: 0; } }

.is-hidden { display: none !important; }

:focus-visible { outline: 3px solid rgba(47,139,132,0.35); outline-offset: 2px; }

@media (min-width: 561px) {
  body { padding: 14px 0; }
  .app-shell { min-height: calc(100vh - 28px); border-radius: 30px; }
  .bottom-nav { bottom: 14px; border-radius: 18px; }
  .onboarding { left: 50%; width: 560px; transform: translateX(-50%); box-shadow: 0 0 60px rgba(71,47,8,0.24); }
}

@media (max-width: 355px) {
  .app-shell { padding-right: 12px; padding-left: 12px; }
  .audio-row { grid-template-columns: 1fr; }
  .mission-card, .mosaic-card { padding: 17px; }
  .outcome-button { padding-right: 9px; padding-left: 9px; }
  .nav-button span { font-size: 8px; }
  .hub-grid, .topic-grid { grid-template-columns: 1fr; }
  .hub-card--wide { grid-column: auto; grid-template-columns: 39px minmax(0,1fr) auto; }
  .onboarding__sheet { padding-right: 16px; padding-left: 16px; }
}

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

.privacy-shell {
  position: relative;
  width: min(100%, 560px);
  min-height: 100vh;
  margin: 0 auto;
  padding: calc(var(--safe-top) + 18px) 16px calc(var(--safe-bottom) + 34px);
}

.privacy-back { display: inline-flex; align-items: center; gap: 7px; padding: 8px 0; color: var(--navy); font-size: 12px; font-weight: 800; text-decoration: none; }
.privacy-back span { font-size: 19px; }
.privacy-header { margin: 23px 2px 20px; }
.privacy-header h1 { max-width: 450px; margin: 6px 0 10px; color: var(--navy); font-size: clamp(31px, 9vw, 44px); line-height: 1.02; letter-spacing: -0.055em; }
.privacy-header > p:last-child { max-width: 440px; margin: 0; color: rgba(29,43,55,0.7); font-size: 13px; line-height: 1.5; }
.privacy-card { margin-top: 11px; padding: 19px; border: 1px solid rgba(255,255,255,0.5); border-radius: 22px 22px 22px 8px; background: rgba(255,250,240,0.84); box-shadow: 0 10px 25px rgba(71,47,8,0.1); backdrop-filter: blur(8px); }
.privacy-card h2 { margin: 0 0 9px; color: var(--navy); font-size: 18px; letter-spacing: -0.025em; }
.privacy-card p { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.52; }
.privacy-card ul { display: grid; gap: 9px; margin: 0; padding-left: 19px; color: var(--muted); font-size: 12px; line-height: 1.48; }
.privacy-card li::marker { color: var(--turquoise); }
.privacy-card strong { color: var(--navy); }
.privacy-visible { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0; }
.privacy-visible span { padding: 8px 11px; border-radius: 11px; background: var(--turquoise-pale); color: #286a65; font-size: 11px; font-weight: 800; }
.privacy-return { display: block; margin-top: 18px; text-align: center; text-decoration: none; }
.privacy-footnote { margin: 14px 5px 0; color: rgba(29,43,55,0.58); font-size: 10px; line-height: 1.45; text-align: center; }
