:root {
  --ink: #2a2118;
  --muted: #6d5c4e;
  --paper: rgba(255, 250, 244, 0.72);
  --paper-solid: #fffaf4;
  --sky-a: #ffd7a1;
  --sky-b: #ffe9cf;
  --sky-c: #f4efe6;
  --sun: #ffb703;
  --hill-a: #d7ebc8;
  --hill-b: #b7d7a8;
  --hill-c: #8fb88a;
  --water: #7eb6d6;
  --line: rgba(120, 72, 36, 0.14);
  --accent: #d4653a;
  --accent-dark: #9d3b22;
  --honey: #f0b429;
  --good: #2f7a4a;
  --good-bg: #e5f6ea;
  --warn: #8d5a10;
  --warn-bg: #fff1d4;
  --bad: #a33b3b;
  --bad-bg: #fde8e4;
  --der: #24598a;
  --die: #a33b5c;
  --das: #1d7a5c;
  --shadow: 0 18px 40px rgba(92, 48, 18, 0.12);
  --radius: 1.5rem;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; background: #f3e4cf; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  color: var(--ink);
  background: transparent;
  --sky-a: #ffd7a1;
  --sky-b: #ffe9cf;
  --sky-c: #f3e4cf;
  --sun: #ffb703;
  --hill-a: #d7ebc8;
  --hill-b: #b7d7a8;
  --hill-c: #8fb88a;
  --water: #7eb6d6;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: clamp(1rem, 0.4vw + 0.95rem, 1.08rem);
  line-height: 1.5;
  overflow-x: clip;
}

