/* Konjuku: one stylesheet for the whole site.
   Sections: tokens, base, shared pieces, Kon, then one block per page. */

:root{
  --sky:#37C2EE;
  --sky-tint:#E1F5FD;
  --navy:#16205A;
  --navy-deep:#0B1238;
  --yellow:#FFD43B;
  --yellow-tint:#FFF3C2;
  --coral-tint:#FFE4D2;
  --green:#6CCB5F;
  --kon:#F28B30;
  --red:#D92E24;
  --grey:#E9ECF5;
  --white:#FFFFFF;
}

/* ---------- Base ---------- */
body{margin:0;color:var(--navy);font-family:'M PLUS Rounded 1c',sans-serif;font-weight:500;font-size:18px;line-height:1.6}
h1,h2,p,ol,dl,dd{margin:0}
h1,h2,strong{font-weight:800}
a{color:var(--navy)}
a:hover{color:var(--navy-deep)}
button{font:inherit;cursor:pointer}
a:focus-visible,button:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.dark a:focus-visible{outline-color:var(--yellow)}
[hidden]{display:none!important}
[tabindex="-1"]:focus{outline:none}

.page{background:var(--white)}
.wrap{max-width:1180px;margin-left:auto;margin-right:auto;padding-left:4%;padding-right:4%}
.sprite{position:absolute;width:0;height:0;overflow:hidden}

/* ---------- Header and footer ---------- */
.hero{background:var(--sky);border-radius:0 0 64px 64px;overflow:hidden}
.site-head{display:flex;flex-wrap:wrap;gap:12px 28px;align-items:center;justify-content:space-between;padding-top:22px;padding-bottom:22px}
.brand{display:flex;align-items:center;gap:12px;text-decoration:none}
/* The brand mark is Kon's face, img/kon-icon.svg, which carries its own navy ring. */
.brand-mark{display:block;width:50px;height:50px;transform:rotate(-6deg)}
.brand-name{font-weight:800;font-size:28px;line-height:1;letter-spacing:-0.01em}
.site-nav{display:flex;flex-wrap:wrap;gap:6px 26px;align-items:center;font-weight:800;font-size:17px}
.site-nav a{padding:11px 0;text-decoration:none}
.site-nav a[aria-current],.site-nav .back-link{text-decoration:underline}
.site-nav .btn{padding:9px 22px}
.nav-user{padding:8px 18px;border-radius:999px;background:var(--white)}

.site-foot-in{display:flex;flex-wrap:wrap;gap:10px 32px;justify-content:space-between;padding-top:30px;padding-bottom:38px;font-size:15px}

/* ---------- Buttons: round, navy border, solid navy lip underneath ---------- */
.btn,.btn:hover{color:var(--navy)}
.btn{display:inline-block;padding:11px 26px;border:3px solid var(--navy);border-radius:999px;background:var(--white);box-shadow:0 5px 0 var(--navy);font-weight:800;text-decoration:none}
.btn-primary{background:var(--yellow)}
.dark .btn{box-shadow:0 5px 0 var(--navy-deep)}
.btn:active{box-shadow:none;transform:translateY(5px)}
.btn-navy,.btn-navy:hover{color:var(--white)}
.btn-navy{padding:12px 28px;background:var(--navy);box-shadow:none}
.btn-navy:active{transform:none}

/* ---------- Marks drawn in red ---------- */
.circle-mark{fill:none;stroke:var(--red);stroke-width:5;stroke-linecap:round}
.paw{fill:var(--red)}
.icon-play{fill:currentColor}

/* ---------- Kon's speech and tips ---------- */
.bubble{align-self:flex-start;margin-bottom:10px;padding:16px 22px;border-radius:28px 28px 28px 6px;background:var(--white);font-weight:700;font-size:19px;line-height:1.4}
.bubble--live{min-height:80px;max-width:330px;box-sizing:border-box}
.tip{padding:10px 18px;border-radius:22px 22px 22px 6px;background:var(--yellow);font-weight:700;line-height:1.4}

/* ---------- Answer choices (ア イ ウ エ) ---------- */
.choice{position:relative;display:flex;align-items:center;gap:10px;min-height:62px;padding:8px 26px 8px 12px;border:3px solid var(--navy);border-radius:22px;background:var(--white);box-shadow:0 5px 0 var(--navy);color:var(--navy);font-size:20px;font-weight:800}
.choice-mark{display:flex;align-items:center;justify-content:center;width:40px;height:40px}
.choice .circle-mark{display:none;position:absolute;left:0;top:-2px;width:64px;height:64px}
.choice.is-wrong,.choice.is-right{box-shadow:none;transform:translateY(5px)}
.choice.is-wrong{background:var(--grey);opacity:.6}
.choice.is-right{background:var(--yellow)}
.choice.is-right .circle-mark{display:block}

.choice--big{min-height:80px;padding:10px 16px 10px 14px;border-radius:26px;text-align:left}
.choice--big .choice-mark{flex:0 0 42px;height:42px;font-size:18px}
.choice--big .choice-text{font-size:24px;line-height:1.3}
.choice--big .circle-mark{left:3px;top:6px;width:66px;height:66px}

.q-badge{display:inline-block;margin-right:12px;padding:1px 16px;border-radius:999px;background:var(--navy);color:var(--white);font-size:18px;vertical-align:3px}

/* ---------- Kon ----------
   Her drawing is injected by js/kon.js into any element with data-kon.
   One state class on that element poses her:
   .st-idle  breathing, blinking, tail wag
   .st-talk  mouth moves, head nods, one paw half raised
   .st-show  one paw raised to point, slight lean
   .st-cheer both paws up, happy eyes, hopping
   .st-oops  eyes shut tight, head tilts, tail droops */
.kon svg{display:block;width:100%;height:auto}
.kon .frown,.kon .mouth,.kon .happy,.kon .oops{opacity:0}
.kon .bod,.kon .lean{transform-box:fill-box;transform-origin:50% 100%}
.kon .eye,.kon .mouth{transform-box:fill-box}
.kon .eye{transform-origin:50% 60%;animation:blink 4.2s infinite}
.kon .mouth{transform-origin:50% 0}
.kon .lean,.kon .arm,.kon .head{transition:transform .35s cubic-bezier(.3,1.5,.5,1),opacity .25s ease}
.kon .tail{animation:wag 1.1s ease-in-out infinite alternate}
.kon.st-idle .bod{animation:breathe 2.6s ease-in-out infinite}
.kon.st-talk .smile,.kon.st-cheer .smile,.kon.st-oops .smile{opacity:0}
.kon.st-talk .mouth,.kon.st-cheer .mouth{opacity:1}
.kon.st-talk .mouth{animation:talk .17s ease-in-out infinite alternate}
.kon.st-talk .head{animation:nod .34s ease-in-out infinite alternate}
.kon.st-talk .arm-r{transform:rotate(-34deg)}
.kon.st-show .arm-r{transform:rotate(-98deg)}
.kon.st-show .lean{transform:rotate(4deg)}
.kon.st-show .head{transform:rotate(5deg)}
.kon.st-cheer .bod{animation:hop .34s ease-out infinite alternate}
.kon.st-cheer .arm-r{transform:rotate(-142deg)}
.kon.st-cheer .arm-l{transform:rotate(142deg)}
.kon.st-cheer .eye,.kon.st-oops .eye{opacity:0}
.kon.st-cheer .happy,.kon.st-oops .oops,.kon.st-oops .frown{opacity:1}
.kon.st-oops .head{transform:rotate(-8deg) translateY(6px)}
.kon.st-oops .lean{transform:rotate(-3deg)}
.kon.st-oops .tail{animation:none;transform:rotate(14deg)}
@keyframes breathe{50%{transform:scale(1.015,.975)}}
@keyframes talk{from{transform:scaleY(.3)}to{transform:scaleY(1)}}
@keyframes nod{from{transform:rotate(-2deg)}to{transform:rotate(2deg)}}
@keyframes hop{to{transform:translateY(-22px) scale(.98,1.03)}}
@keyframes blink{0%,93%,100%{transform:scaleY(1)}96%{transform:scaleY(.08)}}
@keyframes wag{from{transform:rotate(-5deg)}to{transform:rotate(7deg)}}
@media (prefers-reduced-motion:reduce){.kon .bod,.kon .mouth,.kon .eye,.kon .tail,.kon .head{animation:none!important}}

