/* Slowingo Grammar — site styles */

/* Palette from the lesson previews in slowingo-english (localized, preview folders). */
:root {
  --bg: #fbfaf7;
  --bg-2: #ffffff;
  --bg-3: #f3f1eb;
  --ink: #1d2330;
  --ink-2: #5b6474;
  --ink-3: #686f7c;
  --line: #e6e2d9;
  --line-2: #d6d1c5;
  --field: #8c877c;
  --brand: #2f6fe4;
  --brand-2: #2358b8;
  --brand-soft: #e8effd;
  --coral: #d9480f;
  --ek: #d9480f;
  --ek-soft: #fff0e6;
  --gold: #fff7d6;
  --good: #18753f;
  --good-soft: #e9f7ef;
  --bad: #c92a2a;
  --bad-soft: #fdecec;
  --warn: #a46a00;
  --warn-soft: #fff6dd;
  --grad: linear-gradient(120deg, #2f6fe4 0%, #6a4fd8 55%, #d9480f 100%);
  --shadow-1: 0 1px 2px rgba(29, 35, 48, .06);
  --shadow-2: 0 10px 28px -14px rgba(29, 35, 48, .2), 0 2px 6px rgba(29, 35, 48, .05);
  --r: 12px;
  --r-lg: 14px;
  --wrap: 1180px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', sans-serif;
  --display: var(--font);
  --lv: var(--brand);
  --lv-soft: var(--brand-soft);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #14161b; --bg-2: #1c1f26; --bg-3: #23272f; --ink: #e8eaf0; --ink-2: #9aa3b2; --ink-3: #8f97a5;
  --line: #2c313b; --line-2: #3a404c; --field: #6b7383; --brand: #7aa7ff; --brand-2: #a5c3ff; --brand-soft: #1e2a44;
  --coral: #ff9a5c; --ek: #ff9a5c; --ek-soft: #3a2417; --gold: #2f2a16;
  --good: #5fd18f; --good-soft: #16301f; --bad: #ff7b7b; --bad-soft: #3a1c1c; --warn: #ffc94d; --warn-soft: #3a3016;
  --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .6);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14161b; --bg-2: #1c1f26; --bg-3: #23272f; --ink: #e8eaf0; --ink-2: #9aa3b2; --ink-3: #8f97a5;
    --line: #2c313b; --line-2: #3a404c; --field: #6b7383; --brand: #7aa7ff; --brand-2: #a5c3ff; --brand-soft: #1e2a44;
    --coral: #ff9a5c; --ek: #ff9a5c; --ek-soft: #3a2417; --gold: #2f2a16;
    --good: #5fd18f; --good-soft: #16301f; --bad: #ff7b7b; --bad-soft: #3a1c1c; --warn: #ffc94d; --warn-soft: #3a3016;
    --shadow-1: 0 1px 2px rgba(0, 0, 0, .3); --shadow-2: 0 14px 34px -14px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

/* Level colours */
/* Level colours: dark enough for white badge text and for text on --lv-soft (≥4.5:1);
   in dark mode lighter shades, with dark text on the badges. */
.lv-a1 { --lv: #11804f; --lv-soft: rgba(17, 128, 79, .1); }
.lv-a2 { --lv: #0b7480; --lv-soft: rgba(11, 116, 128, .1); }
.lv-b1 { --lv: #2c63cc; --lv-soft: rgba(44, 99, 204, .1); }
.lv-b2 { --lv: #5546c8; --lv-soft: rgba(85, 70, 200, .1); }
.lv-c1 { --lv: #8d35b3; --lv-soft: rgba(141, 53, 179, .1); }
.lv-c2 { --lv: #bf3b2d; --lv-soft: rgba(191, 59, 45, .1); }
.lv-t  { --lv: #8a5c00; --lv-soft: rgba(138, 92, 0, .1); }
:root[data-theme="dark"] .lv-a1 { --lv: #4cd68f; } :root[data-theme="dark"] .lv-a2 { --lv: #3fd0dc; }
:root[data-theme="dark"] .lv-b1 { --lv: #86acff; } :root[data-theme="dark"] .lv-b2 { --lv: #aba2ff; }
:root[data-theme="dark"] .lv-c1 { --lv: #db93f5; } :root[data-theme="dark"] .lv-c2 { --lv: #ff9585; }
:root[data-theme="dark"] .lv-t { --lv: #f0bd55; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .lv-a1 { --lv: #4cd68f; } :root:not([data-theme="light"]) .lv-a2 { --lv: #3fd0dc; }
  :root:not([data-theme="light"]) .lv-b1 { --lv: #86acff; } :root:not([data-theme="light"]) .lv-b2 { --lv: #aba2ff; }
  :root:not([data-theme="light"]) .lv-c1 { --lv: #db93f5; } :root:not([data-theme="light"]) .lv-c2 { --lv: #ff9585; }
  :root:not([data-theme="light"]) .lv-t { --lv: #f0bd55; }
}

/* ── Base ── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
.level { scroll-margin-top: 66px; }        /* + the sticky level bar under the top bar */
.empty { margin: 16px 0; padding: 14px 16px; border-radius: var(--r); background: var(--bg-3); color: var(--ink-2); text-align: center; }
.langsel .empty { margin: 4px 0; padding: 8px; font-size: .88rem; }
[dir="rtl"] .prose td, [dir="rtl"] .prose th { unicode-bidi: plaintext; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 16px/1.65 var(--font); -webkit-font-smoothing: antialiased;
  display: flex; flex-direction: column; min-height: 100vh;
}
main { flex: 1; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
img { max-width: 100%; height: auto; }
h1, h2, h3 { line-height: 1.2; margin: 0; }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; top: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip:focus { width: auto; height: auto; clip-path: none; inset-inline-start: 12px; top: 12px; z-index: 99; background: var(--bg-2); padding: 6px 12px; }
.grad { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.display { font-family: var(--display); font-weight: 800; letter-spacing: -.025em; font-size: clamp(2.1rem, 5vw, 3.6rem); line-height: 1.08; }
.eyebrow { margin: 0 0 14px; font-size: .82rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.eyebrow a { color: inherit; }
.lead { font-size: clamp(1.05rem, 1.6vw, 1.2rem); color: var(--ink-2); max-width: 46rem; margin: 18px 0 0; }

/* ── Buttons, chips, inputs ── */
.btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; cursor: pointer;
  background: var(--ink); color: var(--bg); padding: 13px 22px; border-radius: 999px;
  font-weight: 600; font-size: .98rem; text-decoration: none !important; transition: transform .15s, box-shadow .15s, background .15s;
  box-shadow: var(--shadow-1);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.btn--ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1.5px var(--line-2); }
.btn--ghost:hover { background: var(--bg-2); }
.btn--sm { padding: 7px 14px; font-size: .86rem; }
.iconbtn { width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--line); background: var(--bg-2); cursor: pointer; display: grid; place-items: center; color: var(--ink-2); }
.iconbtn:hover { color: var(--ink); }
.i-sun { display: none; }
:root[data-theme="dark"] .i-sun { display: block; }
:root[data-theme="dark"] .i-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .i-sun { display: block; }
  :root:not([data-theme="light"]) .i-moon { display: none; }
}
.pill { display: inline-block; font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: var(--bg-3); color: var(--ink-2); }
.pill--review { background: var(--warn-soft); color: var(--warn); }
.chip { display: inline-flex; gap: 6px; align-items: baseline; padding: 7px 13px; border-radius: 10px; background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); font-size: .9rem; }
.chip b { color: var(--brand); font-size: .8rem; }
.chip:hover { border-color: var(--brand); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip.is-done { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); }
.chip.is-done b::before { content: "✓ "; color: var(--good); }
/* review lessons: which lessons this review goes over */
.covers { margin-bottom: 26px; padding: 18px 22px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.covers__h { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 12px; }
.covers__n { margin-inline-start: 6px; color: var(--good); letter-spacing: 0; }
/* best practice score on list rows; low scores ask for a review */
.lesson__score { flex: none; align-self: center; font-size: .78rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--good-soft); color: var(--good); font-variant-numeric: tabular-nums; }
.lesson__score.is-low { background: var(--warn-soft); color: var(--warn); }
.lesson__tag--repeat { color: var(--warn); background: var(--warn-soft); }
/* Study tools: mistake cards (level page, under the lessons), placement test (course page) */
.deck { margin: 28px 0 0; }
.tool { margin-bottom: 24px; padding: 20px 22px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--lv, var(--brand)); box-shadow: var(--shadow-2); scroll-margin-top: 84px; }
.tool__head { display: flex; align-items: center; gap: 12px; }
.tool__head h2 { font-size: 1.2rem; flex: 1; }
.tool__count { font-size: .85rem; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.tool__x { width: 32px; height: 32px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.tool__x:hover { background: var(--bg-3); color: var(--ink); }
.tool__intro { margin: 6px 0 16px; color: var(--ink-2); font-size: .93rem; }
.deck__card { padding: 18px 20px; border-radius: var(--r); background: var(--bg-3); }
.deck__wrong, .deck__right { margin: 0; font-size: 1.1rem; font-weight: 600; }
.deck__wrong { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 1px; }
.deck__right { margin-top: 12px; color: var(--good); }
.deck__note { margin: 8px 0 0; color: var(--ink-2); font-size: .93rem; }
.deck__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.deck__empty, .placement__result { margin: 0 0 14px; font-weight: 600; }
.placement__q { margin: 0 0 14px; font-size: 1.05rem; }
/* practice filter: only the items answered wrong (this visit or before) */
.practice.only-wrong .pgroup:not(.has-wrong), .practice.only-wrong .qlist > .q:not(.was-wrong) { display: none; }
.search {
  width: 100%; max-width: 320px; padding: 11px 16px 11px 40px; border-radius: 999px; border: 1px solid var(--field);
  background: var(--bg-2) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%238a8ea3' stroke-width='2'%3E%3Ccircle cx='7' cy='7' r='5.5'/%3E%3Cpath d='m11 11 4 4'/%3E%3C/svg%3E") no-repeat 15px 50%;
}
[dir="rtl"] .search { padding: 11px 40px 11px 16px; background-position: calc(100% - 15px) 50%; }
.search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }

/* ── Top bar ── */
.topbar { position: sticky; top: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; height: 64px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none !important; }
.brand img { border-radius: 10px; }
.brand__name { font-weight: 800; font-size: 1.12rem; letter-spacing: -.01em; }
.brand__sub { font-size: .8rem; font-weight: 600; color: var(--ink-3); padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
/* Language select (same pattern as the main site: flag button, search, flag list) */
.flag { width: 20px; height: 15px; border-radius: 2px; object-fit: cover; flex: none; box-shadow: 0 0 0 1px rgba(0, 0, 0, .08); }
.langsel { position: relative; }
.langsel__btn {
  display: flex; align-items: center; gap: 8px; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); font-size: .88rem; font-weight: 500; transition: border-color .2s, background .2s;
}
.langsel__btn:hover { border-color: var(--line-2); background: var(--bg-3); }
.langsel__arrow { font-size: .6rem; opacity: .6; transition: transform .25s; }
.langsel.is-open .langsel__btn { border-color: var(--brand); }
.langsel.is-open .langsel__arrow { transform: rotate(180deg); }
.langsel__dd {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: 250px; padding: 8px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.langsel.is-open .langsel__dd { opacity: 1; visibility: visible; transform: none; }
.langsel__search { width: 100%; padding: 8px 12px; margin-bottom: 6px; border: 1px solid var(--field); border-radius: 8px; background: var(--bg); font-size: .88rem; }
.langsel__search:focus { outline: none; border-color: var(--brand); }
.langsel__list { max-height: 300px; overflow-y: auto; scrollbar-width: thin; }
.langsel__opt { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 8px; color: var(--ink); font-size: .9rem; text-decoration: none !important; }
.langsel__opt:hover, .langsel__opt:focus-visible { background: var(--bg-3); }
.langsel__opt.is-active { background: var(--brand-soft); color: var(--brand); font-weight: 600; }

/* Apps in the header: two buttons on wide screens; on phones a menu, plus the Android bar at the bottom */
.hdrbtn {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--line);
  background: var(--bg-2); color: var(--ink); font-size: .85rem; font-weight: 600; text-decoration: none !important; transition: border-color .2s, background .2s;
}
.hdrbtn:hover { border-color: var(--line-2); background: var(--bg-3); }
.hdrbtn svg { color: var(--brand); }
.hmenu { position: relative; display: none; }
.hmenu__dd {
  position: absolute; top: calc(100% + 8px); inset-inline-end: 0; z-index: 60; width: 240px; padding: 8px; display: grid; gap: 2px;
  background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2);
  opacity: 0; visibility: hidden; transform: translateY(-8px); transition: opacity .2s, transform .2s, visibility .2s;
}
.hmenu.is-open .hmenu__dd { opacity: 1; visibility: visible; transform: none; }
.hmenu__dd a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 8px; color: var(--ink); font-size: .92rem; font-weight: 500; text-decoration: none !important; }
.hmenu__dd a:hover, .hmenu__dd a:focus-visible { background: var(--bg-3); }
.hmenu__dd svg { color: var(--brand); flex: none; }
.appbar { display: none; }
@media (max-width: 640px) {
  .hdrbtn { display: none; }
  .hmenu { display: block; }
  .appbar {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 45; display: flex; align-items: center; gap: 10px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom)) 14px; background: var(--bg-2); border-top: 1px solid var(--line);
    box-shadow: 0 -6px 20px -12px rgba(29, 35, 48, .25);
  }
  .appbar img { border-radius: 9px; flex: none; }
  .appbar__text { display: grid; flex: 1; min-width: 0; line-height: 1.25; font-size: .9rem; }
  .appbar__text small { font-size: .66rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-3); }
  .appbar__text b { font-size: .88rem; }
  .appbar .appbar__btn { flex: none; padding: 9px 12px; font-size: .85rem; gap: 6px; }
  .appbar__x { flex: none; width: 32px; height: 32px; border: 0; background: none; color: var(--ink-3); font-size: 1.4rem; line-height: 1; cursor: pointer; }
  body { padding-bottom: 64px; }
  .consent { bottom: 76px; }
  :root[data-appbar="off"] .appbar { display: none; }
  :root[data-appbar="off"] body { padding-bottom: 0; }
  :root[data-appbar="off"] .consent { bottom: 16px; }
}

/* ── Hero ── */
.hero { position: relative; padding: 72px 0 56px; overflow: hidden; }
.hero.hero--home { padding-top: 32px; }
.hero::before {
  content: ""; position: absolute; inset: -40% -10% auto -10%; height: 140%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(40% 50% at 15% 30%, rgba(47, 111, 228, .12), transparent 70%),
    radial-gradient(35% 45% at 85% 20%, rgba(217, 72, 15, .09), transparent 70%),
    radial-gradient(30% 40% at 60% 80%, rgba(255, 201, 77, .12), transparent 70%);
}
.hero__grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 56px; align-items: center; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 30px; }
.hero__card { display: flex; justify-content: center; }
.demo {
  width: 100%; max-width: 380px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-2); display: grid; gap: 14px; transform: rotate(-1.5deg);
}
.demo__tag { font-size: .78rem; font-weight: 700; color: #16a36a; background: rgba(22, 163, 106, .12); padding: 4px 10px; border-radius: 999px; justify-self: start; }
.demo__ex { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border-radius: 12px; background: var(--bg-3); }
.demo__ex b { display: block; font-size: 1.05rem; }
.demo__ex small { color: var(--ink-3); }
.demo__say { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--bg-2); box-shadow: var(--shadow-1); flex: none; }
.demo__mk { display: grid; gap: 6px; font-weight: 500; }
.demo__mk .bad { color: var(--bad); text-decoration: line-through; text-decoration-thickness: 2px; }
.demo__mk .good { color: var(--good); }
.demo__q { font-size: 1.05rem; }
.demo__gap { display: inline-block; min-width: 60px; padding: 1px 10px; border-bottom: 2px solid var(--good); background: var(--good-soft); border-radius: 6px 6px 0 0; font-weight: 600; }
.demo__ok { color: var(--good); font-weight: 800; margin-inline-start: 6px; }

/* ── Home ── */
.levels-strip { display: flex; flex-wrap: wrap; gap: 10px; margin-top: -16px; }
.lvchip { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 14px; border-radius: 999px; background: var(--bg-2); border: 1px solid var(--line); }
.lvchip b { color: var(--lv); }
.lvchip span { font-size: .8rem; font-weight: 600; background: var(--lv-soft); color: var(--lv); border-radius: 999px; padding: 2px 9px; }
.section { padding: 56px 20px; }
.section__head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section__head h2 { font-family: var(--display); font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -.01em; }
.langgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.langcard {
  position: relative; display: grid; gap: 2px; padding: 16px 44px 16px 18px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.langcard:hover { transform: translateY(-2px); border-color: var(--brand); box-shadow: var(--shadow-2); }
.langcard--suggested { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.langcard__native { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.08rem; min-width: 0; overflow-wrap: break-word; hyphens: auto; }
.langcard__en { font-size: .85rem; color: var(--ink-3); padding-inline-start: 30px; }
.langcard__arrow { position: absolute; right: 18px; top: 50%; transform: translateY(-50%); color: var(--ink-3); transition: transform .15s, color .15s; }
.langcard:hover .langcard__arrow { color: var(--brand); transform: translate(3px, -50%); }
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 16px; padding-top: 8px; }
.feature { padding: 24px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line); }
.feature__ic { font-size: 1.6rem; margin-bottom: 10px; }
.feature h3 { font-size: 1.08rem; margin-bottom: 6px; }
.feature p { margin: 0; color: var(--ink-2); font-size: .95rem; }

/* ── Course page ── */
.hero--course { padding-bottom: 28px; }
.hero.hero--course { padding-top: 32px; }
.hero--course .lead { margin-top: 12px; }
/* resume button and overall progress on one line */
.hero__row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 28px; margin-top: 24px; }
.progress { display: flex; align-items: center; gap: 12px; flex: 1 1 260px; max-width: 420px; }
.progress__bar { flex: 1; height: 10px; border-radius: 99px; background: var(--bg-3); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.progress__bar span { display: block; height: 100%; background: var(--grad); border-radius: 99px; transition: width .6s; }
.progress__label { font-size: .88rem; color: var(--ink-2); }
.progress__num { font-size: .88rem; color: var(--ink-2); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress__num b { color: var(--ink); }
.levelnav-wrap { position: sticky; top: 64px; z-index: 30; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.levelnav { display: flex; align-items: center; gap: 8px; padding-top: 10px; padding-bottom: 10px; overflow-x: auto; scrollbar-width: none; }
.levelnav::-webkit-scrollbar { display: none; }
.levelnav .search { margin-inline-start: auto; min-width: 200px; padding-top: 8px; padding-bottom: 8px; }
.lvtab { display: flex; align-items: center; gap: 8px; padding: 6px 14px 6px 6px; border-radius: 999px; white-space: nowrap; color: var(--ink-2); font-size: .88rem; border: 1px solid transparent; }
.lvtab b { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--lv-soft); color: var(--lv); font-size: .8rem; }
.lvtab:hover, .lvtab.is-active { background: var(--bg-2); border-color: var(--line); text-decoration: none; color: var(--ink); }
.course { padding-top: 34px; padding-bottom: 60px; }
.level { margin-bottom: 44px; }
.level__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.level__head h2 { font-family: var(--display); font-size: 1.6rem; }
.level__badge { display: inline-grid; place-items: center; min-width: 44px; height: 44px; padding: 0 8px; border-radius: 13px; background: var(--lv); color: var(--bg-2); font-weight: 800; font-size: 1rem; box-shadow: 0 6px 16px -6px var(--lv); }
.level__count { margin-inline-start: auto; font-size: .88rem; color: var(--ink-3); }
.lessonlist { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 10px; }
.lesson {
  position: relative; display: flex; align-items: center; gap: 14px; height: 100%; padding: 14px 16px; border-radius: var(--r);
  background: var(--bg-2); border: 1px solid var(--line); color: var(--ink); text-decoration: none !important;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.lesson::before { content: ""; position: absolute; inset-block: 12px; inset-inline-start: 0; width: 3px; border-radius: 3px; background: var(--lv); opacity: 0; transition: opacity .15s; }
.lesson:hover { border-color: color-mix(in srgb, var(--lv) 55%, var(--line)); transform: translateY(-1px); box-shadow: var(--shadow-2); }
.lesson:hover::before { opacity: 1; }
.lesson__id { flex: none; font-size: .75rem; font-weight: 700; color: var(--lv); background: var(--lv-soft); padding: 4px 8px; border-radius: 8px; font-variant-numeric: tabular-nums; }
.lesson__text { display: grid; gap: 2px; min-width: 0; flex: 1; }
.lesson__title { font-weight: 600; line-height: 1.35; }
.lesson__en { font-size: .83rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lesson--review { background: linear-gradient(0deg, var(--warn-soft), var(--warn-soft)), var(--bg-2); }
/* only finished lessons show a mark */
.lesson__done { display: none; flex: none; width: 24px; height: 24px; border-radius: 50%; place-items: center; font-size: .75rem; font-weight: 800; }
.lesson.is-done .lesson__done { display: grid; background: var(--good); color: var(--bg-2); }
.lesson__tag { justify-self: start; font-size: .72rem; font-weight: 700; color: var(--warn); background: color-mix(in srgb, var(--warn) 14%, transparent); padding: 1px 8px; border-radius: 999px; margin-bottom: 2px; }
.is-hidden { display: none !important; }
[hidden] { display: none !important; }

/* Course overview: level cards */
.course__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; margin-bottom: 18px; }
.course__h { font-size: 1.3rem; }
.lvcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(320px, 100%), 1fr)); gap: 14px; }
.lvcard {
  display: grid; gap: 12px; padding: 20px 22px; border-radius: var(--r-lg); background: var(--bg-2); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none !important; position: relative; overflow: hidden; transition: border-color .15s, transform .15s, box-shadow .15s;
}
.lvcard::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; width: 4px; background: var(--lv); }
.lvcard:hover { border-color: color-mix(in srgb, var(--lv) 50%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow-2); }
.lvcard__top { display: flex; align-items: center; gap: 14px; }
.lvcard__name { font-size: 1.25rem; font-weight: 700; flex: 1; }
.lvcard__count { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-3); font-size: .88rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.lvcard__topics { color: var(--ink-2); font-size: .93rem; line-height: 1.5; }
.lvcard__bar { height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; }
.lvcard__bar i { display: block; height: 100%; background: var(--lv); border-radius: 99px; }

/* Lesson rows (level page, search results): one per line, with the goal sentence */
.lessonrows { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.lesson--row { align-items: flex-start; padding: 16px 18px; }
.lesson--row .lesson__id { margin-top: 2px; }
.lesson__num { min-width: 30px; text-align: center; }
.lesson__goal { color: var(--ink-2); font-size: .93rem; line-height: 1.55; margin-top: 2px; }
.lesson--row .lesson__title { font-size: 1.05rem; }

/* Level page */
.hero.hero--level { padding: 28px 0 24px; background: linear-gradient(180deg, var(--lv-soft), transparent); border-bottom: 1px solid var(--line); }
.hero--level .crumbs { margin-bottom: 14px; }
.levelhead { display: flex; align-items: center; gap: 16px; max-width: 840px; }
.levelhead__lead { margin: 12px 0 0; max-width: 840px; font-size: 1.05rem; }
.levelmeta { margin: 10px 0 0; }
.levelmeta .level__count { margin: 0; gap: 8px; }
.levelmeta .level__bar { width: 120px; margin: 0 0 0 4px; background: color-mix(in srgb, var(--lv) 14%, var(--bg-3)); }
.level__badge--lg { min-width: 64px; height: 64px; border-radius: 18px; font-size: 1.4rem; flex: none; }
/* lessons on the left, the vocabulary app on the right */
.course--level { display: grid; grid-template-columns: minmax(0, 840px) 300px; justify-content: space-between; gap: 40px; padding-top: 22px; }
/* goal sentence: two lines here, the full text is in the lesson */
.course--level .lesson__goal { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
/* each review lesson closes a unit */
.lessonrows--unit { margin-top: 22px; padding-top: 22px; border-top: 1px dashed var(--line-2); }
/* finished: the number turns into a green tick; next: outlined, with a "Start" tag */
.course--level .lesson.is-done .lesson__done { display: none; }
.lesson.is-done .lesson__num { font-size: 0; background: var(--good); }
.lesson.is-done .lesson__num::after { content: "✓"; font-size: .8rem; color: var(--bg-2); }
.lesson.is-next { border-color: var(--lv); box-shadow: 0 0 0 1px var(--lv); }
.lesson.is-next::before { opacity: 1; }
.lesson__tag--next { color: var(--lv); background: var(--lv-soft); }
.pager--levels { margin-top: 28px; }
.appad__in {
  position: sticky; top: 88px; display: grid; gap: 12px; padding: 22px; border-radius: var(--r-lg);
  background: linear-gradient(165deg, var(--brand-soft), var(--bg-2) 62%); border: 1px solid var(--line); box-shadow: var(--shadow-1);
}
.appad__top { display: flex; align-items: center; gap: 12px; }
.appad__top img { border-radius: 12px; }
.appad__label { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.appad__title { margin: 0; font-size: 1.3rem; font-weight: 700; line-height: 1.2; }
.appad__desc { margin: 0; color: var(--ink-2); font-size: .93rem; line-height: 1.55; }
.appad__slogan { margin: 0; font-weight: 600; font-size: .93rem; }
.appad__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px; padding: 11px 16px; border-radius: 12px;
  background: var(--ink); color: var(--bg); font-weight: 600; text-decoration: none !important; transition: transform .15s, box-shadow .15s;
}
.appad__btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); }
.appad__alt { justify-self: center; font-size: .88rem; font-weight: 600; }

/* ── Lesson page ── */
.lhero { padding: 40px 0 34px; background: linear-gradient(180deg, var(--lv-soft), transparent); border-bottom: 1px solid var(--line); }
/* "← Back" + breadcrumb above every page title (course, level, lesson) */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: .88rem; color: var(--ink-3); margin-bottom: 18px; }
.crumbs a { color: var(--ink-2); }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; min-width: 0; }
.crumbs li + li::before { content: "/"; margin-inline-end: 6px; color: var(--line-2); }
.backbtn {
  display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; flex: none;
  border: 1px solid var(--line); background: var(--bg-2); color: var(--ink) !important; text-decoration: none !important;
}
.backbtn:hover { border-color: var(--line-2); background: var(--bg-3); }
.backbtn svg { margin-inline-end: 2px; }
[dir="rtl"] .backbtn svg { transform: scaleX(-1); }
.lhero__tags { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.lhero__tags .level__badge { min-width: 38px; height: 38px; border-radius: 11px; font-size: .9rem; }
.lhero__title { font-family: var(--display); font-size: clamp(1.8rem, 4vw, 2.8rem); letter-spacing: -.015em; max-width: 50rem; }
.lhero__en { margin: 10px 0 0; color: var(--ink-2); font-size: 1.05rem; }
/* lesson on the left, the "on this page" menu on the right */
.lesson-grid { display: grid; grid-template-columns: minmax(0, 840px) 240px; justify-content: center; gap: 48px; padding-top: 36px; padding-bottom: 64px; }
.toc__in { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow: auto; }
.toc__title { font-size: .76rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); margin: 0 0 10px; }
.toc ol { list-style: none; margin: 0; padding: 0; border-inline-start: 2px solid var(--line); }
.toc a { display: block; padding: 6px 14px; margin-inline-start: -2px; border-inline-start: 2px solid transparent; color: var(--ink-2); font-size: .9rem; line-height: 1.4; }
.toc a:hover { color: var(--ink); text-decoration: none; }
.toc a.is-active { color: var(--lv); border-color: var(--lv); font-weight: 600; }
.toc__score { margin-top: 18px; padding: 12px 14px; border-radius: 12px; background: var(--bg-2); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; }
.lesson-body { min-width: 0; }
.mtoc { display: none; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); }
.mtoc summary { cursor: pointer; list-style: none; padding: 12px 16px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; }
.mtoc summary::-webkit-details-marker { display: none; }
.mtoc summary::after { content: "▾"; color: var(--ink-3); transition: transform .2s; }
.mtoc[open] summary::after { transform: rotate(180deg); }
.mtoc ol { margin: 0; padding: 0 16px 12px 36px; display: grid; gap: 2px; }
.mtoc a { display: block; padding: 5px 0; color: var(--ink-2); }

.sec { margin-bottom: 26px; padding: 28px 30px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r-lg); }
.sec > h2 { font-size: 1.32rem; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
.sec > h2::before { content: ""; width: 8px; height: 22px; border-radius: 4px; background: var(--lv); flex: none; }
.sec--goal { background: var(--lv-soft); border-color: transparent; font-size: 1.08rem; }
.sec--goal > h2::before { display: none; }
.sec--golden_rule, .sec--golden_rules { background: var(--gold); border-color: color-mix(in srgb, var(--warn) 25%, var(--line)); }
.sec--golden_rule > h2::before, .sec--golden_rules > h2::before { content: "★"; width: auto; height: auto; background: none; color: var(--warn); font-size: 1.1rem; }
.sec--traps { border-inline-start: 5px solid var(--ek); }
.sec--traps > h2::before { background: var(--ek); }

.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose p { margin: 0 0 14px; }
.about { max-width: calc(46rem + 40px); }
.intro { max-width: 46rem; margin: 40px 0 8px; }
.intro h2 { font-size: 1.25rem; margin: 30px 0 10px; }
.intro .faq details { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; margin-bottom: 8px; }
.intro .faq summary { cursor: pointer; font-weight: 650; }
.intro .faq details p { margin: 8px 0 2px; }
.about h2 { margin: 32px 0 10px; }
.prose ul, .prose ol { padding-inline-start: 22px; margin: 0 0 14px; }
.prose li { margin-bottom: 6px; }
.prose h3 { font-size: 1.08rem; margin: 26px 0 10px; display: flex; align-items: center; gap: 10px; }
.prose h4, .prose h5, .prose h6 { margin: 20px 0 8px; }
.h-num { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--lv-soft); color: var(--lv); font-size: .85rem; flex: none; }
.prose strong { font-weight: 650; }
.prose .ek { color: var(--ek); background: var(--ek-soft); font-weight: 700; border-radius: 4px; padding: 0 2px; }
.prose a.ref { font-weight: 600; color: var(--brand); }
.table-wrap { overflow-x: auto; margin: 8px 0 16px; }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { padding: 7px 12px; text-align: start; border: 1px solid var(--line); vertical-align: top; }
.prose thead th { background: var(--bg); font-weight: 650; }
.prose td strong, .prose th strong { color: var(--brand); }

