
:root{
  --ink:#222522;
  --muted:#6f7874;
  --line:#e2e6e3;
  --jp:#214f77;
  --jp-soft:#f2f6f9;
  --staff:#4e6d64;
  --paper:#fcfcfb;
  --footer:#292a25;
  --serif:"Noto Serif TC","Songti TC","PMingLiU",serif;
  --sans:"Noto Sans TC","PingFang TC","Microsoft JhengHei",sans-serif;
  --jpfont:"Yu Mincho","Hiragino Mincho ProN","Noto Serif JP","Yu Gothic","Meiryo",serif;
  --max:1100px;
}
*{box-sizing:border-box}
html{font-family:var(--sans);color:var(--ink);background:#fff;overflow-x:hidden}
body{margin:0;background:#fff;line-height:1.75;overflow-x:clip}
a{color:inherit}
button{font:inherit}
.shell{width:min(var(--max),calc(100% - 72px));margin-inline:auto}

/* quiet site header */
.site-head{border-bottom:1px solid var(--line);background:#fff}
.head-in{min-height:68px;display:flex;align-items:center;gap:24px}
.brand{display:flex;align-items:center;gap:10px;text-decoration:none}
.mark{width:35px;height:35px;display:grid;place-items:center;border:1px solid var(--ink);font-family:var(--serif);font-size:18px}
.brand-copy strong{display:block;font-family:var(--serif);font-size:15px;line-height:1.2}
.brand-copy small{display:block;margin-top:3px;color:var(--muted);font-size:9px}
.nav{margin-left:auto;display:flex;gap:24px}
.nav a{position:relative;text-decoration:none;font-size:11px;font-weight:800;color:#58615d;padding:7px 0}
.nav .jp{color:var(--jp)}
.nav a[aria-current="page"]::after{content:"";position:absolute;left:0;right:0;bottom:0;height:1px;background:currentColor}

/* lesson masthead: not a hero */
.lesson-head{padding:42px 0 30px;border-bottom:1px solid var(--line)}
.lesson-head__grid{display:grid;grid-template-columns:150px minmax(0,1fr);gap:26px}
.lesson-head__meta{padding-top:7px;color:var(--jp);font-size:9px;font-weight:850;letter-spacing:.08em}
.lesson-head__meta span{display:block}
.lesson-head__meta small{display:block;margin-top:8px;color:#89928e;font-weight:500;letter-spacing:0}
.lesson-head h1{margin:0;font-family:var(--serif);font-size:42px;line-height:1.2;font-weight:650;letter-spacing:-.015em}
.lesson-head p{max-width:42em;margin:10px 0 0;color:#59645f;font-size:12.5px}
.lesson-objective{
  grid-column:2;margin-top:18px;padding:13px 0;border-top:1px solid var(--line);
  display:flex;flex-wrap:wrap;gap:7px 20px;color:#65706b;font-size:10px
}
.lesson-objective strong{color:var(--ink);font-weight:750}

/* compact teaching controls */
.lesson-tools{border-bottom:1px solid var(--line);background:var(--paper)}
.lesson-tools__in{min-height:54px;display:flex;align-items:center;gap:24px;flex-wrap:wrap}
.tool-set{display:flex;align-items:center;gap:8px}
.tool-set>span{color:#858e8a;font-size:9px;white-space:nowrap}
.tool-set button{
  border:0;background:transparent;padding:6px 7px;color:#65706b;font-size:9.5px;cursor:pointer
}
.tool-set button[aria-pressed="true"]{color:var(--jp);font-weight:850;text-decoration:underline;text-underline-offset:4px}
.listen-all{
  margin-left:auto;border:0;background:var(--jp);color:#fff;padding:8px 12px;
  font-size:9.5px;font-weight:800;cursor:pointer
}
.audio-status{flex-basis:100%;margin:-12px 0 6px;color:#929a96;font-size:8.5px}

/* lesson document */
.lesson-sheet{width:min(900px,calc(100% - 72px));margin:0 auto;padding:48px 0 0}
.lesson-section{margin-top:66px}
.lesson-section:first-child{margin-top:0}
.lesson-section__head{display:grid;grid-template-columns:110px minmax(0,1fr);gap:22px;padding-bottom:12px;border-bottom:1px solid var(--ink)}
.lesson-section__label{margin:4px 0 0;color:var(--jp);font-size:9px;font-weight:850}
.lesson-section__head h2{margin:0;font-family:var(--serif);font-size:25px;line-height:1.35;font-weight:650}
.lesson-section__head p{grid-column:2;margin:5px 0 0;color:var(--muted);font-size:11px}

/* conversation as workbook timeline */
.conversation{position:relative;padding-left:0}
.scene-chapter{position:relative;display:grid;grid-template-columns:110px minmax(0,1fr);gap:22px;padding-top:30px}
.scene-chapter::before{
  content:"";position:absolute;left:109px;top:0;bottom:0;width:1px;background:var(--line)
}
.scene-chapter__head{grid-column:1;position:relative;padding-right:20px;text-align:right}
.scene-dot{
  position:absolute;right:-27px;top:8px;width:9px;height:9px;border-radius:50%;
  background:#fff;border:2px solid var(--jp);z-index:2
}
.scene-chapter__head h3{margin:0;font-family:var(--serif);font-size:14px;font-weight:700}
.scene-chapter__head p{margin:4px 0 0;color:#8a938f;font-size:9px;line-height:1.55}
.scene-lines{grid-column:2;padding-bottom:10px}
.lesson-line{
  display:grid;grid-template-columns:52px minmax(0,1fr) 36px;gap:12px;
  align-items:start;padding:17px 0;border-bottom:1px solid var(--line)
}
.lesson-line__role{
  padding-top:4px;color:var(--jp);font-size:8.5px;font-weight:900;letter-spacing:.06em
}
.lesson-line--staff .lesson-line__role{color:var(--staff)}
.lesson-line__body{min-width:0;position:relative}
.japanese{margin:0;font-family:var(--jpfont);font-size:18px;line-height:2;font-weight:500;overflow-wrap:anywhere}
.japanese rt{font-family:var(--sans);font-size:.48em;color:#77817c}
.translation{margin-top:4px;line-height:1.65}
.translation--zh{font-size:10.8px;color:#58635e}
.translation--en{font-size:9.5px;color:#8b9490}
.lesson-sheet[data-translation="zh"] .translation--en{display:none}
.lesson-sheet[data-translation="en"] .translation--zh{display:none}
.lesson-sheet[data-translation="all"] .translation{display:block}
.line-audio{
  width:32px;height:32px;border:1px solid #d7e0e5;border-radius:50%;
  background:#fff;color:var(--jp);display:grid;place-items:center;cursor:pointer;font-size:8px
}
.line-audio[aria-pressed="true"]{background:var(--jp);color:#fff;border-color:var(--jp)}
.reveal-line{display:none}

/* role practice */
.lesson-sheet[data-practice-role="customer"] .lesson-line--customer:not(.is-revealed) .japanese,
.lesson-sheet[data-practice-role="customer"] .lesson-line--customer:not(.is-revealed) .translation,
.lesson-sheet[data-practice-role="staff"] .lesson-line--staff:not(.is-revealed) .japanese,
.lesson-sheet[data-practice-role="staff"] .lesson-line--staff:not(.is-revealed) .translation{
  visibility:hidden
}
.lesson-sheet[data-practice-role="customer"] .lesson-line--customer:not(.is-revealed) .lesson-line__body::before,
.lesson-sheet[data-practice-role="staff"] .lesson-line--staff:not(.is-revealed) .lesson-line__body::before{
  content:"先自己說這一句";position:absolute;left:0;top:2px;color:#9aa39f;font-size:10px
}
.lesson-sheet[data-practice-role="customer"] .lesson-line--customer .reveal-line,
.lesson-sheet[data-practice-role="staff"] .lesson-line--staff .reveal-line{
  display:inline-block;position:absolute;left:0;bottom:0;border:0;background:#fff;color:var(--jp);
  padding:2px 0;font-size:8.5px;font-weight:800;cursor:pointer
}
.lesson-line.is-revealed .japanese,.lesson-line.is-revealed .translation{visibility:visible!important}
.lesson-line.is-revealed .lesson-line__body::before{display:none}

/* sentence swaps */
.swap-list{border-bottom:1px solid var(--line)}
.swap-row{
  display:grid;grid-template-columns:120px minmax(0,1fr) 36px;gap:20px;
  align-items:start;padding:19px 0;border-top:1px solid var(--line)
}
.swap-row:first-child{border-top:0}
.swap-row__label{padding-top:4px;color:var(--jp);font-size:9px;font-weight:850}
.swap-row .japanese{font-size:17px}

/* field notes */
.field-notes{border-bottom:1px solid var(--line)}
.field-note{
  display:grid;grid-template-columns:60px minmax(0,1fr);gap:24px;
  padding:24px 0;border-top:1px solid var(--line)
}
.field-note:first-child{border-top:0}
.field-note__index{font-family:Georgia,serif;color:#a1aaa5;font-size:10px}
.field-note__body h3{margin:0;font-family:var(--serif);font-size:17px;line-height:1.5;font-weight:650}
.field-note__body p{margin:8px 0 0;color:#59645f;font-size:11px;line-height:1.85}
.japanese--inline{font-family:var(--jpfont);color:var(--ink);font-weight:600}
.japanese--inline rt{font-size:.6em}

/* source + continue */
.lesson-source{margin-top:56px;padding-top:16px;border-top:1px solid var(--ink)}
.lesson-source h2{margin:0;font-family:var(--serif);font-size:16px;font-weight:650}
.lesson-source p{margin:6px 0 0;color:#7e8783;font-size:9px}
.lesson-source ul{list-style:none;margin:10px 0 0;padding:0;display:flex;flex-wrap:wrap;gap:5px 18px}
.lesson-source li{font-size:9px}
.lesson-source a{color:var(--jp);text-decoration:none;border-bottom:1px solid #ccdbe5}
.next-study{margin-top:46px;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.next-study__label{padding:10px 0;color:#8a938f;font-size:8.5px}
.next-study__links{display:grid;grid-template-columns:repeat(4,1fr)}
.next-study a{display:flex;justify-content:space-between;gap:10px;padding:13px 15px;border-left:1px solid var(--line);font-family:var(--serif);font-size:11px;text-decoration:none}
.next-study a:first-child{border-left:0}
.next-study a:hover{color:var(--jp)}

.footer{margin-top:58px;background:var(--footer);color:#f2f2ed;padding:32px 0 38px}
.footer-in{display:flex;justify-content:space-between;gap:28px}
.footer-links{display:flex;flex-wrap:wrap;gap:9px 17px}
.footer a{color:inherit;font-size:10px;text-decoration:none}
.footer p{margin:0;color:#b9bbb4;font-size:10px}

/* Tablet */
@media(max-width:900px){
  .shell{width:calc(100% - 48px)}
  .lesson-head__grid{grid-template-columns:120px minmax(0,1fr)}
  .lesson-head h1{font-size:38px}
  .lesson-sheet{width:calc(100% - 48px)}
  .lesson-section__head{grid-template-columns:90px minmax(0,1fr)}
  .scene-chapter{grid-template-columns:90px minmax(0,1fr)}
  .scene-chapter::before{left:89px}
  .scene-dot{right:-27px}
  .swap-row{grid-template-columns:105px minmax(0,1fr) 36px}
}

/* Mobile */
@media(max-width:720px){
  .shell{width:calc(100% - 28px)}
  .head-in{min-height:auto;display:grid;grid-template-columns:1fr;padding:11px 0 0;gap:8px}
  .brand-copy strong{font-size:14px}
  .brand-copy small{font-size:8px}
  .nav{
    width:calc(100% + 28px);margin-left:-14px;display:grid;grid-template-columns:repeat(4,1fr);
    gap:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)
  }
  .nav a{min-height:46px;display:flex;align-items:center;justify-content:center;border-right:1px solid var(--line);font-size:10px;padding:0 4px}
  .nav a:last-child{border-right:0}
  .nav a[aria-current="page"]{background:rgba(33,79,119,.05)}
  .nav a[aria-current="page"]::after{left:10px;right:10px;height:2px}

  .lesson-head{padding:28px 0 23px}
  .lesson-head__grid{display:block}
  .lesson-head__meta{padding:0;margin-bottom:9px}
  .lesson-head__meta span,.lesson-head__meta small{display:inline}
  .lesson-head__meta small::before{content:" · "}
  .lesson-head h1{font-size:31px}
  .lesson-head p{font-size:11.5px;line-height:1.7}
  .lesson-objective{grid-column:auto;margin-top:14px;padding-top:10px;gap:3px 13px;font-size:9px}

  .lesson-tools__in{padding:10px 0;display:grid;grid-template-columns:1fr;gap:8px}
  .tool-set{justify-content:space-between}
  .tool-set>span{min-width:46px}
  .listen-all{margin-left:0;justify-self:start}
  .audio-status{margin:0;padding-bottom:2px}

  .lesson-sheet{width:calc(100% - 28px);padding-top:31px}
  .lesson-section{margin-top:48px}
  .lesson-section__head{display:block;padding-bottom:9px}
  .lesson-section__label{margin:0 0 3px;font-size:8px}
  .lesson-section__head h2{font-size:21px}
  .lesson-section__head p{margin-top:3px;font-size:10px}

  .scene-chapter{display:block;padding-top:23px}
  .scene-chapter::before{display:none}
  .scene-chapter__head{text-align:left;padding:0 0 9px;border-bottom:1px solid #edf0ee}
  .scene-dot{display:none}
  .scene-chapter__head h3{font-size:13.5px}
  .scene-chapter__head p{font-size:8.7px}
  .scene-lines{padding:0}

  .lesson-line{grid-template-columns:39px minmax(0,1fr) 32px;gap:8px;padding:15px 0}
  .lesson-line__role{font-size:8px}
  .japanese{font-size:16px;line-height:2}
  .translation--zh{font-size:10px}
  .translation--en{font-size:9px}
  .line-audio{width:30px;height:30px}

  .swap-row{grid-template-columns:minmax(0,1fr) 32px;gap:6px 8px;padding:16px 0}
  .swap-row__label{grid-column:1/-1;padding:0;font-size:8px}
  .swap-row__body{grid-column:1}
  .swap-row .line-audio{grid-column:2;grid-row:2}
  .swap-row .japanese{font-size:15.5px}

  .field-note{grid-template-columns:34px minmax(0,1fr);gap:12px;padding:20px 0}
  .field-note__body h3{font-size:15px}
  .field-note__body p{font-size:10.3px;line-height:1.8}

  .lesson-source{margin-top:44px}
  .lesson-source ul{display:block}
  .lesson-source li+li{margin-top:5px}
  .next-study{margin-top:38px}
  .next-study__links{grid-template-columns:1fr 1fr}
  .next-study a{border-top:1px solid var(--line);font-size:10.5px}
  .next-study a:nth-child(odd){border-left:0}

  .footer{margin-top:44px;padding:27px 0 31px}
  .footer-in{display:block}
  .footer p{margin-top:9px}
}
@media(max-width:390px){
  .shell,.lesson-sheet{width:calc(100% - 24px)}
  .nav{width:calc(100% + 24px);margin-left:-12px}
  .lesson-head h1{font-size:29px}
  .lesson-line{grid-template-columns:36px minmax(0,1fr) 30px;gap:7px}
  .japanese{font-size:15.5px}
  .line-audio{width:28px;height:28px}
}


/* V3 — confirmed Japanese-area 木 */
.brand{display:flex;align-items:center;gap:10px;text-decoration:none;flex:0 0 auto}
.mark-wrap{position:relative;width:42px;height:42px;display:grid;place-items:start;flex:0 0 42px}
.mark-shadow{position:absolute;z-index:0;left:0;top:0;width:36px;height:36px;display:grid;grid-template-rows:repeat(4,1fr);overflow:hidden;opacity:0;transform:translate(0,0);pointer-events:none;transition:transform .18s ease,opacity .18s ease}
.mark-shadow i{display:block}
.mark-shadow i:nth-child(1){background:rgba(33,79,119,.16)}
.mark-shadow i:nth-child(2){background:rgba(47,119,108,.16)}
.mark-shadow i:nth-child(3){background:rgba(178,123,0,.16)}
.mark-shadow i:nth-child(4){background:rgba(52,59,58,.14)}
.mark{position:relative;z-index:1;width:36px;height:36px;display:grid;place-items:center;border:1px solid var(--ink);font-family:var(--serif);font-size:19px;line-height:1;font-weight:400;background:#fff;color:var(--ink);transition:transform .18s ease,border-color .18s ease,box-shadow .18s ease}
.brand:hover .mark{transform:translate(-2px,-2px);background:#fff;border-color:#111;box-shadow:0 4px 12px rgba(36,36,31,.05)}
.brand:hover .mark-shadow{opacity:1;transform:translate(5px,5px)}
.brand:active .mark{transform:translate(-1px,-1px)}
.brand:active .mark-shadow{opacity:1;transform:translate(4px,4px)}
.brand:focus-visible{outline:2px solid #6c7b75;outline-offset:5px}
.brand:focus-visible .mark{transform:translate(-2px,-2px);background:#fff;border-color:#111}
.brand:focus-visible .mark-shadow{opacity:1;transform:translate(5px,5px)}
.nav .nav-japanese{color:var(--jp)}
.nav .nav-learning{color:var(--learn,#2f776c)}
.nav .nav-travel{color:var(--travel,#b27b00)}
.nav .nav-tools{color:var(--tool,#343b3a)}

/* Role voices */
.lesson-tools__in{display:grid;grid-template-columns:auto auto minmax(320px,1fr) auto;gap:12px 22px;padding:10px 0}
.voice-controls{display:flex;align-items:center;gap:12px;min-width:0}
.voice-setting{display:flex;align-items:center;gap:7px;min-width:0}
.voice-setting span{color:#858e8a;font-size:9px;font-weight:750;white-space:nowrap}
.voice-setting select{height:30px;min-width:150px;max-width:205px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--ink);padding:2px 20px 2px 4px;font-size:9px;outline:none}
.voice-setting select:focus-visible{border-color:var(--jp);box-shadow:0 1px var(--jp)}
.audio-status{grid-column:1/-1;margin:-5px 0 0;color:#929a96;font-size:8.5px}
.listen-all{margin-left:0;justify-self:end}

/* Source removed: continue-learning should not inherit extra gap */
.next-study{margin-top:54px}

/* Desktop: protect readable line lengths */
@media(min-width:1100px){
  .lesson-sheet{width:min(900px,calc(100% - 120px))}
  .lesson-line__body{max-width:650px}
}

@media(max-width:1000px){
  .lesson-tools__in{grid-template-columns:1fr 1fr;gap:9px 18px}
  .voice-controls{grid-column:1/-1;justify-content:flex-start}
  .listen-all{justify-self:start}
  .audio-status{grid-column:1/-1;margin:0}
}

@media(max-width:720px){
  .lesson-tools__in{grid-template-columns:1fr;gap:7px;padding:10px 0 11px}
  .voice-controls{display:grid;grid-template-columns:1fr;gap:5px;width:100%}
  .voice-setting{display:grid;grid-template-columns:78px minmax(0,1fr);gap:6px}
  .voice-setting select{width:100%;max-width:none;min-width:0;height:32px;font-size:9.5px}
  .listen-all{justify-self:start}
  .audio-status{margin:0;white-space:normal;line-height:1.55}
  .lesson-objective span{white-space:normal}
  .japanese{overflow-wrap:anywhere;word-break:normal}
  .field-note__body p{overflow-wrap:anywhere}
  .next-study{margin-top:42px}
}

@media(max-width:390px){
  .voice-setting{grid-template-columns:72px minmax(0,1fr)}
  .tool-set{gap:5px}
  .tool-set button{padding-inline:5px}
}


/* V3 responsive line-break correction */
.lesson-section__label{grid-column:1}
.lesson-section__head h2{grid-column:2}
.lesson-section__head p:not(.lesson-section__label){grid-column:2}
@media(max-width:720px){
  .lesson-section__label,.lesson-section__head h2,.lesson-section__head p:not(.lesson-section__label){grid-column:auto}
}


/* V4 — role voice selectors, no gender binding */
.voice-controls{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}
.voice-setting span{
  min-width:auto;
}
.stop-audio{
  min-height:32px;
  border:1px solid var(--line);
  background:#fff;
  color:#59645f;
  padding:7px 11px;
  font-size:9.5px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.stop-audio:hover:not(:disabled){
  border-color:var(--jp);
  color:var(--jp);
}
.stop-audio:disabled{
  opacity:.38;
  cursor:default;
}
.listen-all{
  white-space:nowrap;
}

/* keep play and stop together on large screens */
@media(min-width:1001px){
  .lesson-tools__in{
    grid-template-columns:auto auto minmax(300px,1fr) auto auto;
  }
}

@media(max-width:1000px){
  .voice-controls{
    grid-column:1/-1;
  }
  .listen-all,
  .stop-audio{
    justify-self:start;
  }
}

@media(max-width:720px){
  .voice-controls{
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
  }
  .voice-setting{
    display:grid;
    grid-template-columns:72px minmax(0,1fr);
    gap:7px;
  }
  .voice-setting span{
    align-self:center;
  }
  .listen-all,
  .stop-audio{
    width:auto;
    min-height:34px;
  }
}


/* V5 — confirmed Japanese 木 */
.mark-wrap,.mark-shadow{display:none!important}
.site-mark{
  width:40px;
  height:40px;
  display:grid;
  place-items:center;
  position:relative;
  color:#fff;
  font:700 22px/1 var(--serif);
  flex:0 0 auto;
  transition:transform .22s ease,box-shadow .22s ease,background .22s ease;
}
.mark-jp{
  background:linear-gradient(145deg,#2f73a8,#245d8c);
  border:1px solid #174b74;
  box-shadow:4px 4px 0 #d9e8f3,0 5px 14px rgba(25,74,111,.13),inset 0 1px 0 rgba(255,255,255,.24);
}
.jp-brand:hover .site-mark{
  transform:translate(-1px,-2px);
}
.jp-brand:hover .mark-jp{
  box-shadow:6px 6px 0 #d9e8f3,0 9px 18px rgba(25,74,111,.17),inset 0 1px 0 rgba(255,255,255,.3);
}
.jp-brand:focus-visible{
  outline:3px solid rgba(33,79,119,.18);
  outline-offset:5px;
}

/* V5 — lesson objective now owns primary audio controls */
.lesson-objective{
  grid-column:2;
  display:grid;
  grid-template-columns:auto repeat(5,max-content) minmax(20px,1fr) auto;
  align-items:center;
  gap:7px 18px;
}
.lesson-objective strong{white-space:nowrap}
.objective-audio{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:8px;
  margin-left:auto;
}
.objective-play,.objective-stop{
  min-height:34px;
  border:1px solid var(--jp);
  padding:7px 11px;
  font-size:9.5px;
  font-weight:800;
  cursor:pointer;
  white-space:nowrap;
}
.objective-play{background:var(--jp);color:#fff}
.objective-stop{background:#fff;color:var(--jp)}
.objective-stop:disabled{
  opacity:.38;
  border-color:var(--line);
  color:#8e9692;
  cursor:default;
}

/* V5 — shorter middle learning toolbar */
.lesson-tools__in{
  display:grid;
  grid-template-columns:auto auto minmax(340px,1fr);
  gap:8px 22px;
  padding:8px 0 9px;
}
.voice-controls{
  justify-self:end;
}
.audio-status{
  grid-column:1/-1;
  margin:-2px 0 0;
}

/* Floating audio dock */
.floating-audio{
  position:fixed;
  right:22px;
  bottom:22px;
  z-index:90;
  display:flex;
  gap:7px;
  padding:7px;
  background:rgba(255,255,255,.94);
  border:1px solid var(--line);
  box-shadow:0 10px 28px rgba(29,42,36,.12);
  backdrop-filter:blur(10px);
  opacity:0;
  transform:translateY(12px);
  pointer-events:none;
  transition:opacity .18s ease,transform .18s ease;
}
.floating-audio.is-visible{
  opacity:1;
  transform:none;
  pointer-events:auto;
}
.floating-audio button{
  width:42px;
  height:42px;
  display:grid;
  place-items:center;
  border:1px solid var(--jp);
  background:#fff;
  color:var(--jp);
  font-size:12px;
  font-weight:900;
  cursor:pointer;
}
.floating-play{
  background:var(--jp)!important;
  color:#fff!important;
}
.floating-stop:disabled{
  opacity:.35;
  border-color:var(--line);
  color:#8e9692;
  cursor:default;
}

/* Tablet */
@media(max-width:1000px){
  .lesson-objective{
    grid-template-columns:auto repeat(3,max-content) minmax(10px,1fr) auto;
  }
  .lesson-objective span:nth-of-type(n+4){
    grid-row:2;
  }
  .objective-audio{
    grid-column:-2/-1;
    grid-row:1/3;
  }
  .lesson-tools__in{
    grid-template-columns:1fr 1fr;
  }
  .voice-controls{
    grid-column:1/-1;
    justify-self:start;
  }
  .audio-status{
    grid-column:1/-1;
  }
}

/* Mobile */
@media(max-width:720px){
  .site-mark{width:35px;height:35px;font-size:19px}
  .mark-jp{box-shadow:3px 3px 0 #d9e8f3,0 4px 10px rgba(25,74,111,.11)}
  .lesson-objective{
    display:grid;
    grid-template-columns:1fr auto;
    gap:5px 10px;
  }
  .lesson-objective strong{
    grid-column:1/-1;
    white-space:normal;
  }
  .lesson-objective span{
    grid-column:1;
  }
  .objective-audio{
    grid-column:2;
    grid-row:2/7;
    align-self:center;
    display:grid;
    gap:6px;
  }
  .objective-play,.objective-stop{
    min-height:34px;
    padding:7px 9px;
    font-size:9px;
  }

  .lesson-tools__in{
    display:grid;
    grid-template-columns:1fr;
    gap:6px;
    padding:8px 0 9px;
  }
  .voice-controls{
    grid-column:1;
    width:100%;
  }
  .audio-status{
    grid-column:1;
  }

  .floating-audio{
    right:12px;
    bottom:12px;
    padding:5px;
    gap:5px;
  }
  .floating-audio button{
    width:40px;
    height:40px;
  }
}

@media(max-width:390px){
  .objective-audio{
    grid-row:2/7;
  }
  .objective-play{
    max-width:92px;
    white-space:normal;
    line-height:1.35;
  }
  .floating-audio{
    right:10px;
    bottom:10px;
  }
}


/* V5.1 — compact phone controls */
@media(max-width:720px){
  .voice-controls{
    grid-template-columns:1fr 1fr;
    gap:8px;
  }
  .voice-setting{
    display:block;
    min-width:0;
  }
  .voice-setting span{
    display:block;
    margin-bottom:3px;
    font-size:8.5px;
  }
  .voice-setting select{
    width:100%;
    height:30px;
    font-size:9px;
  }
}


/* V5.2 — objective text wraps as a compact lesson target group */
.lesson-objective{
  grid-column:2;
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:18px;
  align-items:center;
}
.objective-content{
  min-width:0;
}
.objective-content strong{
  display:inline-block;
  margin-right:18px;
  color:var(--ink);
  font-weight:750;
  white-space:nowrap;
}
.objective-items{
  display:inline-flex;
  flex-wrap:wrap;
  gap:5px 18px;
  vertical-align:middle;
}
.objective-items span{
  color:#65706b;
  white-space:nowrap;
}
.objective-audio{
  grid-column:2;
  grid-row:1;
  align-self:center;
}

/* neutralize earlier placement rules */
@media(max-width:1000px){
  .lesson-objective{
    grid-template-columns:minmax(0,1fr) auto;
  }
  .lesson-objective span:nth-of-type(n+4){
    grid-row:auto;
  }
  .objective-audio{
    grid-column:2;
    grid-row:1;
  }
}

@media(max-width:720px){
  .lesson-objective{
    grid-template-columns:minmax(0,1fr) auto;
    gap:10px;
  }
  .objective-content strong{
    display:block;
    margin:0 0 5px;
    white-space:normal;
  }
  .objective-items{
    display:flex;
    gap:3px 12px;
  }
  .objective-items span{
    grid-column:auto;
    white-space:nowrap;
    font-size:8.8px;
  }
  .objective-audio{
    grid-column:2;
    grid-row:1;
    align-self:center;
    display:grid;
    gap:6px;
  }
}


/* V6 — background stays white, but add a very soft paper + line-art feeling */
html, body{
  background:
    radial-gradient(circle at 12% 10%, rgba(41,91,133,.025), transparent 26%),
    radial-gradient(circle at 88% 82%, rgba(169,182,190,.035), transparent 22%),
    linear-gradient(#ffffff,#ffffff);
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  opacity:.32;
  background-image:
    linear-gradient(rgba(120,130,128,.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(120,130,128,.018) 1px, transparent 1px);
  background-size: 24px 24px, 24px 24px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.34), rgba(0,0,0,.12));
}
body::after{
  content:"";
  position:fixed;
  right:2.4vw;
  bottom:2.2vw;
  width:min(22vw,300px);
  height:min(15vw,210px);
  pointer-events:none;
  opacity:.10;
  background-repeat:no-repeat;
  background-size:contain;
  background-position:right bottom;
  background-image:url("data:image/svg+xml;utf8,\
  <svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 320 220'>\
    <g fill='none' stroke='%23214f77' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'>\
      <path d='M38 149c18-6 40-18 53-35 8-10 15-22 20-30 8 18 21 36 43 46 17 8 48 13 73 16 10 1 18 10 18 20 0 10-7 18-17 18H67c-22 0-33-23-29-35z'/>\
      <path d='M90 88c8 8 17 13 29 18'/>\
      <path d='M126 106c12 7 25 12 39 16'/>\
      <path d='M194 143h34'/>\
      <path d='M68 186c18 12 48 18 78 18h77' opacity='.55'/>\
      <rect x='190' y='32' width='88' height='52' rx='4' opacity='.55'/>\
      <path d='M202 48h50M202 61h36' opacity='.55'/>\
    </g>\
  </svg>");
}

/* tighter and calmer header area */
.lesson-head{
  background: rgba(255,255,255,.82);
  backdrop-filter: blur(2px);
}

/* reading targets line */
.lesson-objective{
  padding-top:15px;
}
.objective-items{
  gap:6px 16px;
}
.objective-items span{
  position:relative;
  padding-left:0;
}

/* middle toolbar: slightly narrower and cleaner */
.lesson-tools{
  background:rgba(252,252,251,.92);
  backdrop-filter: blur(6px);
}
.lesson-tools__in{
  width:min(var(--max), calc(100% - 72px));
}

/* Field notes: restructure into single reading column */
.lesson-section--fieldnotes .lesson-section__head p{
  max-width:40em;
}
.field-notes{
  border-bottom:1px solid var(--line);
}
.field-note{
  display:grid;
  grid-template-columns:52px minmax(0, 780px);
  justify-content:start;
  gap:18px 28px;
  padding:30px 0;
  border-top:1px solid var(--line);
}
.field-note:first-child{
  border-top:0;
}
.field-note__index{
  padding-top:4px;
  font-size:10px;
  color:#8f9994;
}
.field-note__body{
  min-width:0;
}
.field-note__body h3{
  margin:0;
  max-width:30em;
  font-size:18px;
  line-height:1.55;
}
.note-intro{
  margin-top:12px;
  max-width:41em;
}
.note-intro p,
.note-extra p{
  margin:0;
  color:#58625f;
  font-size:11.2px;
  line-height:1.95;
  overflow-wrap:anywhere;
}
.note-extra{
  margin-top:14px;
  max-width:41em;
}
.note-example{
  margin-top:15px;
  padding:16px 18px;
  max-width:43em;
  background:linear-gradient(180deg, rgba(33,79,119,.028), rgba(33,79,119,.018));
  border:1px solid rgba(33,79,119,.10);
  border-left:3px solid rgba(33,79,119,.32);
}
.note-example__jp{
  margin:0;
  font-family:var(--jpfont);
  font-size:17px;
  line-height:2.05;
  color:var(--ink);
  overflow-wrap:anywhere;
}
.note-example__jp + .note-example__zh{
  margin-top:3px;
}
.note-example__zh{
  margin:4px 0 0;
  color:#6a736f;
  font-size:10.6px;
  line-height:1.8;
  overflow-wrap:anywhere;
}
.note-example__jp + .note-example__jp{
  margin-top:12px;
}
.note-example__zh + .note-example__jp{
  margin-top:12px;
}
.note-example ruby rt{
  font-family:var(--sans);
  font-size:.52em;
  color:#76807b;
}

/* keep conversation and main content from stretching too wide */
.lesson-sheet{
  width:min(920px, calc(100% - 72px));
}
.scene-lines,
.swap-row__body{
  max-width:670px;
}

/* tablet */
@media(max-width:1024px){
  body::after{
    width:min(28vw,250px);
    height:min(18vw,170px);
    opacity:.085;
  }
  .lesson-sheet{
    width:calc(100% - 52px);
  }
  .field-note{
    grid-template-columns:44px minmax(0,1fr);
    gap:14px 20px;
    padding:26px 0;
  }
  .field-note__body h3{
    font-size:17px;
  }
  .note-example{
    max-width:none;
  }
}

/* mobile */
@media(max-width:720px){
  body::before{
    opacity:.22;
    background-size: 20px 20px, 20px 20px;
  }
  body::after{
    right:-16px;
    bottom:92px;
    width:160px;
    height:112px;
    opacity:.06;
  }
  .lesson-sheet{
    width:calc(100% - 28px);
  }
  .field-note{
    grid-template-columns:1fr;
    gap:8px;
    padding:22px 0;
  }
  .field-note__index{
    padding-top:0;
    font-size:9px;
  }
  .field-note__body h3{
    font-size:16px;
    line-height:1.55;
  }
  .note-intro{
    margin-top:10px;
  }
  .note-intro p,
  .note-extra p{
    font-size:10.5px;
    line-height:1.9;
  }
  .note-example{
    margin-top:12px;
    padding:14px 13px;
  }
  .note-example__jp{
    font-size:15.6px;
    line-height:1.95;
  }
  .note-example__zh{
    font-size:10px;
    line-height:1.75;
  }
}


/* V7 — clean white lesson background */
html,
body{
  background:#fff !important;
  background-image:none !important;
}
body::before,
body::after{
  content:none !important;
  display:none !important;
  background:none !important;
}
.lesson-head{
  background:#fff !important;
  backdrop-filter:none !important;
}
.lesson-tools{
  background:#fff !important;
  backdrop-filter:none !important;
}
.note-example{
  background:#fff !important;
}

/* keep only structure, spacing and reading-flow improvements from V6 */
