
:root{color-scheme:light;--ink:#273842;--muted:#65747d;--line:#d9e2e7;--blue:#f7fafb;--paper:#ffffff;--accent:#446c84}
*{box-sizing:border-box}html,body{margin:0;min-height:100%;font-family:-apple-system,BlinkMacSystemFont,"Noto Sans", "Hiragino Kaku Gothic ProN",Meiryo,sans-serif;color:var(--ink)}
body{background:linear-gradient(180deg,#f9fbfc 0,#ffffff 75%,#fcfcfb 100%);padding:24px 15px 42px}
.shell{max-width:530px;margin:auto}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 2px 16px}
a{color:var(--accent);text-decoration:none}.back{font-size:14px;font-weight:600}.small{color:var(--muted);font-size:12px;letter-spacing:.09em}
.heading{margin:12px 0 22px;text-align:center}.heading h1{font-size:22px;margin:9px 0 5px;letter-spacing:.05em;font-weight:750}.heading p{font-size:13px;color:var(--muted);margin:0}
.progress{height:5px;background:#dbe8ed;border-radius:30px;overflow:hidden;margin-bottom:14px}.progress>div{background:#719aae;height:100%;width:8.333%;transition:width .2s ease}
.quiz{appearance:none;background:#fff;border:1px solid #dde6ea;border-radius:24px;padding:19px 21px 23px;display:flex;align-items:center;flex-direction:column;width:100%;min-height:525px;color:inherit;cursor:pointer;box-shadow:0 10px 28px rgba(54,95,113,.05);font:inherit;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
.quiz:focus-visible{outline:3px solid #719aae;outline-offset:3px}.quiz:active{transform:scale(.997)}
.illustration{width:min(100%,335px);height:auto;aspect-ratio:1/1;object-fit:contain;border-radius:18px;display:block;background:#fffdf9;border:1px solid #edf0ef}
.prompt{font-size:12px;font-weight:550;color:var(--muted);letter-spacing:.07em;margin:9px 0 8px}.ja{font-size:clamp(24px,7vw,34px);font-weight:750;line-height:1.4;text-align:center;margin:0 0 6px}
.reveal{min-height:118px;width:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;gap:7px;margin-top:10px;border-top:1px solid #e4eef2;padding-top:13px}
.answer{font-family:"Segoe UI",Arial,"Helvetica Neue","Noto Sans",sans-serif;font-size:clamp(32px,7.7vw,48px);font-weight:700;line-height:1.25;letter-spacing:0;overflow-wrap:anywhere;text-align:center;width:100%;color:#203e50}
.answer.long{font-size:clamp(23px,5.5vw,32px)}.answer.verylong{font-size:clamp(21px,5vw,28px)}
.pron{font-size:16px;color:#667e89;line-height:1.35;text-align:center}.alt{padding-top:6px;text-align:center;color:#4b6c7b}.alt .altword{font-family:"Segoe UI",Arial,"Helvetica Neue","Noto Sans",sans-serif;font-size:clamp(21px,5.2vw,26px);font-weight:700;line-height:1.3;letter-spacing:0;overflow-wrap:anywhere}.alt .altpron{font-size:14px;color:#758992;margin-top:4px}
.placeholder{display:flex;align-items:center;gap:8px;color:#899ca5;font-size:14px}.hint{font-size:13px;color:var(--muted);text-align:center;margin:15px 0 13px}
.tools{display:flex;gap:10px}.tool{border:1px solid var(--line);border-radius:13px;background:var(--paper);padding:12px 15px;color:#45677a;font-size:14px;font-weight:650;cursor:pointer}.tool.primary{flex:1;background:#517e94;color:#fff;border-color:#517e94}.tool:focus-visible{outline:3px solid #719aae;outline-offset:2px}
.credit{font-size:11px;text-align:center;color:#82949d;line-height:1.6;margin-top:25px}.credit a{color:inherit;text-decoration:underline}
.home h1{font-size:clamp(26px,7vw,37px);line-height:1.4;text-align:center;margin:16px 0 8px}.home p{font-size:15px;color:var(--muted);text-align:center;line-height:1.6;margin:0 0 20px}.hero{width:100%;height:auto;aspect-ratio:16/9;object-fit:cover;border-radius:22px;border:1px solid var(--line);margin-bottom:24px}.choices{display:grid;grid-template-columns:1fr 1fr;gap:13px}.choice{display:flex;align-items:center;justify-content:center;flex-direction:column;padding:21px 8px;min-height:110px;border:1px solid #d3e2e9;border-radius:17px;background:#fff;box-shadow:0 7px 23px rgba(48,90,109,.04);color:#294a5b;gap:7px}.choice strong{font-size:17px}.choice span{font-size:11px;color:#6f8997}.choice:focus-visible{outline:3px solid #719aae}
@media(max-width:390px){body{padding:13px 12px 28px}.quiz{padding:14px 13px 17px;min-height:480px}.illustration{width:min(100%,290px)}.pron{font-size:14px}.heading{margin-bottom:15px}.reveal{min-height:125px}.home h1{font-size:28px}}
@media(prefers-reduced-motion:reduce){*{transition:none!important}}

/* Landing page with the user's annotated 12-fruit pencil illustration */
.home-body{background:#fffdf8}
.home{max-width:960px}
.home h1{font-size:clamp(27px,5vw,37px);margin:12px 0 20px}
.home .hero{display:block;width:100%;height:auto;aspect-ratio:auto;object-fit:contain;border:1px solid #eee8de;border-radius:13px;margin:0 auto 15px;box-shadow:0 3px 17px rgba(96,72,39,.04);background:#fffdf8}
.home p.choose-intro{margin:15px 0 17px;font-size:16px;color:#536577}
.home .choices{max-width:550px;margin:0 auto;gap:12px}
.home .choice{border-color:#e4ddd2;border-radius:14px;box-shadow:0 4px 18px rgba(96,72,39,.045)}
.home .choice:focus-visible{outline:3px solid #719aae}
@media(max-width:550px){.home h1{font-size:27px}.home .hero{border-radius:8px}.home .choice{min-height:83px;padding:13px 5px}.home .choice strong{font-size:15px}.home .choice span{font-size:10px}.home p.choose-intro{font-size:14px}}


/* 2026-11 mobile-first compact review: keep controls visible without scrolling. */
@media (max-width: 600px) {
  body:not(.home-body) {
    padding: 9px 12px calc(86px + env(safe-area-inset-bottom, 0px));
    background: #fdfefe;
  }
  body:not(.home-body) .shell {max-width: 470px;}
  body:not(.home-body) .topbar {margin: 0 2px 5px;gap: 8px;min-height: 19px;}
  body:not(.home-body) .topbar .small {font-size: 11px;letter-spacing: .03em;}
  body:not(.home-body) .back {font-size: 13px;}
  /* The language is already visible in the upper-right navigation. */
  body:not(.home-body) .heading {display: none;}
  body:not(.home-body) .topbar + .progress {margin-top: 0;}
  body:not(.home-body) .progress {height: 4px;margin: 1px 0 7px;}
  body:not(.home-body) .quiz {
    border-radius: 17px;
    min-height: 0;
    padding: 9px 10px 11px;
    box-shadow: 0 4px 18px rgba(54,95,113,.035);
  }
  body:not(.home-body) .illustration {
    width: min(55vw, 185px, 30dvh);
    height: auto;
    border-radius: 11px;
    flex-shrink: 0;
  }
  /* The card is already labeled by the selected language. */
  body:not(.home-body) .prompt {display: none;}
  body:not(.home-body) .ja {
    font-size: clamp(23px, 6.4vw, 29px);
    line-height: 1.23;
    margin: 7px 0 5px;
  }
  body:not(.home-body) .reveal {
    margin-top: 3px;
    padding-top: 7px;
    min-height: 91px;
    gap: 4px;
  }
  body:not(.home-body) .answer {font-size: clamp(30px, 7.7vw, 40px);line-height: 1.16;}
  body:not(.home-body) .answer.long {font-size: clamp(23px, 6vw, 31px);}
  body:not(.home-body) .answer.verylong {font-size: clamp(20px, 5.2vw, 27px);}
  body:not(.home-body) .pron {font-size: 14px;line-height: 1.22;}
  body:not(.home-body) .alt {padding-top: 1px;}
  body:not(.home-body) .alt .altword {font-size: 19px;}
  body:not(.home-body) .alt .altpron {font-size: 12px;margin-top: 1px;}
  body:not(.home-body) .placeholder {font-size: 13px;}
  body:not(.home-body) .hint {display: none;}
  /* Always-visible action buttons, including in note's in-app browser. */
  body:not(.home-body) .tools {
    position: fixed;
    z-index: 20;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 494px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    background: rgba(255,255,255,.97);
    border-top: 1px solid #e1e8ec;
    box-shadow: 0 -6px 20px rgba(33,62,79,.06);
    gap: 8px;
  }
  body:not(.home-body) .tool {min-height: 48px;padding: 9px 12px;font-size: 15px;}
  body:not(.home-body) .tool.primary {flex: 1.5;}
  body:not(.home-body) .credit {display: none;}
  /* Landing page: the four language buttons should also appear promptly. */
  body.home-body {padding: 10px 12px 26px;}
  .home .small {font-size: 11px;}
  .home h1 {font-size: clamp(21px, 5.8vw, 27px);margin: 4px 0 11px;}
  .home .hero {max-height: 35dvh;object-fit: contain;margin-bottom: 9px;}
  .home p.choose-intro {font-size: 13px;margin: 7px 0 10px;}
  .home .choices {gap: 8px;}
  .home .choice {min-height: 67px;padding: 9px 5px;gap: 3px;border-radius: 12px;}
  .home .choice strong {font-size: 14px;}
  .home .choice span {font-size: 10px;}
}
@media (max-width: 600px) and (max-height: 620px) {
  body:not(.home-body) .illustration {width: min(47vw, 154px, 26dvh);}
  body:not(.home-body) .reveal {min-height: 82px;}
  body:not(.home-body) .quiz {padding-top: 7px;padding-bottom: 7px;}
  .home .hero {max-height: 30dvh;}
}


/* Screen-fit study layout, desktop/tablet/mobile, updated 2026-11-09. */
.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
body.study-page{
  margin:0;
  padding:12px clamp(12px,2.5vw,24px);
  background:#fafcfd;
  min-height:100vh;
  min-height:100dvh;
  overflow:hidden;
}
body.study-page .shell{
  max-width:920px;
  width:100%;
  height:calc(100vh - 24px);
  height:calc(100dvh - 24px);
  min-height:0;
  display:flex;
  flex-direction:column;
  margin:0 auto;
}
body.study-page .topbar{min-height:23px;margin:0 2px 6px;flex-shrink:0}
body.study-page .back{font-size:14px}
body.study-page .small{font-size:12px;letter-spacing:.015em}
body.study-page .study-count{margin-top:2px;margin-bottom:6px}
body.study-page .progress{height:4px;margin:0 0 10px;flex:0 0 4px}
body.study-page .quiz{
  flex:1 1 0;
  min-height:0;
  height:auto;
  width:100%;
  border-radius:21px;
  padding:12px clamp(13px,3vw,32px);
  box-shadow:0 6px 24px rgba(40,74,92,.045);
  display:grid;
  grid-template-columns:minmax(0,1fr) minmax(0,1.16fr);
  grid-template-rows:auto auto;
  column-gap:clamp(12px,3vw,48px);
  align-content:center;
  align-items:center;
  justify-items:center;
}
body.study-page .illustration{
  grid-column:1;
  grid-row:1 / span 2;
  width:min(100%,320px,48dvh);
  height:auto;
  max-height:52dvh;
  aspect-ratio:1/1;
  object-fit:contain;
  flex-shrink:1;
  background:#fffdf9;
}
body.study-page .prompt{display:none}
body.study-page .ja{
  grid-column:2;
  grid-row:1;
  margin:0;
  padding:8px 0;
  font-size:clamp(27px,3vw,37px);
  line-height:1.22;
  overflow-wrap:anywhere;
}
body.study-page .reveal{
  grid-column:2;
  grid-row:2;
  margin:3px 0 0;
  padding:12px 0 0;
  width:100%;
  min-height:144px;
  gap:6px;
  border-color:#e7edef;
  align-self:start;
}
body.study-page .answer{font-size:clamp(29px,4vw,44px);line-height:1.15}
body.study-page .answer.long{font-size:clamp(23px,2.8vw,32px)}
body.study-page .answer.verylong{font-size:clamp(20px,2.5vw,28px)}
body.study-page .pron{font-size:15px}
body.study-page .alt{padding-top:4px}
body.study-page .alt .altword{font-size:22px}
body.study-page .alt .altpron{font-size:13px}
body.study-page .placeholder{font-size:14px}
body.study-page .hint, body.study-page .credit{display:none}
body.study-page .tools{
  flex:0 0 auto;
  display:flex;
  position:static;
  bottom:auto;
  left:auto;
  transform:none;
  width:100%;
  max-width:none;
  padding:10px 0 0;
  margin:0;
  gap:10px;
  background:transparent;
  box-shadow:none;
  border:0;
}
body.study-page .tool{
  min-height:48px;
  border-radius:12px;
  padding:9px 18px;
  font-size:15px;
}
body.study-page .tool.primary{flex:1}
@media (max-width:720px){
  body.study-page{padding:8px 10px;}
  body.study-page .shell{
    max-width:500px;
    height:calc(100vh - 16px);
    height:calc(100dvh - 16px);
  }
  body.study-page .topbar{margin-bottom:4px;min-height:22px}
  body.study-page .study-count{margin-top:0;margin-bottom:5px}
  body.study-page .small{font-size:11px}
  body.study-page .progress{margin-bottom:7px}
  body.study-page .quiz{
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    padding:8px 12px;
    border-radius:16px;
    min-height:0;
  }
  body.study-page .illustration{
    width:min(54vw,215px,30dvh);
    height:auto;
    max-height:30dvh;
    border-radius:12px;
  }
  body.study-page .ja{
    font-size:clamp(23px,6.3vw,30px);
    margin:7px 0 4px;
    padding:0;
  }
  body.study-page .reveal{
    min-height:95px;
    margin:3px 0 0;
    padding-top:8px;
    flex:0 1 auto;
    gap:4px;
  }
  body.study-page .answer{font-size:clamp(29px,7.7vw,40px);line-height:1.16}
  body.study-page .answer.long{font-size:clamp(22px,5.5vw,29px)}
  body.study-page .answer.verylong{font-size:clamp(19px,5vw,26px)}
  body.study-page .pron{font-size:14px;line-height:1.2}
  body.study-page .alt{padding-top:1px}
  body.study-page .alt .altword{font-size:19px}
  body.study-page .alt .altpron{font-size:12px}
  body.study-page .tools{
    padding:8px 0 0;
    gap:8px;
  }
  body.study-page .tool{min-height:48px;padding:8px 10px;font-size:14px}
}
@media(max-width:720px) and (max-height:620px){
  body.study-page .illustration{width:min(48vw,175px,26dvh);max-height:26dvh}
  body.study-page .quiz{padding:5px 9px}
  body.study-page .ja{font-size:clamp(21px,6vw,27px);margin:4px 0}
  body.study-page .reveal{min-height:78px;padding-top:5px}
  body.study-page .tool{min-height:43px}
}
@media (min-width:721px) and (max-height:570px){
  body.study-page .illustration{width:min(100%,260px,45dvh)}
  body.study-page .quiz{padding:6px 16px}
  body.study-page .reveal{min-height:95px;padding-top:6px}
}
/* Desktop: a compact card so actions are visible near the top without scrolling. */
@media (min-width:721px){
  body.study-page .shell{height:auto;min-height:0}
  body.study-page .quiz{flex:0 0 auto;height:clamp(310px,52dvh,470px)}
  body.study-page .illustration{width:min(100%,300px,44dvh);max-height:44dvh}
  body.study-page .tools{padding-top:12px}
}

/* Center the illustration and answer as a tighter group on desktop. */
@media (min-width:721px) {
  body.study-page .quiz {
    grid-template-columns: minmax(0, min(42%, 300px)) minmax(0, min(54%, 380px));
    column-gap: clamp(10px, 1.2vw, 18px);
    justify-content: center;
  }
}


/* Home layout update: show four language choices on arrival, without scrolling. */
body.home-body{background:#fffdf8;padding:clamp(8px,1.5vw,18px) clamp(9px,1.5vw,20px) 14px}
.home{max-width:1250px;margin:0 auto}
.home .home-header{text-align:center;margin:0 0 clamp(9px,1.6dvh,14px)}
.home .home-kicker{font-size:12px;color:#68808e;letter-spacing:.055em;line-height:1.35}
.home h1{font-size:clamp(20px,2.4vw,31px);font-weight:750;line-height:1.22;margin:4px 0 0;text-align:center}
.home .home-stage{display:grid;grid-template-columns:minmax(0,1.9fr) minmax(260px, .83fr);gap:clamp(14px,2.3vw,30px);align-items:center;justify-content:center}
.home .hero{display:block;width:100%;height:auto;max-height:68dvh;object-fit:contain;aspect-ratio:auto;margin:0;border:1px solid #eee9dc;border-radius:12px;box-shadow:none;background:#fffdf8}
.home .home-select{min-width:0;display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:11px}
.home p.choose-intro{font-size:clamp(14px,1.25vw,17px);font-weight:650;margin:0;color:#36505d;line-height:1.45}
.home .choices{display:grid;grid-template-columns:1fr;gap:10px;max-width:none;margin:0}
.home .choice{min-height:64px;display:flex;flex-direction:column;gap:3px;border-radius:12px;padding:10px 8px;box-shadow:none;border:1px solid #d7e2e6;background:#fff;justify-content:center;align-items:center;touch-action:manipulation}
.home .choice strong{font-size:17px;line-height:1.25}
.home .choice span{font-size:12px;line-height:1.25;color:#718794}
.home .choice:hover{border-color:#7fa6ba;background:#f8fbfc}
.home p.home-guide{margin:1px 0 0;color:#6b7f89;font-size:12px;line-height:1.5;text-align:center}
.home .home-footer{text-align:center;margin:12px auto 0;font-size:12px;color:#718794}
.home .home-footer a{text-decoration:underline;color:inherit}
@media(max-width:850px){
 body.home-body{padding:10px 10px 14px}
 .home .home-header{margin:0 0 9px}
 .home .home-kicker{font-size:11px}
 .home h1{font-size:clamp(17px,4.4vw,22px);line-height:1.27;margin:3px 0 0}
 .home .home-stage{display:flex;flex-direction:column;align-items:center;gap:8px}
 .home .hero{width:min(100%,70dvh);height:auto;max-height:37dvh;border-radius:9px;align-self:center}
 .home .home-select{width:100%;max-width:560px;gap:8px}
 .home p.choose-intro{font-size:13px;line-height:1.25;margin:0;text-align:center}
 .home .choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .home .choice{min-height:61px;gap:2px;padding:7px 5px;border-radius:10px}
 .home .choice strong{font-size:clamp(13px,3.7vw,16px)}
 .home .choice span{font-size:11px}
 .home p.home-guide{font-size:11px;margin:0}
 .home .home-footer{margin:9px auto 0;font-size:11px}
}
@media(max-width:850px) and (max-height:610px){
 body.home-body{padding:6px 8px 7px}
 .home .home-header{margin-bottom:5px}
 .home .home-kicker{font-size:10px}
 .home h1{font-size:clamp(16px,4.4vw,20px);margin:1px 0 0}
 .home .home-stage{gap:5px}
 .home .hero{width:min(100%,61dvh);max-height:29dvh}
 .home .home-select{gap:5px}
 .home p.choose-intro{font-size:12px}
 .home .choices{gap:5px}
 .home .choice{min-height:49px;padding:5px 3px}
 .home .choice strong{font-size:13px}
 .home .choice span{font-size:10px}
 .home p.home-guide,.home .home-footer{display:none}
}
@media(min-width:851px) and (max-height:620px){
 .home .home-stage{grid-template-columns:minmax(0,1.75fr) minmax(240px,.75fr)}
 .home .hero{max-height:67dvh}
 .home .home-select{gap:6px}
 .home .choices{gap:6px}
 .home .choice{min-height:48px;padding:6px 4px}
 .home .choice strong{font-size:14px}
 .home .choice span{font-size:10px}
 .home p.home-guide{display:none}
}
