.bm-lesson {
  --bm-pine: #194b3a;
  --bm-ink: #203f34;
  --bm-muted: #5d7167;
  --bm-paper: #fffef9;
  --bm-tint: #e3f3d7;
  --bm-line: #dce3d5;
  --bm-bold: ui-rounded, "Arial Rounded MT Bold", "Nunito", system-ui, sans-serif;
  box-sizing: border-box;
  width: min(520px, calc(100vw - 32px));
  min-width: 0;
  max-width: none;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  margin: auto;
  padding: 0;
  color: var(--bm-ink);
  border: 1px solid #c4d3bc;
  border-radius: 28px;
  background: var(--bm-paper);
  box-shadow: 0 20px 80px #102d3852;
  overflow: auto;
  overscroll-behavior: contain;
  font-family: inherit;
  font-size: 16px;
  text-align: left;
  line-height: 1.5;
}
.bm-lesson[open] { display: block; }
.bm-lesson::backdrop { background: #1b352c7d; backdrop-filter: blur(5px); }
.bm-lesson[data-chapter="2"] { --bm-tint: #efe6fa; }
.bm-lesson[data-chapter="3"] { --bm-tint: #fff0cf; }
.bm-lesson[data-chapter="4"] { --bm-tint: #dff0fb; }
.bm-dialog-inner { display: flex; flex-direction: column; isolation: isolate; }
.bm-lesson *, .bm-lesson *::before, .bm-lesson *::after { box-sizing: border-box; }
.bm-lesson h2,.bm-lesson h3,.bm-lesson p,.bm-lesson small { margin: 0; }
.bm-lesson button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font: inherit;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  touch-action: manipulation;
  color: inherit;
  transition: background-color .14s, border-color .14s, transform .14s;
}
.bm-lesson button:focus-visible { outline: 3px solid #88671f; outline-offset: 2px; }
.bm-lesson h2:focus { outline: none; }
.bm-lesson button:not(:disabled):active { transform: translateY(1px); }
.bm-lesson svg { flex-shrink: 0; }
.bm-dialog-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 20px 26px 16px;
}
.bm-chapter-heading { display: flex; align-items: center; gap: 11px; }
.bm-round-mark { width: 39px; height: 39px; display: grid; place-items: center; color: var(--bm-pine); background: var(--bm-tint); border: 1px solid #203e3214; border-radius: 12px; }
.bm-chapter-heading strong { display: block; font-size: 16px; font-weight: 750; letter-spacing: .02em; }
.bm-chapter-no,.bm-result-over { display: block; color: var(--bm-muted); font: 800 12px/1.5 var(--bm-bold); letter-spacing: .09em; }
.bm-lesson .bm-icon-key { width: 44px; height: 44px; background: transparent; border: 1px solid transparent; border-radius: 50%; padding: 0; color: var(--bm-muted); }
.bm-lesson .bm-icon-key:hover { background: #1b4b3510; }
.bm-progress { padding: 0 28px 18px; }
.bm-progress-line { display: flex; justify-content: space-between; color: var(--bm-muted); font-size: 13px; font-weight: 650; margin-bottom: 7px; }
.bm-ticks { display: flex; gap: 4px; }
.bm-ticks span { display: block; height: 5px; border-radius: 10px; background: #e7eadf; flex: 1; }
.bm-ticks .bm-filled { background: #438c68; }
.bm-ticks .bm-current { background: #f2c454; }
.bm-content { display: flex; flex-direction: column; gap: 16px; padding: 0 26px 24px; }
.bm-word-card { border: 1px solid var(--bm-line); border-radius: 20px; overflow: hidden; background: #fff; }
.bm-art { aspect-ratio: 2.5; background: var(--bm-tint); }
.bm-art img { display: block; width: 100%; height: 100%; object-fit: contain; }
.bm-result-art { background: var(--bm-tint); position: relative; isolation: isolate; }
.bm-result-art img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center 44%; }
.bm-word-info { position: relative; text-align: center; padding: 17px 45px 19px; }
.bm-lesson .bm-favorite { position: absolute; right: 5px; top: 6px; }
.bm-lesson .bm-favorite[aria-pressed="true"] { color: #ad4b61; }
.bm-favorite[aria-pressed="true"] svg { fill: #efb4c0; }
.bm-word-info h2,.bm-quiz-prompt h2 { color: var(--bm-pine); font: 850 clamp(36px, 7.5vw, 49px)/1.18 var(--bm-bold); letter-spacing: -.035em; overflow-wrap: anywhere; }
.bm-lesson .bm-meaning { font-size: 19px; font-weight: 700; margin: 3px 0 7px; }
.bm-lesson .bm-sound { min-height: 44px; background: #eff5e9; color: var(--bm-pine); border: 0; border-radius: 25px; padding: 5px 15px; font-family: ui-sans-serif, system-ui, sans-serif; font-weight: 550; font-size: 15px; }
.bm-lesson .bm-sound:hover { background: #e2eedb; }
.bm-example { display: flex; align-items: center; gap: 8px; justify-content: space-between; background: #f6f6ee; border-radius: 15px; padding: 13px 10px 14px 16px; }
.bm-example h3 { color: var(--bm-muted); font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.bm-lesson .bm-example p { font: 600 17px/1.45 var(--bm-bold); }
.bm-example p strong { font-weight: 850; color: #285f43; }
.bm-example small { display: block; font-size: 14px; color: var(--bm-muted); margin-top: 3px; }
.bm-example .bm-icon-key { flex: 0 0 44px; }
.bm-actions { display: flex; align-items: stretch; justify-content: flex-end; gap: 10px; }
.bm-lesson .bm-primary,.bm-lesson .bm-secondary {
  min-height: 48px; border-radius: 14px; padding: 10px 18px; font-size: 16px; font-weight: 750;
}
.bm-lesson .bm-primary { color: #fff; background: var(--bm-pine); border: 1px solid #163f31; box-shadow: 0 2px 0 #113626; flex: 1; }
.bm-lesson .bm-primary:hover { background: #255e47; }
.bm-lesson .bm-secondary { background: #fffef9; border: 1px solid #cbd6c7; color: var(--bm-pine); }
.bm-lesson .bm-secondary:hover { background: #f0f4e9; }
.bm-quiz-prompt { text-align: center; border: 1px solid #244d3412; background: var(--bm-tint); border-radius: 18px; padding: 18px 20px 21px; }
.bm-quiz-icon { display: inline-flex; align-items: center; justify-content: center; width: 45px; height: 45px; border-radius: 14px; color: #74551d; background: #fff9e4; margin-bottom: 8px; }
.bm-quiz-prompt p { font-size: 15px; margin-bottom: 3px; }
.bm-quiz-prompt h2 { display: inline; vertical-align: middle; }
.bm-quiz-prompt h2:not([lang]) { font-family: inherit; font-size: 34px; font-weight: 800; line-height: 1.5; letter-spacing: -.02em; }
.bm-lesson .bm-prompt-audio { vertical-align: middle; width: 44px; height: 44px; border-radius: 50%; margin-left: 6px; background: #fffff98c; border: 1px solid #224b3926; }
.bm-options { display: grid; gap: 9px; }
.bm-lesson .bm-option { justify-content: flex-start; width: 100%; text-align: left; padding: 9px 13px; gap: 13px; min-height: 52px; background: #fff; border: 1px solid #d6dfcf; border-radius: 13px; font-weight: 650; }
@media (hover:hover) { .bm-lesson .bm-option:hover:not(:disabled) { background: #eff5e8; border-color: #9bb296; } }
.bm-letter { color: #566a5b; background: #f1f4ec; min-width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font: 750 14px/1 var(--bm-bold); }
.bm-lesson .bm-option:disabled { opacity: 1; cursor: default; }
.bm-option-indicator { margin-left: auto; display: inline-flex; }
.bm-lesson .bm-option.bm-right { color: #245c3b; border-color: #6d9d74; background: #e9f5e6; }
.bm-lesson .bm-option.bm-wrong { color: #85533f; border-color: #e5bda5; background: #fff5ed; }
.bm-feedback:not(:empty) { display: flex; align-items: center; gap: 7px; font-size: 15px; line-height: 1.5; }
.bm-feedback.bm-positive { color: #28663f; }
.bm-feedback.bm-try { color: #895037; }
.bm-quiz-actions:empty,.bm-feedback:empty,.bm-voice-status:empty,.bm-voice-toast:empty { display: none; }
.bm-voice-status:not(:empty) { margin: -10px 26px 19px; font-size: 14px; color: #814a33; }
.bm-voice-toast:not(:empty) { position: fixed; max-width: calc(100% - 28px); bottom: 70px; left: 50%; transform: translateX(-50%); padding: 12px 18px; border-radius: 12px; background: #204735; color: white; box-shadow: 0 5px 16px #10291928; z-index: 200; font-size: 14px; }
.bm-result { align-items: center; gap: 11px; text-align: center; }
.bm-result-art { align-self: stretch; height: 148px; border-radius: 17px; margin-bottom: 12px; }
.bm-result-art img { border-radius: inherit; }
.bm-result-art span { position: absolute; bottom: -17px; left: 50%; transform: translateX(-50%); background: #ffe28b; color: #75531b; border: 3px solid var(--bm-paper); border-radius: 18px; width: 51px; height: 51px; display: grid; place-items: center; }
.bm-result-over { color: #527454; letter-spacing: .1em; text-transform: uppercase; font-size: 13px; }
.bm-result h2 { font-size: clamp(27px, 6.2vw, 34px); color: var(--bm-pine); line-height: 1.25; }
.bm-result p { font-size: 15px; }
.bm-result .bm-story { max-width: 36ch; text-wrap: pretty; line-height: 1.75; }
.bm-result .bm-farewell { color: var(--bm-muted); font-size: 14px; }
.bm-result-over.bm-ending { font: 750 20px/1.25 var(--bm-bold); text-transform: none; letter-spacing: -.02em; }
.bm-result-words { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.bm-result-words span { display: flex; gap: 4px; align-items: center; font: 700 14px/1.5 var(--bm-bold); background: #edf5e6; color: #345e3f; padding: 4px 8px; border-radius: 8px; }
.bm-earned { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 7px 13px; margin-top: 3px; font-size: 14px; color: #765922; }
.bm-earned svg { fill: #f9cf5a; }
.bm-result .bm-actions { align-self: stretch; margin-top: 7px; }
@media (max-width: 560px) {
  .bm-lesson {
    width: 100%; height: 100vh; height: 100dvh; max-height: none; margin: 0;
    border: 0; border-radius: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .bm-dialog-inner { min-height: 100%; }
  .bm-dialog-header { padding: 16px 16px 13px; }
  .bm-progress { padding: 0 19px 19px; }
  .bm-content { padding: 0 17px 20px; flex: 1; gap: 15px; }
  .bm-word-info { padding: 15px 42px 17px; }
  .bm-actions { margin-top: auto; padding-top: 5px; }
  .bm-content.bm-result { justify-content: flex-start; }
  .bm-result .bm-actions { margin-top: auto; }
  .bm-result-art { height: clamp(140px, 28vh, 225px); }
  .bm-voice-status:not(:empty) { margin: -8px 19px 14px; }
}
@media (min-width: 561px) and (max-height: 680px) {
  .bm-art { max-height: 125px; }
  .bm-dialog-header { padding-top: 12px; padding-bottom: 9px; }
  .bm-content { gap: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .bm-lesson button { transition: none; }
}