body[data-scene="priroda"] { --sky-a: #8ecfff; --sky-b: #d7f3e4; --sky-c: #e5f6df; --sun: #ffc44d; --hill-a: #c6e6b0; --hill-b: #7dcc78; --hill-c: #3f8f55; --water: #4f9ed4; }
body[data-scene="kalendar"] { --sky-a: #c9ddff; --sky-b: #e7f0ff; --sky-c: #f7f1e6; --sun: #ffb703; --hill-a: #d5efc4; --hill-b: #b7d7a8; }
body[data-scene="cas"] { --sky-a: #ffd18a; --sky-b: #fff3d8; --sky-c: #f8ead4; --sun: #ffb000; --hill-a: #f0ddb0; --hill-b: #e4c98a; }
body[data-scene="cisla"] { --sky-a: #f7c4de; --sky-b: #fde8f2; --sky-c: #fff4ea; --sun: #ff8fab; --hill-a: #f3d0e4; --hill-b: #e7bdd4; }
body[data-scene="jidlo"] { --sky-a: #ffc7a8; --sky-b: #ffe8dc; --sky-c: #fff3ea; --sun: #ff9a4a; --hill-a: #efd0b4; --hill-b: #e4bc98; }
body[data-scene="obleceni"] { --sky-a: #e4d4ff; --sky-b: #f3e9ff; --sky-c: #f8f1ff; --sun: #d7b4ff; --hill-a: #e6d8f6; --hill-b: #d4c4ee; }
body[data-scene="domov"] { --sky-a: #b7ebe0; --sky-b: #e7f7f3; --sky-c: #f4f1ea; --sun: #ffcc66; --hill-a: #cfe8cf; --hill-b: #b7d7c4; --water: #6eb4c8; }
body[data-scene="zdravi"] { --sky-a: #c8f0d4; --sky-b: #e5f8ea; --sky-c: #f3f8f1; --sun: #ffe08a; --hill-a: #c6ebc8; --hill-b: #9ed6a8; }
body[data-scene="penize"] { --sky-a: #ffe39a; --sky-b: #fff6d8; --sky-c: #f8efd8; --sun: #f0b429; --hill-a: #f0ddb0; --hill-b: #e6cc86; }
body[data-scene="cesta"] { --sky-a: #b9dcff; --sky-b: #e7f3ff; --sky-c: #eef3f8; --sun: #ffd15c; --hill-a: #d5e4c8; --hill-b: #c5d4bc; }
body[data-scene="prace"] { --sky-a: #f0d2b4; --sky-b: #f8eee4; --sky-c: #f6efe6; --sun: #f0a35a; --hill-a: #ead4bc; --hill-b: #dcc0a4; }
body[data-scene="drobnosti"] { --sky-a: #ffd0b0; --sky-b: #fff0e4; --sky-c: #fff6ee; --sun: #ffb703; --hill-a: #f6dcc4; --hill-b: #f0c8a8; }

.sky {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

.sky svg { width: 100%; height: 100%; display: block; }
.scene { display: none; }
body[data-scene="home"] .scene-home,
body[data-scene="priroda"] .scene-priroda,
body[data-scene="kalendar"] .scene-kalendar,
body[data-scene="cas"] .scene-cas,
body[data-scene="cisla"] .scene-cisla,
body[data-scene="jidlo"] .scene-jidlo,
body[data-scene="obleceni"] .scene-obleceni,
body[data-scene="domov"] .scene-domov,
body[data-scene="zdravi"] .scene-zdravi,
body[data-scene="penize"] .scene-penize,
body[data-scene="cesta"] .scene-cesta,
body[data-scene="prace"] .scene-prace,
body[data-scene="drobnosti"] .scene-drobnosti { display: block; }

.sky-sun { animation: glow 7s ease-in-out infinite; }
.cloud-a { animation: drift 22s ease-in-out infinite; }
.cloud-b { animation: drift 28s ease-in-out infinite reverse; }

img { max-width: 100%; height: auto; }

button, input, summary { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-dark); }

.top, .foot, .wrap {
  width: min(1120px, calc(100% - clamp(1rem, 3vw, 2rem) - env(safe-area-inset-left) - env(safe-area-inset-right)));
  margin-inline: auto;
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: calc(0.85rem + env(safe-area-inset-top)) 0 0.35rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
  color: var(--ink);
  font-weight: 800;
  font-size: clamp(1.2rem, 2vw, 1.45rem);
  letter-spacing: -0.03em;
  text-decoration: none;
}

.mark {
  width: 2.8rem;
  height: 2.8rem;
  flex: none;
  filter: drop-shadow(0 8px 12px rgba(156, 59, 34, 0.28));
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  max-width: 100%;
}

.nav a {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: rgba(255, 250, 244, 0.55);
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav a.is-on {
  background: var(--paper-solid);
  box-shadow: inset 0 0 0 2px rgba(212, 101, 58, 0.45);
}

.wrap { padding-bottom: calc(2.5rem + env(safe-area-inset-bottom)); }

.eyebrow {
  margin: 0 0 0.25rem;
  color: var(--accent-dark);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.78rem;
}

h1 {
  margin: 0 0 0.35rem;
  font-size: clamp(2.1rem, 4vw + 1rem, 3.6rem);
  line-height: 0.98;
  letter-spacing: -0.045em;
}

h1:focus {
  outline: none;
}

h2 { margin: 0 0 0.3rem; font-size: clamp(1.15rem, 1vw + 1rem, 1.35rem); line-height: 1.2; }

.lead { margin: 0; max-width: 40rem; color: var(--muted); font-size: clamp(1.02rem, 0.4vw + 1rem, 1.2rem); }

.hero, .lesson, .stage, .manual, .dict-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
}

.hero, .stage, .manual { animation: rise 0.45s cubic-bezier(.2, .7, .2, 1) both; }

.hero {
  position: relative;
  overflow: hidden;
  padding: clamp(1.1rem, 2vw, 2rem);
}

.hero::after {
  content: "";
  position: absolute;
  right: -40px;
  top: -50px;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 183, 3, 0.45), transparent 68%);
  pointer-events: none;
}

.hero-head {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 0.5rem;
  align-items: center;
}

.hero-art svg {
  width: min(100%, 280px);
  height: auto;
  display: block;
  margin-inline: auto;
  filter: drop-shadow(0 12px 18px rgba(90, 50, 20, 0.12));
}

.streak {
  display: inline-flex;
  margin: 0.85rem 0 0;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: #e7f6ea;
  color: var(--good);
  font-weight: 800;
}

.stats {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr));
  gap: 0.7rem;
  margin: 1.15rem 0;
}

.stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: 0.7rem;
  align-items: center;
  padding: 0.85rem 0.95rem;
  border-radius: 1.15rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 244, 228, 0.9));
  box-shadow: inset 0 0 0 1px rgba(120, 72, 36, 0.08);
}

.stat-icon {
  grid-row: 1 / span 2;
  width: 2.3rem;
  height: 2.3rem;
  display: grid;
  place-items: center;
  border-radius: 0.8rem;
  background: #fff;
  color: var(--accent-dark);
}

.stat-icon svg { width: 1.35rem; height: 1.35rem; }
.stat strong { font-size: clamp(1.6rem, 2vw, 2rem); line-height: 1; }
.stat span:last-child { color: var(--muted); }

.status-line {
  margin: 0 0 1rem;
  font-weight: 700;
  color: var(--ink);
}

.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }

.btn, .choice, .grade, .match-btn {
  min-height: 52px;
  border-radius: 999px;
  border: 0;
  text-decoration: none;
  font-weight: 800;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.75rem 1.3rem;
  background: linear-gradient(180deg, #e57a4e, var(--accent) 45%, #c4512c);
  color: #fffaf6;
  box-shadow: 0 8px 16px rgba(180, 70, 36, 0.25);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 20px rgba(180, 70, 36, 0.3); }
.btn:active { transform: translateY(0); }

.btn.secondary, .btn.ghost {
  background: rgba(255, 255, 255, 0.7);
  color: var(--ink);
  box-shadow: inset 0 0 0 2px rgba(212, 101, 58, 0.35);
}

.btn.ghost {
  box-shadow: none;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  min-height: 44px;
}

.switches { display: grid; gap: 0.95rem; margin-top: 1.1rem; position: relative; z-index: 1; }

.switch-set { margin: 0; padding: 0; border: 0; min-width: 0; }
.switch-set legend { padding: 0; margin-bottom: 0.45rem; font-weight: 800; }
.hint { margin: 0.4rem 0 0; color: var(--muted); overflow-wrap: anywhere; }

.seg { display: flex; flex-wrap: wrap; gap: 0.45rem; }

.seg button {
  min-height: 48px;
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  border: 2px solid transparent;
  background: rgba(255, 255, 255, 0.72);
  font-weight: 800;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: background 0.18s ease, transform 0.18s ease, color 0.18s ease;
}

.seg button[aria-pressed="true"] {
  background: #fff1e8;
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.block-title {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  margin: 1.7rem 0 0.8rem;
}

.block-title h2 { margin: 0; font-size: clamp(1.4rem, 2vw, 1.8rem); }
.block-title .hint { margin: 0; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr));
  gap: 0.9rem;
}

.lesson {
  --wash: #fff4e4;
  --spine: var(--accent);
  position: relative;
  padding: 0.95rem 0.95rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--wash) 72%, transparent), rgba(255, 250, 244, 0.5) 58%);
  animation: rise 0.5s cubic-bezier(.2, .7, .2, 1) both;
  animation-delay: calc(var(--i, 0) * 40ms);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.lesson::before {
  content: "";
  height: 0.45rem;
  border-radius: 99px;
  background: var(--spine);
}

[data-tone="priroda"] { --wash: #e7f6df; --spine: #3c8f4e; }
[data-tone="kalendar"] { --wash: #e7f0ff; --spine: #3d6fbf; }
[data-tone="cas"] { --wash: #fff3d8; --spine: #d0891e; }
[data-tone="cisla"] { --wash: #fde8f2; --spine: #c44b78; }
[data-tone="jidlo"] { --wash: #ffe8dc; --spine: #d4653a; }
[data-tone="obleceni"] { --wash: #f3e9ff; --spine: #7a56b8; }
[data-tone="domov"] { --wash: #e7f7f3; --spine: #1d8a78; }
[data-tone="zdravi"] { --wash: #e5f8ea; --spine: #2f8f58; }
[data-tone="penize"] { --wash: #fff6d8; --spine: #c49616; }
[data-tone="cesta"] { --wash: #e7f3ff; --spine: #2f78c4; }
[data-tone="prace"] { --wash: #f8eee4; --spine: #a86432; }
[data-tone="drobnosti"] { --wash: #fff0e4; --spine: #e07a32; }
.hero[data-tone] { background: linear-gradient(180deg, color-mix(in srgb, var(--wash) 70%, transparent), rgba(255, 250, 244, 0.42) 68%); }

.lesson-open { color: inherit; text-decoration: none; display: grid; gap: 0.4rem; min-width: 0; }
.lesson-kicker { font-size: 1.7rem; line-height: 1; }
.lesson p { margin: 0; color: var(--muted); }

.thumbs { display: flex; flex-wrap: wrap; gap: 0.35rem; }
.thumbs img {
  width: 52px;
  height: 52px;
  object-fit: cover;
  border-radius: 0.75rem;
  background: #fff;
  box-shadow: 0 4px 10px rgba(80, 40, 20, 0.12);
}

.meter, .bar {
  position: relative;
  height: 0.55rem;
  border-radius: 99px;
  background: rgba(90, 50, 20, 0.1);
  overflow: hidden;
}

.meter span, .bar span {
  display: block;
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #f0b429, #2f9d62);
  transition: width 0.45s ease;
}

.meter span {
  position: absolute;
  left: 0;
  top: 0;
  background: #f0b429;
}

.meter .is-learn { width: var(--learn, 0%); }
.meter .is-known { width: var(--known, 0%); background: #2f9d62; }

.tag {
  display: inline-block;
  margin: 0.35rem 0 0;
  padding: 0.12rem 0.55rem;
  border-radius: 999px;
  background: #fff3d4;
  color: #8a5a10;
  font-size: 0.82rem;
  font-weight: 800;
}

.tag.is-known { background: var(--good-bg); color: var(--good); }
.tag.is-due { background: #fff0e4; color: var(--accent-dark); }
.bar { margin: 0.8rem 0 0.15rem; }
.bar span { background: linear-gradient(90deg, #f0b429, var(--accent) 55%, #9d3b22); }

.stage { padding: clamp(0.85rem, 2vw, 1.25rem); }

.stage-top {
  display: flex;
  justify-content: space-between;
  gap: 0.6rem;
  align-items: center;
}

.stage-top a { font-weight: 800; }

.pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-top: 0.7rem; }

.pill {
  padding: 0.2rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.8);
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.mode {
  margin: 0.85rem 0 0.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-size: 0.82rem;
  color: var(--accent-dark);
}

.ask {
  margin: 0 0 0.8rem;
  font-size: clamp(1.15rem, 1vw + 1rem, 1.4rem);
  font-weight: 800;
  text-align: center;
}

.frame {
  width: min(100%, 440px);
  margin: 0.2rem auto 1rem;
  padding: 0.65rem 0.65rem 0.85rem;
  background: #fff;
  border-radius: 1.15rem 1.15rem 1.35rem 1.35rem;
  box-shadow: 0 16px 30px rgba(80, 40, 20, 0.14);
  animation: tilt 0.45s ease both;
}

.frame-small {
  width: 100%;
  margin: 0 0 0.45rem;
  padding: 0.4rem 0.4rem 0.55rem;
  animation: none;
}

.photo, .frame-small .photo, .photo-small {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  max-height: min(42vh, 420px);
  margin: 0;
  object-fit: contain;
  background:
    radial-gradient(circle at 50% 20%, #fff, #f3e6d2 80%);
  border-radius: 0.8rem;
}

.frame-small .photo, .photo-small { max-height: 150px; }

.word-de, .word-cs { margin: 0.25rem 0; text-align: center; overflow-wrap: anywhere; }

.word-de {
  font-family: Georgia, "Palatino Linotype", Palatino, serif;
  font-size: clamp(1.7rem, 3vw + 0.6rem, 2.7rem);
  line-height: 1.15;
}

.word-de .lemma { margin-left: 0.35rem; }

.word-cs { font-size: clamp(1.35rem, 2vw + 0.7rem, 2rem); font-weight: 800; }

.art {
  display: inline-block;
  padding: 0.08rem 0.5rem 0.12rem;
  border-radius: 999px;
  color: white;
  font-family: "Segoe UI", system-ui, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  vertical-align: 0.3rem;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.15);
}

.art-der { background: var(--der); }
.art-die { background: var(--die); }
.art-das { background: var(--das); }
.art-empty { display: none; }

.choices, .grades, .match {
  display: grid;
  gap: 0.65rem;
  margin-top: 0.8rem;
}

.choice, .grade, .match-btn {
  width: 100%;
  padding: 0.8rem 1rem;
  text-align: left;
  background: rgba(255, 255, 255, 0.88);
  border: 2px solid transparent;
  box-shadow: inset 0 0 0 1px var(--line);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}

.choice { font-size: clamp(1.05rem, 1vw + 0.9rem, 1.2rem); border-radius: 1.1rem; overflow-wrap: anywhere; }
.choice:hover:not(:disabled), .match-btn:hover:not(:disabled), .grade:hover { transform: translateY(-2px); }

.choice.is-right, .match-btn.is-done { border-color: var(--good); background: var(--good-bg); }
.choice.is-wrong, .match-btn.is-bad { border-color: var(--bad); background: var(--bad-bg); animation: shake 0.35s ease; }

.grade {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  border-radius: 1.1rem;
}

.grade span { font-weight: 650; color: var(--muted); }
.grade-again { background: var(--bad-bg); }
.grade-hard { background: var(--warn-bg); }
.grade-good { background: var(--good-bg); }
.grade-easy { background: #ddf8e6; }

.note {
  margin: 0.85rem 0;
  padding: 0.9rem 1rem;
  border-radius: 1.1rem;
  font-weight: 800;
  animation: pop 0.35s ease;
}

.note.good { background: var(--good-bg); color: var(--good); }
.note.almost { background: var(--warn-bg); color: var(--warn); }
.note.again, .note.bad { background: var(--bad-bg); color: var(--bad); }

.type-form { display: grid; gap: 0.55rem; margin-top: 0.6rem; }

.type-form input {
  width: 100%;
  min-height: 58px;
  padding: 0.7rem 0.95rem;
  border-radius: 1rem;
  border: 2px solid transparent;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
  font-size: clamp(1.15rem, 1vw + 1rem, 1.35rem);
}

.type-form input:focus {
  outline: 3px solid rgba(212, 101, 58, 0.35);
  border-color: var(--accent);
}

.match { grid-template-columns: 1fr 1fr; align-items: start; }
.match-col { display: grid; gap: 0.6rem; align-content: start; min-width: 0; }
.match-btn.is-on { border-color: var(--accent); background: #fff1ea; box-shadow: 0 0 0 3px rgba(212, 101, 58, 0.18); }

.match-btn {
  display: grid;
  gap: 0.35rem;
  justify-items: center;
  text-align: center;
  border-radius: 1rem;
  overflow-wrap: anywhere;
}

.match-btn img {
  width: 100%;
  max-width: 160px;
  height: clamp(72px, 18vw, 110px);
  object-fit: contain;
  background: #f6efe4;
  border-radius: 0.7rem;
}

.keys { margin: 0.85rem 0 0; color: var(--muted); font-size: 0.92rem; }

.dict {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(0.65rem, 1.6vw, 0.95rem);
  margin-top: 1rem;
}

.dict-card {
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0.75rem 0.8rem 0.9rem;
  text-align: center;
  min-width: 0;
  animation: rise 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 25ms);
}

.dict-card,
.lesson,
.hero[data-tone] {
  background-color: transparent;
  backdrop-filter: none;
}

.dict-card {
  background: rgba(255, 250, 244, 0.46);
}

.dict-card .frame-small {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 0.4rem;
  padding: 0.22rem 0.22rem 0.34rem;
  background: #fff;
}

.dict-card .frame-small .photo,
.dict-card .photo-small {
  width: auto;
  max-width: min(100%, 168px);
  height: auto;
  max-height: 124px;
  background: transparent;
}

.dict-card .art-empty {
  display: inline-block;
  visibility: hidden;
}

.dict-card .word-cs,
.dict-card .word-de {
  width: 100%;
  overflow-wrap: normal;
  word-break: normal;
  text-wrap: balance;
}

.dict-card .word-cs {
  font-size: clamp(1rem, 7.2cqi, 1.28rem);
  line-height: 1.25;
}

.dict-card .word-de {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.28rem;
  font-size: clamp(1.02rem, 7.6cqi, 1.42rem);
  line-height: 1.2;
}

.dict-card .word-de .lemma { margin-left: 0; }

.dict-card .art {
  margin: 0;
  vertical-align: 0;
  font-size: 0.78rem;
}

.dict-card .btn {
  width: auto;
  max-width: 100%;
  min-height: 40px;
  margin-top: auto;
  padding: 0.35rem 0.9rem;
  font-size: 0.92rem;
}

.manual { padding: clamp(1.1rem, 2vw, 1.6rem); }

.steps, .plain {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.75rem;
}

.steps li, .callout, .plain li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.8rem;
  align-items: start;
  padding: 0.9rem;
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.62);
}

.plain li { grid-template-columns: 1fr; }
.callout { grid-template-columns: 1fr; }

.num {
  display: grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: linear-gradient(180deg, #e57a4e, #c4512c);
  color: white;
  font-weight: 800;
  box-shadow: 0 6px 12px rgba(180, 70, 36, 0.25);
}

.steps p, .callout p, .parents p, .plain li { margin: 0.15rem 0 0; }

.parents {
  margin-top: 1.15rem;
  padding: 0.4rem 1rem 0.8rem;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.55);
}

.parents summary {
  font-weight: 800;
  cursor: pointer;
  min-height: 48px;
  display: flex;
  align-items: center;
}

.parents p + p { margin-top: 0.55rem; }

.foot {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  padding: 0 0 calc(1.2rem + env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.95rem;
}

.img-missing {
  display: grid;
  place-items: center;
  min-height: 120px;
  border-radius: 0.8rem;
  background: #f6efe4;
  color: var(--muted);
}

button:focus-visible, a:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #e39a7e;
  outline-offset: 3px;
}

@media (hover: hover) {
  .lesson:hover { transform: translateY(-6px); box-shadow: 0 22px 40px rgba(92, 48, 18, 0.16); }
  .nav a:hover { background: var(--paper-solid); }
}

@media (min-width: 540px) {
  .dict { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 560px) {
  .choices { grid-template-columns: 1fr 1fr; }
}

@media (min-width: 860px) {
  .dict { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (min-width: 1120px) {
  .dict { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 800px) {
  .hero-head { grid-template-columns: minmax(0, 1.4fr) minmax(180px, 0.7fr); }
  .choices, .grades { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .row { flex-direction: column; align-items: stretch; }
  .btn, .seg button, .row .btn { width: 100%; }
  .btn.ghost { width: auto; align-self: flex-start; }
  .hero-art { order: -1; }
  .match { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 380px) {
  .thumbs img { width: 44px; height: 44px; }
  .stat { grid-template-columns: 1fr; }
  .stat-icon { display: none; }
  .keys { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}

@keyframes pop {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: none; }
}

@keyframes tilt {
  from { opacity: 0; transform: rotate(-1.5deg) translateY(8px); }
  to { opacity: 1; transform: rotate(-0.4deg); }
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

@keyframes glow {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.72; }
}

@keyframes drift {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(28px); }
}
