:root {
  color-scheme: light;
  --paper: #fbf8ef;
  --surface: #fffdf8;
  --ink: #1e392f;
  --muted: #52665a;
  --green: #215b47;
  --deep: #173e35;
  --sage: #e5eee0;
  --sage-line: #c8d6c6;
  --sand: #f4e7cf;
  --line: #dedac9;
  --orange: #e6a668;
  --blue: #dceaf0;
  --radius: 22px;
  --shadow: 0 5px 0 #5b6d4f0b, 0 12px 28px #43544509;
  --body: "BIZ UDPGothic","Yu Gothic UI",Meiryo,system-ui,sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: var(--body); line-height: 1.55; }
button, input { font: inherit; }
button, a, summary { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:not(:disabled), summary { cursor: pointer; }
button:disabled { cursor: default; }
[hidden] { display: none !important; }
a { color: var(--green); text-underline-offset: .22em; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, label:has(input:focus-visible) .set-option {
  outline: 3px solid #c5783d; outline-offset: 4px;
}
:focus:not(:focus-visible) { outline: 0; }
h1,h2,h3,p,ul,ol,figure { margin: 0; }
p { overflow-wrap: break-word; }
rt { font-size: .48em; font-weight: 750; letter-spacing: 0; }
svg { display: block; }
.icon { width: 1.55em; height: 1.55em; flex: 0 0 auto; }
.illustration-icon { color: #315d4d; }
.room-art { width: 100%; height: 100%; overflow: visible; }
.room-static .entrant { animation: none; }
.room-light { filter: brightness(1); transition: filter .26s ease; }
.room-light.dimmed { filter: brightness(.78) saturate(.85); }
.sash,.door { transform-box: fill-box; transform-origin: left bottom; transition: transform .24s ease; }
.sash-open { transform: skewY(-19deg) scaleX(.48); }
.tr-ja, .tr-id, .tr-th { display: block; }
.tr-ja { font-weight: 750; line-height: 1.55; }
.tr-id, .tr-th { font-size: .78em; line-height: 1.48; font-weight: 500; }
.tr-th { font-family: "Leelawadee UI","Noto Sans Thai",Tahoma,sans-serif; line-height: 1.72; }
.skip { position: fixed; left: 12px; top: 10px; translate: 0 -200%; z-index: 50; background: white; padding: .6rem 1rem; border-radius: 8px; }
.skip:focus { translate: 0; }
.surface { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.fallback { max-width: 620px; padding: 24px; margin: 3rem auto; }
.site-header { border-bottom: 1px solid #dddccf; background: #fffdf8; }
.header-inner { width: min(1210px,calc(100% - 64px)); min-height: 71px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { color: var(--deep); display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-size: .91rem; font-weight: 850; }
.brand img { width: 38px; height: 38px; }
.brand b { color: #a19d7d; font-weight: 400; margin-inline: .15em; }
nav { display: flex; align-items: center; gap: 24px; }
nav a { text-decoration: none; font-size: .84rem; font-weight: 800; white-space: nowrap; }
nav a:hover { text-decoration: underline; }
.nav-cta { color: white; background: var(--green); display: inline-flex; align-items: baseline; gap: .6rem; padding: .57rem 1rem; border-radius: 50px; }
.nav-cta:hover { background: #174a38; text-decoration: none; }
.site-footer { font-size: .78rem; color: var(--muted); background: #f2eee1; border-top: 1px solid #e5deca; }
.site-footer > div { width: min(1210px,calc(100% - 48px)); margin: auto; padding: 20px 0; }
.site-footer a { font-weight: 700; display: inline-block; margin-top: .3rem; }

.home-main { width: min(1210px,calc(100% - 64px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: .86fr 1.14fr; align-items: center; position: relative; gap: 16px; padding: 41px 0 29px; }
.hero-copy { position: relative; z-index: 1; padding: 12px 0; }
.course-tag, .tag { display: inline-flex; align-items: center; gap: 10px; border: 1px solid #d5e1d0; border-radius: 50px; color: #294e3c; background: #e9efdf; padding: .5rem .95rem; font-size: .88rem; font-weight: 800; }
.course-tag { border-radius: 15px; padding: .52rem .92rem; }
.course-tag .tr-id,.course-tag .tr-th { display: inline; font-size: .69em; }
.course-tag .tr-id::after { content: " · "; }
.small-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; background: #539b73; box-shadow: 0 0 0 4px #97bd952d; }
.hero h1 { margin-top: 27px; color: #1d4c3b; }
.hero h1 .tr-ja { max-width: 9.5em; font-size: clamp(2.55rem,4.9vw,4.65rem); font-weight: 900; letter-spacing: -.065em; line-height: 1.09; }
.title-line { display: block; }
.title-line + .title-line { margin-top: .09em; }
.hero h1 rt { font-size: .30em; letter-spacing: .02em; color: #446f58; }
.hero h1 .tr-id { margin-top: .8rem; font-size: clamp(1rem,1.65vw,1.32rem); color: #526e60; font-weight: 740; }
.hero h1 .tr-th { font-size: clamp(1rem,1.65vw,1.28rem); color: #526e60; font-weight: 700; }
.hero-description { margin-top: 1.15rem; max-width: 26rem; color: var(--muted); font-size: 1.04rem; }
.hero-description .tr-ja { color: var(--ink); }
.hero-description .tr-id,.hero-description .tr-th { margin-top: .16rem; }
.hero-art { position: relative; display: grid; place-items: center; isolation: isolate; min-height: 425px; min-width: 0; overflow: hidden; border-radius: 46% 38% 44% 42% / 37% 42% 37% 34%; background: radial-gradient(ellipse at 52% 50%, #e6eee0 0%,#edf1e3 71%,#fbf8ef 74%); }
.hero-art .room-art { position: relative; z-index: 1; width: 99%; height: auto; }
.hero-orbit { display: block; position: absolute; border: 1px solid #a9b8a258; border-radius: 50%; width: 84%; height: 65%; rotate: -15deg; }
.orbit-b { rotate: 15deg; width: 91%; height: 70%; border-style: dashed; opacity: .7; }
.hero-spark { color: #bf8d50; position: absolute; z-index: 2; width: 32px; height: 32px; }
.spark-a { top: 15%; right: 14%; rotate: 8deg; }
.spark-b { bottom: 23%; left: 5%; width: 25px; height: 25px; rotate: -12deg; }

.goal-band { display: grid; grid-template-columns: minmax(225px,.43fr) 1fr; align-items: center; gap: 28px; padding: 25px 32px; color: white; background: var(--green); border-radius: 25px; box-shadow: 0 6px 0 #184632; }
.goal-band .section-title { display: flex; align-items: center; gap: 15px; margin: 0; }
.goal-band .section-title .icon { width: 45px; height: 45px; padding: 6px; border: 1px solid #9bd2ad59; color: #d4eacb; border-radius: 14px; background: #e0f4df17; }
.goal-band h2 { font-size: 1.31rem; }
.goal-band > p { border-left: 1px solid #b4dbc074; padding-left: 28px; }
.goal-band > p .tr-ja { font-size: clamp(1.02rem,1.55vw,1.25rem); }
.goal-band .tr-id,.goal-band .tr-th { color: #d8ecdd; }

.lesson-section { margin: 61px 0 0; scroll-margin-top: 18px; }
.section-title { margin-bottom: 17px; }
.section-title h2 { font-size: clamp(1.39rem,2.5vw,2rem); line-height: 1.14; }
.section-title h2 .tr-id,.section-title h2 .tr-th { font-size: .47em; }
.section-title h2 .tr-id,.section-title h2 .tr-th,.section-tip .tr-id,.section-tip .tr-th { color: var(--muted); }
.goal-band .section-title h2 .tr-id,.goal-band .section-title h2 .tr-th { color: #d8ecdd; }
.section-tip { margin-bottom: 16px; }
.steps { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(5,1fr); gap: 12px; }
.steps li { min-width: 0; position: relative; padding: 17px 16px 16px; background: #fffdf6; border: 1px solid var(--line); border-radius: 17px; }
.steps li:nth-child(2n) { background: #f4f7ee; }
.steps li > .icon { width: 55px; height: 55px; padding: 7px; background: #edf1e6; border-radius: 15px; margin-bottom: 12px; }
.steps li:nth-child(2n) > .icon { background: #e5ede0; }
.step-n { position: absolute; top: 15px; right: 15px; color: #3d6f59; font-weight: 850; font-size: .85rem; }
.steps .tr-id, .steps .tr-th { color: var(--muted); }
.words-grid { display: grid; grid-template-columns: repeat(3,1fr); list-style: none; padding: 0; gap: 11px; }
.words-grid li { padding: 10px 13px; background: #fffdf7; border: 1px solid var(--line); border-radius: 14px; display: flex; align-items: center; gap: 13px; min-height: 80px; }
.words-grid .icon { width: 52px; height: 52px; padding: 6px; border-radius: 12px; background: #eef1e6; }
.words-grid .tr-id,.words-grid .tr-th { color: var(--muted); }
.more { margin-top: 12px; }
.more summary { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 12px; padding: 13px 15px; color: var(--green); border: 1px solid var(--sage-line); border-radius: 13px; background: #edf2e8; }
.more summary::before { content: '+'; font-weight: 900; margin-right: .3em; }
.more[open] summary::before { content: '−'; }
.more[open] > ul { margin-top: 13px; }
.talk-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 15px; }
.bubbles,.phrases { padding: 18px 21px; }
.bubble { background: #eaf1e6; border-radius: 13px; padding: 12px; margin-bottom: 9px; width: 91%; }
.bubble:last-child { margin-bottom: 0; }
.speaker-1 { background: #e5eef3; margin-left: auto; }
.phrases ul,.reflection ul { padding-left: 0; list-style: none; }
.phrases li,.reflection li { padding: .5rem 0; border-top: 1px solid #e9e5d9; }

.setup { margin: 58px 0; padding: 26px 28px; scroll-margin-top: 12px; background: #fffaf0; }
.name-label { font-size: 1.15rem; }
.name-label .tr-id,.name-label .tr-th { color: var(--muted); }
.name-line { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 9px; }
input:not([type=radio]) { width: min(100%,390px); min-height: 44px; color: var(--ink); background: white; border: 1.5px solid #949e8a; border-radius: 10px; padding: .48rem .74rem; }
.optional .tr-ja { font-size: .82rem; color: var(--muted); }
.optional .tr-id,.optional .tr-th { display: inline; color: var(--muted); font-size: .71rem; }
.optional .tr-id::after { content: ' · '; }
fieldset { margin: 24px 0 0; border: 0; padding: 0; min-width: 0; }
legend { padding: 0; font-size: 1.25rem; margin-bottom: 10px; }
legend .tr-id,legend .tr-th { color: var(--muted); }
.set-grid { display: grid; grid-template-columns: repeat(5,1fr); gap: 9px; }
.set-card { position: relative; display: flex; cursor: pointer; }
.set-card input { position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; margin: 0; opacity: 0; cursor: pointer; }
.set-option { background: white; border: 1.5px solid #dedaca; border-radius: 14px; display: grid; align-content: start; gap: .45rem; width: 100%; padding: .69rem; }
.set-option .tr-ja { font-size: .92rem; }
.set-letter { display: grid; place-items: center; border-radius: 9px; background: #e6efdf; font-weight: 850; color: var(--green); width: 31px; height: 31px; }
.set-card input:checked + .set-option { background: #edf5e9; border: 2px solid #4a8461; padding: calc(.69rem - .5px); }
.set-card input:checked + .set-option .set-letter { color: white; background: var(--green); }
.start-actions { margin-top: 20px; display: flex; flex-wrap: wrap; gap: 10px; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: .46em; padding: .55rem .9rem; text-decoration: none; border-radius: 11px; border: 1px solid transparent; font-weight: 780; line-height: 1.32; }
.button.primary { color: white; background: var(--green); border-color: #1f5743; box-shadow: 0 3px 0 #153a2c; }
.button.primary:hover:not(:disabled) { background: #174d39; }
.button.secondary { color: #28473d; background: #f5f7ef; border-color: #c0cdbd; }
.button.secondary:hover:not(:disabled) { background: #e6f0e4; }
.button:disabled { opacity: .45; box-shadow: none; }
.button.big { padding: .72rem 1.1rem; min-width: 225px; justify-content: space-between; }
.button .tr-id,.button .tr-th { font-size: .7em; }
.text-button { background: transparent; border: 0; color: var(--green); text-decoration: underline; text-underline-offset: 3px; padding: 4px 0; text-align: left; }
.local-record { margin-top: 13px; }
.local-record:has(button[hidden]):has(p:empty) { display: none; }

.teacher-main { width: min(1000px,calc(100% - 56px)); margin: 24px auto 44px; }
.teacher-intro { margin-bottom: 20px; }
.teacher-intro h1 { font-size: clamp(1.9rem,4vw,3rem); margin-top: .5rem; }
.teacher-intro > p:last-child { color: var(--muted); }
.teacher-guide,.teacher-sheet,.share-settings { padding: 23px; }
.teacher-guide h2 { font-size: 1.3rem; }
.teacher-guide ol { padding-left: 1.4rem; margin-top: .5rem; }
.teacher-guide li + li { margin-top: .17rem; }
.teacher-tip { margin-top: .65rem; border-left: 4px solid #d59a63; padding-left: .65rem; }
.teacher-tools { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; margin: 18px 0 13px; }
#teacher-sets { display: flex; flex-wrap: wrap; gap: 6px; }
#teacher-sets button[aria-pressed=true] { background: var(--green); color: white; border-color: var(--green); }
.sheet-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px 12px; }
.sheet-heading h2 { color: var(--green); font-size: 1.48rem; }
.sheet-missions { display: grid; grid-template-columns: repeat(2,1fr); gap: 10px 13px; margin-top: 14px; }
.sheet-mission { border: 1px solid var(--line); background: #fcfbf4; border-radius: 13px; padding: 12px; break-inside: avoid; }
.sheet-mission h3 { font-size: 1.02rem; }
.sheet-mission h3 span { display: inline-grid; place-items: center; min-width: 1.65em; border-radius: 6px; background: #dfeadc; color: var(--green); margin-right: .42em; }
.read-aloud { font-size: 1.04rem; font-weight: 790; margin: .44em 0; }
.sheet-answer,.sheet-repeat { font-size: .88rem; }
.sheet-answer b,.sheet-repeat b { color: var(--green); }
.sheet-bottom { display: grid; grid-template-columns: 1.35fr 1fr; align-items: start; gap: 18px; margin-top: 17px; }
.sheet-bottom figure { border-radius: 14px; background: #eef1e8; padding: 8px 14px; }
.sheet-bottom figcaption { font-weight: 750; }
.sheet-bottom .room-art { max-height: 225px; }
#share-card { display: grid; align-content: start; gap: 5px; }
#share-card a { overflow-wrap: anywhere; }
#qr svg { display: block; width: 99px; height: 99px; }
.share-settings { margin-top: 13px; }
.share-settings label { font-weight: 770; }
.share-settings form { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .6rem; }
.print-only { display: none; }
@media (max-width: 900px) {
  .hero-art { min-height: 320px; }
  .steps { grid-template-columns: repeat(3,1fr); }
  .set-grid { grid-template-columns: repeat(3,1fr); }
  nav { gap: 14px; }
}
@media (max-width: 640px) {
  .header-inner,.home-main,.teacher-main { width: calc(100% - 30px); }
  .header-inner { min-height: 58px; gap: 10px; }
  .brand img { width: 32px; height: 32px; }
  .brand { gap: 5px; font-size: .75rem; }
  .home-page nav a:not(.nav-cta) { display: none; }
  nav a { font-size: .77rem; }
  .nav-cta { padding: .45rem .63rem; }
  .hero { grid-template-columns: 1fr; gap: 0; padding: 21px 0 16px; }
  .hero-copy { padding: 0; }
  .hero h1 { margin-top: 17px; }
  .hero h1 .tr-ja { font-size: clamp(2.45rem,10vw,3.6rem); max-width: none; }
  .hero-description { margin-top: .85rem; font-size: .95rem; }
  .hero-art { min-height: 0; width: min(100%,465px); margin: 0 auto; }
  .hero-art .room-art { width: 100%; }
  .goal-band { grid-template-columns: 1fr; gap: 13px; padding: 14px 15px 16px; border-radius: 17px; }
  .goal-band > p { border-left: 0; border-top: 1px solid #b4dbc074; padding: .65rem 0 0; }
  .goal-band h2 { font-size: 1.17rem; }
  .lesson-section { margin-top: 41px; }
  .steps,.words-grid,.set-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .steps li { padding: 13px 11px; }
  .words-grid li { gap: 7px; padding: 8px; }
  .words-grid .icon { width: 39px; height: 39px; }
  .talk-grid,.sheet-missions { grid-template-columns: 1fr; }
  .setup { margin-top: 40px; padding: 17px 13px; }
  .teacher-intro { margin-top: 16px; }
  .teacher-guide,.teacher-sheet,.share-settings { padding: 15px; }
}
@media (max-width: 380px) {
  .brand b { display: none; }
  .brand { font-size: .68rem; }
  .sheet-bottom { grid-template-columns: 1fr; }
  .words-grid .icon { width: 33px; height: 33px; padding: 3px; }
}
@page { size: A4 portrait; margin: 12mm; }
@media print {
  .teacher-page { background: white; color: #172c23; font-size: 10pt; }
  .teacher-page .site-header,.teacher-page .site-footer,.teacher-intro,.teacher-guide,.teacher-tools,.share-settings,.no-print,.skip { display: none !important; }
  .print-only { display: inline; }
  .teacher-main { width: 100%; margin: 0; }
  .teacher-sheet { border: none; padding: 0; box-shadow: none; }
  .sheet-heading h2 { font-size: 16pt; }
  .sheet-missions { display: grid; grid-template-columns: 1fr; gap: 2.7mm; margin-top: 4mm; }
  .sheet-mission { padding: 2mm 3mm; border-radius: 2mm; }
  .read-aloud { font-size: 11pt; margin: 1mm 0; }
  .sheet-answer,.sheet-repeat { font-size: 9pt; }
  .sheet-bottom { grid-template-columns: 1.15fr 1fr; margin-top: 4mm; gap: 4mm; break-inside: avoid; }
  .sheet-bottom .room-art { max-height: 54mm; }
  #qr svg { width: 23mm; height: 23mm; }
  .teacher-page a { color: inherit; }
}
@media (prefers-reduced-motion: reduce) {
  *,*::before,*::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-delay: 0s !important; transition-duration: .01ms !important; }
}