/* The scene behind her: sun, clouds, the hill she stands on. */
.kon-col{min-width:0;display:flex;flex-direction:column;align-items:center}
.scene{position:relative;width:100%;max-width:400px;aspect-ratio:1}
.scene-sun{position:absolute;left:14%;top:0;width:72%;aspect-ratio:1;border-radius:50%;background:var(--yellow)}
.scene-cloud{position:absolute;border-radius:999px;background:var(--white)}
.scene-cloud--a{left:-6%;top:34%;width:28%;height:9%}
.scene-cloud--b{right:-8%;top:16%;width:22%;height:7%}
.scene-hill{position:absolute;left:-14%;right:-14%;bottom:-34%;height:56%;border-radius:50%;background:var(--green)}
.scene .kon{position:absolute;left:14%;bottom:3%;width:72%}

/* ---------- Home ---------- */
.home-hero{display:flex;flex-wrap:wrap;gap:20px 40px;align-items:flex-end;padding-top:26px}
.home-hero-text{flex:999 1 560px;min-width:0;display:flex;flex-direction:column;gap:22px;padding-bottom:64px}
.home-hero h1{font-size:clamp(42px,5.6vw,76px);line-height:1.04;letter-spacing:-0.02em;text-wrap:balance}
.home-hero .kon-col{flex:1 1 330px}
.lead{max-width:560px;font-size:21px;font-weight:700}

.quiz-card{display:flex;flex-direction:column;gap:18px;margin-top:8px;padding:26px 28px 30px;border-radius:36px;background:var(--white)}
.quiz-q{font-size:24px;font-weight:800;line-height:1.35}
.quiz-q .hl{padding:0 10px;border-radius:12px;background:var(--yellow)}
.choices{display:flex;flex-wrap:wrap;gap:14px}
.quiz-solved{font-weight:700}

.section-title{font-size:clamp(30px,3.6vw,46px);line-height:1.12;letter-spacing:-0.01em}
.n-1{background:var(--yellow)}
.n-2{background:var(--sky)}
.n-3{background:var(--kon)}

.parts{display:flex;flex-wrap:wrap;gap:40px 56px;align-items:center;padding-top:88px;padding-bottom:88px}
.parts-text{flex:1 1 380px;min-width:0;display:flex;flex-direction:column;gap:20px}
.steps{display:flex;flex-direction:column;gap:14px;padding:0;list-style:none}
.steps li{display:flex;gap:16px;align-items:center}
/* Not .step-n: that name belongs to the numbered steps in Kon's chat panel. */
.steps-n{flex:0 0 52px;height:52px;display:flex;align-items:center;justify-content:center;border-radius:50%;font-weight:800;font-size:24px}

.sample{flex:1 1 420px;min-width:0;display:flex;flex-direction:column;gap:12px;padding:26px;border-radius:44px;background:var(--sky-tint);transform:rotate(1.5deg)}
.sample-row{display:flex;align-items:center;gap:16px;padding:14px 20px;border-radius:24px;background:var(--white)}
.play-dot{flex:0 0 44px;height:44px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border:3px solid var(--navy);border-radius:50%;background:var(--yellow)}
.play-dot svg{width:18px;height:18px}
.sample-jp{flex:1 1 auto;font-weight:800;font-size:23px}
.sample-tr{font-size:16px}
.ring{padding:0 3px;border:3px solid var(--red);border-radius:50%}
.sample .tip{align-self:flex-start;margin-top:4px;padding:12px 18px;line-height:inherit}

.band{background:var(--yellow);border-radius:64px}
.band-in{display:flex;flex-direction:column;gap:28px;padding-top:80px;padding-bottom:80px}
.band-head{display:flex;flex-wrap:wrap;gap:12px 40px;align-items:flex-end;justify-content:space-between}
.band-head p{max-width:440px;font-weight:700;text-wrap:balance}
.mini-tiles{display:flex;flex-wrap:wrap;gap:14px}
.mini-tile{flex:1 1 150px;box-sizing:border-box;min-width:0;padding:18px 18px 20px;border-radius:28px;background:var(--white)}
.mini-n{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--navy);color:var(--white);font-weight:800}
.mini-jp{font-size:25px;line-height:1.5}
.mini-tr{font-size:16px}


/* ---------- Lists: the units page and the games page ---------- */
.page--list{line-height:1.55}
.tt-hero{display:flex;flex-wrap:wrap;gap:10px 48px;align-items:flex-end;justify-content:space-between;padding-top:18px;padding-bottom:44px}
.tt-hero h1{font-size:clamp(42px,5.2vw,70px);line-height:1.05;letter-spacing:-0.02em}
.tt-hero h1 span{font-size:.5em;letter-spacing:0}
.tt-hero p{max-width:440px;font-weight:700}
.tt-main{display:flex;flex-wrap:wrap;gap:36px 32px;align-items:flex-start;padding-top:44px;padding-bottom:80px}
.tt-terms{flex:999 1 640px;min-width:0;display:flex;flex-direction:column;gap:20px}

.term{display:flex;flex-direction:column;gap:16px;padding:22px 24px 26px;border-radius:40px}
.term--1{background:var(--sky-tint)}
.term--2{background:var(--yellow-tint)}
.term--3{background:var(--coral-tint)}
.term-head{display:flex;flex-wrap:wrap;gap:6px 16px;align-items:center}
.term-head h2{font-size:27px;line-height:1.2}
.term-head h2 span{font-size:19px}
.term-kind{font-weight:700}

