/* Лингора v2 — original identity: ink-violet + saffron + lagoon.
   System font stack, 4pt spacing grid, no fixed heights on text containers. */

:root {
  --bg: #100E1C;
  --bg-glow-1: rgba(123, 108, 255, .22);
  --bg-glow-2: rgba(255, 164, 76, .10);
  --surface: #1A1729;
  --surface-2: #231F36;
  --surface-3: #2C2744;
  --line: rgba(236, 232, 255, .09);
  --line-2: rgba(236, 232, 255, .16);
  --ink: #F3F0FF;
  --ink-2: #D2CCEA;
  --muted: #9D96BA;
  --iris: #7B6CFF;
  --iris-deep: #5B4BE0;
  --iris-soft: rgba(123, 108, 255, .16);
  --on-iris: #FFFFFF;
  --saffron: #FFB547;
  --saffron-soft: rgba(255, 181, 71, .14);
  --lagoon: #2EC4B6;
  --lagoon-soft: rgba(46, 196, 182, .14);
  --rose: #FF5C7C;
  --rose-soft: rgba(255, 92, 124, .13);
  --offer-a: #6E5BFF;
  --offer-b: #B64DFF;
  --offer-c: #FF8A5B;
  --shadow: 0 10px 30px rgba(5, 3, 20, .35);
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --fs-xs: 12px;
  --fs-sm: 13.5px;
  --fs-md: 15px;
  --fs-lg: 17px;
  --fs-xl: 20px;
  --fs-2xl: 24px;
  --fs-3xl: 30px;
  --tab-h: 62px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --pad: 16px;
  color-scheme: dark;
}
html[data-theme="light"] {
  --bg: #F4F2FB;
  --bg-glow-1: rgba(123, 108, 255, .16);
  --bg-glow-2: rgba(255, 164, 76, .10);
  --surface: #FFFFFF;
  --surface-2: #F1EEFB;
  --surface-3: #E6E1F7;
  --line: rgba(28, 22, 60, .09);
  --line-2: rgba(28, 22, 60, .16);
  --ink: #1B1633;
  --ink-2: #3B3458;
  --muted: #6C6589;
  --iris: #5E4DF0;
  --iris-deep: #4636C9;
  --iris-soft: rgba(94, 77, 240, .10);
  --saffron: #E58F0B;
  --saffron-soft: rgba(229, 143, 11, .12);
  --lagoon: #0F9E91;
  --lagoon-soft: rgba(15, 158, 145, .11);
  --rose: #E23A5E;
  --rose-soft: rgba(226, 58, 94, .10);
  --shadow: 0 8px 24px rgba(40, 30, 90, .10);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: 72px; scroll-padding-bottom: calc(var(--tab-h) + var(--safe-b) + 16px); }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--ink); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: var(--fs-md);
  line-height: 1.45;
  min-height: 100vh;
  min-height: var(--tg-vh, 100dvh);
  overflow-x: hidden;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: manual;
  background:
    radial-gradient(120% 60% at 0% -10%, var(--bg-glow-1), transparent 60%),
    radial-gradient(90% 50% at 110% 0%, var(--bg-glow-2), transparent 55%),
    var(--bg);
  background-attachment: fixed;
}
button, input { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, h4, p { margin: 0; }
img, svg { display: block; max-width: 100%; }
.ic { display: inline-flex; width: 20px; height: 20px; flex: 0 0 auto; }
.ic svg { width: 100%; height: 100%; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: calc(10px + var(--safe-t)) var(--pad) 10px;
  max-width: 560px; margin: 0 auto;
  background: var(--bg);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.brand {
  display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 auto;
  background: none; border: 0; padding: 0; text-align: left;
}
.brand-mark { width: 38px; height: 38px; flex: 0 0 38px; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name { font-weight: 800; font-size: var(--fs-lg); letter-spacing: -.01em; line-height: 1.15; }
.brand-sub {
  font-size: var(--fs-xs); color: var(--muted); line-height: 1.3; overflow-wrap: anywhere;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}
.top-chips { display: flex; gap: 6px; flex: 0 0 auto; }
.chip {
  display: inline-flex; align-items: center; gap: 4px;
  height: 32px; padding: 0 10px; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line);
  font-size: var(--fs-sm); font-weight: 700; white-space: nowrap;
}
.chip .ic { width: 16px; height: 16px; }
.chip-streak { color: var(--saffron); }
.chip-xp { color: var(--iris); }
html[data-theme="dark"] .chip-xp { color: #B3A9FF; }

/* ---------- layout ---------- */
.view {
  display: flex; flex-direction: column; gap: 12px;
  max-width: 560px; margin: 0 auto;
  padding: 4px var(--pad) calc(var(--tab-h) + var(--safe-b) + 24px);
  outline: none;
}
.view > * { min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row > * { min-width: 0; }
.grow { flex: 1 1 auto; min-width: 0; }
.mt4 { margin-top: 4px; } .mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.center { text-align: center; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-sm); }
.xs { font-size: var(--fs-xs); }
.strong { font-weight: 700; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 16px;
  min-width: 0;
}
.card.tight { padding: 12px 14px; }
.eyebrow {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  color: var(--muted);
}
.h1 { font-size: var(--fs-2xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.h2 { font-size: var(--fs-xl); font-weight: 800; letter-spacing: -.01em; line-height: 1.25; }
.h3 { font-size: var(--fs-lg); font-weight: 700; line-height: 1.3; }
.screen-head { display: flex; align-items: center; gap: 12px; padding: 4px 0 2px; }
.screen-head .mascot { width: 48px; height: 48px; flex: 0 0 48px; }
.screen-head p { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 12px 18px;
  border-radius: var(--r-md); border: 1px solid transparent;
  font-weight: 700; font-size: var(--fs-md); line-height: 1.25;
  text-align: center; white-space: normal; overflow-wrap: break-word; hyphens: manual;
  transition: transform .08s ease, filter .15s ease, background .15s ease;
  user-select: none;
}
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-primary { background: var(--iris); color: var(--on-iris); box-shadow: 0 6px 18px color-mix(in srgb, var(--iris) 35%, transparent); }
.btn-primary:hover { filter: brightness(1.06); }
.btn-light { background: #fff; color: #2A1F66; }
.btn-soft { background: var(--iris-soft); color: var(--iris); }
html[data-theme="dark"] .btn-soft { color: #C4BCFF; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ok { background: var(--lagoon); color: #fff; }
.btn-block { display: flex; width: 100%; }
.btn-sm { min-height: 38px; padding: 8px 14px; font-size: var(--fs-sm); border-radius: var(--r-sm); }
.btn-link { background: none; border: 0; padding: 6px 0; color: var(--iris); font-weight: 700; font-size: var(--fs-sm); min-height: 32px; text-align: left; }
html[data-theme="dark"] .btn-link { color: #B3A9FF; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.btn-row > .btn { flex: 1 1 140px; }
.icon-btn {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink);
}
.icon-btn .ic { width: 20px; height: 20px; }
.spinner { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- mascot ---------- */
.mascot { display: inline-block; width: 64px; height: 64px; flex: 0 0 auto; }
.mascot svg { width: 100%; height: 100%; overflow: visible; }
.mascot.xl { width: 104px; height: 104px; }
.mascot.lg { width: 84px; height: 84px; }
.mascot.sm { width: 44px; height: 44px; }
.mascot.bob svg { animation: bob 3.2s ease-in-out infinite; }
@keyframes bob { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@media (prefers-reduced-motion: reduce) { .mascot.bob svg { animation: none; } }

/* ---------- offer (subscription) ---------- */
.offer {
  position: relative; overflow: visible; /* never clip CTA / tag / bobbing mascot */
  border-radius: var(--r-lg); padding: 16px;
  color: #fff;
  background: transparent;
  box-shadow: 0 14px 34px rgba(110, 91, 255, .30);
  isolation: isolate;
}
.offer::before {
  content: ""; position: absolute; inset: 0; z-index: 0; border-radius: inherit;
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--offer-c) 70%, transparent), transparent 55%),
    linear-gradient(135deg, var(--offer-a), var(--offer-b));
  pointer-events: none;
}
.offer::after {
  content: ""; position: absolute; right: -40px; bottom: -60px; width: 180px; height: 180px; border-radius: 50%;
  background: rgba(255,255,255,.08); pointer-events: none; z-index: 0;
}
.offer > * { position: relative; z-index: 1; }
.offer-top { display: flex; align-items: flex-start; gap: 12px; min-width: 0; }
.offer-top .mascot { width: 56px; height: 56px; flex: 0 0 56px; margin-top: 2px; }
.offer-tag {
  display: inline-flex; align-items: center; flex-wrap: wrap; gap: 6px; padding: 3px 9px; border-radius: 999px;
  background: rgba(255,255,255,.18); font-size: var(--fs-xs); font-weight: 700;
  max-width: 100%; line-height: 1.35;
}
.offer-title { font-size: var(--fs-xl); font-weight: 800; line-height: 1.25; margin-top: 6px; letter-spacing: -.01em; overflow-wrap: break-word; }
.offer-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.offer-list li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.35; }
.offer-list li .ic { width: 16px; height: 16px; margin-top: 1px; color: #FFE1A8; }
.offer-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 8px; margin-top: 12px; }
.offer-price b { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.02em; line-height: 1; }
.offer-price span { font-size: var(--fs-sm); opacity: .9; }
.offer .btn-light { margin-top: 12px; }

/* Compact home offer — keeps Continue CTA above the fold on ~640px Telegram viewports */
.offer--home { padding: 14px; }
.offer--home .offer-title { font-size: var(--fs-lg); margin-top: 4px; }
.offer--home .offer-list { margin-top: 8px; gap: 4px; }
.offer--home .offer-price { margin-top: 8px; }
.offer--home .offer-price b { font-size: var(--fs-2xl); }
.offer--home .btn-light { margin-top: 10px; min-height: 46px; }
.offer--home .offer-note { margin-top: 6px; }
.offer--home .offer-top .mascot { width: 44px; height: 44px; flex: 0 0 44px; }
.offer--home .offer-pending { margin-top: 10px; padding: 10px; }
.offer-note { font-size: var(--fs-xs); opacity: .85; margin-top: 8px; text-align: center; }
.offer-pending { margin-top: 12px; padding: 12px; border-radius: var(--r-md); background: rgba(0,0,0,.18); }
.offer-pending p { font-size: var(--fs-sm); }
.offer-pending .btn-row { margin-top: 10px; }
.offer-pending .btn-ghost { border-color: rgba(255,255,255,.45); color: #fff; }

.sub-status { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 12px; }
.sub-status .grow { flex: 1 1 140px; min-width: 0; }
.sub-status .btn { flex: 0 0 auto; }
.sub-status .badge-ic {
  width: 40px; height: 40px; flex: 0 0 40px; border-radius: 12px;
  display: grid; place-items: center; background: var(--lagoon-soft); color: var(--lagoon);
}
.sub-status .badge-ic .ic { width: 22px; height: 22px; }

/* ---------- continue ---------- */
.continue { display: flex; flex-direction: column; gap: 10px; }
.continue-title { font-size: var(--fs-xl); font-weight: 800; line-height: 1.25; letter-spacing: -.01em; }
.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter > i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--iris), #A08FFF); transition: width .35s ease; }
.meter.ok > i { background: linear-gradient(90deg, var(--lagoon), #6FE0D4); }
.meter.warm > i { background: linear-gradient(90deg, var(--saffron), #FFD08A); }
.meta-row { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; font-size: var(--fs-sm); color: var(--muted); }

/* ---------- plan ---------- */
.plan-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.plan-list { display: grid; gap: 8px; margin-top: 12px; }
.plan-item {
  display: flex; align-items: center; gap: 12px; width: 100%;
  padding: 10px 12px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1px solid var(--line); text-align: left;
}
.plan-item .dot {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 50%;
  display: grid; place-items: center; border: 2px solid var(--line-2); color: transparent;
}
.plan-item .dot .ic { width: 16px; height: 16px; }
.plan-item.done .dot { background: var(--lagoon); border-color: var(--lagoon); color: #fff; }
.plan-item.done .plan-title { color: var(--muted); }
.plan-title { font-weight: 700; font-size: var(--fs-md); line-height: 1.3; }
.plan-sub { font-size: var(--fs-sm); color: var(--muted); line-height: 1.3; }
.plan-item .chev { color: var(--muted); width: 18px; height: 18px; }
.ring { position: relative; width: 44px; height: 44px; flex: 0 0 44px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring b { position: absolute; inset: 0; display: grid; place-items: center; font-size: var(--fs-xs); font-weight: 800; }

/* ---------- word of the day ---------- */
.wotd-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: var(--fs-xs); font-weight: 700;
  max-width: 100%;
}
.pill.free { background: var(--lagoon-soft); color: var(--lagoon); border-color: transparent; }
.pill.lock { background: var(--saffron-soft); color: var(--saffron); border-color: transparent; }
.pill.iris { background: var(--iris-soft); color: var(--iris); border-color: transparent; }
html[data-theme="dark"] .pill.iris { color: #C4BCFF; }
.word-big { font-size: var(--fs-3xl); font-weight: 800; letter-spacing: -.02em; line-height: 1.15; margin-top: 12px; overflow-wrap: anywhere; hyphens: manual; }
.word-reading { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; overflow-wrap: anywhere; }
.word-ru { font-size: var(--fs-lg); font-weight: 700; margin-top: 8px; }
.example { margin-top: 12px; padding: 10px 12px; border-left: 3px solid var(--iris); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; }
.example .en { font-weight: 600; }
.example .ru { color: var(--muted); font-size: var(--fs-sm); margin-top: 2px; }
.skel { color: transparent !important; background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2)); background-size: 200% 100%; border-radius: 8px; animation: skel 1.2s linear infinite; }
@keyframes skel { to { background-position: -200% 0; } }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.stat { background: var(--surface-2); border-radius: var(--r-md); padding: 10px 6px; text-align: center; min-width: 0; }
.stat b { display: block; font-size: var(--fs-xl); font-weight: 800; line-height: 1.1; }
.stat span { display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; line-height: 1.2; }
@media (max-width: 340px) { .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.invite { display: flex; gap: 12px; align-items: center; }
.invite .mascot { width: 52px; height: 52px; flex: 0 0 52px; }

/* ---------- learn / course ---------- */
.course-hero { display: flex; gap: 14px; align-items: center; }
.course-hero .ring { width: 64px; height: 64px; flex: 0 0 64px; }
.course-hero .ring b { font-size: var(--fs-sm); }
.module { display: flex; flex-direction: column; gap: 8px; }
.module-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; padding: 6px 2px 0; }
.module-head .h3 { font-size: var(--fs-md); }
.steps { display: flex; flex-direction: column; gap: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.step {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; background: transparent; border: 0; border-top: 1px solid var(--line);
  min-height: 60px;
}
.step:first-child { border-top: 0; }
.step .num {
  width: 34px; height: 34px; flex: 0 0 34px; border-radius: 11px;
  display: grid; place-items: center; font-weight: 800; font-size: var(--fs-sm);
  background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--line);
}
.step .num .ic { width: 16px; height: 16px; }
.step.done .num { background: var(--lagoon-soft); color: var(--lagoon); border-color: transparent; }
.step.current { background: var(--iris-soft); }
.step.current .num { background: var(--iris); color: #fff; border-color: transparent; }
.step.locked .num { color: var(--muted); }
.step-title { font-weight: 700; line-height: 1.3; }
.step-meta { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.step .tail { flex: 0 0 auto; color: var(--muted); display: flex; align-items: center; }
.step .tail .ic { width: 18px; height: 18px; }
.step .go-pill { padding: 5px 10px; border-radius: 999px; background: var(--iris); color: #fff; font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
.kind-tag { padding: 1px 7px; border-radius: 6px; background: var(--surface-2); font-weight: 700; }

/* ---------- lesson / quiz session ---------- */
.session-top { display: flex; align-items: center; gap: 10px; }
.session-top .meter { flex: 1 1 auto; height: 10px; }
.session-top .count { font-size: var(--fs-sm); color: var(--muted); font-weight: 700; white-space: nowrap; }
.lesson-body { white-space: pre-line; line-height: 1.55; font-size: var(--fs-md); color: var(--ink-2); }
.lesson-intro { display: flex; flex-direction: column; gap: 12px; }
.skills { display: flex; gap: 6px; flex-wrap: wrap; }
.teach-card { text-align: center; padding: 22px 16px; border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line); }
.teach-term { font-size: var(--fs-3xl); font-weight: 800; line-height: 1.15; overflow-wrap: anywhere; hyphens: manual; }
.teach-ru { font-size: var(--fs-lg); font-weight: 600; margin-top: 10px; color: var(--ink-2); }
.teach-note { margin-top: 10px; display: inline-flex; }
.prompt { font-size: var(--fs-xl); font-weight: 800; line-height: 1.3; letter-spacing: -.01em; overflow-wrap: break-word; }
.prompt-sub { color: var(--muted); font-size: var(--fs-sm); margin-top: 4px; }
.options { display: grid; gap: 8px; margin-top: 14px; }
.opt {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px;
  padding: 10px 14px; border-radius: var(--r-md); text-align: left;
  background: var(--surface-2); border: 1.5px solid var(--line-2);
  font-weight: 600; line-height: 1.3; overflow-wrap: break-word;
  transition: border-color .15s ease, background .15s ease;
}
.opt .key {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 8px; display: grid; place-items: center;
  font-size: var(--fs-xs); font-weight: 800; background: var(--surface-3); color: var(--muted);
}
.opt .txt { flex: 1 1 auto; min-width: 0; }
.opt:not(:disabled):active { border-color: var(--iris); }
.opt:disabled { cursor: default; }
.opt.correct { border-color: var(--lagoon); background: var(--lagoon-soft); }
.opt.correct .key { background: var(--lagoon); color: #fff; }
.opt.wrong { border-color: var(--rose); background: var(--rose-soft); }
.opt.wrong .key { background: var(--rose); color: #fff; }
.opt.dim { opacity: .55; }
.feedback { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); border: 1px solid transparent; }
.feedback.ok { background: var(--lagoon-soft); border-color: color-mix(in srgb, var(--lagoon) 35%, transparent); }
.feedback.bad { background: var(--rose-soft); border-color: color-mix(in srgb, var(--rose) 35%, transparent); }
.feedback .fb-title { font-weight: 800; display: flex; align-items: center; gap: 6px; }
.feedback.ok .fb-title { color: var(--lagoon); }
.feedback.bad .fb-title { color: var(--rose); }
.feedback .fb-why { margin-top: 4px; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.45; }
.feedback .fb-why b { color: var(--ink); }
.result-hero { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; }
.score-big { font-size: 44px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.review-list { display: grid; gap: 8px; margin-top: 8px; text-align: left; }
.review-item { padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border-left: 3px solid var(--rose); }
.review-item .w { font-weight: 700; overflow-wrap: break-word; }
.review-item .e { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }

/* ---------- practice ---------- */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); }
.seg button { min-height: 40px; border-radius: 10px; border: 0; background: transparent; font-weight: 700; color: var(--muted); }
.seg button.on { background: var(--iris); color: #fff; }
.modes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.mode {
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px; text-align: left;
  padding: 14px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line);
  min-height: 128px; min-width: 0;
}
.mode .mi { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.mode .mi .ic { width: 20px; height: 20px; }
.mode b { font-size: var(--fs-md); line-height: 1.25; }
.mode span.d { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; }
.mode.wide { grid-column: 1 / -1; flex-direction: row; align-items: center; min-height: 0; }
.mode.wide > div { min-width: 0; flex: 1 1 auto; }
.mode:disabled { opacity: .55; }
.mi.c1 { background: var(--iris-soft); color: var(--iris); }
.mi.c2 { background: var(--saffron-soft); color: var(--saffron); }
.mi.c3 { background: var(--lagoon-soft); color: var(--lagoon); }
.mi.c4 { background: var(--rose-soft); color: var(--rose); }
html[data-theme="dark"] .mi.c1 { color: #B3A9FF; }
@media (max-width: 340px) { .mode { padding: 12px; } }

.list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; }
.li {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 12px 14px; min-height: 58px; background: transparent; border: 0; border-top: 1px solid var(--line);
}
.li:first-child { border-top: 0; }
.li .lead { width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px; display: grid; place-items: center; background: var(--surface-2); font-size: 20px; }
.li .lead .ic { width: 20px; height: 20px; }
.li-title { font-weight: 700; line-height: 1.3; }
.li-sub { font-size: var(--fs-xs); color: var(--muted); margin-top: 2px; line-height: 1.35; }
.li .trail { flex: 0 0 auto; display: flex; align-items: center; gap: 6px; color: var(--muted); }
.li .trail .ic { width: 18px; height: 18px; }
.li.sel { background: var(--iris-soft); }
.price-pill { padding: 6px 10px; border-radius: 999px; background: var(--iris); color: #fff; font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }
.ok-pill { padding: 5px 10px; border-radius: 999px; background: var(--lagoon-soft); color: var(--lagoon); font-size: var(--fs-xs); font-weight: 800; white-space: nowrap; }

/* ---------- dialogue ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 88%; padding: 10px 12px; border-radius: 16px 16px 16px 4px; background: var(--surface); border: 1px solid var(--line); align-self: flex-start; min-width: 0; }
.bubble.me { align-self: flex-end; border-radius: 16px 16px 4px 16px; background: var(--iris-soft); border-color: transparent; }
.bubble .sp { font-size: var(--fs-xs); font-weight: 800; color: var(--muted); display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.bubble .t { font-weight: 600; margin-top: 2px; }
.bubble .r { font-size: var(--fs-sm); color: var(--muted); margin-top: 2px; }
.bubble .say { background: none; border: 0; padding: 4px; color: var(--iris); display: inline-flex; min-width: 32px; min-height: 32px; align-items: center; justify-content: center; }
.input {
  width: 100%; min-height: 48px; padding: 12px 14px; border-radius: var(--r-md);
  background: var(--surface-2); border: 1.5px solid var(--line-2); color: var(--ink); outline: none;
}
.input:focus { border-color: var(--iris); }

/* ---------- profile ---------- */
.profile-hero { display: flex; gap: 14px; align-items: center; }
.profile-hero .mascot { width: 68px; height: 68px; flex: 0 0 68px; }
.kv { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); font-size: var(--fs-sm); flex-wrap: wrap; }
.kv:first-child { border-top: 0; }
.kv span:first-child { color: var(--muted); }
.kv span:last-child { font-weight: 700; text-align: right; }

/* ---------- subscription page ---------- */
.benefits { display: grid; gap: 10px; }
.benefit { display: flex; gap: 12px; align-items: flex-start; }
.benefit .bi { width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; display: grid; place-items: center; background: var(--iris-soft); color: var(--iris); }
html[data-theme="dark"] .benefit .bi { color: #B3A9FF; }
.benefit .bi .ic { width: 18px; height: 18px; }
.benefit b { display: block; line-height: 1.3; }
.benefit span { font-size: var(--fs-sm); color: var(--muted); line-height: 1.35; }
.faq { display: grid; gap: 10px; font-size: var(--fs-sm); }
.faq b { display: block; }
.faq span { color: var(--muted); }

.gate { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; }
.gate p { color: var(--muted); font-size: var(--fs-sm); }

.back { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; color: var(--muted); font-weight: 700; padding: 6px 0; min-height: 36px; }
.back .ic { width: 18px; height: 18px; }

/* ---------- tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  max-width: 560px; margin: 0 auto;
  padding: 6px 6px calc(6px + var(--safe-b));
  background: var(--surface);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tab-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-height: 50px; padding: 4px 2px; border: 0; background: none; border-radius: 12px;
  color: var(--muted); font-size: 11px; font-weight: 700; line-height: 1.15; min-width: 0;
}
.tab-btn span { max-width: 100%; overflow-wrap: break-word; text-align: center; }
.tab-btn .ic { width: 22px; height: 22px; }
.tab-btn.active { color: var(--iris); }
html[data-theme="dark"] .tab-btn.active { color: #B3A9FF; }
.tab-btn.active .ic { background: var(--iris-soft); border-radius: 10px; width: 44px; padding: 1px 11px; }
@media (max-width: 340px) { .tab-btn { font-size: 10.5px; } }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; transform: translateX(-50%); z-index: 50;
  bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  width: max-content; max-width: calc(100% - 32px);
  padding: 10px 14px; border-radius: 12px;
  background: var(--ink); color: var(--bg);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.35; text-align: center;
  box-shadow: var(--shadow);
}

/* compact tokens never wrap mid-price */
.pill.lock, .price-pill, .ok-pill, .go-pill, .chip, .plan-item .pill, .li .trail > * { white-space: nowrap; flex-shrink: 0; }
.offer-tag { max-width: 100%; }
.offer-tag span { overflow-wrap: anywhere; min-width: 0; }

p, .lesson-body, .fb-why, .li-sub, .plan-sub, .mode .d, .benefit span, .faq span, .review-item .e, .offer-list li { hyphens: auto; -webkit-hyphens: auto; }
.btn-sm { white-space: nowrap; flex-shrink: 0; }

/* --- unified account / legal / MAX (2026-09-28) --- */
.link-code { font: 700 30px/1.2 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .18em; text-align: center; padding: 14px 8px; border-radius: 14px; background: var(--surface-2, rgba(127,127,127,.12)); margin: 4px 0 8px; user-select: all; }
.legal-head { display: flex; align-items: center; gap: 8px; width: 100%; background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
.legal-head .ic { transform: rotate(90deg); opacity: .6; transition: transform .2s; flex: none; }
.legal-head[aria-expanded="false"] .ic { transform: rotate(0deg); }
.legal-body { margin-top: 8px; }
.legal-body p { margin: 6px 0; overflow-wrap: anywhere; }
.danger-zone { border: 1px solid rgba(255, 92, 92, .35); }
.btn-danger { color: #ff6b6b; border-color: rgba(255, 92, 92, .45); }
.btn-row .input { flex: 1 1 auto; min-width: 0; text-transform: uppercase; }

/* ---------- sticky home pay dock (easy purchase) ---------- */
.pay-dock {
  position: fixed; left: 0; right: 0; z-index: 28;
  bottom: calc(var(--tab-h) + var(--safe-b));
  max-width: 560px; margin: 0 auto;
  padding: 10px var(--pad) 10px;
  display: flex; flex-wrap: wrap; gap: 8px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(5, 3, 20, .18);
}
.pay-dock .btn { flex: 1 1 140px; min-height: 46px; }
.pay-dock .btn > span { min-width: 0; }
body.has-pay-dock .view {
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 118px);
}
body.has-pay-dock .toast {
  bottom: calc(var(--tab-h) + var(--safe-b) + 102px);
}
.btn > span { min-width: 0; }

/* fix 2026-09-29: decorative .offer::after blob (right:-40px) caused horizontal scroll on narrow phones */
.view { overflow-x: clip; }

/* ---------- pricing 2026-09-29: plan picker (1/3/6/12 months × languages) ---------- */
.offer-best { flex: 1 1 100%; font-size: var(--fs-xs); opacity: .95; line-height: 1.35; }
.sub-hero { display: flex; align-items: center; gap: 12px; padding: 2px 0; min-width: 0; }
.sub-hero .mascot { width: 64px; height: 64px; flex: 0 0 64px; }
.sub-hero .grow { min-width: 0; }
.sub-hero p { color: var(--ink-2); line-height: 1.4; }
.pick-step { display: flex; align-items: flex-start; gap: 10px; }
.pick-step .grow { min-width: 0; }
.step-no {
  width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; display: grid; place-items: center;
  background: var(--iris-soft); color: var(--iris); font-weight: 800; font-size: var(--fs-sm);
}
html[data-theme="dark"] .step-no { color: #C4BCFF; }
.lang-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.lang-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 7px 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  font-size: var(--fs-sm); font-weight: 600; line-height: 1.2; max-width: 100%; cursor: pointer;
  transition: background .15s ease, border-color .15s ease;
}
.lang-chip .flag { font-size: 17px; line-height: 1; }
.lang-chip .nm { min-width: 0; overflow-wrap: anywhere; }
.lang-chip .ic { width: 15px; height: 15px; flex: 0 0 15px; }
.lang-chip.on { background: var(--iris-soft); border-color: var(--iris); }
html[data-theme="dark"] .lang-chip.on { color: #E4DFFF; }
.lang-chip.locked { border-style: dashed; }
.xs .ic { width: 13px; height: 13px; vertical-align: -2px; }

.plans { display: grid; gap: 10px; }
.plan-opt {
  position: relative; display: grid; width: 100%; text-align: left; cursor: pointer;
  grid-template-columns: 22px minmax(0, 1fr) auto; grid-template-areas: "radio main price" ". badges badges";
  align-items: center; gap: 6px 12px; padding: 14px 14px 12px;
  border-radius: var(--r-md); border: 1.5px solid var(--line-2); background: var(--surface-2); color: var(--ink);
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.plan-opt.best { margin-top: 10px; padding-top: 18px; }
.plan-opt.sel {
  border-color: var(--iris); background: color-mix(in srgb, var(--iris) 12%, var(--surface-2));
  box-shadow: 0 6px 20px color-mix(in srgb, var(--iris) 22%, transparent);
}
.plan-radio { grid-area: radio; width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); display: block; }
.plan-opt.sel .plan-radio { border-color: var(--iris); background: radial-gradient(circle, var(--iris) 0 45%, transparent 50%); }
.plan-main { grid-area: main; display: flex; flex-direction: column; min-width: 0; }
.plan-name { font-weight: 800; font-size: var(--fs-md); line-height: 1.25; }
.plan-per { font-size: var(--fs-xs); color: var(--muted); line-height: 1.35; margin-top: 2px; }
.plan-price { grid-area: price; display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.plan-price b { font-size: var(--fs-lg); font-weight: 800; line-height: 1.2; white-space: nowrap; letter-spacing: -.01em; }
.plan-price s { font-size: var(--fs-xs); color: var(--muted); white-space: nowrap; margin-top: 2px; }
.plan-badges { grid-area: badges; display: flex; flex-wrap: wrap; gap: 6px; }
.disc-badge, .save-badge, .plain-badge {
  display: inline-flex; align-items: center; padding: 3px 8px; border-radius: 999px;
  font-size: var(--fs-xs); font-weight: 800; line-height: 1.3; white-space: nowrap;
}
.disc-badge { background: var(--saffron); color: #2A1B00; }
.save-badge { background: var(--lagoon-soft); color: var(--lagoon); }
.plain-badge { background: var(--surface-3); color: var(--muted); font-weight: 700; white-space: normal; }
.plan-ribbon {
  position: absolute; top: -11px; right: 12px; display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 800; line-height: 1.35; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, var(--offer-a), var(--offer-b));
  box-shadow: 0 4px 12px rgba(110, 91, 255, .35);
}
.plan-ribbon .ic { width: 12px; height: 12px; }
@media (max-width: 360px) {
  .plan-opt { gap: 6px 10px; padding-left: 12px; padding-right: 12px; }
  .plan-price b { font-size: var(--fs-md); }
}

.sub-summary { border-color: color-mix(in srgb, var(--iris) 40%, var(--line)); }
.sum-rows .kv span:first-child { flex: 1 1 160px; min-width: 0; }
.kv.save span:last-child { color: var(--lagoon); }
.kv.total { font-size: var(--fs-lg); }
.kv.total span:first-child { color: var(--ink); font-weight: 800; }
.kv.total span:last-child { font-weight: 800; }
.btn-pay { min-height: 52px; font-size: var(--fs-lg); }
.assure { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.assure li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.4; }
.assure li .ic { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; color: var(--lagoon); }
.assure b { color: var(--ink); }

.fvp { display: grid; gap: 14px; }
@media (min-width: 520px) { .fvp { grid-template-columns: 1fr 1fr; } }
.fvp-col { min-width: 0; }
.fvp-col.paid .eyebrow { color: var(--iris); }
html[data-theme="dark"] .fvp-col.paid .eyebrow { color: #B3A9FF; }
.check-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.check-list li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-sm); line-height: 1.4; }
.check-list li .ic { width: 16px; height: 16px; flex: 0 0 16px; margin-top: 2px; color: var(--lagoon); }
.fvp-col.paid .check-list li .ic { color: var(--iris); }
html[data-theme="dark"] .fvp-col.paid .check-list li .ic { color: #B3A9FF; }

/* pricing 2026-09-29: home offer savings chip + benefits card on top */
.nw { white-space: nowrap; }
.offer-price .offer-best b { font-size: inherit; line-height: inherit; font-weight: 800; letter-spacing: 0; }
.offer-save { display: inline-block; margin-top: 4px; padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.22); font-weight: 700; }
.fvp .check-list b { font-weight: 700; color: var(--ink); }
@media (max-width: 519px) { .fvp-col.paid + .fvp-col { padding-top: 12px; border-top: 1px solid var(--line-2); } }
