/* Български — app styles. Mirrors the approved design canvas (design/lib.mjs):
   warm linen ground, red / green / gold accents, шевица (embroidery) diamonds. */

:root {
  --bg: #F6F1E8; --bg2: #EEE6D8; --surface: #FFFDF8; --ink: #221A15; --ink2: #5C5048; --ink3: #968A7F;
  --line: #E5DACB; --line2: #D9CBB8;
  --red: #B3322A; --red-deep: #8C231C; --red-tint: #F6E2DC;
  --green: #2E6E4E; --green-tint: #E0EDE4; --gold: #9A6B1E; --gold-tint: #F4E9D2;
  --f: "Sofia Sans", "Segoe UI", system-ui, sans-serif;
  --fc: "Sofia Sans Extra Condensed", "Sofia Sans", "Segoe UI", sans-serif;
  --shadow: 0 10px 30px rgba(34, 26, 21, .08);
  --stitch-off: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M8 1 13 6 8 11 3 6Z' fill='none' stroke='%23D9CBB8' stroke-width='1.4'/%3E%3C/svg%3E");
  --stitch-red: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M8 1 13 6 8 11 3 6Z' fill='%23B3322A' stroke='%23B3322A' stroke-width='1.4'/%3E%3C/svg%3E");
  --stitch-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='M8 1 13 6 8 11 3 6Z' fill='%232E6E4E' stroke='%232E6E4E' stroke-width='1.4'/%3E%3C/svg%3E");
  --band: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='36' height='18' viewBox='0 0 36 18'%3E%3Cpath d='M9 2 16 9 9 16 2 9Z' fill='none' stroke='%23B3322A' stroke-width='1.6'/%3E%3Cpath d='M9 6 12 9 9 12 6 9Z' fill='%23B3322A'/%3E%3Cpath d='M27 5 31 9 27 13 23 9Z' fill='%232E6E4E'/%3E%3C/svg%3E");
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--f); font-size: 16px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  /* Sofia Sans draws Bulgarian-style Cyrillic (т like m, д like g) by default. Learners get the
     standard print forms everywhere; the Bulgarian style appears only where it is taught. */
  font-language-override: "RUS";
}
[lang="bg"] { font-style: normal; }
.bgform { font-language-override: "BGR"; }
h1, h2, h3, p { margin: 0; }
a { color: var(--red); text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: inherit; }
button:disabled { cursor: default; }
:focus-visible { outline: 3px solid rgba(179, 50, 42, .45); outline-offset: 2px; border-radius: 10px; }
img { max-width: 100%; }
[hidden] { display: none !important; }

/* Stress is drawn, not typed: the font cannot place U+0301 over я, so BG.bg() turns
   "vowel + U+0301" into <span class="st"> and this draws the accent. */
.w { white-space: nowrap; }
.st { position: relative; }
.st::after {
  content: ""; position: absolute; left: 50%; top: .06em; width: .08em; height: .25em; border-radius: .04em;
  background: currentColor; transform: translateX(-20%) rotate(36deg); transform-origin: 50% 100%;
}
.st.up::after { top: -.18em; height: .22em; }
.nostress .st::after { display: none; }

/* ---------- type ---------- */
.eyebrow { font-size: 13px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--red); }
.eyebrow.green { color: var(--green); }
.h1 { font-size: 44px; line-height: 1.05; font-weight: 800; letter-spacing: -.02em; }
.h2 { font-size: 24px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; }
.h3 { font-size: 18px; font-weight: 800; }
.muted { color: var(--ink2); }
.faint { color: var(--ink3); }
.num { font-family: var(--fc); font-weight: 800; line-height: 1; }
.q { font-size: 15px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--ink3); text-align: center; }
.hl { color: var(--red); }
.small { font-size: 13.5px; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: 100vh; }
.side {
  position: sticky; top: 0; height: 100vh; background: var(--surface); border-right: 1px solid var(--line);
  padding: 24px 16px; display: flex; flex-direction: column; gap: 4px; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 0 10px 22px; color: var(--ink); }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--red); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: 22px; flex: none; }
.brand b { font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink2); font-weight: 600; font-size: 15.5px; }
.nav svg { width: 20px; height: 20px; flex: none; }
.nav:hover { background: var(--bg); color: var(--ink); }
.nav.on { background: var(--red-tint); color: var(--red-deep); }
.nav .count { margin-left: auto; font-size: 12.5px; font-weight: 800; background: var(--red); color: #fff; border-radius: 99px; padding: 1px 8px; }
.side .spacer { flex: 1; }
.main { padding: 36px 48px 64px; display: flex; flex-direction: column; gap: 28px; width: 100%; max-width: 1240px; }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; }
.page-head p { font-size: 18px; margin-top: 6px; }
.tabbar { display: none; }