.lessons{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.lesson-tile{position:relative;box-sizing:border-box;display:flex;flex-direction:column;gap:2px;min-height:112px;padding:14px 18px 16px;border:3px solid transparent;border-radius:24px;background:var(--white);text-decoration:none}
.lesson-tile.is-today{border-color:var(--navy);background:var(--yellow);box-shadow:0 5px 0 var(--navy)}
.lesson-n{font-weight:800;font-size:15px}
.lesson-jp{font-size:21px;line-height:1.3}
.lesson-tr{font-size:15px;line-height:1.35}
.lesson-tile .circle-mark{position:absolute;right:8px;top:8px;width:36px;height:36px;stroke-width:6}
.today-tag{align-self:flex-start;margin-top:auto;padding:1px 12px;border-radius:999px;background:var(--navy);color:var(--white);font-weight:800;font-size:14px}
.tt-legend{font-size:16px}

.tt-side{flex:1 1 270px;min-width:0;display:flex;flex-direction:column;gap:20px}
.tt-side .bubble{margin-bottom:6px;padding:14px 20px;border-radius:26px 26px 26px 6px;background:var(--sky-tint);font-size:inherit}
.tt-side .kon{width:70%;max-width:220px}
.tt-side .btn{padding:14px 20px;font-size:19px;text-align:center}

.attend{display:flex;flex-direction:column;gap:14px;margin-top:8px;padding:22px 22px 24px;border-radius:36px;background:var(--yellow)}
.attend h2{font-size:23px;line-height:1.2}
.attend h2 span{font-size:16px}
.attend p{font-size:16px;line-height:1.5}

/* ---------- Lesson ---------- */
.lesson-hero{display:flex;flex-wrap:wrap;gap:16px 40px;align-items:flex-end;padding-top:14px}
.lesson-hero-text{flex:999 1 520px;min-width:0;display:flex;flex-direction:column;gap:16px;padding-bottom:52px}
.lesson-hero h1{font-size:clamp(56px,7.6vw,104px);line-height:1.05}
.lesson-hero .lead{max-width:540px}
.lesson-hero .kon-col{flex:1 1 300px}
.lesson-hero .bubble{margin-bottom:8px;padding:14px 22px}
.lesson-hero .scene{max-width:330px;aspect-ratio:1.06}
.lesson-hero .scene-sun{top:2%}
.lesson-hero .scene-hill{bottom:-36%}
.lesson-hero .scene .kon{bottom:2%}
.pills{display:flex;flex-wrap:wrap;gap:8px;font-weight:800;font-size:15px}
.pill{padding:3px 16px;border-radius:999px;background:var(--white)}
.pill--navy{background:var(--navy);color:var(--white)}

.lesson-main{display:flex;flex-wrap:wrap;gap:36px 40px;align-items:flex-start;padding-top:52px;padding-bottom:80px}
.lesson-body{flex:999 1 620px;min-width:0;display:flex;flex-direction:column;gap:56px}
.part-title{font-size:34px;line-height:1.15}
.part-title .jp{font-size:19px}
.part-n{display:inline-flex;align-items:center;justify-content:center;width:46px;height:46px;margin-right:12px;border-radius:50%;font-size:24px;vertical-align:2px}

.words{display:flex;flex-direction:column;gap:14px}
.words .part-title{margin-bottom:4px}
.word{display:flex;flex-wrap:wrap;gap:8px 20px;align-items:center;padding:18px 24px;border-radius:32px;background:var(--sky-tint)}
.play{flex:0 0 58px;height:58px;box-sizing:border-box;display:flex;align-items:center;justify-content:center;border:3px solid var(--navy);border-radius:50%;background:var(--yellow);box-shadow:0 4px 0 var(--navy);color:var(--navy)}
.play.is-playing{background:var(--kon);box-shadow:none;transform:translateY(4px)}
.play svg{width:22px;height:22px}
.word-jp-col{flex:1 1 250px;min-width:0;display:flex;flex-direction:column}
.word-jp{font-weight:800;font-size:31px;line-height:1.3}
.word-romaji{font-size:16px}
.word-tr-col{flex:1 1 210px;min-width:0;display:flex;flex-direction:column}
.word-when{font-size:16px;line-height:1.45}
.word .tip{flex:0 1 auto;margin-top:4px}

.talk{display:flex;flex-direction:column;gap:16px}
.lines{display:flex;flex-direction:column;gap:14px}
.line{align-self:flex-start;max-width:78%;display:flex;flex-direction:column;gap:4px}
.line-name{padding-left:18px;font-weight:800;font-size:15px}
.line-text{padding:14px 24px;border-radius:30px 30px 30px 8px;background:var(--sky-tint)}
.line-jp{font-weight:800;font-size:25px}
.line-jp .hl{padding:0 6px;border-radius:10px;background:var(--yellow)}
.line-tr{font-size:16px}
.line--reply{align-self:flex-end;align-items:flex-end}
.line--reply .line-name{padding-left:0;padding-right:18px}
.line--reply .line-text{border-radius:30px 30px 8px 30px;background:var(--yellow-tint)}
.talk .tip{align-self:flex-start}

.go{display:flex;flex-wrap:wrap;gap:18px 32px;align-items:center;justify-content:space-between;padding:34px 36px;border-radius:44px;background:var(--navy);color:var(--white)}
.go-text{flex:1 1 300px;min-width:0;display:flex;flex-direction:column;gap:6px}
.go .part-n{color:var(--navy)}
.go .btn{padding:15px 32px;font-size:20px}

.lesson-side{flex:1 1 240px;min-width:0;display:flex;flex-direction:column;gap:18px}
.toc{display:flex;flex-direction:column;gap:4px;padding:20px 24px;border-radius:32px;background:var(--yellow-tint)}
.toc h2{margin-bottom:4px;font-size:19px}
.toc a{padding:7px 0;font-weight:700}
.lesson-side .btn{padding:10px 22px;border-radius:26px;font-size:16px}

/* ---------- Practice ---------- */
.page--practice{background:var(--sky);overflow:hidden}
.q-tabs{display:flex;gap:10px;padding:0;list-style:none}
.q-tab{position:relative;min-width:74px;box-sizing:border-box;padding:7px 18px;border:3px solid var(--navy);border-radius:999px;background:var(--white);font-weight:800;text-align:center}
.q-tab.is-current{background:var(--yellow)}
.q-tab .circle-mark{position:absolute;left:50%;top:50%;width:46px;height:46px;margin:-23px 0 0 -23px}

.practice{display:flex;flex-wrap:wrap;gap:20px 40px;align-items:flex-end;padding-top:20px}
.practice-card{flex:999 1 580px;min-width:0;margin-bottom:72px;border-radius:44px;background:var(--white)}
.practice .kon-col{flex:1 1 320px}
.practice .scene{max-width:380px}
.practice .scene-cloud--a{left:-8%;top:30%}

.practice-play{display:flex;flex-direction:column;gap:26px;padding:38px 6% 40px}
.practice-q{font-size:clamp(26px,3.1vw,38px);line-height:1.25}
.practice-q .q-badge{margin-right:14px;padding:1px 18px;font-size:.6em;vertical-align:4px}
.choice-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;padding-bottom:5px}
.practice-foot{display:flex;flex-wrap:wrap;gap:14px 28px;align-items:center;justify-content:space-between;min-height:64px}
.practice-foot p{flex:1 1 260px;font-size:16px}
.practice-foot .btn{padding:13px 30px;font-size:19px}

.practice-done{display:flex;flex-wrap:wrap;gap:28px 40px;align-items:center;padding:40px 6% 46px}
.stamp{flex:0 0 176px;width:176px;height:176px;transform:rotate(-10deg)}
.done-text{flex:1 1 320px;min-width:0;display:flex;flex-direction:column;gap:14px}
.done-text h1{font-size:clamp(30px,3.4vw,44px);line-height:1.15}
.done-actions{display:flex;flex-wrap:wrap;gap:14px 18px;align-items:center;padding-bottom:5px}
.done-actions .btn{padding:11px 24px;font-size:17px}
.done-actions .btn-primary{padding:13px 28px;font-size:19px}
.site-foot--cover{position:relative;background:var(--white)}

/* ---------- Books: the page sheet ----------
   A book page (.bk-page) is a fixed sheet measured in page units. --u is one
   unit: the frame's width divided by the page width. Everything on the sheet
   is sized in units, so the sheet scales as a whole and nothing reflows.
   Items are placed by js/books.js. */
.bk-frame{container-type:inline-size}
.bk-page{--u:calc(100cqw / var(--pw));position:relative;aspect-ratio:var(--pw) / var(--ph);overflow:hidden;border-radius:calc(20 * var(--u));background:var(--white);font-weight:500}
.bk-item{position:absolute;left:calc(var(--x) * var(--u));top:calc(var(--y) * var(--u));width:calc(var(--w) * var(--u));margin:0;box-sizing:border-box}
.bk-shape,.bk-img,.bk-audio,.bk-choice{height:calc(var(--h) * var(--u))}
.bk-shape{border-radius:calc(var(--r,0) * var(--u));transform:rotate(calc(var(--rot,0) * 1deg))}
.bk-ellipse{border-radius:50%}
.bk-img{display:block;user-select:none}
.bk-text{font-size:calc(var(--s) * var(--u));font-weight:var(--fw,500);line-height:var(--lh,1.4);white-space:pre-wrap;overflow-wrap:break-word}
/* Book typefaces a text item can ask for with "font" (printed-book look).
   "textbook" is the Japanese school-book face (教科書体): UD Digi Kyokasho
   where Windows has it, Klee One from Google Fonts elsewhere. */
@font-face{font-family:'KBook Textbook';src:local('UD Digi Kyokasho N'),local('UDDigiKyokashoN'),local('UD Digi Kyokasho N-R');font-weight:400}
@font-face{font-family:'KBook Textbook';src:local('UD Digi Kyokasho N Bold'),local('UDDigiKyokashoN-Bold'),local('UD Digi Kyokasho N-B');font-weight:700 800}
/* The school-book face draws "1" as a bare stroke; the printed book uses a
   gothic numeral with a flag, so digits and Latin come from BIZ UDGothic
   (same 0.5 em advance, so nothing moves). These rules come last on purpose:
   for an overlapping unicode-range the last matching face wins. */
@font-face{font-family:'KBook Textbook';src:local('BIZ UDGothic'),local('BIZUDGothic');font-weight:400;unicode-range:U+0030-0039,U+0041-005A,U+0061-007A}
@font-face{font-family:'KBook Textbook';src:local('BIZ UDGothic Bold'),local('BIZUDGothic-Bold');font-weight:700 800;unicode-range:U+0030-0039,U+0041-005A,U+0061-007A}
.bk-text.bk-font-textbook{font-family:'KBook Textbook','Klee One',serif;font-weight:var(--fw,400)}
.bk-text.bk-font-serif{font-family:'Noto Serif JP','Yu Mincho','YuMincho','Hiragino Mincho ProN','MS Mincho',serif;font-weight:var(--fw,400)}
.bk-text.bk-font-sans{font-family:'Noto Sans JP','Yu Gothic','YuGothic','Hiragino Sans','Meiryo',sans-serif;font-weight:var(--fw,400)}
.bk-text::selection{background:var(--navy);color:var(--white)}
.bk-page button{font-family:inherit;color:var(--navy)}
.bk-page :focus-visible{outline:calc(3 * var(--u)) solid var(--navy);outline-offset:calc(3 * var(--u))}

