dialog.lesson-dialog {
  box-sizing: border-box;
  width: min(620px, calc(100vw - 32px));
  max-width: 100%;
  max-height: min(90dvh, 930px);
  margin: auto;
  padding: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  color: var(--ink, #203b31);
  background: var(--paper, #fcfcf6);
  border: 1px solid var(--line, #d6dfd0);
  border-radius: 22px;
  box-shadow: 0 24px 100px #112c2852;
  font: inherit;
  text-align: left;
}
dialog.lesson-dialog::backdrop { background: rgb(17 39 30 / .57); }
.lesson-dialog *, .lesson-dialog *::before, .lesson-dialog *::after { box-sizing: border-box; }
.lesson-dialog .lt-shell { display: flex; flex-direction: column; width: 100%; }
.lesson-dialog .lt-bar,
.lesson-dialog .lt-footer {
  display: flex; align-items: center; justify-content: space-between; gap: .75rem;
  padding: .8rem 1.65rem; background: var(--paper, #fcfcf6);
}
.lesson-dialog .lt-bar { border-bottom: 1px solid var(--line, #d6dfd0); }
.lesson-dialog .lt-bar > span, .lesson-dialog .lt-meta, .lesson-dialog .lt-meta > span,
.lesson-dialog .lt-type { display: inline-flex; align-items: center; gap: .4rem; }
.lesson-dialog .lt-bar > span { flex-wrap: wrap; font-size: .86rem; font-weight: 650; color: var(--muted, #52665a); }
.lesson-dialog .lt-bar > span > span[aria-hidden] { opacity: .48; padding: 0 .1rem; }
.lesson-dialog .lt-meta { flex-wrap: wrap; gap: .65rem; font-size: .82rem; }
.lesson-dialog .lt-body { padding: clamp(1.35rem, 3.9vw, 2.15rem); }
.lesson-dialog h2, .lesson-dialog h3, .lesson-dialog p { margin: 0; }
.lesson-dialog #lesson-title:focus { outline: none; }
.lesson-dialog h2 { font: inherit; font-size: clamp(1.8rem, 5vw, 2.45rem); line-height: 1.12; letter-spacing: -.042em; font-weight: 780; }
.lesson-dialog h2.lt-question { font-size: clamp(1.3rem, 3.4vw, 1.77rem); line-height: 1.25; letter-spacing: -.023em; }
.lesson-dialog h3 { font: inherit; font-size: 1.1rem; font-weight: 750; margin: 1.5rem 0 .4rem; }
.lesson-dialog .lt-kicker, .lesson-dialog .lt-type { color: var(--green, #24694a); font-size: .88rem; font-weight: 710; margin-bottom: .65rem; }
.lesson-dialog .lt-kicker { display: block; }
.lesson-dialog .lt-scene { margin-top: .8rem; color: var(--muted, #52665a); line-height: 1.55; }
.lesson-dialog .lt-goal, .lesson-dialog .lt-feedback { display: flex; gap: .8rem; align-items: flex-start; padding: 1rem 1.05rem; border-radius: 12px; }
.lesson-dialog .lt-goal { margin-top: 1.2rem; background: #eaf1e4; color: #214e36; }
.lesson-dialog .lt-goal svg, .lesson-dialog .lt-feedback svg { flex: 0 0 auto; margin-top: .08rem; }
.lesson-dialog .lt-goal strong, .lesson-dialog .lt-feedback strong { font-weight: 750; }
.lesson-dialog .lt-goal p, .lesson-dialog .lt-feedback p { line-height: 1.5; margin-top: .2rem; }
.lesson-dialog .lt-phrases { list-style: none; padding: 0; margin: 0; }
.lesson-dialog .lt-phrases li { display: flex; justify-content: space-between; align-items: center; padding: .7rem 0; gap: 1rem; border-bottom: 1px solid var(--line, #d6dfd0); }
.lesson-dialog .lt-phrases li:last-child { border-bottom: 0; padding-bottom: 0; }
.lesson-dialog .lt-phrases li > div { display: grid; gap: .15rem; }
.lesson-dialog .lt-phrases strong { font-size: 1rem; }
.lesson-dialog .lt-phrases li span, .lesson-dialog .lt-note, .lesson-dialog .lt-resume-note { color: var(--muted, #52665a); font-size: .89rem; line-height: 1.45; }
.lesson-dialog .lt-button {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  min-height: 44px; margin: 0; padding: .58rem .9rem;
  font: inherit; font-size: .95rem; line-height: 1.24; font-weight: 670;
  color: inherit; background: none; cursor: pointer; border: 1px solid transparent; border-radius: 10px;
}
.lesson-dialog .lt-button:focus-visible, .lesson-dialog summary:focus-visible, .lesson-dialog input:focus-visible,
.lesson-dialog .lt-options label:has(input:focus-visible) { outline: 3px solid #498372; outline-offset: 3px; }
.lesson-dialog .lt-icon-button { width: 44px; padding: 0; flex-shrink: 0; color: var(--muted, #52665a); }
.lesson-dialog .lt-icon-button:hover, .lesson-dialog .lt-link:hover { background: #eaf0e7; color: #214e36; }
.lesson-dialog .lt-footer { position: sticky; bottom: 0; z-index: 1; border-top: 1px solid var(--line, #d6dfd0); padding-bottom: max(.8rem, env(safe-area-inset-bottom)); }
.lesson-dialog .lt-primary { margin-left: auto; padding: .7rem 1.35rem; min-width: 9rem; color: #fff; background: var(--green, #24694a); }
.lesson-dialog .lt-primary:enabled:hover { filter: brightness(.92); }
.lesson-dialog .lt-primary:disabled { cursor: default; opacity: .52; }
.lesson-dialog .lt-secondary, .lesson-dialog .lt-chip { border-color: var(--line, #cdd8cb); background: white; }
.lesson-dialog .lt-secondary:hover, .lesson-dialog .lt-chip:enabled:hover { border-color: var(--green, #24694a); }
.lesson-dialog .lt-link { color: var(--green, #24694a); padding-inline: .5rem; }
.lesson-dialog .lt-meter { width: 100%; display: flex; gap: 4px; margin-bottom: 1.6rem; }
.lesson-dialog .lt-meter i { flex: 1; height: 5px; background: #dce5da; border-radius: 4px; }
.lesson-dialog .lt-meter i.filled { background: var(--green, #24694a); }
.lesson-dialog .lt-meter i.current { background: #d7ac53; }
.lesson-dialog .lt-options { display: grid; gap: .55rem; border: 0; padding: 0; margin: 1.2rem 0 0; }
.lesson-dialog .lt-options label { position: relative; display: flex; gap: .75rem; align-items: center; padding: .75rem .9rem; min-height: 49px; background: #fff; border: 1px solid var(--line, #d6dfd0); border-radius: 12px; cursor: pointer; font-size: 1rem; line-height: 1.4; }
.lesson-dialog .lt-options label:has(:checked) { border-color: var(--green, #24694a); background: #edf4e9; box-shadow: inset 0 0 0 1px var(--green, #24694a); }
.lesson-dialog .lt-options input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.lesson-dialog .lt-options label:has(input:disabled) { cursor: default; }
.lesson-dialog .lt-radio-mark { flex: 0 0 auto; width: 1rem; height: 1rem; border-radius: 50%; border: 1.5px solid #89998c; }
.lesson-dialog .lt-options input:checked + .lt-radio-mark { border: 5px solid var(--green, #24694a); }
.lesson-dialog .lt-audio { display: flex; gap: .45rem; align-items: center; flex-wrap: wrap; margin-top: 1rem; }
.lesson-dialog .lt-audio p { flex: 1 0 100%; background: #edf2e8; border-radius: 10px; padding: .75rem .9rem; }
.lesson-dialog .lt-build, .lesson-dialog .lt-word-bank { display: flex; align-items: center; gap: .45rem; flex-wrap: wrap; }
.lesson-dialog .lt-build { min-height: 4.2rem; border: 1px dashed #91a28f; border-radius: 12px; margin: 1.2rem 0 .7rem; padding: .6rem; }
.lesson-dialog .lt-build > span { margin: 0 .25rem; color: var(--muted, #52665a); font-size: .91rem; }
.lesson-dialog .lt-chip { padding: .5rem .85rem; }
.lesson-dialog .lt-chip:disabled { opacity: .35; cursor: default; }
.lesson-dialog .lt-chip.lt-placed { color: #25553e; border-color: #9db8a2; background: #e6f0e2; }
.lesson-dialog .lt-chip.lt-placed:disabled { opacity: 1; }
.lesson-dialog .lt-field { display: block; margin: 1.45rem 0 .48rem; font-size: .88rem; font-weight: 650; }
.lesson-dialog #lt-answer { display: block; width: 100%; background: #fff; font: inherit; font-size: 1rem; line-height: 1.45; min-height: 49px; padding: .73rem .85rem; border: 1px solid #9aad9e; border-radius: 10px; color: var(--ink, #203b31); }
.lesson-dialog #lt-answer:disabled { background: #f0f3ec; opacity: 1; }
.lesson-dialog .lt-hint, .lesson-dialog .lt-review { margin-top: .8rem; }
.lesson-dialog summary { width: fit-content; padding: .55rem 0; color: var(--green, #24694a); cursor: pointer; font-size: .92rem; font-weight: 650; }
.lesson-dialog .lt-hint p { color: var(--muted, #52665a); line-height: 1.5; font-size: .95rem; }
.lesson-dialog .lt-feedback { margin-top: 1rem; }
.lesson-dialog .lt-right { color: #235a3e; background: #e4efdf; }
.lesson-dialog .lt-wrong { color: #70491e; background: #fff0d3; }
.lesson-dialog .lt-feedback p { font-size: .93rem; }
.lesson-dialog .lt-err { color: #9a321e; margin-top: .8rem; }
.lesson-dialog .lt-result-mark { display: inline-grid; place-items: center; width: 62px; height: 62px; border-radius: 17px; color: #965e1f; background: #fbebbd; margin-bottom: 1rem; }
.lesson-dialog .lt-result-stats { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: .5rem; margin: 1.3rem 0 .9rem; }
.lesson-dialog .lt-result-stats > div { display: flex; flex-direction: column; gap: .35rem; padding: .8rem .65rem; color: var(--muted, #52665a); background: #edf2e8; border-radius: 11px; }
.lesson-dialog .lt-result-stats strong { display: flex; align-items: center; gap: .2rem; font-size: 1.15rem; color: var(--ink, #203b31); }
.lesson-dialog .lt-result-stats span { font-size: .83rem; }
.lesson-dialog .lt-result-stats strong > svg:first-child { color: #aa7823; }
.lesson-dialog .lt-review ol { margin: .55rem 0 0; padding-left: 1.35rem; }
.lesson-dialog .lt-review li { padding: .65rem 0; border-top: 1px solid var(--line, #d6dfd0); font-size: .95rem; }
.lesson-dialog .lt-review li span, .lesson-dialog .lt-review li p { display: block; margin-top: .3rem; line-height: 1.45; }
.lesson-dialog .lt-review li span { color: var(--green, #24694a); font-weight: 680; }
.lesson-dialog .lt-review li p { color: var(--muted, #52665a); }
@media (max-width: 580px) {
  dialog.lesson-dialog { max-height: 100dvh; height: 100dvh; width: 100%; margin: 0; border: 0; border-radius: 0; }
  .lesson-dialog .lt-shell { min-height: 100%; }
  .lesson-dialog .lt-bar { padding: max(.6rem, env(safe-area-inset-top)) 1rem .6rem; }
  .lesson-dialog .lt-body { flex-grow: 1; padding: 1.25rem 1rem; }
  .lesson-dialog .lt-footer { padding-inline: 1rem; }
  .lesson-dialog .lt-bar > span { column-gap: .35rem; }
}
@media (max-width: 360px) {
  .lesson-dialog .lt-result-stats { gap: .28rem; }
  .lesson-dialog .lt-result-stats > div { padding: .6rem .4rem; }
  .lesson-dialog .lt-meta span:last-child { display: none; }
}
.lesson-dialog .lt-dialogue { display:grid; gap:.68rem; padding:0; margin:.8rem 0 1.1rem; list-style:none; }
.lesson-dialog .lt-dialogue li { display:flex; align-items:flex-start; gap:.6rem; padding:.75rem .9rem; border-inline-start:3px solid #6b9671; background:#eef4e8; border-radius:0 12px 12px 0; }
.lesson-dialog .lt-dialogue li:nth-child(even) { margin-left:.9rem; border-color:#c19949; background:#f7f1dc; }
.lesson-dialog .lt-dialogue-turn { flex:1; min-width:0; }
.lesson-dialog .lt-dialogue-turn b,.lesson-dialog .lt-read>span { font-size:.8rem; color:#465f4d; }
.lesson-dialog .lt-dialogue-turn p,.lesson-dialog .lt-read p { margin:.2rem 0; line-height:1.55; }
.lesson-dialog .lt-dialogue-turn summary { width:fit-content; color:#43614c; font-size:.84rem; cursor:pointer; padding:.25rem 0; }
.lesson-dialog .lt-dialogue-turn details p { font-size:.92rem; color:#506052; }
.lesson-dialog .lt-read { margin:.85rem 0; background:#e9f1e4; border-radius:12px; padding:.75rem 1rem; }
.lesson-dialog .lt-read p { font-weight:700; font-size:1.05rem; }
.lesson-dialog .lt-vocabulary { margin:.7rem 0; }
