/* Japan Road Rules — a quiet, focused learning space. */
:root {
  --bg: #f5f6f3;
  --panel: #fff;
  --panel-2: #f0f3ef;
  --ink: #202c29;
  --muted: #63716b;
  --line: #dfe6df;
  --blue-bg: #285f92;
  --blue-fg: #285f92;
  --green-bg: #22634b;
  --green-fg: #22634b;
  --red-bg: #b9403f;
  --red-fg: #b9403f;
  --yellow: #efbd58;
  --focus: #287557;
  --shadow: 0 8px 32px #243c2c06;
  --font: "Overpass", "Zen Kaku Gothic New", system-ui, sans-serif;
  --fontja: "Zen Kaku Gothic New", "Hiragino Sans", "Yu Gothic", sans-serif;
  --header: 76px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #131c19;
    --panel: #1b2722;
    --panel-2: #23322b;
    --ink: #edf3ec;
    --muted: #a5b5aa;
    --line: #33443a;
    --green-bg: #78b998;
    --green-fg: #99d4b5;
    --blue-bg: #477dae;
    --blue-fg: #9ac2ed;
    --red-bg: #be5553;
    --red-fg: #f5a19c;
    --focus: #9edabe;
    --shadow: 0 8px 32px #0002;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #131c19;
  --panel: #1b2722;
  --panel-2: #23322b;
  --ink: #edf3ec;
  --muted: #a5b5aa;
  --line: #33443a;
  --green-bg: #78b998;
  --green-fg: #99d4b5;
  --blue-bg: #477dae;
  --blue-fg: #9ac2ed;
  --red-bg: #be5553;
  --red-fg: #f5a19c;
  --focus: #9edabe;
  --shadow: 0 8px 32px #0002;
  color-scheme: dark;
}
* {
  box-sizing: border-box;
}
html {
  scroll-padding-top: calc(var(--header) + 20px);
}
html,
body {
  margin: 0;
  padding: 0;
}
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  min-height: 100dvh;
}
button,
input {
  font: inherit;
  color: inherit;
}
button,
a,
input {
  -webkit-tap-highlight-color: transparent;
}
button {
  cursor: pointer;
  touch-action: manipulation;
}
button:disabled {
  cursor: default;
  opacity: 0.4;
}
a {
  color: var(--green-fg);
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1,
h2,
h3 {
  line-height: 1.2;
}
button {
  transition:
    background 0.18s,
    border-color 0.18s,
    transform 0.18s;
}
button:active:not(:disabled) {
  transform: translateY(1px);
}
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}
button:focus-visible {
  border-radius: 8px;
}
.sr {
  position: absolute;
  width: 1px;
  height: 1px;
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}
:lang(ja),
.ja {
  font-family: var(--fontja);
}
.icon {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: none;
}
.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  background: var(--panel);
  padding: 12px 20px;
  z-index: 100;
  border-radius: 8px;
}
.skip-link:focus {
  top: 12px;
}
.top {
  height: var(--header);
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 0 max(28px, calc((100vw - 1464px) / 2));
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  text-decoration: none;
  color: var(--ink);
  flex: none;
}
.brand > svg {
  width: 38px;
  height: 38px;
}
.brand b {
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.6px;
  line-height: 1.2;
  display: block;
}
.brand span {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 1.4px;
  text-transform: uppercase;
  display: block;
  margin-top: 3px;
}
.tabs {
  display: flex;
  align-self: stretch;
  align-items: center;
  gap: 8px;
  margin: auto;
}
.tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 0;
  background: transparent;
  padding: 10px 17px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  border-radius: 9px;
}
.tabs button[aria-selected="true"] {
  background: var(--panel-2);
  color: var(--green-fg);
}
.tabs button:hover {
  background: var(--panel-2);
}
.tabs .icon {
  width: 18px;
  height: 18px;
}
.ctl {
  display: flex;
  align-items: center;
  gap: 9px;
}
.ctl button {
  border: 1px solid var(--line);
  background: transparent;
  min-height: 40px;
  border-radius: 9px;
  padding: 7px 11px;
  font-size: 12px;
  font-weight: 600;
}
.ctl button:hover {
  background: var(--panel-2);
}
.ctl #themeBtn {
  border-color: transparent;
  padding: 9px;
}
.ctl svg {
  display: block;
  width: 19px;
  height: 19px;
}
.view {
  display: none;
}
.view.on {
  display: block;
}
#learn.on {
  display: grid;
  grid-template-columns: 236px minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  column-gap: 38px;
  row-gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 30px 28px 48px;
  align-items: start;
}
.rail {
  grid-column: 1;
  grid-row: 1/4;
  position: sticky;
  top: calc(var(--header) + 24px);
  max-height: calc(100dvh - var(--header) - 48px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  padding-right: 18px;
  border-right: 1px solid var(--line);
}
.rail-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 2px 0 18px;
}
.rail h2 {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 1.8px;
  text-transform: uppercase;
}
.rail-heading > span {
  font-size: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  min-width: 26px;
  text-align: center;
  color: var(--muted);
}
.course-progress {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 14px;
  border-radius: 12px;
  margin-bottom: 23px;
}
.progress-caption {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.progress-caption b {
  font-weight: 600;
}
.progress-caption span {
  color: var(--muted);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}
.progress-track {
  height: 4px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
}
.progress-track span {
  display: block;
  height: 100%;
  background: var(--green-bg);
  transition: width 0.3s;
}
.chapter-group {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1.35px;
  font-weight: 700;
  color: var(--muted);
  margin: 22px 10px 8px;
}
.chap {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 10px 9px;
  text-align: left;
  border: 1px solid transparent;
  border-radius: 9px;
  background: transparent;
  margin: 2px 0;
}
.chap:hover {
  background: var(--panel-2);
}
.chap[aria-current="true"] {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 2px 4px #102a1e03;
}
.chap .n {
  width: 25px;
  height: 25px;
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  place-items: center;
  flex: none;
  font-size: 11px;
  color: var(--muted);
  font-weight: 600;
}
.chap[aria-current="true"] .n {
  background: var(--green-bg);
  color: var(--panel);
  border-color: var(--green-bg);
}
.chap.done .n {
  color: var(--green-fg);
  background: var(--panel-2);
  border-color: transparent;
}
.chap .t {
  min-width: 0;
}
.chap .t b {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.35;
}
.chap .t i {
  display: block;
  font-size: 10px;
  font-style: normal;
  font-weight: 400;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 3px;
}
.chapter-arrow {
  margin-left: auto;
  color: var(--green-fg);
  font-size: 19px;
}
.rail-note {
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 22px;
  padding: 16px 9px 5px;
  display: flex;
  gap: 8px;
}
.rail-note .icon {
  width: 16px;
  height: 16px;
}
.learn-intro {
  grid-column: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 1px 0 4px;
}
.eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 10px;
  letter-spacing: 1.8px;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--green-fg);
  margin-bottom: 9px;
}
.eyebrow::before {
  content: "";
  height: 6px;
  width: 6px;
  border-radius: 50%;
  background: var(--green-bg);
}
.learn-intro h1 {
  font-size: 30px;
  letter-spacing: -1.1px;
  font-weight: 700;
  line-height: 1.2;
}
.learn-intro p {
  color: var(--muted);
  font-size: 13px;
  margin-top: 9px;
}
.intro-stamp {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  white-space: nowrap;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--muted);
}
.intro-stamp .icon {
  width: 15px;
  height: 15px;
  color: var(--green-fg);
}
.chapter-mobile {
  display: none;
}
.stagewrap {
  grid-column: 2;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  scroll-margin-top: calc(var(--header) + 16px);
  min-width: 0;
}
.lesson-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 19px 24px;
  border-bottom: 1px solid var(--line);
}
.lesson-number {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: var(--panel-2);
  color: var(--green-fg);
  font-size: 17px;
  font-weight: 700;
  display: grid;
  place-items: center;
  flex: none;
}
.lesson-heading h2 {
  font-size: 21px;
  letter-spacing: -0.55px;
  display: inline;
}
.lesson-heading small {
  color: var(--muted);
  font-size: 12px;
  margin-left: 10px;
}
.lesson-subtitle {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}
.lesson-meta {
  margin-left: auto;
  display: flex;
  gap: 6px;
  align-items: center;
  color: var(--muted);
  font-size: 11px;
  white-space: nowrap;
}
.lesson-meta .icon {
  height: 15px;
  width: 15px;
}
#stage {
  height: clamp(285px, 32vw, 390px);
  position: relative;
  overflow: hidden;
  touch-action: pan-y;
  cursor: grab;
  background: #bed7e7;
}
#stage.exploring {
  touch-action: none;
}
#stage.drag {
  cursor: grabbing;
}
#c {
  display: block;
  width: 100%;
  height: 100%;
}
.chip-scene {
  position: absolute;
  top: 16px;
  left: 16px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #ffffff66;
  padding: 6px 10px;
  border-radius: 6px;
  background: #ffffffdf;
  color: #31443b;
  font-size: 10px;
  box-shadow: 0 2px 8px #00000006;
}
.chip-scene .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #398465;
}
.hud {
  position: absolute;
  top: 16px;
  right: 16px;
  display: none;
  align-items: center;
  gap: 5px;
  border-radius: 9px;
  padding: 9px 12px;
  background: #ffffffee;
  color: #243a30;
}
.hud.on {
  display: flex;
}
.hud b {
  font-size: 24px;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.hud small {
  font-size: 10px;
}
.hud.warn b {
  color: #b93f31;
}
.scene-transition {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 6px;
  padding: 24px;
  background: linear-gradient(135deg, #163d31fa, #0f2823fa);
  color: #fff;
  text-align: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.scene-transition.on {
  visibility: visible;
}
.scene-transition span,
.scene-transition small {
  color: #c9ddd5;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.scene-transition b {
  font-size: clamp(24px, 4vw, 38px);
  letter-spacing: -0.025em;
}
.scene-transition small {
  color: #f2c23b;
  letter-spacing: 0.04em;
  text-transform: none;
}
.scene-tools {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  align-items: center;
  gap: 6px;
}
.scene-tools button {
  border: 1px solid #fff8;
  border-radius: 8px;
  min-width: 36px;
  min-height: 36px;
  background: #ffffffeb;
  color: #31443b;
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  padding: 7px 10px;
}
.scene-tools button:hover {
  background: white;
}
.scene-tools button[aria-pressed="true"] {
  background: #22634b;
  color: white;
  border-color: #22634b;
}
.scene-tools .icon {
  width: 16px;
  height: 16px;
}
.hint {
  position: absolute;
  bottom: 20px;
  left: 16px;
  color: #23372e;
  background: #ffffffe6;
  border-radius: 6px;
  font-size: 11px;
  padding: 5px 9px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.hint.on {
  opacity: 1;
}
.cap {
  position: relative;
  min-height: 95px;
  padding: 19px 24px 17px;
  border-top: 1px solid var(--line);
  transition: opacity 0.2s;
}
.cap.swap {
  opacity: 0.15;
}
.cap .p {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.55;
}
.cap .s {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
  margin-top: 5px;
}
.transport {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  background: var(--panel);
  border-top: 1px solid var(--line);
}
.transport button {
  border: 0;
  background: var(--panel-2);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  flex: none;
}
.transport button:hover {
  background: var(--line);
}
.transport #playBtn {
  background: var(--green-bg);
  color: var(--panel);
  width: 38px;
  height: 38px;
}
.transport #narrationBtn[aria-pressed="true"] {
  color: var(--green-fg);
  box-shadow: inset 0 0 0 1px currentColor;
}
.transport #narrationBtn .icon {
  fill: none;
  stroke: currentColor;
}
.transport svg {
  width: 17px;
  height: 17px;
  fill: currentColor;
}
.transport input[type="range"] {
  flex: 1;
  width: 100%;
  min-width: 0;
  height: 32px;
  accent-color: var(--green-bg);
  cursor: pointer;
}
.transport .time {
  font-size: 10px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.transport-label {
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
}
.nofx {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  text-align: center;
  padding: 30px;
  background: var(--panel-2);
  color: var(--ink);
}
.nofx.on {
  display: grid;
}
.nofx p {
  max-width: 45ch;
  font-size: 13px;
  margin: 10px 0;
}
.nofx b {
  font-size: 18px;
}
.detail {
  grid-column: 2;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 24px 36px;
  padding: 5px 2px 0;
  min-width: 0;
}
.detail h3 {
  font-size: 13px;
  margin: 0 0 15px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}
.detail h3 .icon {
  width: 17px;
  height: 17px;
  color: var(--green-fg);
}
.pts {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 13px;
}
.pts li {
  position: relative;
  font-size: 13px;
  line-height: 1.65;
  padding-left: 23px;
  color: var(--muted);
}
.pts li:first-child {
  color: var(--ink);
  font-weight: 600;
}
.pts li::before {
  content: "✓";
  position: absolute;
  top: 1px;
  left: 0;
  color: var(--green-fg);
  font-size: 12px;
}
.rule-reference {
  border-left: 1px solid var(--line);
  padding-left: 27px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.chip {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  flex: 1;
  min-width: 125px;
  background: var(--panel);
}
.chip small {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 4px;
}
.chip b {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}
.chip.red {
  border-color: color-mix(in srgb, var(--red-fg) 22%, var(--line));
  background: color-mix(in srgb, var(--red-fg) 5%, var(--panel));
}
.chip.red b {
  color: var(--red-fg);
}
.chip.blue b {
  color: var(--blue-fg);
}
.law {
  font-size: 11px;
  line-height: 1.65;
  color: var(--muted);
  border-left: 2px solid var(--line);
  padding: 1px 0 1px 11px;
}
.tip {
  grid-column: 1/-1;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-2);
  display: flex;
  gap: 12px;
  padding: 15px 18px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--muted);
}
.tip > .icon {
  color: var(--green-fg);
  margin-top: 1px;
  width: 18px;
  height: 18px;
}
.tip b {
  display: block;
  font-size: 11px;
  color: var(--green-fg);
  margin-bottom: 3px;
}
.navbtns {
  grid-column: 1/-1;
  display: flex;
  align-items: center;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}
.navbtns button {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 9px;
  padding: 10px 17px;
  font-size: 12px;
  font-weight: 600;
}
.navbtns button.primary {
  background: var(--green-bg);
  border-color: var(--green-bg);
  color: var(--panel);
  margin-left: auto;
}
.navbtns .icon {
  width: 16px;
  height: 16px;
}
.lesson-saved {
  font-size: 10px;
  color: var(--muted);
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 5px;
}
.lesson-saved .icon {
  width: 13px;
  height: 13px;
}
.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 48px 28px 70px;
}
.page h1 {
  font-size: 34px;
  letter-spacing: -1.1px;
  margin-bottom: 12px;
  max-width: 26ch;
}
.page .lead {
  font-size: 14px;
  line-height: 1.75;
  max-width: 77ch;
  color: var(--muted);
  margin-bottom: 28px;
}
.page h2 {
  font-size: 23px;
  letter-spacing: -0.5px;
  margin: 38px 0 18px;
}
.reference-toolbar {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 25px;
}
.search-field {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 10px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  min-width: 210px;
  max-width: 360px;
  flex: 1;
  color: var(--muted);
}
.search-field input {
  border: 0;
  outline: 0;
  min-width: 0;
  width: 100%;
  background: transparent;
  min-height: 44px;
  font-size: 13px;
}
.search-field:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}
.search-field .icon {
  width: 17px;
  height: 17px;
}
.filter-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  max-width: 100%;
  scrollbar-width: none;
}
.filter-chips button {
  padding: 8px 12px;
  border: 1px solid var(--line);
  background: transparent;
  border-radius: 8px;
  font-size: 12px;
  white-space: nowrap;
  min-height: 38px;
}
.filter-chips button[aria-pressed="true"] {
  background: var(--green-bg);
  border-color: var(--green-bg);
  color: var(--panel);
}
.result-count {
  font-size: 11px;
  color: var(--muted);
  margin: -10px 0 16px;
}
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.sign {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 13px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 20px;
  gap: 10px;
}
.sign > svg {
  width: 80px;
  height: 80px;
  align-self: center;
  margin: 5px 0 13px;
}
.sign b {
  font-size: 14px;
  line-height: 1.5;
}
.sign span {
  font-size: 12px;
  line-height: 1.65;
  color: var(--muted);
}
.sign b span {
  font-size: 11px;
  font-weight: 400;
}
.sign .cat {
  font-size: 9px;
  font-weight: 600;
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 6px;
  background: var(--panel-2);
}
.sign .cat.reg {
  color: var(--red-fg);
}
.sign .cat.warn {
  color: #8c650a;
}
.sign .cat.ins {
  color: var(--blue-fg);
}
.empty-state {
  grid-column: 1/-1;
  border: 1px dashed var(--line);
  padding: 45px 24px;
  text-align: center;
  border-radius: 12px;
  color: var(--muted);
  font-size: 14px;
}
.marks {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.mark {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.mark svg {
  width: 85px;
  height: 65px;
  flex: none;
}
.mark b {
  display: block;
  font-size: 13px;
  margin-bottom: 5px;
}
.mark span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.6;
}
.cols {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  padding: 24px;
  border-radius: 13px;
}
.card h3 {
  font-size: 15px;
  margin-bottom: 14px;
}
.card p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}
.ticket {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 6px;
  border: 1px solid #0002;
  border-radius: 3px;
}
.tw {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
}
table {
  border-collapse: collapse;
  width: 100%;
  background: var(--panel);
  font-size: 13px;
}
th,
td {
  text-align: left;
  padding: 13px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
th {
  background: var(--panel-2);
  font-weight: 600;
  font-size: 11px;
}
tr:last-child td {
  border-bottom: 0;
}
td.num {
  font-weight: 700;
  white-space: nowrap;
}
.red-t {
  color: var(--red-fg);
  font-weight: 700;
}
.tl {
  list-style: none;
  margin: 0 0 0 7px;
  padding: 0;
  border-left: 2px solid var(--line);
}
.tl li {
  position: relative;
  padding: 0 0 24px 25px;
  font-size: 13px;
}
.tl li::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 6px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--green-bg);
  border: 2px solid var(--bg);
}
.tl b {
  display: block;
  color: var(--green-fg);
  font-size: 12px;
  margin-bottom: 4px;
}
.tl span {
  color: var(--muted);
}
#quiz .page {
  max-width: 820px;
}
.qbox {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 17px;
  padding: 32px;
  box-shadow: var(--shadow);
}
.qbox .prog {
  display: flex;
  gap: 5px;
  margin: 14px 0 30px;
}
.qbox .prog i {
  height: 5px;
  flex: 1;
  border-radius: 3px;
  background: var(--line);
}
.qbox .prog i.ok {
  background: var(--green-bg);
}
.qbox .prog i.ng {
  background: var(--red-bg);
}
.qbox .prog i.cur {
  background: var(--blue-bg);
}
.quiz-progress {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.quiz-progress-text,
.qn {
  font-size: 12px;
  color: var(--muted);
}
.quiz-eyebrow {
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--green-fg);
  margin-bottom: 12px;
}
.qbox .q {
  font-size: 24px;
  line-height: 1.5;
  letter-spacing: -0.4px;
  margin: 12px 0;
}
.qbox .qs {
  font-size: 13px;
  line-height: 1.7;
  color: var(--muted);
  margin-bottom: 26px;
}
.qbtns {
  display: flex;
  gap: 12px;
}
.qbtns button {
  flex: 1;
  min-height: 62px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--panel);
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 13px;
}
.qbtns button:not([aria-disabled="true"]):hover {
  background: var(--panel-2);
  border-color: var(--green-fg);
}
.qbtns button:disabled {
  opacity: 1;
}
.qbtns button.pick.ok {
  background: var(--green-bg);
  color: var(--panel);
  border-color: var(--green-bg);
}
.qbtns button.pick.ng {
  background: var(--red-bg);
  color: #fff;
  border-color: var(--red-bg);
}
.qbtns button.reveal {
  border: 2px solid var(--green-fg);
}
.quiz-answer-state {
  font-size: 10px;
  font-weight: 400;
  display: block;
}
.expl {
  display: none;
  background: var(--panel-2);
  border-radius: 11px;
  padding: 18px;
  margin-top: 20px;
  font-size: 13px;
  line-height: 1.8;
}
.expl.on {
  display: flex;
  gap: 12px;
}
.expl b {
  display: block;
  font-size: 14px;
  margin-bottom: 5px;
}
.quiz-feedback-icon {
  font-weight: 800;
  font-size: 18px;
}
.quiz-feedback-copy {
  flex: 1;
}
.qnext {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.qnext button {
  background: var(--green-bg);
  color: var(--panel);
  border: 0;
  border-radius: 9px;
  padding: 12px 22px;
  min-height: 46px;
  font-size: 13px;
  font-weight: 700;
}
.qnext button.ghost {
  background: var(--panel-2);
  color: var(--ink);
  border: 1px solid var(--line);
}
.score {
  font-size: 60px;
  letter-spacing: -2px;
  font-weight: 800;
  color: var(--green-fg);
}
.quiz-result-header {
  display: flex;
  align-items: center;
  gap: 20px;
  margin: 24px 0;
}
.quiz-result-icon {
  font-size: 34px;
  color: var(--green-fg);
}
.quiz-result-copy {
  font-size: 14px;
  color: var(--muted);
}
.quiz-review {
  margin-top: 25px;
}
.quiz-review h3 {
  font-size: 15px;
  margin-bottom: 14px;
}
.quiz-review-list {
  padding-left: 20px;
  font-size: 13px;
}
.quiz-review-list li {
  padding: 8px 0;
}
.quiz-review-list p {
  color: var(--muted);
  margin-top: 5px;
}
footer {
  border-top: 1px solid var(--line);
  padding: 26px 28px 30px;
  text-align: center;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}
footer p {
  max-width: 110ch;
  margin: 0 auto 7px;
}
.chapter-sheet {
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
  padding: 0;
  max-height: 85dvh;
  width: min(460px, calc(100% - 32px));
  border-radius: 18px;
  box-shadow: 0 24px 90px #0003;
}
.chapter-sheet::backdrop {
  background: #0b221a77;
  backdrop-filter: blur(4px);
}
.sheet-head {
  padding: 22px 22px 14px;
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 1;
  border-bottom: 1px solid var(--line);
}
.sheet-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.sheet-head h2 {
  font-size: 22px;
  letter-spacing: -0.5px;
}
.sheet-head p {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
.sheet-close {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  background: var(--panel-2);
  border: 0;
  border-radius: 50%;
  flex: none;
}
.sheet-head .search-field {
  max-width: none;
}
.sheet-list {
  padding: 5px 16px 24px;
}
.sheet-list .chap {
  min-height: 60px;
  padding: 11px;
}
.sheet-list .chap .t b {
  font-size: 14px;
}
.sheet-list .chap .t i {
  font-size: 11px;
}
.sheet-list .chap .n {
  width: 32px;
  height: 32px;
}
.sheet-list .chap[aria-current="true"] {
  background: var(--panel-2);
}
body.sheet-open {
  overflow: hidden;
}
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--panel);
  box-shadow: var(--shadow);
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 13px;
  pointer-events: none;
  opacity: 0;
  transition:
    opacity 0.2s,
    transform 0.2s;
  z-index: 70;
  max-width: calc(100% - 32px);
  text-align: center;
}
.toast.on {
  opacity: 1;
  transform: translate(-50%, 0);
}
@media (min-width: 1450px) {
  #learn.on {
    column-gap: 46px;
    grid-template-columns: 246px minmax(0, 1fr);
    padding-top: 38px;
  }
  .learn-intro {
    padding-bottom: 10px;
  }
  .learn-intro h1 {
    font-size: 34px;
  }
}
@media (max-width: 1100px) {
  .top {
    padding: 0 22px;
    gap: 15px;
  }
  .tabs {
    gap: 1px;
  }
  .tabs button {
    padding: 10px 12px;
  }
  #learn.on {
    grid-template-columns: 207px minmax(0, 1fr);
    column-gap: 25px;
    padding: 26px 22px 40px;
  }
  .rail {
    padding-right: 14px;
  }
  .intro-stamp {
    display: none;
  }
  .learn-intro h1 {
    font-size: 28px;
  }
  .detail {
    gap: 22px;
  }
  .rule-reference {
    padding-left: 22px;
  }
  .lesson-heading {
    padding: 17px 20px;
  }
  .lesson-heading small {
    display: block;
    margin: 4px 0 0;
  }
  .lesson-subtitle {
    display: none;
  }
  #stage {
    height: 330px;
  }
  .cap {
    padding: 17px 20px;
  }
  .transport-label {
    display: none;
  }
  .lesson-saved {
    display: none;
  }
}
@media (max-width: 760px) {
  :root {
    --header: 65px;
  }
  .top {
    padding: env(safe-area-inset-top) 18px 0;
    height: calc(var(--header) + env(safe-area-inset-top));
    gap: 10px;
  }
  .brand {
    gap: 8px;
  }
  .brand > svg {
    width: 33px;
    height: 33px;
  }
  .brand b {
    font-size: 17px;
    letter-spacing: -0.5px;
  }
  .brand span {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .ctl {
    margin-left: auto;
    gap: 2px;
  }
  .ctl button {
    min-height: 44px;
    min-width: 44px;
    font-size: 11px;
    padding: 6px 8px;
  }
  .ctl #themeBtn {
    padding: 12px;
  }
  .ctl svg {
    width: 18px;
    height: 18px;
  }
  .tabs {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(67px + env(safe-area-inset-bottom));
    padding: 5px max(9px, env(safe-area-inset-right))
      calc(5px + env(safe-area-inset-bottom))
      max(9px, env(safe-area-inset-left));
    background: var(--panel);
    border-top: 1px solid var(--line);
    box-shadow: 0 -5px 22px #20372805;
    gap: 0;
    z-index: 40;
    justify-content: space-around;
  }
  .tabs button {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    border-radius: 11px;
    padding: 7px 4px;
    min-height: 54px;
    max-width: 105px;
    font-size: 10px;
    line-height: 1.2;
    font-weight: 600;
  }
  .tabs .icon {
    width: 21px;
    height: 21px;
  }
  .tabs button[aria-selected="true"] {
    background: var(--panel-2);
    color: var(--green-fg);
  }
  body {
    padding-bottom: calc(67px + env(safe-area-inset-bottom));
  }
  #learn.on {
    display: flex;
    flex-direction: column;
    gap: 19px;
    padding: 25px 20px 32px;
  }
  .rail {
    display: none;
  }
  .learn-intro {
    display: block;
    width: 100%;
    padding: 0;
  }
  .eyebrow {
    font-size: 9px;
    letter-spacing: 1.5px;
    margin-bottom: 9px;
  }
  .learn-intro h1 {
    font-size: 28px;
    letter-spacing: -1px;
    max-width: 17ch;
    line-height: 1.16;
  }
  .learn-intro p {
    font-size: 12px;
    line-height: 1.7;
    max-width: 35ch;
    margin-top: 10px;
  }
  .chapter-mobile {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }
  .chapter-mobile-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .mobile-course-label {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 10px;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    font-weight: 600;
    color: var(--muted);
  }
  .chapter-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 11px;
    font-weight: 600;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    min-height: 40px;
  }
  .chapter-trigger .icon {
    height: 15px;
    width: 15px;
  }
  .mobile-progress {
    height: 3px;
    border-radius: 3px;
    background: var(--line);
    overflow: hidden;
  }
  .mobile-progress span {
    display: block;
    height: 100%;
    background: var(--green-bg);
    transition: width 0.3s;
  }
  .stagewrap {
    width: 100%;
    border-radius: 13px;
    scroll-margin-top: calc(var(--header) + 12px);
  }
  .lesson-heading {
    padding: 16px;
    gap: 10px;
  }
  .lesson-number {
    height: 35px;
    width: 35px;
    border-radius: 9px;
    font-size: 15px;
  }
  .lesson-heading h2 {
    font-size: 19px;
  }
  .lesson-heading small {
    font-size: 11px;
    margin-top: 3px;
  }
  .lesson-meta {
    font-size: 10px;
    gap: 4px;
  }
  .lesson-meta .icon {
    height: 13px;
    width: 13px;
  }
  #stage {
    height: 270px;
  }
  .chip-scene {
    left: 11px;
    top: 11px;
    padding: 5px 8px;
    font-size: 9px;
  }
  .hud {
    top: 11px;
    right: 11px;
    padding: 8px;
  }
  .hud b {
    font-size: 21px;
  }
  .hud small {
    font-size: 9px;
  }
  .scene-tools {
    bottom: 11px;
    right: 11px;
    gap: 5px;
  }
  .scene-tools button {
    min-height: 44px;
    min-width: 44px;
    padding: 9px;
  }
  .scene-tools #exploreBtn {
    padding: 9px 11px;
  }
  .hint {
    display: none;
  }
  .cap {
    padding: 15px 16px;
    min-height: 114px;
  }
  .cap .p {
    font-size: 14px;
    line-height: 1.55;
  }
  .cap .s {
    font-size: 11px;
    line-height: 1.7;
    margin-top: 6px;
  }
  .transport {
    padding: 10px 12px;
    display: grid;
    grid-template-columns: 44px 44px 44px 44px minmax(0, 1fr) 44px;
    grid-template-rows: 26px 44px;
    gap: 6px;
  }
  .transport input[type="range"] {
    grid-column: 1/5;
    grid-row: 1;
    height: 26px;
  }
  .transport .time {
    grid-column: 5;
    grid-row: 1;
    justify-self: end;
    min-width: 75px;
    font-size: 10px;
    padding-left: 8px;
    background: var(--panel);
  }
  .transport #prevBtn {
    grid-row: 2;
    grid-column: 1;
  }
  .transport #playBtn {
    grid-row: 2;
    grid-column: 2;
    width: 44px;
    height: 44px;
  }
  .transport #replayBtn {
    grid-row: 2;
    grid-column: 3;
  }
  .transport #narrationBtn {
    grid-row: 2;
    grid-column: 4;
  }
  .transport #nextBtn {
    grid-row: 2;
    grid-column: 6;
    justify-self: end;
  }
  .transport button {
    width: 44px;
    height: 44px;
  }
  .transport .transport-label {
    display: block;
    grid-column: 5;
    grid-row: 2;
    justify-self: end;
    padding-right: 8px;
    font-size: 9px;
  }
  .detail {
    width: 100%;
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 4px 0 0;
  }
  .detail h3 {
    font-size: 14px;
    margin-bottom: 16px;
  }
  .pts {
    gap: 13px;
  }
  .pts li {
    font-size: 13px;
    line-height: 1.75;
  }
  .rule-reference {
    border-left: 0;
    border-top: 1px solid var(--line);
    padding: 23px 0 0;
  }
  .chip {
    padding: 13px 15px;
  }
  .chip small {
    font-size: 11px;
  }
  .chip b {
    font-size: 16px;
  }
  .law {
    font-size: 12px;
  }
  .tip {
    padding: 16px;
    font-size: 12px;
  }
  .navbtns {
    position: relative;
    gap: 8px;
    padding-top: 18px;
  }
  .navbtns button {
    font-size: 11px;
    min-height: 48px;
    padding: 10px 13px;
  }
  .navbtns button.primary {
    flex: 1;
    margin-left: 0;
  }
  .page {
    padding: 30px 20px 44px;
  }
  .page h1 {
    font-size: 29px;
    letter-spacing: -0.9px;
    margin-bottom: 13px;
  }
  .page .lead {
    font-size: 13px;
    line-height: 1.75;
    margin-bottom: 23px;
  }
  .page h2 {
    font-size: 22px;
    margin-top: 32px;
  }
  .reference-toolbar {
    gap: 12px;
    margin-bottom: 21px;
  }
  .search-field {
    max-width: none;
    flex-basis: 100%;
  }
  .search-field input {
    font-size: 16px;
    min-height: 47px;
  }
  .filter-chips {
    width: 100%;
    padding-bottom: 3px;
  }
  .filter-chips button {
    min-height: 42px;
    font-size: 11px;
    padding: 8px 12px;
  }
  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 11px;
  }
  .sign {
    padding: 16px 13px;
    gap: 9px;
  }
  .sign > svg {
    width: 68px;
    height: 68px;
    margin: 6px 0 9px;
  }
  .sign b {
    font-size: 12px;
  }
  .sign span {
    font-size: 11px;
    line-height: 1.7;
  }
  .sign b span {
    font-size: 10px;
  }
  .marks {
    grid-template-columns: 1fr;
    gap: 11px;
  }
  .mark {
    padding: 17px;
    gap: 12px;
  }
  .mark svg {
    width: 70px;
  }
  .cols {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card {
    padding: 20px;
  }
  th,
  td {
    padding: 12px 10px;
    font-size: 12px;
  }
  .qbox {
    padding: 22px 18px;
    border-radius: 13px;
  }
  .qbox .q {
    font-size: 20px;
    line-height: 1.5;
  }
  .qbox .prog {
    gap: 4px;
    margin-bottom: 24px;
  }
  .qbox .qs {
    font-size: 12px;
  }
  .qbtns {
    gap: 10px;
  }
  .qbtns button {
    min-height: 60px;
    flex-wrap: wrap;
    gap: 5px;
  }
  .quiz-answer-state {
    width: 100%;
    font-size: 10px;
  }
  .quiz-progress {
    gap: 8px;
  }
  .quiz-progress-text,
  .qn {
    font-size: 11px;
  }
  .expl {
    padding: 15px;
    font-size: 12px;
  }
  .qnext button {
    min-height: 48px;
    width: 100%;
  }
  .score {
    font-size: 50px;
  }
  .chapter-sheet {
    position: fixed;
    inset: auto 0 0;
    margin: 0;
    width: 100%;
    max-width: none;
    max-height: 85dvh;
    border-radius: 21px 21px 0 0;
    border-bottom: 0;
    padding-bottom: env(safe-area-inset-bottom);
  }
  .sheet-head {
    padding: 20px 20px 14px;
  }
  .sheet-list {
    padding-bottom: 22px;
  }
  .toast {
    bottom: calc(83px + env(safe-area-inset-bottom));
    font-size: 12px;
    width: max-content;
  }
  footer {
    font-size: 9px;
    padding: 23px 24px;
  }
  .nofx {
    padding: 20px;
  }
}
@media (max-width: 360px) {
  .top {
    padding-left: 12px;
    padding-right: 12px;
  }
  .brand b {
    font-size: 15px;
  }
  .brand > svg {
    width: 29px;
  }
  .brand span {
    font-size: 7px;
  }
  #learn.on,
  .page {
    padding-left: 14px;
    padding-right: 14px;
  }
  .learn-intro h1 {
    font-size: 27px;
  }
  .lesson-meta {
    display: none;
  }
  #stage {
    height: 240px;
  }
  .lesson-heading h2 {
    font-size: 18px;
  }
  .lesson-heading {
    padding: 14px;
  }
  .transport {
    gap: 4px;
    padding-left: 10px;
    padding-right: 10px;
  }
  .cap {
    min-height: 125px;
  }
  .transport-label {
    display: none !important;
  }
  .navbtns button {
    padding: 10px;
    font-size: 10px;
  }
  .grid {
    gap: 9px;
  }
  .sign {
    padding: 14px 11px;
  }
}
.ctl {
  flex: none;
}
.ctl button {
  white-space: nowrap;
}
.quiz-review-item > .qn,
.quiz-review-item > b {
  display: block;
}
.quiz-review-item > .qn {
  margin-bottom: 4px;
}
.qbtns button[aria-disabled="true"] {
  cursor: default;
}
.qbtns button[aria-disabled="true"]:hover {
  background: inherit;
}
.qbtns button.pick.ok[aria-disabled="true"]:hover {
  background: var(--green-bg);
}
.qbtns button.pick.ng[aria-disabled="true"]:hover {
  background: var(--red-bg);
}
.expl[data-state="correct"] .quiz-feedback-icon,
.expl[data-state="correct"] b {
  color: var(--green-fg);
}
.expl[data-state="incorrect"] .quiz-feedback-icon,
.expl[data-state="incorrect"] b {
  color: var(--red-fg);
}
@media (max-width: 760px) {
  #learn.on {
    gap: 16px;
    padding-top: 22px;
  }
  .learn-intro p {
    display: none;
  }
  .learn-intro h1 {
    font-size: 27px;
    max-width: 19ch;
  }
  .chapter-mobile {
    gap: 8px;
  }
  .chapter-trigger {
    min-height: 44px;
  }
  #stage {
    height: 240px;
  }
  .cap {
    min-height: 108px;
  }
  .transport {
    grid-template-rows: 22px 44px;
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .ctl #langBtn {
    min-width: 50px;
  }
  .brand span {
    font-size: 8px;
    letter-spacing: 1.4px;
  }
  .brand {
    min-width: 0;
  }
  .brand > div {
    min-width: 0;
  }
  .brand span {
    white-space: nowrap;
  }
  .brand b {
    white-space: nowrap;
  }
}
@media (max-width: 360px) {
  .brand b {
    font-size: 15px;
  }
  .brand span {
    font-size: 7px;
  }
  .ctl #langBtn {
    min-width: 44px;
  }
  .top {
    gap: 6px;
  }
  .ctl #themeBtn {
    min-width: 38px;
    padding: 10px;
  }
  #stage {
    height: 220px;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
  .cap.swap {
    opacity: 1;
  }
}