/* Things on a sheet that can be pressed. */
.bk-tap{cursor:pointer}
.bk-forms{text-decoration:underline dotted;text-decoration-thickness:calc(2 * var(--u));text-underline-offset:calc(6 * var(--u));text-decoration-color:var(--sky)}
.bk-covered .bk-text{margin:0}
.bk-text.is-under-cover{visibility:hidden}
.bk-cover{position:absolute;inset:0;min-height:calc(min(30, var(--s) * 1.6) * var(--u));padding:0 calc(min(14, var(--s) * 0.7) * var(--u));border:0;border-radius:calc(min(14, var(--s) * 0.7) * var(--u));background:var(--yellow);font-weight:800;font-size:calc(min(var(--s),17) * var(--u));text-align:left}
.bk-audio{display:flex;align-items:center;justify-content:center;padding:0;border:calc(3 * var(--u)) solid var(--navy);border-radius:50%;background:var(--yellow);box-shadow:0 calc(4 * var(--u)) 0 var(--navy)}
.bk-audio-icon{width:60%;height:60%;fill:currentColor}
.bk-audio.is-playing,.bk-audio:active{box-shadow:none;transform:translateY(calc(4 * var(--u)))}
.bk-audio.is-playing{background:var(--white)}
.bk-choice{display:flex;align-items:center;gap:calc(8 * var(--u));padding:0 calc(14 * var(--u)) 0 calc(8 * var(--u));border:calc(3 * var(--u)) solid var(--navy);border-radius:calc(20 * var(--u));background:var(--white);box-shadow:0 calc(4 * var(--u)) 0 var(--navy);font-weight:800;font-size:calc(var(--s) * var(--u));text-align:left}
.bk-choice-mark{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:calc(34 * var(--u));height:calc(34 * var(--u));font-size:calc(15 * var(--u))}
.bk-circle{display:none;position:absolute;left:calc(1 * var(--u));top:50%;width:calc(48 * var(--u));height:calc(48 * var(--u));margin-top:calc(-25 * var(--u));fill:none;stroke:var(--red);stroke-width:5;stroke-linecap:round}
.bk-choice.is-wrong,.bk-choice.is-right{box-shadow:none;transform:translateY(calc(4 * var(--u)))}
.bk-choice.is-wrong{background:var(--grey);opacity:.6}
.bk-choice.is-right{background:var(--yellow)}
.bk-choice.is-right .bk-circle{display:block}
.bk-button{min-height:calc(40 * var(--u));padding:calc(6 * var(--u)) calc(16 * var(--u));border:calc(3 * var(--u)) solid var(--navy);border-radius:calc(999 * var(--u));background:var(--white);box-shadow:0 calc(4 * var(--u)) 0 var(--navy);font-weight:800;font-size:calc(var(--s) * var(--u));line-height:1.2}
.bk-button--primary{background:var(--yellow)}
.bk-page .bk-button--navy{background:var(--navy);color:var(--white);box-shadow:none}
.bk-button:active{box-shadow:none;transform:translateY(calc(4 * var(--u)))}
.bk-button--navy:active{transform:none}

/* ---------- Books: what Kon draws on a page (js/kon-page.js) ----------
   A layer over the sheet, measured in the same page units. Yellow marker:
   "Kon is talking about this", with the number of her step. Red pencil: an
   answer she wrote in. Sky blue: what the learner pointed at. */
.bk-marks{position:absolute;inset:0;pointer-events:none}
.bk-hl{height:calc(var(--h) * var(--u));border-radius:calc(3 * var(--u));background:var(--yellow);mix-blend-mode:multiply;transform-origin:0 50%;animation:hl-in .35s ease-out}
.bk-hl--picture{border-radius:calc(8 * var(--u))}
.bk-hl--veil{mix-blend-mode:normal;opacity:.5}
.bk-hl--ring{box-sizing:border-box;border:calc(4 * var(--u)) solid var(--yellow);border-radius:calc(12 * var(--u));background:none;mix-blend-mode:normal;animation:none}
.bk-hl--point{background:var(--sky);opacity:.55;animation:none}
.bk-hl--point.bk-hl--ring{border-color:var(--sky);background:none;opacity:1}
.bk-page .bk-badge{display:flex;align-items:center;justify-content:center;height:calc(var(--h) * var(--u));padding:0;border:0;border-radius:50%;background:var(--navy);color:var(--white);font-family:'M PLUS Rounded 1c',sans-serif;font-weight:800;font-size:calc(8.5 * var(--u));line-height:1;pointer-events:auto}
.bk-page .bk-pen{display:flex;align-items:center;justify-content:center;height:calc(var(--h) * var(--u));padding:0;border:0;background:none;color:var(--red);font-family:'KBook Textbook','Klee One',serif;font-weight:600;font-size:calc(var(--s) * var(--u));line-height:1;white-space:nowrap;pointer-events:auto;animation:pen-in .4s ease-out}
.bk-page .bk-pen--beside{width:max-content;padding:0 calc(3 * var(--u));border-radius:calc(4 * var(--u));background:var(--white)}
.bk-marks .is-flash{animation:mark-flash .9s ease-in-out}
@keyframes hl-in{from{transform:scaleX(0)}}
@keyframes pen-in{from{opacity:0;transform:translateY(calc(-5 * var(--u)))}}
@keyframes mark-flash{0%,50%,100%{transform:scale(1)}25%,75%{transform:scale(1.14)}}
@media (prefers-reduced-motion:reduce){.bk-hl,.bk-page .bk-pen,.bk-marks .is-flash{animation:none}}

/* ---------- Books: the shelf (books.html) ---------- */
.page--books{line-height:1.55}
.books-hero{display:flex;flex-wrap:wrap;gap:10px 48px;align-items:flex-end;justify-content:space-between;padding-top:18px;padding-bottom:44px}
.books-hero h1{font-size:clamp(42px,5.2vw,70px);line-height:1.05;letter-spacing:-0.02em}
.books-hero h1 span{font-size:.5em;letter-spacing:0;white-space:nowrap}
.books-hero p{max-width:440px;font-weight:700}
.books-main{display:flex;flex-wrap:wrap;gap:36px 32px;align-items:flex-start;padding-top:44px;padding-bottom:80px}
.shelf{flex:999 1 560px;min-width:0;display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:20px}
.book-tile{display:flex;flex-direction:column;gap:2px;padding:16px 16px 20px;border-radius:36px;background:var(--sky-tint);text-decoration:none}
.book-tile .bk-frame{margin-bottom:12px;pointer-events:none;user-select:none}
.book-title{padding:0 6px;font-size:23px;line-height:1.25}
.book-sub,.book-pages{padding:0 6px;font-size:16px}
.book-pages{font-weight:700}
.books-side{flex:1 1 270px;min-width:0;display:flex;flex-direction:column;gap:20px}
.books-side .bubble{margin-bottom:6px;padding:14px 20px;border-radius:26px 26px 26px 6px;background:var(--sky-tint);font-size:inherit}
.books-side .kon{width:70%;max-width:220px}
.own-file{display:flex;flex-direction:column;gap:12px;align-items:flex-start;padding:22px 22px 26px;border-radius:36px;background:var(--yellow-tint)}
.own-file h2{font-size:23px;line-height:1.2}
.own-file p{font-size:16px;line-height:1.5}

/* ---------- Books: the viewer (book.html) ----------
   Fills the window: a bar of tools on top; under it the page thumbnails, the
   scrolling stack of pages, and Kon's panel. */