/* ---------- surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 24px; }
.card.flat { background: var(--bg); border-color: transparent; }
.card.tint-red { background: var(--red-tint); border-color: transparent; }
.card.tint-green { background: var(--green-tint); border-color: transparent; }
.card.tint-gold { background: var(--gold-tint); border-color: transparent; }
a.card, button.card { display: block; color: inherit; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card.row, button.card.row { display: flex; }
a.card:hover, button.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; align-items: center; gap: 12px; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.between { justify-content: space-between; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.grid-main { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 24px; align-items: start; }
.band { height: 18px; background: var(--band) left center / 36px 18px; background-repeat: round no-repeat; }
.card > .band:first-child { margin: -24px -24px 20px; border-radius: 22px 22px 0 0; }
.pic { display: grid; place-items: center; background: var(--bg); border-radius: 18px; }
.pic img { display: block; }
.glyph { font-family: var(--fc); font-weight: 800; line-height: 1; color: var(--red-deep); }
.swatch { display: block; border-radius: 22%; box-shadow: inset 0 0 0 2px rgba(34, 26, 21, .12); }
.ph { font-weight: 800; color: var(--ink3); line-height: 1; }
.divider { height: 1px; background: var(--line); }
.card table { border-collapse: collapse; width: 100%; }
.card td, .card th { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.card tr:last-child td { border-bottom: 0; }
.card th { font-size: 13px; color: var(--ink3); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.card td b { font-size: 18px; white-space: nowrap; }

/* stitched progress */
.sbar { position: relative; height: 12px; min-width: 60px; background: var(--stitch-off) left center / 16px 12px; background-repeat: round no-repeat; }
.sbar i { position: absolute; inset: 0; background: var(--stitch-red) left center / 16px 12px; background-repeat: round no-repeat; clip-path: inset(0 calc(100% - var(--p, 0%)) 0 0); transition: clip-path .4s ease; }
.sbar.green i { background-image: var(--stitch-green); }