.timeline {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}
.timeline .time {
  flex: none;
}
.timeline input {
  flex: 1;
  min-width: 0;
  width: 0;
}
:root[data-theme="dark"] .sign .cat.warn {
  color: #efbd58;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sign .cat.warn {
    color: #efbd58;
  }
}
@media (max-width: 760px) {
  .transport .timeline {
    grid-column: 1/-1;
    grid-row: 1;
    gap: 12px;
  }
  .transport .timeline .time {
    min-width: 75px;
    padding: 0;
    text-align: right;
  }
  .transport .timeline input {
    width: 0;
  }
}

.stagewrap {
  scroll-margin-top: 0;
}
html {
  scroll-padding-top: calc(var(--header) + env(safe-area-inset-top) + 16px);
}
@media (max-width: 760px) {
  html {
    scroll-padding-bottom: calc(82px + env(safe-area-inset-bottom));
  }
  .ctl #themeBtn {
    min-width: 44px;
  }
  .filter-chips button {
    min-height: 44px;
  }
}

/* Keep the lesson and its controls together in native or in-page fullscreen. */
.scene-tools #fullscreenBtn {
  min-width: 44px;
  min-height: 44px;
}
.scene-tools #fullscreenBtn:focus-visible {
  outline: 3px solid #22634b;
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}
body.viewer-fullscreen {
  overflow: hidden;
  overscroll-behavior: none;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  flex-direction: column;
  width: 100vw;
  width: 100dvw;
  height: 100vh;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0
    env(safe-area-inset-left);
  border: 0;
  border-radius: 0;
  box-shadow: none;
  isolation: isolate;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen)
  .lesson-heading {
  display: none;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) #stage {
  flex: 1 1 0;
  min-height: 0;
  height: auto;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .scene-tools {
  z-index: 2;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .cap {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 30vh;
  max-height: 30dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .transport {
  flex: none;
  padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
@media (max-height: 540px) and (min-aspect-ratio: 4/3) {
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .cap {
    max-height: 26vh;
    max-height: 26dvh;
    padding: 8px 16px;
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .cap .p {
    font-size: 13px;
    line-height: 1.4;
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .cap .s {
    font-size: 11px;
    line-height: 1.4;
    margin-top: 3px;
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .transport {
    display: flex;
    gap: 8px;
    padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen)
    .transport
    button,
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) #playBtn {
    width: 44px;
    height: 44px;
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen)
    .transport-label {
    display: none;
  }
  .stagewrap:is(.is-fullscreen, :fullscreen, :-webkit-full-screen) .timeline {
    gap: 8px;
  }
}