.viewer-body{overflow:hidden}
.viewer{display:flex;flex-direction:column;height:100vh;height:100dvh;background:var(--sky-tint);line-height:1.5}
.viewer-bar{flex:0 0 auto;display:flex;flex-wrap:wrap;gap:10px 16px;align-items:center;padding:10px 18px 13px;background:var(--sky)}
.brand--small{gap:8px}
.brand--small .brand-mark{width:40px;height:40px}
.brand--small .brand-name{font-size:22px}
.viewer-title{flex:1 1 120px;min-width:0;overflow:hidden;font-size:20px;white-space:nowrap;text-overflow:ellipsis}
.viewer-tools{display:flex;flex-wrap:wrap;gap:10px 18px;align-items:center}
.tool-group{display:flex;gap:8px;align-items:center}

/* A tool is a small button: same border and lip as .btn, sized for a bar. */
.tool,.tool:hover{color:var(--navy)}
.tool{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;height:40px;min-width:40px;padding:0 15px;border:3px solid var(--navy);border-radius:999px;background:var(--white);box-shadow:0 3px 0 var(--navy);font-weight:800;font-size:15px;line-height:1;text-decoration:none;white-space:nowrap}
.tool--icon{width:40px;padding:0}
.tool--sign{font-size:24px}
.tool--primary{background:var(--yellow)}
.tool--chip{height:36px;font-size:14px}
.tool--kon{margin-left:auto}
.tool-arrow{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:3;stroke-linecap:round;stroke-linejoin:round}
.tool:active,.tool[aria-pressed="true"]{box-shadow:none;transform:translateY(3px)}
.tool[aria-pressed="true"]{background:var(--yellow)}
.tool:disabled{background:var(--grey);box-shadow:none;transform:translateY(3px);opacity:.6;cursor:default}
.page-box{display:flex;gap:7px;align-items:center;font-weight:800;font-size:15px;white-space:nowrap}
.page-box input{box-sizing:border-box;width:58px;height:40px;padding:0 6px;border:3px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);font:inherit;text-align:center;appearance:textfield;-moz-appearance:textfield}
.page-box input::-webkit-outer-spin-button,.page-box input::-webkit-inner-spin-button{appearance:none;-webkit-appearance:none;margin:0}
.page-box input:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.zoom-label{min-width:46px;font-weight:800;font-size:15px;text-align:center}

.viewer-main{position:relative;flex:1 1 auto;min-height:0;display:flex}
.viewer-thumbs{flex:0 0 auto;display:flex;flex-direction:column;gap:14px;width:132px;padding:18px 16px;overflow-y:auto;background:var(--white)}
.thumb{display:flex;flex-direction:column;gap:5px;align-items:center;padding:0;border:0;background:none;color:var(--navy);font-weight:800;font-size:13px}
.thumb-page{display:block;width:100%;border:3px solid var(--sky-tint);border-radius:11px;overflow:hidden;background:var(--sky-tint)}
.thumb-page .bk-page{border-radius:0}
.thumb[aria-current] .thumb-page{border-color:var(--navy)}
.thumb-n{padding:1px 11px;border-radius:999px}
.thumb[aria-current] .thumb-n{background:var(--navy);color:var(--white)}

.viewer-pages{position:relative;flex:1 1 auto;min-width:0;overflow:auto}
.viewer-pages:focus{outline:none}
.viewer-stack{display:flex;flex-direction:column;gap:20px;align-items:center;width:max-content;min-width:100%;box-sizing:border-box;padding:24px}
.viewer-open{display:flex;flex-direction:column;gap:14px;align-items:flex-start;max-width:640px;box-sizing:border-box;margin:48px auto;padding:34px 36px 38px;border-radius:44px;background:var(--yellow-tint)}
.viewer-open h1{font-size:27px;line-height:1.2}
.viewer-open-msg{font-weight:800}
.viewer-open-msg:empty{display:none}
.viewer-note{position:sticky;left:0;right:0;bottom:22px;width:max-content;max-width:calc(100% - 48px);box-sizing:border-box;margin:0 auto;padding:11px 22px;border-radius:999px;background:var(--navy);color:var(--white);font-weight:700;font-size:16px}

/* Kon's panel */
.viewer-kon{flex:0 0 auto;display:flex;flex-direction:column;gap:12px;width:390px;max-width:100%;box-sizing:border-box;padding:16px 18px 14px;background:var(--white)}
.chat-head{display:flex;gap:12px;align-items:center}
.chat-head .kon{flex:0 0 84px}
.chat-head h2{font-size:23px;line-height:1.2}
.chat-head p{font-size:15px;line-height:1.4}
.chat-log{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:10px;overflow-y:auto;padding:4px 2px}
.msg{max-width:90%;padding:11px 16px;font-size:16px;line-height:1.5;white-space:pre-wrap;overflow-wrap:break-word}
.msg--kon{align-self:flex-start;border-radius:22px 22px 22px 6px;background:var(--sky-tint)}
.msg--me{align-self:flex-end;border-radius:22px 22px 6px 22px;background:var(--yellow-tint);font-weight:700}
.msg--wait{font-weight:700}
.chat-chips{display:flex;flex-wrap:wrap;gap:8px}
.chat-form{display:flex;gap:10px;align-items:flex-end}
.chat-form textarea{flex:1 1 auto;min-width:0;box-sizing:border-box;padding:10px 16px;border:3px solid var(--navy);border-radius:22px;background:var(--white);color:var(--navy);font:inherit;font-size:16px;line-height:1.4;resize:none}
.chat-form textarea:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.chat-form textarea:disabled{background:var(--grey)}
.chat-form .btn{padding:9px 20px}
.chat-hint{font-size:13px}

/* Kon's answer: numbered steps. The yellow words inside a step are buttons
   that show the place on the page; so is the step's number. */
.answer{align-self:stretch;display:flex;flex-direction:column;gap:8px}
.step{display:flex;gap:10px;align-items:flex-start;padding:10px 14px 11px 10px;border-radius:22px;background:var(--sky-tint);font-size:16px;line-height:1.5}
.step:has(.mention){cursor:pointer}
.step.is-current,.msg--kon.is-current{background:var(--yellow-tint)}
.step-n{flex:0 0 auto;display:flex;align-items:center;justify-content:center;width:30px;height:30px;padding:0;border:0;border-radius:50%;background:var(--navy);color:var(--white);font-weight:800;font-size:15px;line-height:1}
.step-n:disabled{cursor:default}
.step-body{flex:1 1 auto;min-width:0}
.step-text{white-space:pre-wrap;overflow-wrap:break-word}
.step-marks{display:flex;flex-wrap:wrap;gap:6px;margin-top:7px}
.mention{padding:1px 6px;border:0;border-radius:8px;background:var(--yellow);color:var(--navy);font-weight:800;line-height:inherit}
.step-marks .mention{padding:4px 12px;border-radius:999px;font-size:14px}
.mention--pen{background:var(--white);color:var(--red)}
.msg-pointed{display:block;margin-top:3px;font-weight:500;font-size:13px}

/* Pointing at the page: the button that starts it, and what was pointed at. */
.chat-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.chat-actions .chat-chips,.chat-point{display:contents}
.tool--pick{background:var(--sky-tint)}
.chat-point-help{font-weight:700;font-size:14px}
.chat-pointed{display:inline-flex;gap:6px;align-items:center;max-width:100%;box-sizing:border-box;padding:4px 5px 4px 14px;border-radius:999px;background:var(--sky);font-weight:800;font-size:14px}
.chat-pointed-label{min-width:0;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}
.chat-unpoint{flex:0 0 auto;width:26px;height:26px;padding:0;border:0;border-radius:50%;background:var(--white);color:var(--navy);font-weight:800;font-size:17px;line-height:1}
.chat-foot{display:flex;gap:10px;align-items:center;justify-content:space-between}
.chat-clear{flex:0 0 auto;padding:5px 13px;border:0;border-radius:999px;background:var(--grey);color:var(--navy);font-weight:800;font-size:13px;white-space:nowrap}
.viewer-stack.is-picking,.viewer-stack.is-picking [data-ref]{cursor:crosshair}
.viewer-stack.is-picking [data-ref]:hover{outline:calc(3 * var(--u)) solid var(--sky);outline-offset:calc(2 * var(--u));border-radius:calc(4 * var(--u))}
.select-ask{position:fixed;z-index:5}
.btn:disabled{background:var(--grey);box-shadow:none;transform:translateY(5px);opacity:.6;cursor:default}

