:root{--accent:#a71138;--red-dark:#9b0d2e;--edge:#edd7df;--header-height:62px}
html{scroll-padding-top:var(--header-height)}
body{height:auto;min-height:100dvh;display:block;background:#fbf8f3}
.prototype-top{min-height:var(--header-height);position:sticky;top:0;z-index:10;display:flex;align-items:center;justify-content:space-between;gap:9px;padding:9px max(12px,env(safe-area-inset-left));color:#fff;background:linear-gradient(125deg,#c91942,#a10a2b);border-bottom:2px solid #dfb97d}
.prototype-brand{display:flex;align-items:center;gap:9px}
.prototype-brand .seal{width:39px;height:39px;font-size:16px}
.prototype-brand strong,.prototype-brand span:not(.seal){display:block}
.prototype-brand strong{font-size:13px;line-height:1.35}
.prototype-brand span:not(.seal){color:#ffe6bc;font-size:10px;letter-spacing:.08em;font-weight:700}
.preview-tag{border:1px solid #ffffff6f;border-radius:999px;padding:5px 9px;font-size:9px;font-weight:750;white-space:nowrap}
.prototype-page{display:block;max-width:1100px;margin:0 auto;padding:12px 10px 28px}
.prototype-nav{display:flex;align-items:center;gap:5px;margin:0 0 12px;padding:6px 8px;border:1px solid var(--edge);border-radius:13px;background:#fff}
.prototype-nav strong{padding:0 7px;color:var(--accent);font-size:12px}
.prototype-nav a{min-height:36px;display:grid;place-items:center;padding:4px 12px;border:1px solid var(--edge);border-radius:9px;color:var(--accent);font-size:13px;font-weight:750}
.prototype-nav [aria-current]{background:var(--accent);color:white}
.exercise{border:1px solid var(--edge);border-radius:15px;background:white}
.exercise:last-child{min-height:calc(100dvh - var(--header-height))}
.exercise-banner{position:sticky;top:var(--header-height);z-index:2;display:flex;min-height:66px;align-items:center;justify-content:space-between;gap:8px;padding:9px 12px;border-radius:14px 14px 0 0;color:white;background:linear-gradient(118deg,#c51645,#ac1036)}
.exercise-banner p{margin:0 0 2px;color:#ffe1be;font-size:9px;letter-spacing:.08em;font-weight:800}
.exercise-banner h1,.exercise-banner h2{color:inherit;font:800 clamp(19px,5vw,24px)/1.15 Geist,Arial,sans-serif;letter-spacing:-.02em;margin:0}
.exercise-banner button{display:flex;align-items:center;gap:5px;min-height:44px;padding:5px 8px;border:1px solid #fff;border-radius:12px;background:#fff8f5;color:#9b1235;font-size:12px;font-weight:800;white-space:nowrap}
.exercise-banner svg{width:17px;height:17px}
.vocab-total{background:#f6dfe7;color:#881330;padding:1px 5px;border-radius:7px;font-size:10px}
.exercise-audio{position:relative;min-height:100px}
.exercise-audio iframe{display:block;width:100%;height:var(--lesson-height,160px);border:0;border-radius:0 0 14px 14px}
.lesson-loading{position:absolute;inset:12px auto auto 15px;color:#744954;font-size:13px}
#vocabulary-sheet{width:min(530px,calc(100vw - 32px));max-width:none;max-height:min(620px,84dvh);margin:auto;border:1px solid #eac9d4;border-radius:21px;padding:0;background:#fffaf9;color:#36272f;box-shadow:0 16px 58px #511b354d;overflow:hidden}
#vocabulary-sheet::backdrop{background:#30111d82}
.sheet-content{display:flex;flex-direction:column;max-height:inherit}
.sheet-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:15px 15px 12px;background:linear-gradient(120deg,#fff3f5,#fffaf6);border-bottom:1px solid #f0d9df}
.sheet-heading h2{margin:0;color:var(--red-dark);font-size:23px;font-weight:800}
.sheet-heading p{margin:3px 0 0;color:#6b4c58;font-size:12px;font-weight:600}
#close-vocabulary{min-height:44px;padding:4px 10px;border:1px solid #e9c5d0;border-radius:10px;background:white;color:var(--accent);font-size:13px;font-weight:750}
#close-vocabulary span{padding-left:3px;font-size:18px;vertical-align:middle}
.sheet-hint{padding:9px 15px 3px;margin:0;color:#694d58;font-size:12px}
.sheet-list{min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 14px max(10px,env(safe-area-inset-bottom))}
.sheet-entry{border-bottom:1px solid #efdfe2}
.sheet-word{display:grid;grid-template-columns:minmax(0,1fr) 38px;gap:8px;align-items:center;width:100%;padding:9px 2px;border:0;text-align:left;background:transparent}
.sheet-word strong,.sheet-ipa,.sheet-meaning{display:block}
.sheet-word strong{color:#295a46;font-size:16px;overflow-wrap:anywhere}
.sheet-word small{font-weight:600;color:#5d5c59}
.sheet-ipa{font-size:12px;color:#614d56}
.sheet-meaning{font-size:13px;color:#49313d}
.sheet-play{width:34px;height:34px;display:grid;place-items:center;border:1px solid #efd1da;border-radius:50%;background:#fff2f5;color:#a71138;font-size:12px}
.sheet-word[aria-pressed=true] .sheet-play{background:var(--accent);color:white}
.sheet-image{width:118px;height:90px;margin:0 0 8px;object-fit:contain;border-radius:8px;background:white}
#sheet-status{margin:0;padding:6px 15px;color:var(--accent);font-size:12px}
#sheet-status:empty{display:none}
html:has(#vocabulary-sheet[open]){overflow:hidden}
@media(max-width:800px), (max-height:560px){
 #vocabulary-sheet{inset:auto 0 0;width:100%;margin:0 auto;max-height:84dvh;border-radius:20px 20px 0 0}
}
.sheet-entry.vocab-row{display:block;padding:0;gap:0}
.sheet-image:not([hidden]){display:block}

/* The approved exercise banners share the existing Test 9 site header. */
.continuous-test .prototype-page{width:100%}
.continuous-test .prototype-nav{flex-wrap:wrap;gap:8px 16px}
.continuous-test .nav-part-group{display:flex;align-items:center;gap:5px}
.continuous-test .nav-part-group strong{white-space:nowrap}
.continuous-test .continuous-selectors{display:none}
.continuous-test #lesson-status:empty{display:none}
.continuous-test .exercise+.exercise{border-top:0}
.continuous-test .exercise-audio iframe{height:var(--lesson-height,360px)}
.continuous-test .exercise-audio iframe:not(.ready){opacity:0}
.continuous-test .exercise-audio .lesson-loading{z-index:1}
.continuous-test .sheet-hide{margin-inline-start:auto;min-height:44px;border:1px solid #e9c5d0;border-radius:10px;padding:4px 8px;background:#fff;color:var(--accent);white-space:nowrap;font-size:12px;font-weight:750}
.continuous-test .sheet-list.words-hidden .sheet-word strong{color:transparent;background:repeating-linear-gradient(90deg,#abc4b7 0 12px,transparent 12px 17px) left center/80px 2px no-repeat}
.continuous-test .sheet-list.words-hidden .sheet-word small{visibility:hidden}
@media(max-width:800px), (max-width:1100px) and (max-height:600px){
 .continuous-test .prototype-nav{display:block}
 .continuous-test .nav-part-group{display:none}
 .continuous-test .continuous-selectors{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.3fr);gap:6px}
 .continuous-test .continuous-selectors select{min-width:0;width:100%;max-width:none;min-height:38px}
}
@media(max-width:600px){
 .continuous-test .masthead{min-height:55px;padding:6px 10px}
 .continuous-test .masthead .brand>span:last-child,.continuous-test .masthead .site-title span,.continuous-test #feedback-open>span:last-child{display:none}
 .continuous-test .masthead .site-title{display:flex}
 .continuous-test #feedback-open{min-width:40px;min-height:40px;padding:7px;justify-content:center}
}
.continuous-test .exercise-audio:not(:has(iframe.ready)){min-height:360px}

.continuous-test #feedback-open {
  display: inline-flex;
  text-decoration: none;
}
#vocabulary-sheet.side-panel {
  position: fixed;
  inset: calc(var(--header-height) + 14px) 14px auto auto;
  margin: 0;
  width: min(340px, 29vw);
  max-height: calc(100dvh - var(--header-height) - 30px);
}
.continuous-test:has(#vocabulary-sheet.side-panel[open]) .prototype-page {
  margin-right: min(365px, 31vw);
}
