@charset "UTF-8";

:root {
  color-scheme: light;
  --paper: #f9f5e9;
  --white: #fffdf7;
  --ink: #3e362d;
  --muted: #6d6253;
  --line: #e4d9c4;
  --green: #496c52;
  --dark-green: #304c39;
  --sage: #e9efdf;
  --sun: #f8e2a9;
  --peach: #f9e5d4;
  --orange: #a85637;
  --radius: 22px;
  --shadow: 0 3px 0 #eae0cf;
  font-family: "Hiragino Sans", "Meiryo", "Yu Gothic", system-ui, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 0; background: var(--paper); }
body { margin: 0; color: var(--ink); font-size: 16px; line-height: 1.65; }
h1, h2, h3, h4, p, ul, ol, dl, dd { margin: 0; }
h1, h2, h3, h4 { line-height: 1.35; }
ul, ol { padding: 0; }
img { display: block; max-width: 100%; }
a { color: var(--dark-green); text-underline-offset: .23em; }
svg { width: 1.3em; height: 1.3em; flex: none; }
button, input, select { font: inherit; color: inherit; }
button, select, summary { cursor: pointer; }
button:disabled { cursor: default; }
button, a { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #b37143; outline-offset: 3px; }
[tabindex="-1"]:focus { outline: none; }
ruby { ruby-position: over; }
rt { letter-spacing: 0; font-size: .54em; font-weight: 650; }
[lang="th"] { font-family: "Noto Sans Thai","Leelawadee UI",Tahoma,Thonburi,system-ui,sans-serif; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; white-space: nowrap; overflow: hidden; clip-path: inset(50%); }
.tr-ja, .tr-id, .tr-th { display: block; overflow-wrap: anywhere; }
.tr-ja { font-weight: 750; line-height: 1.55; }
.tr-id, .tr-th { font-size: .83rem; line-height: 1.52; font-weight: 500; color: var(--muted); }
.tr-th { line-height: 1.65; }

.topbar { background: var(--white); border-bottom: 1px solid var(--line); }
.top-inner { width: min(1140px, calc(100% - 56px)); margin: auto; min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 11px; font-weight: 850; letter-spacing: .01em; text-decoration: none; color: var(--dark-green); }
.brand-mark, .section-icon { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border-radius: 12px; background: var(--sage); color: var(--dark-green); }
.brand-mark svg { width: 23px; height: 23px; }
.brand small { display: block; font-size: .72rem; font-weight: 600; color: var(--muted); }
.top-actions { display: flex; align-items: center; flex: none; gap: 8px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: .5em; min-height: 44px; padding: .65em 1em; border-radius: 12px; border: 1px solid transparent; font-weight: 750; line-height: 1.3; text-align: center; text-decoration: none; }
.button.primary { background: var(--green); color: white; border-color: var(--dark-green); box-shadow: 0 3px 0 var(--dark-green); }
.button.primary:hover:not(:disabled) { background: var(--dark-green); }
.button.primary:active:not(:disabled) { transform: translateY(2px); box-shadow: 0 1px 0 var(--dark-green); }
.button.primary .tr-id, .button.primary .tr-th { color: #eef2e6; }
.button.secondary, .button-quiet { background: var(--white); border-color: var(--line); color: var(--dark-green); }
.button.secondary:hover:not(:disabled), .button-quiet:hover { background: var(--sage); }
.button:disabled { opacity: .55; box-shadow: none; }
.button-quiet { padding: 7px 12px; font-size: .83rem; border-radius: 10px; }
.nav-teacher .tr-id, .nav-teacher .tr-th { font-size: .68rem; }
.nav-teacher { padding-block: 4px; }
.panel { min-width: 0; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.error-panel { margin: 28px auto; width: min(92%, 700px); padding: 28px; }
.site-footer { margin: 30px auto 0; padding: 16px 22px 26px; text-align: center; color: var(--muted); font-size: .77rem; border-top: 1px solid var(--line); }
.site-footer a { display: inline-block; margin-top: 3px; }
.eyebrow { color: var(--dark-green); font-size: .84rem; font-weight: 800; letter-spacing: .035em; }

.student-app, .teacher-app { width: min(1140px, calc(100% - 56px)); margin: 27px auto 0; }
.student-hero { display: grid; min-height: 390px; grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); align-items: center; overflow: hidden; background: #fbefcf; }
.hero-copy { position: relative; z-index: 1; padding: 30px 0 37px clamp(24px, 4.4vw, 66px); }
.hero-copy .eyebrow { display: inline-block; padding: 4px 11px; background: #fbf7e5; border: 1px solid #eadba8; border-radius: 8px; }
.lesson-title { color: #746044; font-size: .85rem; margin-top: 11px; }
.hero-copy h1 { margin: 13px 0 20px; }
.hero-copy h1 .tr-ja { color: var(--dark-green); font-size: clamp(1.9rem, 3.7vw, 3rem); line-height: 1.37; letter-spacing: -.048em; }
.title-phrase { display: inline-block; max-width: 100%; }
.hero-copy h1 .tr-id, .hero-copy h1 .tr-th { color: #574a36; font-size: clamp(.87rem, 1.38vw, 1.08rem); }
.hero-copy h1 .tr-id { margin-top: 8px; }
.hero-start { min-width: 145px; gap: 12px; }
.hero-start .tr-ja { font-size: 1.04rem; }
.hero-start .tr-id, .hero-start .tr-th { font-size: .72rem; }
.hero-illustration { width: calc(100% + 20px); max-width: none; margin-left: -20px; }
.landing-columns { margin-top: 24px; display: grid; align-items: start; grid-template-columns: minmax(0, 1fr) minmax(265px, 32%); gap: 20px; }
.lesson-cards { display: grid; gap: 13px; }
.goal-strip { display: flex; gap: 14px; padding: 20px 22px; background: var(--sage); border-color: #d5e0ca; box-shadow: 0 3px 0 #dfe6d6; }
.goal-strip .section-icon { background: #d7e5cf; }
.goal-strip h2 .tr-ja, .lesson-details summary .tr-ja, .entry h2 .tr-ja { color: var(--dark-green); font-size: 1.24rem; }
.goal-strip p { margin-top: 9px; }
.goal-strip p .tr-ja { font-size: 1.04rem; }
.lesson-details summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 13px 21px; list-style: none; color: var(--dark-green); }
.lesson-details summary::-webkit-details-marker { display: none; }
.lesson-details[open] summary svg { transform: rotate(180deg); }
.steps { display: grid; gap: 0; margin: 0 16px 14px; list-style: none; }
.steps li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 10px; align-items: center; padding: 9px 5px; border-top: 1px solid var(--line); }
.steps img { width: 48px; aspect-ratio: 1; object-fit: contain; background: var(--paper); border-radius: 10px; }
.entry { padding: 21px; scroll-margin-block: 20px; }
.entry h2 { margin-bottom: 15px; }
.entry label > .tr-ja, .entry legend .tr-ja { font-size: 1rem; color: var(--dark-green); }
input:not([type="radio"]), select { width: 100%; min-height: 43px; padding: 7px 10px; border: 1px solid #cfbea2; border-radius: 10px; background: var(--white); }
.entry input:not([type="radio"]) { margin-top: 7px; }
.form-hint { margin-top: 7px; }
.form-hint .tr-ja { font-size: .84rem; }
.form-hint .tr-id, .form-hint .tr-th { font-size: .75rem; }
fieldset { border: 0; min-width: 0; padding: 0; margin: 0; }
.entry fieldset { margin-top: 16px; }
.set-options { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; margin: 8px 0 4px; }
.set-options label { cursor: pointer; }
.set-options span { display: grid; place-items: center; min-height: 42px; border-radius: 9px; background: var(--paper); border: 1px solid var(--line); font-size: 1.13rem; font-weight: 850; }
.set-options input:checked + span { color: var(--dark-green); background: var(--sage); border-color: var(--green); box-shadow: inset 0 -3px #93ab8f; }
.set-options input:focus-visible + span, .ratings input:focus-visible + span { outline: 3px solid #b37143; outline-offset: 3px; }
.student-start { width: 100%; justify-content: space-between; margin-top: 16px; padding-inline: 18px; }
.student-start > span, .student-next > span { text-align: start; }
.student-start .tr-ja { font-size: 1.1rem; }
.teacher-entry { display: flex; width: fit-content; align-items: center; gap: 7px; margin: 17px auto 0; text-decoration: none; }
.teacher-entry:hover .tr-ja { text-decoration: underline; }
.teacher-entry .tr-id, .teacher-entry .tr-th { font-size: .73rem; }
.example-grid { display: grid; gap: 9px; padding: 0 15px 15px; }
.example-card { border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fcf6e9; }
.example-turn { display: grid; align-items: center; grid-template-columns: 44px minmax(0, 1fr); gap: 9px; padding-block: 5px; }
.example-turn + .example-turn { border-top: 1px solid var(--line); }
.speaker .tr-ja, .speaker .tr-id, .speaker .tr-th { font-size: .72rem; color: var(--dark-green); }
.speaker { margin-bottom: 3px; }
.vocab-body { padding: 0 15px 15px; }
.vocab-body h3 { padding: 8px 5px; }
.vocab-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); list-style: none; gap: 8px; }
.vocab-grid li { min-width: 0; padding: 8px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; }
.vocab-grid img { width: min(100%, 98px); margin: auto; }
.vocab-grid .tr-ja { font-size: .95rem; }
.vocab-grid .tr-id, .vocab-grid .tr-th { font-size: .73rem; }

.mission-app { width: min(100% - 32px, 670px); margin: 19px auto 0; display: grid; gap: 14px; }
.mission-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 8px 14px; padding: 10px 1px; }
.mission-customer { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; font-weight: 750; overflow-wrap: anywhere; }
.mission-customer span, .mission-tag { display: inline-block; border-radius: 9px; padding: 2px 9px; background: var(--sun); color: #624a2c; font-size: .83rem; font-weight: 800; }
.mission-head h1 { color: var(--dark-green); font-size: clamp(1.85rem, 6.8vw, 2.5rem); letter-spacing: -.03em; }
.mission-head h1 small { color: var(--muted); font-size: .57em; }
.progress-marks { list-style: none; display: flex; gap: 6px; }
.progress-marks li { display: grid; place-items: center; width: 31px; height: 31px; background: var(--white); color: var(--muted); font-size: .9rem; font-weight: 850; border-radius: 50%; border: 1px solid var(--line); }
.progress-marks .current { background: var(--sun); border-color: #caa963; color: #503a22; }
.progress-marks .done { background: var(--green); color: white; border-color: var(--dark-green); }
.student-products, .student-services { padding: 16px; }
.student-products h2, .student-services h2 { display: flex; align-items: center; gap: 7px; color: var(--dark-green); font-size: 1.21rem; margin-bottom: 10px; }
.student-products h2 svg, .student-services h2 svg { width: 20px; }
.products { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 8px; list-style: none; }
.product-card { position: relative; min-width: 0; text-align: center; border-radius: 13px; border: 1px solid var(--line); background: #fbf5e5; padding: 6px 5px 10px; }
.product-card img { width: min(100%, 146px); margin: 0 auto; }
.product-card strong { display: block; font-size: clamp(.95rem, 4vw, 1.24rem); overflow-wrap: anywhere; }
.product-quantity { display: inline-block; margin-top: 3px; padding: 0 9px; border-radius: 8px; background: var(--sun); font-weight: 850; }
.mission-cards { display: grid; gap: 7px; list-style: none; }
.mission-card { display: grid; grid-template-columns: 53px minmax(0, 1fr) 30px; align-items: center; gap: 8px; padding: 7px 9px; border-radius: 12px; border: 1px solid #dbe4ce; background: #f0f4e8; }
.mission-card.skip { background: #fbf3e7; border-color: #ece0cd; }
.mission-card img { width: 53px; }
.mission-card span, .mission-card strong { display: block; }
.mission-card span { font-size: .93rem; }
.mission-card strong { font-size: 1.13rem; }
.mission-symbol { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; font-size: 1.17rem; color: #365c43; background: #dae9d4; }
.skip .mission-symbol { color: #82523a; background: #f1dfca; }
.conversation-callout { display: grid; grid-template-columns: 61px 1fr; align-items: center; gap: 8px; padding: 9px 13px; border-radius: 13px; background: #f7e8bc; }
.conversation-callout img { width: 60px; }
.conversation-callout p { font-size: .85rem; }
.student-next { justify-content: space-between; padding-inline: 18px; min-height: 53px; }
.goal-banner { position: relative; overflow: hidden; text-align: center; padding: 22px 15px; background: var(--sun); }
.goal-banner > img { width: 92px; margin: auto; }
.goal-banner h1 .tr-ja { color: var(--dark-green); font-size: clamp(2rem, 8vw, 3rem); }
.goal-banner .progress-marks { justify-content: center; margin-top: 12px; }
.reflect { padding: 15px; }
.reflect > p { margin-top: 9px; }
.ratings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 5px; margin-top: 10px; }
.ratings label > span { display: block; min-height: 100%; padding: 5px; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); cursor: pointer; text-align: center; }
.ratings input:checked + span { background: var(--sage); border-color: var(--green); }
.ratings b { font-size: 1.15rem; color: #875019; }
.ratings .tr-ja { font-size: .86rem; }
.ratings .tr-id, .ratings .tr-th { font-size: .72rem; }
.confetti { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.confetti i { position: absolute; top: -12px; left: var(--x); width: 7px; height: 12px; border-radius: 2px; background: var(--c); opacity: 0; animation: confetti-fall 1.35s var(--d) ease-out; }
.confetti i:nth-child(3n) { border-radius: 50%; width: 8px; height: 8px; }
@keyframes confetti-fall { 10% { opacity: 1; } 85% { opacity: .95; } 100% { transform: translate(34px, 400px) rotate(var(--r)); opacity: 0; } }

.teacher-app { display: grid; gap: 16px; }
.teacher-hero { display: flex; justify-content: space-between; align-items: center; gap: 15px; padding: 22px; background: #f7e7bd; }
.teacher-hero h1 { font-size: clamp(1.85rem, 5vw, 2.8rem); color: var(--dark-green); margin-block: 4px; }
.teacher-hero img { width: min(32%, 230px); }
.teacher-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 16px; }
.teacher-section { padding: 20px; }
.teacher-section h2 { color: var(--dark-green); font-size: 1.4rem; margin-bottom: 8px; }
.teacher-section ol { margin: 8px 0 12px; padding-left: 23px; }
.teacher-section li + li { margin-top: 5px; }
.teacher-section .teaching-note { padding: 8px 11px; margin-bottom: 10px; border-radius: 8px; background: var(--sage); }
.share-section form { margin-top: 12px; }
.share-section label { font-weight: 750; }
.share-input, .share-actions, .answer-head { display: flex; gap: 8px; align-items: center; }
.share-input button { flex: none; }
#qr-status { font-size: .88rem; color: var(--muted); margin: 6px 0; }
.qr { width: 156px; margin: 10px auto; }
.qr svg { display: block; width: 100%; height: auto; }
.share-actions { flex-wrap: wrap; justify-content: center; }
.answer-head { justify-content: space-between; align-items: start; flex-wrap: wrap; }
.answer-nav { display: flex; gap: 8px; flex-wrap: wrap; margin-block: 12px; }
.answer-nav a { padding: 4px 10px; background: var(--sage); border-radius: 8px; font-weight: 700; }
.answer-set { padding-top: 13px; }
.answer-set h3 { color: var(--dark-green); font-size: 1.28rem; margin-bottom: 7px; }
.answer-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.answer-card { padding: 10px; border: 1px solid var(--line); border-radius: 11px; min-width: 0; }
.answer-card > p { margin-block: 3px 7px; }
.answer-card table { font-size: .83rem; }
.table-scroll { overflow: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 5px 6px; text-align: left; vertical-align: top; }
thead th { background: var(--sage); color: var(--dark-green); }
tbody th { font-weight: 600; }
.teacher-note p + p { margin-top: 7px; }

@media (max-width: 860px) {
  .student-hero { min-height: 0; }
  .hero-copy { padding-left: 25px; }
  .landing-columns { grid-template-columns: minmax(0, 1fr) minmax(245px, 40%); }
  .answer-grid { grid-template-columns: 1fr; }
}
@media (max-width: 650px) {
  .top-inner { width: calc(100% - 26px); min-height: 60px; }
  .brand { gap: 6px; font-size: .94rem; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .brand-mark svg { width: 18px; height: 18px; }
  .top-actions { gap: 4px; }
  .button-quiet { min-height: 38px; padding: 4px 7px; }
  .student-body .sound span { display: none; }
  .student-app, .teacher-app { width: calc(100% - 26px); margin-top: 13px; }
  .student-hero { position: relative; grid-template-columns: 1fr; }
  .hero-copy { padding: 19px 16px 0; }
  .hero-copy .eyebrow { padding-inline: 6px; font-size: .75rem; }
  .hero-copy h1 { margin-block: 6px 10px; }
  .hero-copy h1 .tr-ja { font-size: clamp(1.75rem, 7.5vw, 2.76rem); }
  .hero-copy h1 .tr-id { margin-top: 3px; }
  .hero-illustration { width: min(100%, 400px); margin: -16px auto 0; }
  .hero-start { position: relative; z-index: 1; min-width: 120px; min-height: 0; padding: 5px 10px; }
  .hero-start .tr-ja { font-size: .91rem; }
  .hero-start .tr-id, .hero-start .tr-th { font-size: .67rem; }
  .landing-columns { grid-template-columns: 1fr; margin-top: 15px; gap: 13px; }
  .entry { grid-row: 1; }
  .goal-strip { padding: 15px; gap: 8px; }
  .teacher-grid { grid-template-columns: 1fr; }
  .teacher-section { padding: 13px; }
}
@media (max-width: 370px) {
  .brand { font-size: .78rem; }
  .nav-teacher .tr-id, .nav-teacher .tr-th { font-size: .62rem; }
  .vocab-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .share-input { flex-wrap: wrap; }
  .mission-app { width: calc(100% - 22px); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}
@media print {
  body { background: white; color: black; font-size: 10pt; }
  .teacher-body .topbar, .teacher-body .site-footer, .teacher-hero, .teacher-grid, .teacher-note, .answer-nav, #print, .answer-head p { display: none !important; }
  .teacher-app { display: block; width: 100%; margin: 0; }
  .answer-section { border: 0; padding: 0; box-shadow: none; }
  .answer-grid { display: block; }
  .answer-set { break-before: page; padding: 0; }
  .answer-set:first-child { break-before: auto; }
  .answer-card { break-inside: avoid; margin-bottom: 8px; }
  .answer-card table { font-size: 9pt; }
  .table-scroll { overflow: visible; }
}