/* Pages of the open book: each frame has its full size before it is drawn. */
.viewer-stack .bk-frame{display:flex;align-items:center;justify-content:center;width:var(--frame-w);height:var(--frame-h);border-radius:var(--frame-r);background:var(--white)}
.viewer-stack .bk-page{flex:1 1 auto}
.page-retry{max-width:80%;font-size:16px}
.book-access{align-self:flex-start;margin:6px 6px 0;padding:2px 12px;border-radius:999px;background:var(--navy);color:var(--white);font-weight:800;font-size:13px}

/* The listening panel (js/listen.js): docked under the pages, never over
   them. A bar of controls, then the transcript with the word being said in
   yellow. */
.listen{flex:0 0 auto;display:flex;flex-direction:column;max-height:40vh;border-radius:34px 34px 0 0;background:var(--white)}
.listen-bar{position:relative;display:flex;flex-wrap:wrap;gap:10px 22px;align-items:center;padding:14px 66px 12px 24px}
.listen-head{display:flex;flex-direction:column;gap:2px;min-width:0;max-width:240px}
.listen-title{overflow:hidden;font-size:17px;line-height:1.3;white-space:nowrap;text-overflow:ellipsis}
.listen-page{align-self:flex-start;padding:0;border:0;background:none;color:var(--navy);font-weight:700;font-size:14px;text-decoration:underline;text-underline-offset:3px}
.listen-controls{display:flex;gap:8px;align-items:center}
.listen-skip{padding:0 11px;font-weight:800;font-size:14px;white-space:nowrap}
.listen-icon{width:20px;height:20px;fill:currentColor}
.listen-play{display:flex;align-items:center;justify-content:center;width:56px;height:56px;margin:0 2px 5px;padding:0;border:3px solid var(--navy);border-radius:50%;background:var(--yellow);color:var(--navy);box-shadow:0 5px 0 var(--navy)}
.listen-play .listen-icon{width:28px;height:28px}
.listen-play:active{box-shadow:none;transform:translateY(5px)}
.listen.is-loading .listen-play{opacity:.55;cursor:progress}
.listen-seek{flex:1 1 220px;display:flex;gap:10px;align-items:center;min-width:180px}
.listen-clock{min-width:38px;font-weight:800;font-size:14px;font-variant-numeric:tabular-nums;text-align:center}
.listen-seek input{flex:1 1 auto;min-width:0;height:28px;margin:0;background:none;appearance:none;-webkit-appearance:none;cursor:pointer}
.listen-seek input::-webkit-slider-runnable-track{height:10px;border-radius:999px;background:var(--sky-tint)}
.listen-seek input::-moz-range-track{height:10px;border-radius:999px;background:var(--sky-tint)}
.listen-seek input::-moz-range-progress{height:10px;border-radius:999px;background:var(--sky)}
.listen-seek input::-webkit-slider-thumb{width:22px;height:22px;margin-top:-6px;border:3px solid var(--navy);border-radius:50%;background:var(--yellow);-webkit-appearance:none;appearance:none}
.listen-seek input::-moz-range-thumb{box-sizing:border-box;width:22px;height:22px;border:3px solid var(--navy);border-radius:50%;background:var(--yellow)}
.listen-seek input:focus-visible{outline:3px solid var(--navy);outline-offset:3px;border-radius:999px}
.listen-options{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.listen-speed{display:flex;gap:2px;padding:3px;border-radius:999px;background:var(--sky-tint)}
.listen-rate{height:30px;min-width:46px;padding:0 9px;border:0;border-radius:999px;background:none;color:var(--navy);font-weight:800;font-size:14px}
.listen-rate[aria-pressed="true"]{background:var(--navy);color:var(--white)}
.listen-close{position:absolute;top:14px;right:18px;width:36px;height:36px;padding:0;border:0;border-radius:50%;background:var(--grey);color:var(--navy);font-weight:800;font-size:22px;line-height:1}
.listen-lines{flex:1 1 auto;min-height:0;display:flex;flex-direction:column;gap:2px;margin:0;padding:2px 20px 16px;overflow-y:auto;list-style:none}
.listen-line{display:flex;gap:14px;align-items:baseline;width:100%;padding:6px 14px;border:0;border-radius:16px;background:none;color:var(--navy);text-align:left}
.listen-line:hover{background:var(--sky-tint)}
.listen-line.is-now{background:var(--yellow-tint)}
.listen-at{flex:0 0 auto;min-width:36px;font-weight:700;font-size:13px;font-variant-numeric:tabular-nums}
.listen-said{font-family:'Noto Sans JP','M PLUS Rounded 1c',sans-serif;font-size:19px;line-height:1.6}
.listen-said .is-said{border-radius:6px;background:var(--yellow);box-shadow:0 0 0 2px var(--yellow)}
.listen.is-text-hidden .listen-lines{display:none}
.listen:not(.has-lines) .listen-lines,.listen:not(.has-lines) [data-listen-loop],.listen:not(.has-lines) [data-listen-step],
.listen:not(.has-lines) [data-listen-text],.listen:not(.has-lines) [data-listen-prev],.listen:not(.has-lines) [data-listen-next]{display:none}

/* ---------- Members: sign-in and admin pages ---------- */
.site-nav .nav-user{padding:8px 18px}
.sign-in,.admin{padding-top:44px;padding-bottom:80px}
.sign-in{max-width:640px}
.admin-panel{display:flex;flex-direction:column;gap:22px}
.card{display:flex;flex-direction:column;gap:14px;padding:28px 30px 32px;border-radius:40px}
.card--sky{background:var(--sky-tint)}
.card--yellow{background:var(--yellow-tint)}
.card--coral{background:var(--coral-tint)}
.card h2{font-size:27px;line-height:1.2}
.card h3{margin:8px 0 0;font-size:20px;font-weight:800}
.form{display:flex;flex-direction:column;gap:14px;align-items:flex-start}
.form--line{flex-direction:row;flex-wrap:wrap;align-items:flex-end}
.form-row{display:flex;flex-direction:column;gap:5px;font-weight:800;font-size:16px}
.form-actions{display:flex;flex-wrap:wrap;gap:14px}
.field{box-sizing:border-box;height:46px;min-width:220px;max-width:100%;padding:0 18px;border:3px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);font:inherit;font-weight:500}
select.field{min-width:0;padding-right:12px}
.field--file{height:auto;padding:8px 14px;border-radius:24px}
.field:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.field:disabled{background:var(--grey)}
.form-message{font-weight:800}
.form-message:empty{display:none}
.form-note{font-size:16px}
.admin-list{display:flex;flex-direction:column;gap:10px;margin:0;padding:0;list-style:none}
.admin-row{display:flex;flex-wrap:wrap;gap:10px 14px;align-items:center;padding:12px 18px;border-radius:26px;background:var(--white)}
.admin-row-text{flex:1 1 220px;min-width:0;display:flex;flex-direction:column}
.admin-row-title{font-weight:800;font-size:19px}
.admin-row-meta{font-size:15px}
.admin-row .field{height:40px;font-size:15px}
.admin-inline{display:flex;gap:8px;align-items:center}
.admin-inline .field{min-width:150px}

/* >>> course */
/* ---------- Course: readings, units list, unit page, lesson pieces ----------
   Drawn by js/lesson.js from the content files in units/. The units list
   reuses the list blocks above (.term, .lesson-tile, .attend). */
rt{font-size:.46em;font-weight:700;line-height:1.3}
.romaji{font-size:15px}
.no-romaji .romaji{display:none}
.text-btn{padding:6px 0;border:0;background:none;color:var(--navy);font-weight:700;font-size:15px;text-decoration:underline}
.course-wait{font-weight:700}
.voice-note{padding:14px 20px;border-radius:24px;background:var(--grey);font-size:16px;font-weight:700}

.term--0,.term--3{background:var(--sky-tint)}
.term--1,.term--4{background:var(--yellow-tint)}
.term--2{background:var(--coral-tint)}
.term-about{margin-top:-8px;font-size:16px}
.lesson-jp{line-height:1.5}
.lesson-tile .today-tag{margin-top:8px}
.paws{display:flex;gap:4px;margin-top:auto;padding-top:8px}
.paws .paw{width:20px;height:20px;fill:var(--grey)}
.lesson-tile.is-today .paws .paw{fill:var(--white)}
.paws .paw.is-on,.lesson-tile.is-today .paws .paw.is-on{fill:var(--red)}