/* Examples */
.ex { display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.ex:last-of-type { border-bottom: 0; }
.ex .say {
  flex: none; padding: 2px 7px; border-radius: 8px; border: 1px solid var(--line); cursor: pointer; background: var(--bg);
  font-size: .9rem; line-height: 1.5; transition: border-color .15s, background .15s;
}
.ex .say:hover { border-color: var(--brand); }
.ex .say.is-speaking { background: var(--lv); animation: pulse 1s infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px var(--lv-soft); } }
.ex .en { font-weight: 600; direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .ex .en { text-align: right; }
.ex .tr { color: var(--ink-2); }
.ex .note { font-size: .85rem; color: var(--ink-2); font-style: italic; }
.ex .or { color: var(--ink-2); font-weight: 400; }

/* Mistakes */
.mk { margin: 8px 0; padding: 10px 12px; border-radius: 10px; background: var(--bad-soft); display: grid; gap: 2px; }
.mk .ic { display: inline-block; margin-inline-end: 6px; }
.mk .wrong { text-decoration: line-through; text-decoration-color: var(--bad); }
.mk .wrong .ic { text-decoration: none; }
.mk .right { color: var(--good); font-weight: 600; }
.mk .why { font-size: .9rem; color: var(--ink-2); }
.mk.warn { background: var(--warn-soft); }
.mk.warn .wrong { text-decoration-color: var(--warn); }
.mk .wrong, .mk .right { direction: ltr; unicode-bidi: isolate; }
[dir="rtl"] .mk .wrong, [dir="rtl"] .mk .right { text-align: right; }

/* Video + transcript */
.video { margin-bottom: 26px; border-radius: var(--r-lg); overflow: hidden; aspect-ratio: 16 / 9; background: #000; box-shadow: var(--shadow-2); }
.video iframe { width: 100%; height: 100%; border: 0; display: block; }
.video__ph { width: 100%; height: 100%; border: 0; cursor: pointer; background: center / cover no-repeat; display: grid; place-items: center; }
.video__play { width: 78px; height: 78px; border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); position: relative; transition: transform .2s; }
.video__play::after { content: ""; position: absolute; left: 31px; top: 24px; border: 15px solid transparent; border-left: 24px solid #e0564a; border-right: 0; }
.video__ph:hover .video__play { transform: scale(1.08); }

/* ── Practice ── */
.practice { background: var(--bg-2); }
/* stays under the top bar while scrolling through the questions, so score and "check all" are always at hand */
.practice__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; margin: -8px 0 8px; padding: 8px 0; position: sticky; top: 64px; z-index: 5; background: var(--bg-2); border-bottom: 1px solid var(--line); }
.practice__head h2 { font-size: 1.32rem; display: flex; align-items: center; gap: 10px; }
.practice__head h2::before { content: ""; width: 8px; height: 22px; border-radius: 4px; background: var(--lv); }
.scorebar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.scorebar__score { font-weight: 700; color: var(--good); font-size: .92rem; margin-inline-end: 4px; }
.pgroup { padding: 22px 0 6px; border-top: 1px dashed var(--line-2); margin-top: 18px; }
.pgroup__title { font-size: 1.02rem; margin-bottom: 4px; color: var(--lv); }
.pgroup__inst { margin: 0 0 12px; color: var(--ink-2); font-size: .95rem; }
.qlist { margin: 0; padding-inline-start: 26px; display: grid; gap: 10px; }
.qlist > li::marker { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
/* Answer key under the practice (collapsed; the HTML is there for readers and search engines) */
.akey { margin-top: 22px; border: 1px solid var(--line); border-radius: var(--r); background: var(--bg-2); padding: 0 16px; }
.akey summary { cursor: pointer; font-weight: 650; padding: 12px 0; }
.akey[open] { padding-bottom: 10px; }
.akey__h { font-size: .95rem; margin: 12px 0 6px; color: var(--lv); }
.akey__list { margin: 0; padding-inline-start: 26px; display: grid; gap: 4px; font-size: .95rem; color: var(--ink-2); }
.akey__list > li::marker { color: var(--ink-3); font-weight: 600; font-size: .9rem; }
.q { padding: 4px 0 6px; }
.q__prompt { margin-bottom: 6px; }
.q__prompt--inline { line-height: 2.3; }
.q__inputs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-bottom: 6px; }
.q__tests { float: inline-end; margin-inline-start: 10px; }
.q__tests .chip { padding: 2px 8px; font-size: .75rem; }
.q__tests .chip span, .q__tests .chip { max-width: 160px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.gap {
  width: var(--w, 7ch); min-width: 7ch; max-width: 100%; padding: 3px 8px; margin: 0 3px; line-height: 1.4; border: 0; border-bottom: 2px solid var(--field);
  background: var(--bg-3); border-radius: 6px 6px 0 0; font-weight: 600; text-align: center; transition: border-color .15s, background .15s;
}
.gap:focus { outline: none; border-color: var(--brand); background: var(--brand-soft); }
.gap--sel { width: auto; max-width: 16rem; text-align: start; cursor: pointer; }
.gap--wide { width: 100%; text-align: start; padding: 9px 12px; margin: 0 0 6px; border-radius: 10px; border: 1px solid var(--field); }
.gap.is-right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.gap.is-wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
/* the check button sits on the same line as the answer field */
.q__check { margin-inline-start: 4px; vertical-align: middle; }
.q__inputs .q__check { margin: 0; }
.q__inputs .gap--wide { flex: 1 1 8rem; min-width: 0; width: auto; margin: 0; }
.q__fb { font-size: .9rem; font-weight: 600; min-height: 0; }
.q__fb:not(:empty) { margin-top: 4px; }
.q__fb.is-right { color: var(--good); }
.q__fb.is-wrong { color: var(--bad); }
.q__fb.is-model { color: var(--ink-2); font-weight: 500; background: var(--bg-3); padding: 8px 12px; border-radius: 10px; }
.q__note { font-size: .88rem; color: var(--ink-2); margin-top: 4px; padding-inline-start: 10px; border-inline-start: 2px solid var(--line-2); }
.q__text { width: 100%; padding: 10px 12px; border: 1px solid var(--field); border-radius: 10px; background: var(--bg-3); resize: vertical; margin-bottom: 6px; }
.blank { display: inline-block; min-width: 3.5em; border-bottom: 2px solid var(--line-2); text-align: center; color: var(--ink-3); }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { padding: 8px 16px; border-radius: 10px; border: 1.5px solid var(--field); background: var(--bg-2); cursor: pointer; font-weight: 600; text-align: start; transition: border-color .15s, background .15s; }
.opt:hover:not(:disabled) { border-color: var(--brand); }
.opt.is-right { border-color: var(--good); background: var(--good-soft); color: var(--good); }
.opt.is-wrong { border-color: var(--bad); background: var(--bad-soft); color: var(--bad); }
.opt:disabled { cursor: default; }
.q.is-right .q__prompt::after { content: " ✓"; color: var(--good); font-weight: 800; }
.context { padding: 18px 20px; margin-bottom: 10px; border-radius: 14px; background: var(--bg-3); line-height: 2.4; }
.ctxgap { white-space: nowrap; }
.ctxgap sup { color: var(--ink-3); font-weight: 700; font-size: .7rem; margin-inline-end: 1px; }
.ctx__fb { margin-top: 8px; }

/* ── Lesson foot ── */
.lesson-foot { display: grid; gap: 22px; margin: 34px 0; }
/* small copies of the done button: side menu and mobile menu */
.donebtn--mini { margin-top: 16px; padding: 7px 14px 7px 8px; gap: 8px; font-size: .88rem; }
.donebtn--mini .donebtn__box { width: 20px; height: 20px; font-size: .7rem; }
.mtoc__done { padding: 0 16px 14px; }
.mtoc__done .donebtn--mini { margin-top: 0; }
.ex__more { margin: 4px 0 8px; }
.donebtn {
  justify-self: start; display: inline-flex; align-items: center; gap: 12px; padding: 12px 22px 12px 14px; border-radius: 999px;
  border: 1.5px solid var(--line-2); background: var(--bg-2); cursor: pointer; font-weight: 600;
}
.donebtn__box { width: 26px; height: 26px; border-radius: 50%; border: 2px dashed var(--line-2); display: grid; place-items: center; color: transparent; font-weight: 800; font-size: .8rem; }
.donebtn.is-done { border-color: var(--good); color: var(--good); background: var(--good-soft); }
.donebtn.is-done .donebtn__box { background: var(--good); border: 0; color: var(--bg-2); }
.refs h3 { font-size: .8rem; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 10px; }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.pager__link { display: grid; gap: 4px; padding: 18px 20px; border-radius: var(--r); border: 1px solid var(--line); background: var(--bg-2); color: var(--ink); text-decoration: none !important; transition: border-color .15s, box-shadow .15s; }
.pager__link:hover { border-color: var(--lv); box-shadow: var(--shadow-2); }
.pager__link small { color: var(--ink-3); font-weight: 600; font-size: .8rem; }
.pager__link span { font-weight: 600; line-height: 1.35; }
.pager__prev small::before { content: "← "; }
.pager__next { text-align: end; grid-column: 2; }
/* lesson pages: previous · back to the level (with "3 / 32") · next */
/* previous · up (level or all levels) · next, each in its own column even when one is missing */
.pager--3 { grid-template-columns: 1fr minmax(150px, auto) 1fr; }
.pager--3 .pager__prev { grid-column: 1; grid-row: 1; }
.pager--3 .pager__up { grid-column: 2; grid-row: 1; }
.pager--3 .pager__next { grid-column: 3; grid-row: 1; }
.pager--3 .pager__prev span, .pager--3 .pager__next span { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }
.pager__up { text-align: center; align-content: center; }
.pager__up small { font-variant-numeric: tabular-nums; }
.pager__next small::after { content: " →"; }
[dir="rtl"] .pager__prev small::before { content: "→ "; }
[dir="rtl"] .pager__next small::after { content: " ←"; }

/* ── Footer, consent, 404 ── */
.footer { border-top: 1px solid var(--line); padding: 34px 0; background: var(--bg-2); }
.footer__in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px; }
.footer__brand { display: flex; align-items: center; gap: 12px; }
.footer__brand img { border-radius: 9px; }
.footer__brand div { display: grid; line-height: 1.3; }
.footer__brand span { font-size: .8rem; color: var(--ink-3); }
.footer__links { display: flex; flex-wrap: wrap; gap: 6px 20px; font-size: .92rem; }
.footer__links a { color: var(--ink-2); }
.footer small { color: var(--ink-3); }
.consent { position: fixed; inset-inline: 16px; bottom: 16px; z-index: 50; max-width: 460px; margin-inline-start: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 14px 16px; background: var(--bg-2); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-2); }
.consent p { margin: 0; flex: 1 1 100%; font-size: .92rem; }
.notfound { text-align: center; padding: 40px 0; }
.notfound .display { font-size: 6rem; margin: 0; }
.notfound .btn { margin-top: 26px; }

