:root{
  --ink:#202131; --muted:#6a6876; --paper:#fffaf5; --panel:#ffffff;
  --purple:#4f2e7f; --purple2:#7250aa; --lav:#f4effb; --rose:#dd6f8f;
  --teal:#3a8d8b; --green:#4f8b64; --gold:#e8bd64; --blue:#4a7fb7;
  --line:#e8deef; --shadow:0 14px 36px rgba(44,28,66,.12);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:linear-gradient(180deg,#f3ebfb 0,#fffaf5 28rem);color:var(--ink);
font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",sans-serif;line-height:1.62}
button,input,select{font:inherit}
a{color:inherit}
.shell{width:calc(100% - 24px);max-width:none;margin:auto}
.topbar{
  position:sticky;top:0;z-index:40;background:rgba(57,34,92,.96);color:#fff;
  backdrop-filter:blur(10px);box-shadow:0 4px 18px rgba(35,23,53,.18)
}
.topbar .inner{display:flex;align-items:center;justify-content:space-between;gap:18px;padding:12px 0}
.brand{display:flex;align-items:center;gap:11px;font-weight:950;letter-spacing:.03em}
.brandMark{width:42px;height:42px;flex:0 0 42px;display:grid;place-items:center;border-radius:14px;background:linear-gradient(135deg,var(--rose),var(--purple2));color:#fff;font-size:.88rem;font-weight:950;box-shadow:0 0 0 4px rgba(255,255,255,.08)}
.brandWords{display:block}.brandWords b,.brandWords small{display:block;line-height:1.16}.brandWords b{font-size:.94rem}.brandWords small{margin-top:2px;color:#d9d1e8;font-size:.7rem;font-weight:750;letter-spacing:.08em}
.toptools{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
select{border:0;border-radius:10px;padding:7px 10px;background:#fff;color:#222}
.audio{width:30px;height:30px;border-radius:50%;border:0;background:var(--purple);color:#fff;
display:inline-grid;place-items:center;cursor:pointer;vertical-align:middle;padding:0}
.topbar .audio{background:rgba(255,255,255,.16)}
.audio:hover{transform:scale(1.07)}
.coursehero{padding:54px 0 28px;text-align:center}
.eyebrow{font-weight:950;letter-spacing:.14em;text-transform:uppercase;font-size:.78rem;color:var(--purple)}
h1{font-size:clamp(2.5rem,7vw,5.3rem);line-height:.96;margin:.35rem 0 .8rem;color:var(--purple)}
.lede{max-width:790px;margin:0 auto;font-size:1.08rem;color:#444353}
.pills{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin:18px 0}
.pill{padding:8px 12px;border-radius:999px;background:#fff;border:1px solid var(--line);font-weight:800;font-size:.88rem}

.coursegrid{
  display:flex;gap:0;align-items:stretch;
  height:calc(100vh - 86px);min-height:620px;
  border:1px solid var(--line);border-radius:24px;overflow:hidden;
  background:rgba(255,255,255,.72);box-shadow:var(--shadow);margin-bottom:28px
}
.maincol{
  min-width:480px;flex:1 1 auto;overflow-y:auto;overflow-x:hidden;
  padding:0 18px 28px 0;scrollbar-gutter:stable
}
.splitter{
  flex:0 0 10px;cursor:col-resize;position:relative;background:linear-gradient(90deg,transparent,#eadff0,transparent)
}
.splitter::after{
  content:"";position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);
  width:4px;height:54px;border-radius:999px;background:#bca9ca;box-shadow:0 0 0 1px #fff
}
.toolcol{
  flex:0 0 340px;min-width:250px;max-width:620px;overflow-y:auto;overflow-x:hidden;
  padding:18px;background:linear-gradient(180deg,#faf6fd,#fffaf5);scrollbar-gutter:stable
}
.toolpanel{background:#fff;border:1px solid var(--line);border-radius:20px;padding:16px;box-shadow:var(--shadow);margin-bottom:16px}
.toolpanel h3{margin:.1rem 0 .7rem;color:var(--purple)}
.toolpanel input{width:100%;border:2px solid #ded2e8;border-radius:12px;padding:10px 12px;outline:none}
.results{max-height:320px;overflow:auto;margin-top:8px}
.result{padding:10px;border-radius:12px;border-bottom:1px solid #f0e8f4}
.result:hover{background:#f8f3fb}
.resultrow{display:flex;justify-content:space-between;gap:10px;align-items:center}
.lookupword{cursor:pointer;flex:1}
.lookupword b{font-size:1.18rem;color:var(--purple)}
.packbtn{border:0;border-radius:999px;background:#edf7ef;color:#285b38;padding:7px 10px;font-weight:900;cursor:pointer;white-space:nowrap}
.packlist{display:grid;gap:8px}
.packitem{border:1px solid #e3eada;background:#fbfffc;border-radius:12px;padding:10px}
.packitem .jp{font-size:1.2rem}

.lesson{
  scroll-margin-top:88px;background:rgba(255,255,255,.92);border:1px solid var(--line);
  border-radius:28px;box-shadow:var(--shadow);overflow:hidden;margin-bottom:30px
}
.lessonhead{
  padding:24px 28px;background:linear-gradient(135deg,#563484,#7550ad);color:#fff;
  display:flex;justify-content:space-between;gap:18px;align-items:flex-end;flex-wrap:wrap
}
.lessonhead h2{margin:.2rem 0;font-size:clamp(2rem,5vw,3.6rem);line-height:1}
.lessonhead .jphead{font-size:1.15rem;font-weight:800;opacity:.94}
.lessonbody{padding:24px}

.layout2{display:grid;grid-template-columns:1.08fr .92fr;gap:18px}
.panel{
  border:1px solid var(--line);background:#fff;border-radius:20px;padding:20px;box-shadow:0 8px 22px rgba(40,28,56,.06)
}
.panel h3{margin:.1rem 0 .7rem;color:var(--purple);font-size:1.45rem}
.panel.story{background:linear-gradient(135deg,#fff,#f4effc);border-left:7px solid var(--purple)}
.panel.listen{background:linear-gradient(135deg,#fff,#eef7ff);border-left:7px solid var(--blue)}
.panel.discover{background:linear-gradient(135deg,#fff,#fff7e7);border-left:7px solid var(--gold)}
.panel.explore{background:linear-gradient(135deg,#fff,#fff1f5);border-left:7px solid var(--rose)}
.panel.echo{background:linear-gradient(135deg,#fff,#eaf9f7);border-left:7px solid var(--teal)}
.panel.take{background:linear-gradient(135deg,#fff,#eef9f1);border-left:7px solid var(--green)}
.kicker{font-weight:950;letter-spacing:.1em;text-transform:uppercase;font-size:.73rem;color:var(--purple2)}
.storytext{font-size:1.02rem}
.dialogue{background:#fff;border:1px solid #e9dff0;border-radius:16px;padding:16px;margin:14px 0}
.speaker{font-weight:950;color:var(--purple);margin-bottom:4px}
.jp{font-size:clamp(1.45rem,4vw,2rem);font-weight:900;letter-spacing:.02em}
ruby rt{font-size:.48em;font-weight:650}
.tip{background:#f7f2fb;border:1px solid #e4d7ed;border-radius:14px;padding:12px;margin-top:14px}
.clues,.choices,.words{display:grid;gap:10px}
.clues{display:flex;flex-direction:column;gap:10px}
.clue{background:#fff;border:1px solid #eadff0;border-radius:14px;padding:12px}
.choices{grid-template-columns:repeat(auto-fit,minmax(210px,1fr));margin-top:14px}
.choice{background:#fff;border:2px solid #e3d8e9;border-radius:16px;padding:14px;text-align:left;cursor:pointer;font-weight:760}
.choice:hover{border-color:var(--purple2)}
.choice.selected{border-color:var(--green);background:#f3fbf5}
.commit{display:none;margin-top:12px}
.commit button{width:100%;border:0;border-radius:14px;background:var(--purple);color:#fff;padding:12px 14px;font-weight:950;cursor:pointer}
.feedback{display:none;background:#fff;border:1px solid #dfe9e2;border-radius:14px;padding:14px;margin-top:12px}
.feedback.show{display:block}
.retry{display:none;margin-top:10px}
.retry button{width:100%;border:2px solid #e2d7e9;background:#fff;border-radius:14px;padding:10px;font-weight:850;cursor:pointer}
.words{grid-template-columns:repeat(auto-fit,minmax(180px,1fr))}
.word{background:#fff;border:1px solid #e4dbea;border-radius:15px;padding:13px}
.word .jp{font-size:1.4rem}
.wordtools{display:flex;gap:8px;align-items:center;margin-top:8px;flex-wrap:wrap}
.addsrs{border:0;border-radius:999px;background:#edf7ef;color:#28583a;padding:7px 10px;font-weight:900;cursor:pointer}
.bump{text-align:center;font-weight:950;font-size:clamp(2rem,8vw,4.6rem);color:var(--rose);padding:18px 0;transform:rotate(-2deg)}
.lessonnav{display:grid;grid-template-columns:1fr 1fr 1fr;gap:10px;margin-top:20px}
.lessonnav a,.lessonnav span{border:2px solid #ded5e4;border-radius:13px;padding:10px;text-align:center;text-decoration:none;font-weight:900;background:#fff}
.disabled{opacity:.42}
.reviewbox{margin-top:10px}
.reviewactions{display:flex;gap:10px;margin-top:10px}
.yes,.no{border:0;border-radius:12px;padding:10px 16px;font-weight:900;cursor:pointer}
.yes{background:#e8f6ec;color:#245d38}.no{background:#fdecef;color:#813142}
.small{font-size:.9rem;color:var(--muted)}
.toast{position:fixed;left:50%;bottom:18px;transform:translateX(-50%);background:#27362c;color:#fff;padding:10px 15px;border-radius:999px;
opacity:0;transition:.2s;z-index:60;font-weight:850;pointer-events:none}
.toast.show{opacity:1}
@media(max-width:980px){
  .coursegrid{display:block;height:auto;overflow:visible;border:0;box-shadow:none;background:transparent}
  .maincol{min-width:0;overflow:visible;padding:0}
  .splitter{display:none}
  .toolcol{max-width:none;min-width:0;overflow:visible;padding:0;background:transparent}
  .layout2{grid-template-columns:1fr}
}
@media(max-width:620px){.lessonbody{padding:16px}.lessonhead{padding:20px}.topbar .inner{align-items:flex-start}.lessonnav{grid-template-columns:1fr 1fr 1fr;font-size:.78rem}}

.iconbtn,.audio,.addsrs,.packbtn{
  display:inline-flex;align-items:center;justify-content:center;gap:6px;
  min-height:34px;line-height:1;vertical-align:middle
}
.audio{flex:0 0 30px;min-height:30px}
.addsrs,.packbtn{padding:7px 11px}
.wordtools{display:flex;gap:8px;align-items:center;min-height:36px;margin-top:8px;flex-wrap:wrap}
.resultrow{display:flex;justify-content:space-between;gap:10px;align-items:center;min-height:52px}
.packitem .jp{display:flex;align-items:center;gap:8px}
.packstate{margin-left:auto;display:inline-flex;align-items:center;justify-content:center;gap:4px;
  min-height:30px;padding:5px 9px;border-radius:999px;background:#edf7ef;color:#285b38;font-weight:900}


.choice:focus{outline:none}
.choice:focus-visible{outline:3px solid #9b7fba;outline-offset:2px}


.speakpanel{border-left:7px solid #8a63b8;background:linear-gradient(135deg,#fff,#f4effc)}
.microw{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}
.micbtn{border:0;border-radius:999px;background:var(--purple);color:#fff;padding:9px 14px;font-weight:900;cursor:pointer}
.micbtn.listening{background:#b94d5b}
.micstatus{padding:10px 12px;border-radius:12px;background:#fff;border:1px solid #e7ddef;min-height:44px;flex:1 1 260px}
.transcript{margin-top:10px;padding:12px;border-radius:12px;background:#fff;border:1px solid #e4dbea}


.clue{
  width:100%;
  display:grid;
  grid-template-columns:minmax(180px,220px) 1fr;
  gap:16px;
  align-items:start;
}
.clue strong{display:inline}
@media(max-width:620px){
  .clue{grid-template-columns:1fr;gap:4px}
}


.clue{
  display:block;
  width:100%;
}
.clue strong{
  display:inline;
  margin-left:8px;
}
.clue br{
  display:block;
  content:"";
  margin-top:6px;
}


.packwordlink{
  color:var(--purple);
  text-decoration:none;
  font-weight:950;
}
.packwordlink:hover{text-decoration:underline}
.packwordlink:focus-visible{outline:3px solid #9b7fba;outline-offset:3px;border-radius:4px}


.lookuplink{
  color:var(--purple);
  text-decoration:none;
  font-weight:950;
}
.lookuplink:hover{text-decoration:underline}
.lookuplesson{
  color:var(--purple2);
  text-decoration:none;
  font-weight:800;
}
.lookuplesson:hover{text-decoration:underline}


.flashcard{
  perspective:1000px;
  width:100%;
  min-height:190px;
  cursor:pointer;
  margin-top:8px;
}
.flashcard-inner{
  position:relative;
  width:100%;
  min-height:190px;
  transition:transform .45s ease;
  transform-style:preserve-3d;
}
.flashcard.flipped .flashcard-inner{transform:rotateY(180deg)}
.flashface{
  position:absolute;
  inset:0;
  backface-visibility:hidden;
  -webkit-backface-visibility:hidden;
  border:1px solid #dfd5e7;
  border-radius:16px;
  background:#fff;
  padding:18px;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  text-align:center;
  box-shadow:0 6px 16px rgba(50,35,65,.07);
}
.flashback{transform:rotateY(180deg);background:#fbfff9}
.flashjp{font-size:2rem;font-weight:950;color:var(--purple)}
.flashen{font-size:1.55rem;font-weight:950;color:#2b5c3a}
.flashhint{font-size:.82rem;color:var(--muted);margin-top:12px}
.reviewactions{justify-content:center}


/* Fantasy Adventurer's Pack */
.packpanel{
  position:relative;
  overflow:hidden;
  background:
    linear-gradient(rgba(92,49,20,.04),rgba(92,49,20,.04)),
    #6f3f1f;
  border:3px solid #4c2a16;
  box-shadow:
    inset 0 0 0 2px #9a693b,
    inset 0 0 0 5px #5a321b,
    0 12px 28px rgba(54,31,16,.20);
  color:#2c1b11;
  padding:18px;
}
.packpanel::before{
  content:"";
  position:absolute;inset:8px;
  border:1px dashed rgba(235,190,120,.48);
  border-radius:15px;
  pointer-events:none;
}
.packpanel h3{
  position:relative;
  z-index:1;
  margin:0 0 12px;
  color:#f6dfb4;
  font-family:Georgia,"Times New Roman",serif;
  letter-spacing:.02em;
  text-shadow:0 1px 0 #2f160a;
}
.packsubtitle{
  position:relative;z-index:1;
  color:#f1d3a2;
  font-size:.86rem;
  margin:-4px 0 12px;
}
.packlist,.reviewbox{position:relative;z-index:1}
.packitem{
  position:relative;
  border:1px solid #b88a55;
  background:
    linear-gradient(180deg,#f7e5bd,#edd0a0);
  color:#2b1a11;
  border-radius:14px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.25),0 4px 10px rgba(45,24,10,.16);
}
.packitem .jp{color:#3f2414}
.packwordlink,.lookuplink{color:#713a1f}
.packwordlink:hover,.lookuplink:hover{color:#4d2818}
.packstate{
  background:#e6edc6;
  color:#2e5b2e;
  border:1px solid #aebc86;
}
.removebtn{
  margin-left:auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:30px;height:30px;
  border-radius:9px;
  border:1px solid #c49765;
  background:#f4d6aa;
  color:#8a3427;
  cursor:pointer;
  font-weight:950;
}
.removebtn:hover{background:#efc38c}
.packdivider{
  position:relative;z-index:1;
  border:0;border-top:1px solid rgba(242,210,159,.45);
  margin:14px 0;
}
.reviewdue{
  position:relative;z-index:1;
  margin-top:14px;
  border:2px solid #4a2714;
  background:#5a321b;
  border-radius:15px;
  padding:12px;
  box-shadow:inset 0 0 0 2px #8f5b32;
}
.reviewdue-title{
  color:#f5deb5;
  font-family:Georgia,"Times New Roman",serif;
  font-weight:900;
  margin-bottom:8px;
}
.flashcard{min-height:180px}
.flashface{
  background:linear-gradient(180deg,#f8e6bd,#efd4a6);
  border-color:#b98954;
  color:#2c1a10;
}
.flashback{background:linear-gradient(180deg,#f7e8c9,#ead0a7)}
.flashjp{color:#4b2917}
.flashen{color:#31592f}
.reviewactions{position:relative;z-index:2}
.reviewactions .no{
  background:#f1c2a8;
  color:#7e281c;
  border:1px solid #c77758;
}
.reviewactions .yes{
  background:#cfe0a9;
  color:#315a2d;
  border:1px solid #8da263;
}


/* --- Fancy backpack treatment --- */
.packpanel{
  position:relative;
  overflow:visible;
  padding:34px 18px 22px;
  margin-top:22px;
  background:
    radial-gradient(circle at 16% 14%, rgba(255,220,160,.06), transparent 32%),
    linear-gradient(145deg,#7c4a25 0%,#4f2b16 52%,#6a3a1e 100%);
  border:4px solid #3c2010;
  border-radius:26px;
  box-shadow:
    inset 0 0 0 2px #a5713f,
    inset 0 0 0 6px #5a321b,
    inset 0 -18px 32px rgba(42,21,8,.24),
    0 16px 34px rgba(49,28,15,.28);
}
.packpanel::before{
  content:"";
  position:absolute;
  left:13%;
  right:13%;
  top:-18px;
  height:34px;
  border:7px solid #4d2a15;
  border-bottom:0;
  border-radius:24px 24px 0 0;
  background:linear-gradient(180deg,#8a562e,#5a321b);
  box-shadow:inset 0 0 0 2px #aa7542,0 3px 8px rgba(0,0,0,.18);
}
.packpanel::after{
  content:"";
  position:absolute;
  inset:10px;
  border:1px dashed rgba(245,201,133,.45);
  border-radius:18px;
  pointer-events:none;
}
.packpanel h3{
  position:relative;
  z-index:2;
  margin:0 0 2px;
  padding:12px 14px 10px;
  background:linear-gradient(180deg,#f1d5a2,#dfb873);
  color:#4a2815;
  border:2px solid #b27f43;
  border-radius:16px 16px 10px 10px;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.28),0 5px 12px rgba(42,21,8,.18);
  font-family:Georgia,"Times New Roman",serif;
  font-size:1.35rem;
  letter-spacing:.01em;
  text-shadow:none;
}
.packsubtitle{
  position:relative;
  z-index:2;
  margin:0 8px 14px;
  padding:6px 10px 10px;
  background:linear-gradient(180deg,#e7c58a,#d9ad69);
  color:#5b321a;
  border:2px solid #ae7b40;
  border-top:0;
  border-radius:0 0 12px 12px;
  font-family:Georgia,"Times New Roman",serif;
  font-size:.84rem;
  box-shadow:0 4px 9px rgba(42,21,8,.14);
}
.packlist{position:relative;z-index:2}
.packitem{
  position:relative;
  margin:10px 0;
  border:2px solid #b68147;
  background:
    radial-gradient(circle at 22% 18%,rgba(255,255,255,.18),transparent 28%),
    linear-gradient(180deg,#f4dfb3,#e8c689);
  color:#2a180e;
  border-radius:16px;
  padding:14px;
  box-shadow:
    inset 0 0 0 2px rgba(255,255,255,.22),
    inset 0 -6px 14px rgba(130,76,31,.09),
    0 5px 10px rgba(43,22,10,.18);
}
.packitem::before,
.packitem::after{
  content:"";
  position:absolute;
  top:-12px;
  width:24px;height:22px;
  border:3px solid #5b321b;
  border-top:0;
  background:linear-gradient(180deg,#8b562e,#633719);
  box-shadow:inset 0 0 0 1px #aa7542;
}
.packitem::before{left:18%}
.packitem::after{right:18%}
.packitem .jp{
  display:flex;
  align-items:center;
  gap:8px;
  color:#4a2917;
}
.packstate{
  margin-left:auto;
  background:linear-gradient(180deg,#e8efc7,#d4dda6);
  color:#315a2e;
  border:1px solid #9fae70;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.4);
}
.removebtn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  flex:0 0 30px;
  width:30px;height:30px;
  border-radius:8px;
  border:1px solid #b06f44;
  background:linear-gradient(180deg,#f3d09e,#e8b777);
  color:#91351f;
  cursor:pointer;
  font-weight:950;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}
.removebtn:hover{background:linear-gradient(180deg,#f6d9ad,#edc48c)}

.reviewbox{position:relative;z-index:2}
.reviewdue{
  position:relative;
  z-index:2;
  margin-top:16px;
  padding:14px;
  border:3px solid #3f2110;
  border-radius:18px;
  background:linear-gradient(145deg,#6f4122,#4e2b17);
  box-shadow:
    inset 0 0 0 2px #9a6336,
    0 8px 18px rgba(45,23,10,.22);
}
.reviewdue::before{
  content:"";
  position:absolute;
  left:22%;
  right:22%;
  top:-15px;
  height:22px;
  border:3px solid #3f2110;
  border-bottom:0;
  border-radius:12px 12px 0 0;
  background:linear-gradient(180deg,#83502b,#5c331a);
}
.reviewdue-title{
  position:relative;z-index:2;
  display:inline-block;
  padding:5px 9px;
  border-radius:8px;
  background:#4b2916;
  color:#f6ddb2;
  font-family:Georgia,"Times New Roman",serif;
  font-weight:900;
  box-shadow:inset 0 0 0 1px #8d5a32;
}
.flashcard{
  min-height:190px;
  margin-top:10px;
}
.flashface{
  background:
    radial-gradient(circle at 25% 18%,rgba(255,255,255,.16),transparent 30%),
    linear-gradient(180deg,#f6e2b8,#e9c88e);
  border:2px solid #b77f44;
  color:#2a180e;
  box-shadow:inset 0 0 0 2px rgba(255,255,255,.22);
}
.flashback{
  background:
    radial-gradient(circle at 75% 18%,rgba(255,255,255,.14),transparent 30%),
    linear-gradient(180deg,#f1ddb2,#e3be82);
}
.flashjp{color:#4a2917}
.flashen{color:#31592f}
.reviewactions{
  display:flex;
  justify-content:center;
  gap:10px;
  margin-top:12px;
}
.reviewactions .no{
  background:linear-gradient(180deg,#d78163,#b94f35);
  color:#fff7ef;
  border:2px solid #8f3826;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.2);
}
.reviewactions .yes{
  background:linear-gradient(180deg,#7c9d46,#58752f);
  color:#fff9e8;
  border:2px solid #3f5722;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.18);
}


.storyimage{
  margin:0 0 20px;
  border-radius:22px;
  overflow:hidden;
  border:1px solid #d9cce4;
  box-shadow:0 12px 28px rgba(52,38,67,.14);
  background:#1f1725;
}
.storyimage img{
  display:block;
  width:100%;
  height:auto;
  aspect-ratio:16/9;
  object-fit:cover;
}
.storyimage figcaption{
  padding:9px 14px;
  background:linear-gradient(90deg,#f7f1fb,#fff8f2);
  color:var(--muted);
  font-size:.84rem;
}


/* Furigana progression
   New/less-familiar kanji: normal ruby.
   Familiar words: reading is softly faded.
   Mastered/repeated words: reading can be hidden until hover/focus.
*/
ruby.furi-new rt{
  opacity:1;
  transition:opacity .2s ease;
}
ruby.furi-fading rt{
  opacity:.42;
  transition:opacity .2s ease;
}
ruby.furi-fading:hover rt,
ruby.furi-fading:focus-within rt{
  opacity:1;
}
ruby.furi-hidden rt{
  opacity:0;
  transition:opacity .2s ease;
}
ruby.furi-hidden:hover rt,
ruby.furi-hidden:focus-within rt{
  opacity:.72;
}


.lesson-wheel-wrap{margin:0 auto 28px;background:linear-gradient(180deg,#fff,#faf5fd);border:1px solid var(--line);border-radius:24px;box-shadow:var(--shadow);padding:16px 18px 18px}
.lesson-wheel-head{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:wrap;margin-bottom:12px}
.lesson-wheel-title{display:flex;align-items:center;gap:10px}.lesson-wheel-title h2{margin:0;color:var(--purple);font-size:1.35rem}
.lesson-wheel-tools{display:flex;align-items:center;gap:9px;flex-wrap:wrap}.lesson-jump{display:flex;align-items:center;gap:6px}
.lesson-jump input{width:84px;border:2px solid #dacde5;border-radius:10px;padding:7px 9px;background:#fff}
.wheel-btn,.wheel-go{border:0;border-radius:11px;background:var(--purple);color:#fff;font-weight:900;cursor:pointer;padding:8px 11px}
.wheel-btn{width:38px;height:38px;display:inline-grid;place-items:center;font-size:1.15rem}
.wheel-filter{display:flex;align-items:center;gap:6px;font-size:.88rem;font-weight:800;color:#5a5062}
.lesson-wheel-viewport{overflow:visible;padding:14px 6px 10px}.lesson-wheel-track{display:flex;justify-content:center;align-items:center;gap:16px;min-height:170px}
.wheel-card{width:154px;flex:0 0 154px;position:relative;cursor:pointer;text-align:center;transition:transform .2s ease;transform-origin:center;z-index:1}
.wheel-card:hover,.wheel-card:focus-visible{transform:scale(1.18);z-index:5}.wheel-card.current{transform:scale(1.08);z-index:3}
.wheel-thumb{width:154px;height:92px;border-radius:14px;overflow:hidden;border:3px solid #d7cadf;background:linear-gradient(135deg,#695181,#b69bc8);box-shadow:0 7px 16px rgba(42,28,58,.12)}
.wheel-card.current .wheel-thumb{border-color:var(--gold);box-shadow:0 0 0 3px rgba(232,189,100,.25),0 8px 18px rgba(42,28,58,.15)}
.wheel-thumb img{width:100%;height:100%;object-fit:cover;display:block}.wheel-card.incomplete .wheel-thumb img,.wheel-card.incomplete .wheel-placeholder{filter:grayscale(1)}
.wheel-placeholder{width:100%;height:100%;display:grid;place-items:center;color:#fff;font-weight:950;background:linear-gradient(135deg,#5d4476,#9d7fb4)}
.wheel-number{margin-top:7px;font-weight:950;color:var(--purple);font-size:.9rem}.wheel-name{font-size:.78rem;color:#655d6b;max-height:0;opacity:0;overflow:hidden;transition:.2s}
.wheel-card:hover .wheel-name,.wheel-card:focus-visible .wheel-name,.wheel-card.current .wheel-name{max-height:40px;opacity:1}
.wheel-you{position:absolute;top:-8px;left:50%;transform:translateX(-50%);background:var(--gold);color:#4b3210;border-radius:999px;padding:3px 7px;font-size:.67rem;font-weight:950;white-space:nowrap}
.wheel-empty{width:100%;text-align:center;color:var(--muted);padding:28px 12px}.wheel-status{margin-top:6px;min-height:1.2em;text-align:center;color:var(--muted);font-size:.84rem}
.complete-row{display:flex;justify-content:center;margin:22px 0 8px}.complete-btn{border:2px solid #bda8ca;border-radius:999px;padding:10px 18px;background:#fff;color:var(--purple);font-weight:950;cursor:pointer}
.complete-btn.completed{background:#eef8ef;border-color:#8fb79a;color:#315b3a}.back-wheel{position:fixed;left:18px;bottom:18px;z-index:45;border:0;border-radius:999px;padding:10px 14px;background:rgba(79,46,127,.94);color:#fff;font-weight:900;box-shadow:0 8px 22px rgba(42,28,58,.22);cursor:pointer}


/* Future lesson / under-construction panels */
.future-lesson{
  scroll-margin-top:88px;
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  border-radius:28px;
  box-shadow:var(--shadow);
  overflow:hidden;
  margin-bottom:30px;
}
.future-grid{
  display:grid;
  grid-template-columns:minmax(0,1.25fr) minmax(320px,.75fr);
  gap:20px;
  align-items:stretch;
}
.future-art{
  border-radius:20px;
  overflow:hidden;
  border:1px solid #d9cce4;
  box-shadow:0 10px 24px rgba(52,38,67,.12);
}
.future-art img{
  display:block;
  width:100%;
  height:100%;
  min-height:320px;
  object-fit:cover;
}
.future-copy{
  border:1px solid var(--line);
  border-left:7px solid var(--purple);
  border-radius:20px;
  padding:22px;
  background:linear-gradient(135deg,#fff,#f5effb);
}
.future-copy h3{color:var(--purple);margin:.15rem 0 .7rem;font-size:1.55rem}
.future-copy .jp{font-size:1.7rem}
.future-note{
  margin-top:18px;
  padding:13px 14px;
  border-radius:14px;
  background:#fff;
  border:1px solid #eadff1;
}
@media(max-width:920px){
  .future-grid{grid-template-columns:1fr}
  .future-art img{min-height:220px}
}


.wheel-card{
  padding-top:18px;
}
.wheel-you{
  top:0;
  left:50%;
  transform:translate(-50%,-50%);
  background:linear-gradient(180deg,#f2cd73,#ddb052);
  color:#4b3210;
  border:1px solid #c99737;
  border-radius:999px;
  padding:4px 9px;
  font-size:.64rem;
  line-height:1;
  font-weight:950;
  letter-spacing:.04em;
  box-shadow:0 3px 8px rgba(58,38,12,.16);
  white-space:nowrap;
  z-index:6;
}
.wheel-card:hover .wheel-you,
.wheel-card:focus-visible .wheel-you,
.wheel-card.current .wheel-you{
  transform:translate(-50%,-50%) scale(.92);
}


.wheel-nav-center{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:10px;
  margin:2px auto 4px;
}


/* Compact voice selector above Lesson Wheel */
.voicebar{
  margin:0 auto 10px;
  display:flex;
  justify-content:flex-end;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border:1px solid var(--line);
  border-radius:14px;
  background:rgba(255,255,255,.92);
  box-shadow:0 4px 12px rgba(52,38,67,.06);
}
.voicebar label{
  font-size:.82rem;
  font-weight:900;
  color:var(--purple);
  white-space:nowrap;
}
.voicebar select{
  max-width:260px;
  min-width:180px;
  padding:6px 9px;
  border:1px solid #d8cce1;
  border-radius:9px;
  background:#fff;
  font-size:.82rem;
}
.voice-test{
  border:0;
  border-radius:9px;
  background:var(--purple);
  color:#fff;
  font-weight:900;
  cursor:pointer;
  padding:6px 9px;
}
@media(max-width:650px){
  .voicebar{justify-content:center;flex-wrap:wrap}
  .voicebar select{min-width:0;max-width:65vw}
}


/* Wheel focus behavior: centered lesson grows, current lesson only gets the badge */
.wheel-card.current{
  transform:none;
  z-index:2;
}
.wheel-card.selected{
  transform:scale(1.16);
  z-index:4;
}
.wheel-card.selected .wheel-thumb{
  border-color:var(--purple2);
  box-shadow:0 0 0 3px rgba(114,80,170,.18),0 9px 20px rgba(42,28,58,.16);
}
.wheel-card.current .wheel-thumb{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(232,189,100,.25),0 8px 18px rgba(42,28,58,.15);
}
.wheel-card.current.selected .wheel-thumb{
  border-color:var(--gold);
  box-shadow:0 0 0 3px rgba(232,189,100,.28),0 10px 22px rgba(42,28,58,.18);
}
.wheel-card.selected .wheel-name{
  max-height:40px;
  opacity:1;
}
.wheel-card:hover,
.wheel-card:focus-visible{
  transform:scale(1.16);
  z-index:5;
}
.wheel-card.current:hover,
.wheel-card.current:focus-visible{
  transform:scale(1.16);
}
.wheel-card.selected:hover,
.wheel-card.selected:focus-visible{
  transform:scale(1.20);
}


.lesson-home{position:fixed;left:18px;bottom:66px;z-index:45;border:2px solid #d7cadf;border-radius:999px;padding:10px 14px;background:rgba(255,255,255,.97);color:var(--purple);font-weight:950;box-shadow:0 8px 22px rgba(42,28,58,.16);cursor:pointer}
.lesson-home:hover{transform:translateY(-1px);border-color:var(--purple2)}

/* Roomier SRS review compartment */
.reviewdue{
  padding:16px 12px 20px;
  min-height:330px;
}
.reviewdue-title{
  margin:0 4px 14px;
  line-height:1.3;
}
.flashcard{
  min-height:205px;
  margin-bottom:14px;
}
.flashface{
  padding-top:16px;
  padding-bottom:18px;
}
.flashhint{
  margin-top:12px;
  line-height:1.35;
}
.reviewactions{
  margin-top:16px;
  padding-bottom:2px;
}


.wheel-art-state{
  position:absolute;
  right:5px;
  bottom:31px;
  padding:2px 6px;
  border-radius:999px;
  background:rgba(255,255,255,.92);
  border:1px solid #d8cce1;
  color:#655d6b;
  font-size:.58rem;
  font-weight:900;
  line-height:1.2;
  pointer-events:none;
}

/* v30 cinematic story-room skin */
body{background:#f5f3f8;color:#20253a}
.shell{width:min(1460px,calc(100% - 32px))}
.topbar{background:rgba(22,20,43,.94);box-shadow:0 8px 28px rgba(12,10,28,.28)}
.topbar .inner{min-height:70px}.brand{letter-spacing:.02em}.toptools{color:#d9d5ea}
.coursehero{position:relative;width:100%;min-height:calc(100vh - 70px);padding:0;overflow:hidden;background:#17162b;color:#fff;text-align:left}
.coursehero>img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:center 38%;filter:saturate(.92) contrast(1.04);transform:scale(1.01)}
.heroShade{position:absolute;inset:0;background:linear-gradient(90deg,rgba(13,12,30,.94) 0%,rgba(20,16,39,.72) 37%,rgba(17,15,34,.13) 72%),linear-gradient(0deg,rgba(10,9,24,.72),transparent 38%)}
.heroContent{position:relative;z-index:2;display:flex;min-height:calc(100vh - 70px);max-width:820px;flex-direction:column;justify-content:center;padding:clamp(52px,8vw,110px) clamp(24px,7vw,110px)}
.heroTags{display:flex;gap:8px;margin-bottom:38px}.heroTags span{padding:7px 11px;border:1px solid rgba(255,255,255,.25);border-radius:999px;font-size:.66rem;font-weight:950;letter-spacing:.14em}.heroTags span:first-child{background:var(--rose);border-color:var(--rose)}
.coursehero .eyebrow{color:#d7c4ff}.coursehero h1{margin:.12em 0 .08em;color:#fff;font-size:clamp(4rem,8.5vw,8rem);line-height:.82;letter-spacing:-.065em;text-shadow:0 8px 34px rgba(0,0,0,.32)}
.heroJapanese{margin:18px 0 10px;color:#f4ce78;font-size:clamp(1.15rem,2vw,1.65rem);font-weight:850}.coursehero .lede{max-width:650px;margin:0;color:#e7e5ef;font-size:clamp(.98rem,1.5vw,1.15rem)}
.heroStart{display:inline-flex;align-items:center;align-self:flex-start;gap:18px;margin-top:25px;padding:13px 16px 13px 21px;border:0;border-radius:999px;background:#fff;color:#201c38;text-decoration:none;font-weight:950;box-shadow:0 12px 32px rgba(0,0,0,.25);cursor:pointer}.heroStart b{width:33px;height:33px;display:grid;place-items:center;border-radius:50%;background:var(--rose);color:#fff}
.heroPromise{position:absolute;z-index:2;right:clamp(22px,5vw,72px);bottom:25px;display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}.heroPromise span{padding:7px 10px;border-radius:999px;background:rgba(19,17,38,.74);border:1px solid rgba(255,255,255,.18);font-size:.72rem;font-weight:850;backdrop-filter:blur(8px)}
.voicebar{margin-top:16px;background:#fff}.lesson-wheel-wrap{position:relative;top:auto;z-index:2;margin-bottom:18px;padding:14px 18px 16px;border-radius:20px;background:rgba(255,255,255,.96);backdrop-filter:blur(12px)}
.lesson-wheel-head{margin-bottom:7px}.lesson-wheel-title h2{color:#28203f}.journey-rule{display:flex;gap:8px;flex-wrap:wrap}.journey-rule span{padding:6px 9px;border-radius:999px;background:#f1edf6;color:#5f5570;font-size:.72rem;font-weight:850}
.lesson-wheel-viewport{overflow-x:auto;overflow-y:visible;padding:8px 5px 4px}.lesson-wheel-track{justify-content:flex-start;min-height:112px;gap:10px}.wheel-card{width:145px;flex-basis:145px;padding-top:10px;text-align:left}.wheel-thumb{width:145px;height:70px;border-radius:14px}.wheel-number{margin:6px 4px 0}.wheel-name{max-height:32px;opacity:1;margin:0 4px;white-space:nowrap;text-overflow:ellipsis}.wheel-you{top:3px;left:auto;right:5px;transform:none}.wheel-card:hover .wheel-you,.wheel-card:focus-visible .wheel-you,.wheel-card.current .wheel-you{transform:none}.wheel-card.selected,.wheel-card:hover,.wheel-card:focus-visible,.wheel-card.current:hover,.wheel-card.current:focus-visible,.wheel-card.selected:hover,.wheel-card.selected:focus-visible{transform:translateY(-3px)}
.wheel-card.locked-journey{cursor:not-allowed;opacity:.62}.wheel-card.locked-journey .wheel-thumb{filter:grayscale(1) brightness(.58)}.wheel-card.locked-journey .wheel-name{filter:blur(4px);user-select:none}.wheel-card.locked-journey:hover{transform:none}.wheel-lock{position:absolute;top:32px;left:61px;z-index:5;width:30px;height:30px;display:grid;place-items:center;border-radius:50%;background:rgba(20,18,38,.86);color:#fff;font-size:.8rem}
.wheel-nav-center{display:none}.wheel-status{text-align:left;margin:5px 4px 0}.coursegrid{height:auto;min-height:650px;margin-top:0;border-radius:25px}.maincol{overflow:visible;min-width:0;padding:18px}.lesson{display:none;margin:0}.lesson.lesson-active{display:block;animation:lessonReveal .28s ease}.lessonhead{background:linear-gradient(135deg,#27203f,#5e3e83);padding:30px clamp(22px,4vw,44px)}.lessonhead h2{font-size:clamp(2.6rem,6vw,5rem)}
@keyframes lessonReveal{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.complete-btn:disabled{cursor:default;opacity:.88}.lessonnav a[data-locked="true"]{pointer-events:none;opacity:.38}.back-wheel{display:none}
@media(max-width:980px){.lesson-wheel-wrap{top:70px}.coursegrid{margin-top:0}.toolcol{padding:16px}.heroContent{min-height:72vh}.coursehero{min-height:72vh}.coursehero>img{object-position:62% center}.heroShade{background:linear-gradient(90deg,rgba(13,12,30,.91),rgba(17,15,34,.35)),linear-gradient(0deg,rgba(10,9,24,.65),transparent 45%)}}
@media(max-width:650px){.shell{width:calc(100% - 20px)}.toptools{display:none}.coursehero h1{font-size:4.15rem}.heroContent{min-height:78vh;padding:45px 20px 82px}.coursehero{min-height:78vh}.heroPromise{left:18px;right:18px;justify-content:flex-start}.heroPromise span:nth-child(n+3){display:none}.lesson-wheel-wrap{top:68px;margin-top:10px;padding:12px}.journey-rule span:last-child{display:none}.wheel-card{width:130px;flex-basis:130px}.wheel-thumb{width:130px}.maincol{padding:10px}.lessonbody{padding:17px}}

/* Static course frame: Korean-course clarity, Japanese-world identity */
.coursegrid{
  display:grid;
  grid-template-columns:minmax(0,1fr) 360px;
  gap:18px;
  align-items:start;
  height:auto;
  min-height:650px;
  overflow:visible;
  border:0;
  background:transparent;
  box-shadow:none;
}
.maincol{min-width:0;overflow:visible;padding:0}
.toolcol{
  position:sticky;
  top:94px;
  width:auto;
  min-width:0;
  max-width:none;
  overflow:visible;
  padding:0;
  background:transparent;
}
.toolpanel{
  margin:0 0 16px;
  padding:18px;
  overflow:hidden;
  border:1px solid #e1dce9;
  border-radius:26px;
  background:#fff;
  box-shadow:0 14px 34px rgba(35,31,58,.09);
}
.toolpanel h3{margin:.15rem 0 .7rem;color:#20253a;font-size:1.16rem}
.bubbleLabel{color:#8a7eaa;font-size:.68rem;font-weight:950;letter-spacing:.15em}
.lookupBubble input{border:0;background:#f2f7f7}
.packpanel,.reviewdue{
  overflow:hidden;
  margin:0 0 16px;
  padding:18px;
  border:1px solid #e1dce9;
  border-radius:26px;
  background:#fff;
  color:var(--ink);
  box-shadow:0 14px 34px rgba(35,31,58,.09);
}
.packpanel::before,.packpanel::after,.reviewdue::before{display:none}
.packpanel h3{
  margin:.15rem 0 .25rem;
  padding:0;
  border:0;
  border-radius:0;
  background:transparent;
  color:#20253a;
  box-shadow:none;
  font-family:inherit;
  font-size:1.16rem;
}
.packsubtitle{margin:0 0 12px;padding:0;border:0;background:transparent;color:var(--muted);box-shadow:none;font-family:inherit}
.packitem{
  margin:9px 0;
  padding:13px;
  border:0;
  border-radius:15px;
  background:#eff8f7;
  color:var(--ink);
  box-shadow:none;
}
.packitem::before,.packitem::after{display:none}
.packitem .jp,.packwordlink,.lookuplink{color:#202b43}
.packstate{background:#e9efff;color:#263457;border:0;box-shadow:none}
.reviewdue{min-height:330px;background:#f7f4fb}
.reviewdue-title{background:transparent;color:var(--purple);box-shadow:none;font-family:inherit}
.flashface{background:#fff;border:1px solid #ddd6e8;color:var(--ink);box-shadow:0 7px 18px rgba(42,32,61,.06)}
.flashback{background:#f3faf6}.flashjp{color:var(--purple)}.flashen{color:#31592f}
.fieldnote{
  display:grid;
  grid-template-columns:minmax(240px,1fr) minmax(230px,.65fr);
  align-items:stretch;
  margin:18px 0;
  overflow:hidden;
  border:1px solid #d9cce4;
  border-radius:22px;
  background:#211c32;
  box-shadow:0 12px 28px rgba(52,38,67,.14);
}
.fieldnote img{display:block;width:100%;height:100%;min-height:260px;object-fit:cover}
.fieldnote figcaption{display:flex;flex-direction:column;justify-content:center;gap:8px;padding:24px;color:#e8e3f2}
.fieldnote figcaption b{color:#f2cd73;font-size:1.08rem}.fieldnote figcaption span{color:#d8d1e4}
.episode-cliffhanger{
  position:relative;
  overflow:hidden;
  margin-top:22px;
  padding:clamp(25px,4vw,42px);
  border:1px solid #504466;
  border-left:6px solid var(--gold);
  border-radius:20px;
  background:radial-gradient(circle at 88% 18%,rgba(114,80,170,.35),transparent 34%),linear-gradient(145deg,#171526,#2b2140);
  color:#e9e5f0;
  box-shadow:0 16px 38px rgba(25,19,39,.2);
}
.episode-cliffhanger::after{content:"";position:absolute;right:-55px;bottom:-70px;width:190px;height:190px;border:1px solid rgba(242,205,115,.17);border-radius:50%;box-shadow:0 0 0 25px rgba(242,205,115,.035);pointer-events:none}
.cliff-tag{display:inline-block;margin-bottom:14px;padding:6px 10px;border-radius:999px;background:var(--gold);color:#392714;font-size:.67rem;font-weight:950;letter-spacing:.14em}
.episode-cliffhanger p{position:relative;z-index:1;margin:.55em 0;color:#d8d2e2}.episode-cliffhanger blockquote{position:relative;z-index:1;margin:15px 0;padding:12px 16px;border-left:3px solid var(--rose);background:rgba(255,255,255,.06);color:#fff;font-size:1.35rem;font-weight:900}
.episode-cliffhanger h2{position:relative;z-index:1;max-width:850px;margin:20px 0;color:#fff;font-size:clamp(1.65rem,3.5vw,2.75rem);line-height:1.08}
.continue-line{position:relative;z-index:1;display:flex;align-items:center;gap:13px;margin-top:24px;color:#f2cd73;font-size:.7rem;font-weight:950;letter-spacing:.18em}.continue-line i{height:1px;flex:1;background:linear-gradient(90deg,rgba(242,205,115,.75),transparent)}
.backupActions{display:grid;gap:9px;margin-top:12px}
.backupActions button,.backupActions label{
  display:block;
  width:100%;
  padding:10px 12px;
  border:0;
  border-radius:12px;
  background:#2c2747;
  color:#fff;
  text-align:center;
  font-weight:900;
  cursor:pointer;
}
.backupActions label{background:#f0ecf7;color:var(--purple)}
.backupActions input{display:none}.backupStatus{min-height:1.4em;margin-top:9px;color:#39714b;font-size:.8rem}.backupStatus.backupError{color:#a23c4d}
@media(max-width:980px){
  .coursegrid{grid-template-columns:1fr}
  .toolcol{position:static;padding:0}
}
@media(max-width:650px){.fieldnote{grid-template-columns:1fr}.fieldnote img{min-height:0}}