.stamps{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px}
.stamp-slot{box-sizing:border-box;display:flex;align-items:center;justify-content:center;aspect-ratio:1;border-radius:50%;background:var(--white);font-size:12px;font-weight:700}
.stamp-slot.is-on{border:3px solid var(--red);transform:rotate(-8deg)}
.stamp-slot:nth-child(3n).is-on{transform:rotate(9deg)}
.stamp-slot .paw{width:66%;height:66%}
.wipe{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.wipe-ask{display:flex;flex-direction:column;gap:12px;padding:16px 18px;border-radius:24px;background:var(--grey);font-size:16px;line-height:1.45}
.wipe-actions{display:flex;flex-wrap:wrap;gap:10px;padding-bottom:5px}
.tt-side .wipe .btn{padding:8px 18px;font-size:16px}

.lesson-hero--unit h1,.lesson-hero--part h1{font-size:clamp(38px,5.2vw,70px);line-height:1.35}
a.pill{text-decoration:none}
a.pill--navy,a.pill--navy:hover{color:var(--white)}
.unit-parts{gap:16px}
.part-card{position:relative;display:flex;flex-wrap:wrap;gap:14px 20px;align-items:center;padding:22px 26px;border-radius:36px;background:var(--sky-tint)}
.part-card.is-done{background:var(--yellow-tint)}
.part-card .part-n{flex:0 0 46px;margin-right:0}
.part-card-text{flex:1 1 260px;min-width:0}
.part-card-text h2{font-size:27px;line-height:1.25}
.part-card-text h2 .jp{font-size:17px}
.part-card-text p{font-size:16px;line-height:1.5}
.part-card-go{display:flex;flex-wrap:wrap;gap:12px;padding-bottom:5px}
.part-card-go .btn{padding:9px 22px;font-size:17px}
.part-card>.paw{position:absolute;right:18px;top:-12px;width:38px;height:38px;transform:rotate(12deg)}
.pattern-list{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none;font-weight:700}
.toc a{display:flex;align-items:center;gap:8px}
.toc a[aria-current]{font-weight:800;text-decoration:none}
.toc .paw{width:18px;height:18px}
.switch[aria-pressed="false"]{background:var(--grey)}

.kana{display:flex;flex-direction:column;gap:14px}
.kana-table{display:flex;flex-direction:column;gap:10px}
.kana-row{display:flex;align-items:center;gap:12px;padding:12px 16px 16px;border-radius:28px;background:var(--sky-tint)}
.kana-label{flex:0 0 70px;font-weight:800;font-size:16px}
.kana-cells{display:flex;flex-wrap:wrap;gap:10px}
.kana-cell{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:76px;height:84px;padding:0 10px;border:3px solid var(--navy);border-radius:22px;background:var(--white);box-shadow:0 4px 0 var(--navy);color:var(--navy)}
.kana-cell.is-playing,.kana-cell:active{background:var(--yellow);box-shadow:none;transform:translateY(4px)}
.kana-ch{font-weight:800;font-size:31px;line-height:1.15;white-space:nowrap}
.kana-ro{font-size:15px;font-weight:700}
.tips{display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.word-jp{line-height:1.6}

.patterns{display:flex;flex-direction:column;gap:18px}
.patterns .part-title{margin-bottom:-2px}
.pattern{display:flex;flex-direction:column;gap:12px;align-items:flex-start;padding:24px 26px 26px;border-radius:36px;background:var(--yellow-tint)}
.pattern-form{margin:0;padding:4px 18px;border-radius:16px;background:var(--navy);color:var(--white);font-size:25px;font-weight:800;line-height:1.5}
.pattern-tr{font-weight:800;font-size:19px}
.examples{align-self:stretch;display:flex;flex-direction:column;gap:10px}
.example{display:flex;gap:14px;align-items:center;padding:12px 18px;border-radius:24px;background:var(--white)}
.example-text{display:flex;flex-direction:column;min-width:0}
.example-jp{font-weight:800;font-size:23px;line-height:1.75}
.example-tr{font-size:16px}
.play--small{flex:0 0 44px;height:44px;box-shadow:0 3px 0 var(--navy)}
.play--small.is-playing{transform:translateY(3px)}
.play--small svg{width:17px;height:17px}

.line{max-width:88%}
.line-text{display:flex;gap:14px;align-items:flex-start}
.line-words{display:flex;flex-direction:column;align-items:flex-start;min-width:0}
.line-jp{line-height:1.75}
.line-text .play--small{margin-top:6px}
/* <<< course */

/* >>> practice */
/* ---------- Practice: the question kinds (js/practice.js) ----------
   Choices use the .choice buttons above. These are the pieces for the other
   kinds: a sentence with a gap, word tiles, pairs, a typed reading. */
.practice-stage{display:flex;flex-direction:column;gap:18px}
.practice-ja{font-weight:800;font-size:clamp(34px,4.4vw,54px);line-height:1.5}
.practice-ja--sentence{font-size:clamp(26px,3.2vw,38px);line-height:1.8}
.practice-tr{margin-top:-8px;font-weight:700}
.practice-tr--big{margin-top:0;font-size:22px}
.practice-buttons{display:flex;flex-wrap:wrap;gap:12px 18px;align-items:center;padding-bottom:5px}
.practice-foot .btn[disabled]{opacity:.45;cursor:default}
.choice--big .choice-text{line-height:1.6}
.gap{display:inline-block;min-width:2.4em;margin:0 8px;border-bottom:4px solid var(--navy);text-align:center}
.gap.is-filled{border-color:var(--red);color:var(--red)}

.q-tabs--many{flex-wrap:wrap;gap:6px}
.q-tabs--many .q-tab{min-width:44px;padding:4px 8px;font-size:15px}
.q-tabs--many .q-tab .circle-mark{width:38px;height:38px;margin:-19px 0 0 -19px}

.listen-row{display:flex;align-items:center;gap:18px;font-size:16px}
.play--big{flex:0 0 84px;height:84px}
.play--big svg{width:32px;height:32px}

.build-answer{position:relative;display:flex;flex-wrap:wrap;gap:10px;align-items:center;min-height:68px;padding:12px 14px 16px;border-radius:26px;background:var(--sky-tint)}
.build-answer.is-wrong{background:var(--grey)}
.build-answer.is-right,.build-answer.is-shown{background:var(--yellow)}
.build-answer .circle-mark{position:absolute;right:10px;top:50%;width:56px;height:56px;margin-top:-28px}
.build-tray{display:flex;flex-wrap:wrap;gap:10px;min-height:60px;padding-bottom:4px}
.tile{padding:4px 16px;border:3px solid var(--navy);border-radius:18px;background:var(--white);box-shadow:0 4px 0 var(--navy);color:var(--navy);font-weight:800;font-size:23px;line-height:1.75}
.tile:active{box-shadow:none;transform:translateY(4px)}

.match{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 16px;padding-bottom:5px}
.match-item{min-height:62px;padding:6px 18px;border:3px solid var(--navy);border-radius:22px;background:var(--white);box-shadow:0 5px 0 var(--navy);color:var(--navy);font-weight:800;font-size:20px;line-height:1.6;text-align:left}
.match-item.is-picked{background:var(--sky-tint);box-shadow:none;transform:translateY(5px)}
.match-item.is-right{background:var(--yellow);box-shadow:none;transform:translateY(5px)}
.match-item.is-wrong{background:var(--grey)}
.match-item{position:relative}
.match-item .circle-mark{position:absolute;right:8px;top:50%;width:40px;height:40px;margin-top:-20px}

.type-row{display:flex;flex-wrap:wrap;gap:12px;align-items:center}
.type-input{flex:1 1 240px;min-width:0;box-sizing:border-box;padding:12px 22px;border:3px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);font:inherit;font-weight:800;font-size:22px}
.type-input:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
.type-input.is-right,.type-input.is-shown{background:var(--yellow)}

.done-paw{flex:0 0 130px;width:130px;height:130px;fill:var(--red);transform:rotate(-10deg)}
/* <<< practice */

/* >>> home-play */
/* ---------- Home: who Kon is, the Turkish comparison, where to start ---------- */
.n-4{background:var(--green)}
.who{display:flex;flex-wrap:wrap;gap:36px 56px;align-items:center;padding-top:88px;padding-bottom:88px}
.who-text{flex:1 1 400px;min-width:0;display:flex;flex-direction:column;gap:18px}
.marks{flex:1 1 380px;min-width:0;display:flex;flex-direction:column;gap:12px;padding:26px;border-radius:44px;background:var(--sky-tint);transform:rotate(-1.5deg)}
.mark-row{display:flex;gap:18px;align-items:center;padding:16px 20px;border-radius:24px;background:var(--white);line-height:1.45}
.mark-pic{flex:0 0 56px;height:56px;display:flex;align-items:center;justify-content:center}
.mark-pic .circle-mark{width:56px;height:56px}
.mark-pic .paw{width:44px;height:44px;transform:rotate(-12deg)}
.mark-pic--stamp{box-sizing:border-box;border:4px solid var(--red);border-radius:50%;color:var(--red);font-weight:800;font-size:17px;transform:rotate(-10deg)}
.pair-tiles .mini-tile{flex:1 1 200px;padding:22px 24px 24px;text-align:center}
.pair-tiles .mini-jp{font-size:34px;line-height:1.9}
.pair-tiles .mini-tr{font-size:20px}
/* The particles are picked out in yellow: a red ring would read as "correct". */
.pair-tiles .hl{margin-left:4px;padding:0 6px;border-radius:10px;background:var(--yellow)}
.pair-note{max-width:640px;font-weight:700}
.parts{padding-top:88px}
.doors-wrap{display:flex;flex-direction:column;gap:28px;padding-bottom:96px}
.doors{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:18px}
.door{display:flex;flex-direction:column;gap:10px;align-items:flex-start;padding:28px 28px 32px;border-radius:40px;text-decoration:none;line-height:1.5}
.door--sky{background:var(--sky-tint)}
.door--yellow{background:var(--yellow-tint)}
.door--coral{background:var(--coral-tint)}
.door-title{font-size:28px;line-height:1.2}
.door-jp{font-weight:800;font-size:20px}
.door-go{margin-top:auto;padding:9px 22px;border:3px solid var(--navy);border-radius:999px;background:var(--white);box-shadow:0 5px 0 var(--navy);font-weight:800}
.door--yellow .door-go{background:var(--yellow)}
.door:active .door-go{box-shadow:none;transform:translateY(5px)}

/* ---------- Games (play.html, js/play.js) ----------
   A game is played in .play-stage, which borrows the practice card and
   Kon's column from the practice page. */
.play-main{display:flex;flex-direction:column;gap:36px;padding-top:44px;padding-bottom:80px}
.play-pick{display:flex;flex-direction:column;gap:12px}
.chips{display:flex;flex-wrap:wrap;gap:8px 8px;align-items:center}
.chip{min-width:48px;padding:6px 14px;border:3px solid var(--navy);border-radius:999px;background:var(--white);color:var(--navy);font-weight:800;font-size:16px}
.chip[aria-pressed="true"]{background:var(--yellow)}
.chips .text-btn{margin-left:8px}
.games{display:grid;grid-template-columns:repeat(auto-fit,minmax(210px,1fr));gap:16px}
.game{display:flex;flex-direction:column;gap:6px;align-items:flex-start;padding:22px 24px 26px;border:3px solid var(--navy);border-radius:32px;box-shadow:0 5px 0 var(--navy);color:var(--navy);font-size:16px;font-weight:500;line-height:1.45;text-align:left}
.game strong{font-size:24px;line-height:1.2}
.game [lang="ja"]{font-weight:800}
.game:active{box-shadow:none;transform:translateY(5px)}
.game--sky{background:var(--sky-tint)}
.game--yellow{background:var(--yellow-tint)}
.game--coral{background:var(--coral-tint)}
.play-stage{padding:28px 4% 0;border-radius:56px;background:var(--sky);overflow:hidden;scroll-margin-top:16px}
.play-stage .practice-card{margin-bottom:56px}
.play-bar{display:flex;gap:16px;align-items:center;justify-content:space-between;padding:22px 6% 0;font-size:19px}
.play-stage .q-tabs{flex-wrap:wrap;gap:6px;margin:0;padding:12px 6% 0}
.play-stage .q-tabs:empty{display:none}
.play-stage .practice-play{padding-top:22px}
.play-stage .scene{max-width:300px}

.flip-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px;padding-bottom:5px}
.flip-card{display:flex;align-items:center;justify-content:center;min-height:108px;padding:8px 10px;border:3px solid var(--navy);border-radius:22px;background:var(--sky);box-shadow:0 5px 0 var(--navy);color:var(--navy);font-weight:800;line-height:1.5;overflow-wrap:anywhere}
.flip-card .paw{width:38px;height:38px;fill:var(--white)}
.flip-card.is-up{background:var(--white)}
.flip-card{position:relative}
.flip-card.is-right{background:var(--yellow);box-shadow:none;transform:translateY(5px)}
.flip-card .circle-mark{position:absolute;right:4px;top:4px;width:30px;height:30px;stroke-width:6}
.flip-ja{font-size:23px}
.flip-tr{font-size:17px}