/* ── Responsive ── */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero__card { display: none; }
  .lesson-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
  .mtoc { display: block; }
  .lesson-body { max-width: none; }
  .course--level { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .appad__in { position: static; max-width: 560px; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .hero { padding: 44px 0 36px; }
  .hero.hero--home, .hero.hero--course { padding-top: 20px; }
  .levelhead { gap: 12px; }
  .level__badge--lg { min-width: 48px; height: 48px; border-radius: 14px; font-size: 1.1rem; }
  .levelhead__lead { font-size: .98rem; }
  .hero--course { padding-bottom: 20px; }
  .hero__row { margin-top: 18px; }
  .brand__sub { display: none; }
  .langsel__name { display: none; }
  .langsel__dd { position: fixed; inset-inline: 12px; top: 70px; width: auto; }
  .sec { padding: 22px 18px; border-radius: var(--r); }
  .lessonlist { grid-template-columns: 1fr; }
  /* the ID goes above the title so the title gets the full width */
  .lesson { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 12px 14px; }
  .lesson__id { grid-column: 1; justify-self: start; padding: 2px 7px; }
  .lesson__text { grid-column: 1; }
  .lesson__done { grid-column: 2; grid-row: 1 / span 2; }
  /* level page: the short number stays beside the title */
  .course--level .lesson--row { grid-template-columns: auto minmax(0, 1fr); align-items: start; }
  .course--level .lesson__num { grid-column: 1; grid-row: 1; min-width: 26px; padding: 2px 6px; }
  .course--level .lesson--row .lesson__text { grid-column: 2; grid-row: 1; }
  .course--level .lesson__score { grid-column: 2; justify-self: start; }
  .langgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .langcard, [dir="rtl"] .langcard { padding: 13px 12px; }
  .langcard__native { font-size: 1rem; gap: 8px; }
  .langcard__en { padding-inline-start: 28px; }
  .levels-strip { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -16px; padding: 2px 16px; }
  .levels-strip::-webkit-scrollbar { display: none; }
  .lvchip { flex: none; }
  .langcard__arrow { display: none; }
  /* level bar: badges only, the search box gets its own full-width row */
  .levelnav { flex-wrap: wrap; gap: 6px; overflow: visible; }
  .lvtab { padding: 2px; }
  .lvtab span { display: none; }
  .levelnav .search { order: 2; flex: 1 1 100%; max-width: none; min-width: 0; margin: 0; }
  .level { scroll-margin-top: 110px; }
  .pager { grid-template-columns: 1fr; }
  .pager__next { grid-column: auto; }
  /* phones: previous and next side by side, the way up below them */
  .pager--3 { grid-template-columns: 1fr 1fr; gap: 10px; }
  .pager--3 .pager__prev { grid-column: 1; }
  .pager--3 .pager__next { grid-column: 2; }
  .pager--3 .pager__up { grid-column: 1 / -1; grid-row: 2; }
  .pager--3.no-prev .pager__next, .pager--3.no-next .pager__prev { grid-column: 1 / -1; }
  .pager--3 .pager__link { padding: 14px 14px; }
  .pager--3 .pager__link span { font-size: .92rem; }
  .section { padding: 40px 16px; }
  .lhero { padding: 18px 0 20px; }
  .lesson-grid { padding-top: 16px; }
  .lhero .crumbs { margin-bottom: 12px; }
  .lhero__tags { margin-bottom: 10px; }
  .lhero__title { font-size: 1.55rem; }
  .lhero__en { margin-top: 6px; font-size: .95rem; }
}
@media (pointer: coarse) {
  .ex .say { min-width: 40px; min-height: 40px; }
  .langsel__btn, .iconbtn { min-height: 40px; min-width: 40px; }
  .opt { min-height: 40px; }
}
.level__count { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-variant-numeric: tabular-nums; }
.level__bar { width: 72px; height: 6px; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin-inline-end: 6px; }
.level__bar i { display: block; height: 100%; background: var(--lv); border-radius: 99px; }
@media (min-width: 641px) {
  [dir="rtl"] .langcard { padding: 16px 18px 16px 44px; }
  [dir="rtl"] .langcard__arrow { right: auto; left: 18px; transform: translateY(-50%) scaleX(-1); }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }
/* Print (lesson page "print" button, or Ctrl+P): the lesson as a clean worksheet, every page with the
   Slowingo watermark in the middle (same as the Chrome extension's print page: chrome_extension/print.css). */
.printbtn { margin-inline-start: auto; }
.watermark {
  display: none; position: fixed; top: 50%; left: 50%; transform: translate(-50%, -50%) rotate(-45deg);
  opacity: .06; z-index: 9999; pointer-events: none; align-items: center; gap: 15px; white-space: nowrap;
}
.watermark img { width: 80px; height: 80px; }
.watermark span { font-size: 60px; font-weight: 900; color: #000; }
@media print {
  @page { margin: 1.5cm; size: auto; }
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) { color-scheme: light; --bg: #fff; --bg-2: #fff; --bg-3: #f6f6f6; --ink: #000; --ink-2: #333; --ink-3: #555; --line: #ddd; }
  body { background: #fff !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .topbar, .toc, .mtoc, .footer, .pager, .scorebar, .q__check, .donebtn, .ex .say, .levelnav-wrap, .appbar, .consent,
  .crumbs, .tool, .printbtn, .ex__more, .video, .covers, [data-act], .q__fb, .q__note, .skip { display: none !important; }
  .watermark { display: flex !important; }
  .prose .ex[hidden] { display: flex !important; }          /* "more examples" are printed too */
  .lhero { padding: 0 0 12px; background: none; border: 0; }
  .lesson-grid { display: block; padding: 0; }
  .sec { border: 0; padding: 0; margin-bottom: 18px; box-shadow: none; background: none; }
  .sec h2, .pgroup__title { break-after: avoid; }
  .ex, .mk, .q, tr { break-inside: avoid; }
  .gap, .q__text { border: 0 !important; border-bottom: 1px solid #999 !important; background: none !important; border-radius: 0 !important; }
  .opt { border-color: #999 !important; background: none !important; }
  .gap::placeholder, .q__text::placeholder { color: transparent; }
  .lesson-foot { display: none !important; }                /* links to other lessons mean nothing on paper */
  a { color: inherit; text-decoration: none; }
}