/* ---------- controls ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px;
  border-radius: 14px; font-weight: 700; font-size: 16px; border: 1px solid transparent; white-space: nowrap;
  transition: background .15s, transform .1s, box-shadow .15s;
}
.btn svg { width: 20px; height: 20px; flex: none; }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn-p { background: var(--red); color: #fff; }
.btn-p:hover:not(:disabled) { background: var(--red-deep); color: #fff; }
.btn-g { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-g:hover:not(:disabled) { background: var(--bg); color: var(--ink); }
.btn-green { background: var(--green); color: #fff; }
.btn-green:hover:not(:disabled) { background: #245a3f; }
.btn-gold { background: var(--gold); color: #fff; }
.btn-ghost { color: var(--ink2); padding: 0 12px; }
.btn-ghost:hover { color: var(--ink); background: var(--bg2); }
.btn:disabled { opacity: .45; }
.btn.sm { height: 42px; padding: 0 16px; font-size: 15px; border-radius: 12px; }
.btn.wide { min-width: 200px; }
.btn.block { width: 100%; }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 99px; background: var(--bg2); color: var(--ink2); font-size: 13.5px; font-weight: 700; white-space: nowrap; }
.chip svg { width: 15px; height: 15px; }
.chip.red { background: var(--red-tint); color: var(--red-deep); }
.chip.green { background: var(--green-tint); color: var(--green); }
.chip.gold { background: var(--gold-tint); color: var(--gold); }
button.chip:hover { filter: brightness(.97); }
.chip.lg { height: 44px; padding: 0 16px; font-size: 15px; }
.round { width: 52px; height: 52px; border-radius: 99px; display: grid; place-items: center; background: var(--red); color: #fff; flex: none; transition: transform .1s, background .15s; }
.round svg { width: 22px; height: 22px; }
.round.soft { background: var(--red-tint); color: var(--red-deep); }
.round.soft:hover { background: #efd2c9; }
.round.sm { width: 40px; height: 40px; }
.round.sm svg { width: 18px; height: 18px; }
.round:active { transform: scale(.95); }
.round.playing { box-shadow: 0 0 0 8px rgba(179, 50, 42, .15); }
.ico { width: 24px; height: 24px; color: var(--ink2); display: grid; place-items: center; }
.ico svg { width: 24px; height: 24px; }
.link { color: var(--red); font-weight: 700; display: inline-flex; align-items: center; gap: 6px; }
.link svg { width: 18px; height: 18px; }
.back { color: var(--ink3); font-weight: 700; display: inline-flex; align-items: center; gap: 8px; }
.back svg { width: 18px; height: 18px; }
.back:hover { color: var(--ink); }

.switch { width: 48px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 99px; background: #fff; transition: left .2s; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
.switch[aria-checked="true"] { background: var(--green); }
.switch[aria-checked="true"]::after { left: 23px; }
.seg { display: inline-flex; background: var(--bg2); border-radius: 12px; padding: 4px; gap: 2px; }
.seg button { height: 38px; padding: 0 14px; border-radius: 9px; font-weight: 700; font-size: 15px; color: var(--ink2); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(34, 26, 21, .12); }
.field { height: 50px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 14px; font: inherit; font-size: 17px; color: var(--ink); width: 100%; }
.field:focus { outline: none; border-color: var(--red); box-shadow: 0 0 0 3px rgba(179, 50, 42, .12); }
.search { position: relative; }
.search svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--ink3); }
.search .field { padding-left: 46px; }

/* ---------- navigation pages ---------- */
.level-cards { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.level { border-radius: 18px; padding: 16px; border: 1px dashed var(--line2); color: var(--ink3); display: flex; flex-direction: column; gap: 4px; min-height: 180px; }
.level .lv { font-family: var(--fc); font-size: 40px; font-weight: 800; line-height: 1; }
.level b { font-size: 16px; }
.level p { font-size: 13.5px; line-height: 1.45; }
.level.on { background: var(--surface); border: 2px solid var(--red); color: var(--ink); box-shadow: var(--shadow); }
.level.on .lv { color: var(--red); }
.level.done { background: var(--green-tint); border: 1px solid transparent; color: var(--green); }
.level.open { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
a.level { transition: box-shadow .15s, transform .15s; }
a.level:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.level .top { display: flex; justify-content: space-between; align-items: flex-start; }
.level .top svg { width: 18px; height: 18px; }
.level .sbar { margin-top: auto; }

.timeline { position: relative; display: flex; flex-direction: column; gap: 16px; padding-left: 36px; }
.timeline::before { content: ""; position: absolute; left: 11px; top: 12px; bottom: 12px; border-left: 2px dashed #E3C5BD; }
.urow { position: relative; display: flex; align-items: center; gap: 22px; padding: 18px 20px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
.urow::before { content: ""; position: absolute; left: -32px; top: 50%; width: 18px; height: 18px; margin-top: -9px; border-radius: 99px; background: var(--bg2); }
.urow.done::before { background: var(--green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5 10 16 18 8'/%3E%3C/svg%3E") center / 14px no-repeat; }
.urow.now { border: 2px solid var(--red); box-shadow: var(--shadow); }
.urow.now::before { background: var(--red); }
.urow.locked { background: #FBF7F0; color: var(--ink3); }
.urow.exam { background: var(--gold-tint); border-color: transparent; }
.urow.exam::before { border-radius: 4px; background: var(--gold); }
a.urow, button.urow { display: flex; width: 100%; }
a.urow:hover { box-shadow: var(--shadow); }
.urow .n { font-family: var(--fc); font-size: 34px; font-weight: 800; width: 34px; color: var(--red); text-align: center; flex: none; }
.urow.locked .n, .urow.done .n { color: var(--ink3); }
.urow .t { font-weight: 800; font-size: 17px; }
.urow .s { color: var(--ink2); font-size: 15px; }
.urow.locked .t, .urow.locked .s { color: var(--ink3); }

.lrow { display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); color: var(--ink); }
a.lrow:hover { box-shadow: var(--shadow); }
.lrow .badge { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; font-weight: 800; background: var(--bg2); color: var(--ink3); flex: none; }
.lrow .badge svg { width: 22px; height: 22px; }
.lrow.done .badge { background: var(--green-tint); color: var(--green); }
.lrow.now { border: 2px solid var(--red); }
.lrow.now .badge { background: var(--red); color: #fff; }
.lrow.locked { background: #FBF7F0; }
.lrow.locked .t { color: var(--ink3); }
.lrow .t { font-weight: 800; font-size: 17px; }
.lrow .s { color: var(--ink3); font-size: 14.5px; }
.checks { display: flex; flex-direction: column; gap: 10px; }
.checks div { display: flex; gap: 12px; align-items: flex-start; }
.checks svg { width: 18px; height: 18px; color: var(--green); flex: none; margin-top: 3px; }
.kv { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.kv b { font-size: 18px; }

/* word grid */
.wgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 18px; }
.wcard { padding: 16px; display: flex; flex-direction: column; gap: 8px; }
.wcard .pic { height: 120px; }
.wcard .pic img { width: 76px; height: 76px; }
.wcard .pic .ph { font-size: 44px; font-weight: 800; color: var(--ink3); }
.wcard b { font-size: 22px; line-height: 1.2; }
.dots { display: inline-flex; gap: 3px; }
.dots i { width: 10px; height: 10px; transform: rotate(45deg); border-radius: 2px; background: var(--bg2); }
.dots i.on { background: var(--green); }

/* ---------- focus mode (lessons, review) ---------- */
.focus { min-height: 100vh; display: flex; flex-direction: column; }
.ftop { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 20px; padding: 18px 48px; border-bottom: 1px solid var(--line); background: var(--surface); }
.ftop .sbar { flex: 1; }
.ftop .x { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; color: var(--ink2); }
.ftop .x:hover { background: var(--bg); color: var(--ink); }
.ftop .x svg { width: 24px; height: 24px; }
.fbody { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 40px 48px; gap: 28px; }
.fbody > * { max-width: 100%; }
.fbottom { position: sticky; bottom: 0; z-index: 5; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px 48px; border-top: 1px solid var(--line); background: var(--surface); }
.fbottom.ok { background: var(--green-tint); border-color: transparent; }
.fbottom.near { background: var(--gold-tint); border-color: transparent; }
.fbottom.bad { background: var(--red-tint); border-color: transparent; }
.fbottom.learn { background: var(--gold-tint); border-color: transparent; }
.fb { display: flex; align-items: center; gap: 16px; min-width: 0; }
.fb > .round:first-child { width: 56px; height: 56px; }
.fb > .round:first-child svg { width: 26px; height: 26px; }
.fbottom.ok .fb > .round:first-child { background: var(--green); }
.fbottom.near .fb > .round:first-child { background: var(--gold); }
.fbottom.learn .fb > .round:first-child { background: var(--gold); }
.fb .t { font-size: 22px; font-weight: 800; line-height: 1.2; }
.fbottom.ok .fb .t { color: var(--green); }
.fbottom.near .fb .t { color: var(--gold); }
.fbottom.learn .fb .t { color: var(--gold); }
.fbottom.bad .fb .t { color: var(--red-deep); }
.fb .d { color: var(--ink2); font-size: 16px; }
.fb .d b { color: var(--ink); }

.opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; width: 760px; }
.opts.three { grid-template-columns: repeat(3, minmax(0, 1fr)); width: 880px; }
.opts.four { grid-template-columns: repeat(4, minmax(0, 1fr)); width: 880px; }
.opt { min-height: 84px; padding: 12px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 30px; font-weight: 700; line-height: 1.2; text-align: center; transition: border-color .15s, background .15s, transform .1s; box-shadow: 0 3px 0 var(--line); }
.opt small { font-size: 15px; font-weight: 600; color: var(--ink3); }
.opt:hover:not(:disabled) { border-color: var(--line2); background: #FFFBF3; }
.opt:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.opt.sel { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); box-shadow: 0 3px 0 #E8B9AE; }
.opt.ok { border-color: var(--green); background: var(--green-tint); color: var(--green); box-shadow: 0 3px 0 #B9D6C4; }
.opt.bad { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); opacity: .75; }
.opt.dim { opacity: .45; }
.opt.pic-opt { padding: 16px; }
.opt.pic-opt img { width: 110px; height: 110px; }
.opt .kbd { position: absolute; }

.tile { height: 64px; padding: 0 24px; border-radius: 16px; display: inline-flex; align-items: center; font-size: 28px; font-weight: 700; background: var(--surface); border: 2px solid var(--line); box-shadow: 0 3px 0 var(--line); transition: transform .1s; }
.tile:hover:not(:disabled) { background: #FFFBF3; }
.tile:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--line); }
.tile.used { background: var(--bg2); border-color: var(--bg2); color: transparent; box-shadow: none; }
.tile.placed { border-color: var(--line2); }
.tile.ok { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.tile.bad { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); }
.tiles { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; }
.answer-line { min-height: 100px; width: 820px; border-bottom: 3px solid var(--line); display: flex; align-items: center; gap: 12px; padding: 16px 0; flex-wrap: wrap; }
.gap { min-width: 150px; height: 88px; border-radius: 18px; border: 3px dashed var(--ink3); display: inline-flex; align-items: center; justify-content: center; padding: 0 22px; color: var(--red-deep); }
.gap.filled { border-style: solid; border-color: var(--red); background: var(--red-tint); }
.gap.ok { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.gap.bad { border-color: var(--red); background: var(--red-tint); }
.gapwrap { display: inline-flex; align-items: center; gap: 4px; }
.sentence { font-size: 56px; font-weight: 700; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; justify-content: center; line-height: 1.2; }

/* typing */
.typed { width: 760px; }
.typed .box { position: relative; height: 84px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); display: flex; align-items: center; padding: 0 24px; }
.typed .box:focus-within { border-color: var(--red); box-shadow: 0 0 0 4px rgba(179, 50, 42, .1); }
.typed input { border: 0; outline: 0; background: transparent; font: inherit; font-size: 40px; font-weight: 700; color: var(--ink); width: 100%; font-language-override: "RUS"; }
.typed input::placeholder { color: var(--line2); font-weight: 600; }
.typed.ok .box { border-color: var(--green); background: var(--green-tint); }
.typed.near .box { border-color: var(--gold); background: var(--gold-tint); }
.typed.bad .box { border-color: var(--red); background: var(--red-tint); }
.typed .under { display: flex; justify-content: space-between; margin-top: 10px; font-size: 14.5px; color: var(--ink3); min-height: 22px; }
.typed .under b { color: var(--red); }
.typed .under button { color: var(--ink3); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; }
.typed .under button:hover { color: var(--ink); }
.typed .under svg { width: 18px; height: 18px; }
.osk { width: 900px; background: var(--bg2); border-radius: 22px; padding: 12px; display: flex; flex-direction: column; gap: 6px; }
.osk .krow { display: flex; gap: 6px; justify-content: center; }
.key { height: 52px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; flex: 1; min-width: 0; max-width: 70px; transition: background .1s; }
.key:hover { background: #FFFBF3; }
.key:active, .key.hit { background: var(--red-tint); border-color: var(--red); }
.key.hit b { color: var(--red-deep); }
.key b { font-size: 20px; line-height: 1; font-weight: 700; }
.key > span { font-size: 11px; color: var(--ink3); font-weight: 700; margin-top: 3px; }
.key.hard { border: 2px solid var(--gold); }
.key.wide { max-width: 440px; flex: 6; }
.key.mid { max-width: 124px; flex: 2; }

/* lesson intro cards */
.letter-hero { width: 1120px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.letter-card { position: relative; border-radius: 28px; background: var(--red-tint); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 40px 24px 36px; overflow: hidden; }
.letter-card .band { position: absolute; top: 0; left: 0; right: 0; }
.letter-card .big { display: flex; align-items: baseline; gap: 18px; color: var(--red-deep); font-weight: 800; line-height: 1; }
.letter-card .big .up { font-size: 220px; }
.letter-card .big .lo { font-size: 140px; color: var(--red); }
.word-card { border-radius: 28px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 32px 24px; }
.word-card img { width: 220px; height: 220px; }
.word-card .wd { font-size: 60px; font-weight: 800; line-height: 1.1; }
.word-card .es { font-size: 22px; color: var(--ink2); }
.letter-info { width: 1120px; display: flex; align-items: center; gap: 24px; }
.ipa { min-width: 70px; height: 64px; padding: 0 12px; border-radius: 14px; background: var(--bg2); display: grid; place-items: center; font-size: 28px; font-weight: 700; }
.variant { display: flex; align-items: center; gap: 22px; background: var(--gold-tint); border-radius: 18px; padding: 16px 22px; max-width: 480px; }
.variant .v { display: flex; flex-direction: column; align-items: center; font-weight: 800; }
.variant .v b { font-size: 40px; line-height: 1.1; }
.variant .v > span { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--gold); text-align: center; }
.lettername { font-size: 15px; color: var(--ink2); text-align: center; }
.lookalike { display: inline-flex; align-items: center; gap: 10px; background: var(--gold-tint); color: var(--gold); border-radius: 12px; padding: 8px 14px; font-weight: 700; }

.vocab { width: 1080px; display: grid; grid-template-columns: 440px minmax(0, 1fr); gap: 28px; align-items: stretch; }
.vocab .picbox { border-radius: 28px; background: var(--surface); border: 1px solid var(--line); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 32px; }
.vocab .picbox img { width: 240px; height: 240px; }
.vocab .picbox .ph { font-size: 120px; font-weight: 800; color: var(--red); line-height: 1; }
.vocab .wd { font-size: 76px; font-weight: 800; line-height: 1.05; letter-spacing: -.01em; }
.vocab .wd.long { font-size: 54px; }
.vocab .es { font-size: 26px; color: var(--ink2); }
.forms { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; background: var(--surface); }
.forms div { padding: 12px 18px; border-bottom: 1px solid var(--line); }
.forms div:nth-child(odd) { border-right: 1px solid var(--line); }
.forms div:nth-last-child(-n+2) { border-bottom: 0; }
.forms > div > span { display: block; font-size: 12px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink3); }
.forms b { font-size: 20px; }
.example { display: flex; align-items: center; gap: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; }
.example .bgs { font-size: 21px; font-weight: 600; }
.example .ess { color: var(--ink2); font-size: 15px; }
.note { display: flex; gap: 12px; background: var(--gold-tint); border-radius: 16px; padding: 16px 20px; color: #5a4520; }
.note svg { width: 22px; height: 22px; color: var(--gold); flex: none; margin-top: 2px; }

.gram { width: 1120px; display: grid; grid-template-columns: minmax(0, 1fr) 460px; gap: 28px; align-items: start; }
.gram.single { grid-template-columns: minmax(0, 1fr); width: 760px; }
.gram .title { font-size: 46px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; }
.gram .title em { font-style: normal; color: var(--red); }
.gram .lead { font-size: 19px; color: var(--ink2); line-height: 1.6; }
.gtable { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; }
.gtable .cap { padding: 18px 20px; font-weight: 800; border-bottom: 1px solid var(--line); }
.gtable table { border-collapse: collapse; width: 100%; }
.gtable td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 17px; }
.gtable tr:last-child td { border-bottom: 0; }
.gtable td.k { font-weight: 800; color: var(--red-deep); font-size: 19px; }
.gtable td.es { color: var(--ink2); font-size: 14.5px; }
.gtable tr.on td { background: var(--gold-tint); }

.pairs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 40px; width: 820px; }
.pairs .opt { min-height: 76px; font-size: 26px; flex-direction: row; gap: 10px; }
.pairs .opt.bgw { font-size: 30px; }
.pairs .opt.ok { opacity: .65; }
.pairs .opt svg { width: 22px; height: 22px; }

.bigplay { width: 150px; height: 150px; }
.bigplay svg { width: 56px; height: 56px; }
.bigplay.md { width: 110px; height: 110px; }
.bigplay.md svg { width: 44px; height: 44px; }
.halo { padding: 16px; border-radius: 99px; background: var(--red-tint); }

.prompt-es { font-size: 44px; font-weight: 800; text-align: center; line-height: 1.15; }
.prompt-bg.tap { cursor: pointer; display: block; width: 100%; transition: color .15s, transform .15s; }
.prompt-bg.tap:hover { color: var(--red-deep); }
.prompt-bg.tap.playing { color: var(--red); transform: scale(1.03); }
.prompt-bg { font-size: 56px; font-weight: 800; text-align: center; line-height: 1.15; }
.qpic { width: 360px; height: 300px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); display: grid; place-items: center; }
.qpic img { width: 200px; height: 200px; }
.qpic.sm { width: 220px; height: 180px; }
.qpic.sm img { width: 130px; height: 130px; }

/* complete */
.done-hero { display: flex; flex-direction: column; align-items: center; gap: 22px; text-align: center; }
.stats3 { display: grid; grid-template-columns: repeat(3, 220px); gap: 16px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 22px; text-align: center; }
.stat .num { font-size: 60px; }
.stat > span { font-weight: 700; color: var(--ink2); font-size: 15px; }
.rosette { width: 180px; height: 180px; animation: pop .6s cubic-bezier(.2, 1.4, .4, 1) both; }
@keyframes pop { from { transform: scale(.4) rotate(-20deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* review */
.rcard { width: 760px; border-radius: 28px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; }
.rcard .inner { padding: 40px; display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 36px; align-items: center; }
.rcard .pic { height: 240px; }
.rcard .pic img { width: 150px; height: 150px; }
.rcard .pic .ph { font-size: 90px; font-weight: 800; color: var(--red); }
.rcard .wd { font-size: 76px; font-weight: 800; line-height: 1.05; }
.rcard.front .inner { grid-template-columns: 1fr; text-align: center; justify-items: center; padding: 60px 40px; }
.grades { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; width: 760px; }
.grade { min-height: 76px; border-radius: 18px; border: 2px solid var(--line); background: var(--surface); display: flex; flex-direction: column; align-items: center; justify-content: center; font-weight: 800; font-size: 18px; }
.grade small { font-weight: 600; font-size: 13.5px; color: var(--ink3); }
.grade:hover { border-color: var(--line2); background: #FFFBF3; }
.grade.again { color: var(--red); } .grade.hard { color: var(--gold); } .grade.good { color: var(--green); }

/* misc */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 14px 22px; border-radius: 14px; font-weight: 700; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); animation: tin .25s ease both; }
.toast.out { opacity: 0; transition: opacity .3s; }
@keyframes tin { from { opacity: 0; transform: translate(-50%, 10px); } }
.empty { text-align: center; padding: 48px 24px; color: var(--ink2); display: flex; flex-direction: column; gap: 14px; align-items: center; }
.shake { animation: shake .35s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.fade-in { animation: fin .25s ease both; }
@keyframes fin { from { opacity: 0; transform: translateY(6px); } }
.hero-cards { position: relative; width: 560px; height: 420px; }
.hero-cards .hc { position: absolute; width: 220px; height: 320px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; }
.hero-cards .hc .l { font-size: 76px; font-weight: 800; color: var(--red-deep); line-height: 1; }
.hero-cards .hc .l span { font-size: 48px; color: var(--red); }
.hero-cards .hc img { width: 100px; height: 100px; }
.hero-cards .hc b { font-size: 26px; }

/* ---------- small screens ---------- */
@media (max-width: 1180px) {
  .level-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid-main { grid-template-columns: minmax(0, 1fr); }
  .letter-hero, .letter-info, .vocab, .gram { width: 100%; }
}
@media (max-width: 900px) {
  .app { grid-template-columns: minmax(0, 1fr); padding-bottom: 76px; }
  .side { display: none; }
  .main { padding: 20px 16px 40px; gap: 20px; }
  .h1 { font-size: 34px; }
  .tabbar { display: grid; position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; grid-template-columns: repeat(5, minmax(0, 1fr)); background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); }
  .tab { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; font-weight: 700; color: var(--ink3); min-height: 48px; justify-content: center; }
  .tab svg { width: 22px; height: 22px; }
  .tab.on { color: var(--red); }
  .level-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid2 { grid-template-columns: minmax(0, 1fr); }
  .ftop { padding: 12px 16px; gap: 12px; }
  .ftop .chip { display: none; }
  .fbody { padding: 24px 16px; gap: 20px; justify-content: flex-start; }
  .fbottom { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); flex-wrap: wrap; }
  .fbottom .btn.wide { min-width: 0; flex: 1; }
  /* hint + «No lo sé» on one row, «Comprobar» on its own full-width row below */
  .fbottom > .row + .btn.wide { flex-basis: 100%; }
  .fb .t { font-size: 18px; }
  .fb .round { width: 44px; height: 44px; }
  .opts, .opts.three, .opts.four, .pairs, .typed, .answer-line, .osk, .rcard, .grades { width: 100%; }
  .opts.three, .opts.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opt { min-height: 70px; font-size: 24px; }
  .pairs { gap: 10px; }
  .pairs .opt { font-size: 18px; min-height: 60px; }
  .pairs .opt.bgw { font-size: 22px; }
  .letter-hero { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .letter-card { padding: 28px 16px 22px; }
  .letter-card .big .up { font-size: 130px; }
  .letter-card .big .lo { font-size: 84px; }
  .word-card img { width: 140px; height: 140px; }
  .word-card .wd { font-size: 44px; }
  .letter-info { flex-direction: column; align-items: stretch; }
  .vocab { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .vocab .picbox img { width: 150px; height: 150px; }
  .vocab .wd { font-size: 52px; }
  .gram { grid-template-columns: minmax(0, 1fr); }
  .gram.single { grid-template-columns: minmax(0, 1fr); width: 760px; }
.gram .title { font-size: 32px; }
  .sentence { font-size: 34px; gap: 10px; }
  .gap { min-width: 100px; height: 60px; }
  .tile { height: 54px; font-size: 22px; padding: 0 16px; }
  .typed input { font-size: 30px; }
  .typed .box { height: 70px; }
  .key { height: 46px; }
  .key b { font-size: 17px; }
  .osk { padding: 8px; gap: 4px; }
  .osk .krow { gap: 3px; }
  .prompt-es { font-size: 30px; }
  .prompt-bg { font-size: 38px; }
  .qpic { width: 100%; height: 220px; }
  .qpic img { width: 150px; height: 150px; }
  .rcard .inner { grid-template-columns: minmax(0, 1fr); padding: 24px; gap: 16px; text-align: center; justify-items: center; }
  .rcard .pic { width: 100%; height: 170px; }
  .rcard .wd { font-size: 52px; }
  .grades { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .stat .num { font-size: 40px; }
  .hero-cards { display: none; }
  .timeline { padding-left: 28px; }
  .urow { gap: 14px; padding: 14px 16px; }
  .urow::before { left: -25px; }
  .timeline::before { left: 7px; }
}

/* ---------------- tap a word (app/wordpop.js) ---------------- */
.tapwords [data-t] { cursor: pointer; border-radius: 4px; transition: background .12s; }
.tapwords [data-t]:hover { background: var(--gold-tint); box-shadow: 0 0 0 2px var(--gold-tint); }
.tapwords [data-t].tapped { background: var(--gold-tint); box-shadow: 0 0 0 2px var(--gold); }
.wordpop { position: fixed; z-index: 60; width: min(360px, calc(100vw - 24px)); background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow), 0 12px 40px rgba(40, 20, 10, .18); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: var(--ink); text-align: left; }
.wordpop .wp-head { font-size: 26px; font-weight: 800; line-height: 1.1; }
.wordpop .wp-word { border-top: 1px solid var(--line); padding-top: 10px; }
.wordpop .wp-bg { font-size: 19px; }
.wordpop .wp-es { color: var(--ink2); font-size: 17px; }
.wordpop .wp-form { color: var(--ink3); font-size: 14px; margin-top: 2px; }
.wordpop .wp-small { font-size: 16px; color: var(--ink2); }
.wordpop .wp-en { font-size: 16px; }

/* ---------------- Lecturas (app/readings.js) ---------------- */
.reader { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; max-width: 900px; }
@media (min-width: 1280px) { .reader { grid-template-columns: minmax(0, 1fr) minmax(300px, 360px); max-width: none; } }
.reader-text { font-size: 23px; line-height: 1.75; color: var(--ink); }
.reader-text.big { font-size: 29px; }
.reader-text .rpara { margin: 0 0 18px; }
.reader-text .rs { border-radius: 6px; transition: background .2s; }
.reader-text .rs.now { background: var(--gold-tint); box-shadow: 0 0 0 4px var(--gold-tint); }
.reader-text.bysent .rsent { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--line); }
.reader-text.bysent .rsent .round { flex: none; margin-top: 6px; }
.reader-text .ress { font-size: 16px; line-height: 1.4; color: var(--ink2); margin-top: 2px; }
.ropt { text-align: left; padding: 10px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); font-size: 16px; font-weight: 600; color: var(--ink); }
.ropt:hover { border-color: var(--line2); }
.ropt.sel { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); }
.ropt.right { border-color: var(--green); background: var(--green-tint); color: var(--green); }
.ropt.wrong { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); text-decoration: line-through; }
.lrow.locked { opacity: .6; }
@media (max-width: 700px) { .reader-text { font-size: 20px; } }

/* ---------------- speaking (app/speak.js) ---------------- */
.mic { width: 96px; height: 96px; border-radius: 50%; display: grid; place-items: center; background: var(--red); color: #fff; box-shadow: 0 6px 0 var(--red-deep); transition: transform .1s, box-shadow .1s; }
.mic:hover { filter: brightness(1.05); }
.mic:active { transform: translateY(3px); box-shadow: 0 3px 0 var(--red-deep); }
.mic.on { animation: micpulse 1.2s ease-in-out infinite; background: var(--red-deep); }
@keyframes micpulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(179, 50, 42, .45); } 50% { box-shadow: 0 0 0 18px rgba(179, 50, 42, 0); } }
.sp-status { font-weight: 700; color: var(--ink2); text-align: center; max-width: 560px; }
.sp-heard { color: var(--ink3); font-size: 17px; text-align: center; max-width: 620px; }
.sp-words { font-size: 26px; font-weight: 700; text-align: center; max-width: 720px; line-height: 1.5; }
.sp-words .ok { color: var(--green); }
.sp-words .miss { color: var(--red); text-decoration: underline wavy; text-underline-offset: 5px; }
@media (max-width: 700px) { .fbottom .speak-hint { display: none; } }

/* real listening: the text is blurred until she answers */
.hear-text { font-size: 30px; font-weight: 700; text-align: center; max-width: 760px; line-height: 1.35; transition: filter .25s; }
.hear-text.veil { filter: blur(10px); user-select: none; cursor: pointer; }
.hear-line { font-size: 30px; font-weight: 700; text-align: center; max-width: 820px; line-height: 1.5; }
.hear-line .hgap { display: inline-block; min-width: 120px; border-bottom: 3px dashed var(--line2); margin: 0 4px; line-height: 1.1; }
.hear-line .hgap.ok { border-bottom: 3px solid var(--green); color: var(--green); min-width: 0; }
.hear-line .hgap.bad { border-bottom: 3px solid var(--red); color: var(--red-deep); min-width: 0; }
/* «¿Dónde está el acento?»: the word's vowels are the buttons */
.opts.stressw { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; width: auto; max-width: 100%; font-size: 56px; font-weight: 800; }
.opts.stressw .sc { padding: 0 1px; }
.opts.stressw .opt.sv { min-height: 0; min-width: 58px; padding: 4px 8px; font-size: 56px; font-weight: 800; border-radius: 14px; line-height: 1.1; }
@media (max-width: 700px) {
  .hear-text, .hear-line { font-size: 24px; }
  .opts.stressw, .opts.stressw .opt.sv { font-size: 40px; }
  .opts.stressw .opt.sv { min-width: 44px; }
}
/* readings: «Solo escuchar» */
.reader-text.veil { filter: blur(9px); user-select: none; pointer-events: none; }
.btn-g.on { border-color: var(--red); background: var(--red-tint); color: var(--red-deep); }
/* word page */
.wordpage { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 24px; align-items: start; }
@media (max-width: 1100px) { .wordpage { grid-template-columns: minmax(0, 1fr); } }
.formtab { overflow-x: auto; border: 1px solid var(--line); border-radius: 16px; }
.formtab table { border-collapse: collapse; width: 100%; }
.formtab td, .formtab th { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; }
.formtab tr:last-child td { border-bottom: 0; }
.formtab th { font-size: 12px; color: var(--ink3); font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.formtab td b { font-size: 18px; white-space: nowrap; }
.formtab td.muted { font-size: 14px; }
.formplay { display: inline-flex; align-items: center; gap: 6px; padding: 2px 6px; margin: -2px -6px; border-radius: 8px; color: inherit; }
.formplay svg { color: var(--ink3); }
.formplay:hover { background: var(--red-tint); }
/* On a phone the six forms of a verb have to fit: tighter padding, and the speaker never clipped. */
@media (max-width: 700px) {
  .formtab td, .formtab th { padding: 9px 7px; }
  .formtab td b { font-size: 17px; }
  .formplay { padding: 2px 2px; margin: -2px -2px; gap: 4px; }
}
details.more { border-top: 1px solid var(--line); padding-top: 10px; }
details.more summary { cursor: pointer; font-weight: 800; color: var(--red-deep); padding: 4px 0; }
details.more[open] { display: flex; flex-direction: column; gap: 12px; }
.wordpic { width: 160px; height: 160px; flex: none; }
@media (max-width: 700px) { .wordpic { width: 110px; height: 110px; } .wordpic img { width: 84px !important; height: 84px !important; } }
.copy-note { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-weight: 800; color: var(--red-deep); }
.copy-note.done { color: var(--green); }
.fbottom.learn .copy-note { color: #7a5a14; }
.fbottom.learn .copy-note.done, .fbottom.bad .copy-note.done { color: var(--green); }
/* lesson structure: the four parts, the rule on demand, the opening and closing cards */
.phasebar { display: flex; justify-content: center; gap: 8px; padding: 10px 16px 0; flex-wrap: wrap; }
.phasebar span { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 13px; font-weight: 800; color: var(--ink3); background: transparent; border: 1px solid var(--line); }
.phasebar span b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--line); color: var(--ink2); font-size: 11px; }
.phasebar span.past { color: var(--green); border-color: transparent; }
.phasebar span.past b { background: var(--green); color: #fff; }
.phasebar span.on { color: var(--red-deep); background: var(--red-tint); border-color: var(--red); }
.phasebar span.on b { background: var(--red); color: #fff; }
.phasebar span.again { display: none; }
.phasebar span.again.on { display: inline-flex; }
@media (max-width: 700px) { .phasebar span:not(.on) { display: none; } }
.rule-btn { cursor: pointer; }
.overlay { position: fixed; inset: 0; z-index: 50; background: rgba(34, 26, 21, .45); display: grid; place-items: center; padding: 24px 16px; overflow: auto; }
.overlay-card { background: var(--bg); border-radius: 24px; padding: 28px; width: min(1000px, 100%); max-height: calc(100vh - 48px); overflow: auto; display: flex; flex-direction: column; gap: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
.intro-list { display: flex; flex-direction: column; gap: 14px; }
.intro-row { display: flex; gap: 14px; align-items: flex-start; }
.intro-row .round { width: 44px; height: 44px; flex: none; }
.intro-row b { font-size: 18px; }
.phase-pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.phase-pills span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-weight: 800; font-size: 14px; color: var(--ink2); }
.phase-pills span b { display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--red); color: #fff; font-size: 12px; }
.note.big { font-size: 20px; line-height: 1.5; padding: 22px 24px; }
.recap-words { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 8px 18px; }
.recap-word { display: flex; align-items: center; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.recap-word b { font-size: 18px; }
.recap-word .muted { margin-left: auto; text-align: right; font-size: 14px; }
.recap-letters { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 8px; }
.recap-letter { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.recap-letter b { font-size: 30px; }
.recap-letter span { font-size: 14px; color: var(--ink2); }
.letter-hero.bare { grid-template-columns: minmax(0, 520px); justify-content: center; }
/* the grammar lesson to read: bigger text, and every Bulgarian piece looks (and is) tappable */
.lesson-text { max-width: 860px; }
.lesson-text .lsec { display: flex; flex-direction: column; gap: 10px; padding-top: 6px; }
.lesson-text .lsec h3 { font-size: 22px; font-weight: 800; }
.lesson-text .lsec p, .lesson-text .lsec li { font-size: 18px; line-height: 1.6; color: var(--ink2); }
.lesson-text .lsec ul { display: flex; flex-direction: column; gap: 8px; padding-left: 22px; }
.lesson-text .note { font-size: 17px; line-height: 1.55; }
.lesson-text .es-h { display: block; margin-bottom: 4px; color: var(--ink); }
.lesson-text b:has([lang="bg"]), .lesson-text td[lang="bg"], .lesson-text .bgs { cursor: pointer; border-bottom: 2px dotted var(--line2); }
.lesson-text b:has([lang="bg"]):hover, .lesson-text td[lang="bg"]:hover, .lesson-text .bgs:hover { color: var(--red-deep); }
.lesson-text .saying { color: var(--red) !important; border-bottom-color: var(--red) !important; }
@media (max-width: 700px) { .lesson-text .lsec p, .lesson-text .lsec li { font-size: 16px; } }
.back-step { display: inline-flex; align-items: center; gap: 4px; height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-weight: 800; font-size: 14px; color: var(--ink2); flex: none; }
.back-step:hover:not(:disabled) { border-color: var(--line2); color: var(--ink); }
.back-step:disabled { opacity: .35; cursor: default; }
@media (max-width: 700px) { .back-step span { display: none; } .back-step { padding: 0 8px; } }