.flash{display:flex;gap:22px;align-items:center;min-height:170px;padding:26px 28px;border-radius:32px;background:var(--sky-tint)}
.flash-text{display:flex;flex-direction:column;gap:4px;min-width:0}
.flash-ja{font-weight:800;font-size:clamp(34px,4.4vw,52px);line-height:1.6}
.flash-back{display:flex;flex-direction:column;gap:2px}
.flash-back strong{font-size:24px}
.flash-romaji,.flash-note{font-size:16px}
/* <<< home-play */

/* ---------- Narrow screens ----------
   The layouts are fluid; these are the only fixed adjustments so far. */
.tt-hero h1 span{white-space:nowrap}
@media (max-width:560px){
  .choice-grid{grid-template-columns:minmax(0,1fr)}
  /* Course pages */
  .kana-row{flex-direction:column;align-items:flex-start;gap:8px}
  .kana-label{flex:0 0 auto}
  .kana-cell{min-width:60px;height:74px;padding:0 8px}
  .kana-ch{font-size:27px}
  .line{max-width:100%}
  .part-card{padding:18px 20px}
  .pattern{padding:20px 18px 22px}
  .example{align-items:flex-start;padding:12px 14px}
  .match{gap:10px}
  .match-item{padding:6px 12px;font-size:17px}
  .q-tabs--many .q-tab{min-width:38px}
  /* Games */
  .play-stage{padding:16px 3% 0;border-radius:40px}
  .flip-grid{grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
  .flip-card{min-height:92px;padding:6px}
  .flip-ja{font-size:19px}
  .flip-tr{font-size:15px}
  .flash{flex-direction:column;align-items:flex-start;padding:20px}
}
/* Kon's panel never covers the page, because she points at it: on a narrow
   window it gets slimmer, on a phone it moves under the page. */
@media (max-width:900px){
  .viewer-thumbs{position:absolute;top:0;bottom:0;left:0;z-index:2}
  .viewer-kon{width:320px;padding:12px 14px 10px}
  .viewer-title{flex-basis:100%;order:5}
}
@media (max-width:640px){
  /* The bar shrinks to two rows (its tools slide sideways) to leave room. */
  .viewer-bar{gap:8px 10px;padding:8px 12px 10px}
  .viewer-title{display:none}
  .tool--kon{order:1}
  .viewer-tools{order:2;flex:1 1 100%;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
  .tool-group{flex:0 0 auto}
  .viewer-main{flex-direction:column}
  .viewer-kon{flex:0 0 56%;width:auto;min-height:0;gap:8px;padding:10px 12px 8px}
  .chat-head{display:none}
  .chat-actions{flex:0 0 auto;flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
  .chat-actions .tool,.chat-pointed{flex:0 0 auto}
  .chat-form textarea{height:46px}
  .listen{max-height:52%;border-radius:26px 26px 0 0}
  .listen-bar{gap:8px 12px;padding:10px 54px 8px 14px}
  .listen-head{max-width:100%}
  .listen-close{top:10px;right:10px}
  .listen-controls{flex:1 1 100%;justify-content:center}
  .listen-seek{flex-basis:100%}
  .listen-options{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}
  .listen-options>*{flex:0 0 auto}
  .listen-lines{padding:0 8px 10px}
  .listen-line{gap:10px;padding:5px 10px}
  .listen-said{font-size:17px}
}
