@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Noto+Sans+JP:wght@400;500;600&display=swap');
*{box-sizing:border-box}body{margin:0;background:#fffefa;color:#292737;font-family:'DM Sans',sans-serif}main{max-width:1160px;margin:auto;padding:35px 65px 55px}header{display:flex;align-items:center;gap:28px;padding-bottom:22px}.brand{font-size:38px;font-weight:700;letter-spacing:-2.5px;transform:rotate(-5deg)}.brand span{color:#9b87f5;font-size:23px;margin-left:4px}.tag,.eyebrow,.cardtop{font-size:10px;font-weight:700;letter-spacing:1.9px}#state{margin-left:auto;font-size:12px;color:#797485}.tag{color:#898294}.heading{position:relative;margin:76px 0 80px 30px}.heading:after{content:'✳';position:absolute;right:12%;top:5px;font-size:100px;color:#bca7f5;transform:rotate(12deg);pointer-events:none}h1{font-size:70px;line-height:1.05;letter-spacing:-4px;margin:20px 0;transform:rotate(-2deg);transform-origin:left}.eyebrow{display:inline-block;background:#f8efad;padding:10px 14px;border-radius:5px;transform:rotate(-4deg);color:#645a32}.muted{color:#7b7585;margin:25px 0 0;font-size:16px}.card{position:relative;border-radius:26px;padding:30px 35px;margin-bottom:54px;border:1px solid #e6e0ed;box-shadow:3px 6px 0 #30234208}.prompt{background:#eee7ff;max-width:82%;transform:rotate(-2deg);margin-left:12px}.prompt:before{content:'';position:absolute;top:-13px;left:42%;width:82px;height:26px;background:#f7eaa6b8;transform:rotate(8deg)}.cardtop{display:flex;justify-content:space-between;color:#766989;font-size:10px}h2{font-family:'Noto Sans JP',sans-serif;font-weight:500;font-size:30px;line-height:1.8;margin:24px 0 12px;overflow-wrap:anywhere}#translation{color:#7d6c94;margin:0 0 22px}.subtle{border:0;background:transparent;padding:0;color:#6a5688;text-decoration:underline;text-underline-offset:4px;cursor:pointer}.speech{background:#fff;min-height:170px;max-width:80%;margin-left:auto;transform:rotate(1.5deg)}#transcript{font-family:'Noto Sans JP',sans-serif;font-size:23px;line-height:1.8;overflow-wrap:anywhere}#feedback{font-size:14px;color:#7e7789;border-top:1px solid #e9e4ef;padding-top:17px}.controls{display:flex;justify-content:center;gap:15px;position:sticky;bottom:0;z-index:2;background:#fffefaeF;padding:23px 0;backdrop-filter:blur(10px)}.controls button{border:0;border-radius:40px;padding:18px 29px;font:600 15px 'DM Sans';cursor:pointer;transition:transform .15s}#start{background:#352943;color:white;min-width:230px;box-shadow:4px 5px 0 #d8c9f5;transform:rotate(-2deg)}#start:not(:disabled):hover{transform:rotate(0deg) translateY(-2px)}#start span{margin-left:35px}.secondary{background:#f0ebf7;color:#625270}button:disabled{opacity:.45;cursor:default}button:focus-visible{outline:3px solid #9165d3;outline-offset:5px}footer{display:flex;justify-content:center;gap:25px;font-size:11px;color:#847b90;margin-top:30px}#error{color:#a04435;text-align:center}#hint{color:#66517d;line-height:1.8}.exchange{margin:65px 0;display:flex;flex-direction:column;gap:40px}.chat-prompt,.chat-answer{padding:26px 32px;border-radius:24px;max-width:80%;border:1px solid #dfd7eb;box-shadow:3px 5px 0 #30234208;overflow-wrap:anywhere}.chat-prompt{background:#eee7ff;align-self:flex-start;transform:rotate(-1.7deg);margin-left:12px}.chat-answer{align-self:flex-end;background:#fff;min-width:40%;transform:rotate(1.5deg);margin-right:10px}.exchange:nth-child(even) .chat-prompt{transform:rotate(-.8deg)}.exchange:nth-child(even) .chat-answer{transform:rotate(2deg)}.exchange small{font-size:10px;letter-spacing:1.3px;font-weight:700}.exchange p{margin:13px 0 0;font-family:'Noto Sans JP',sans-serif;font-size:22px;line-height:1.8;white-space:pre-wrap}.translation{font-size:14px;color:#79668f;margin-top:12px}.good{background:#e4f6df!important;border-color:#91c485!important}.good small,.good #feedback{color:#326b29}.correction{background:#fff0cc!important;border-color:#d5ac54!important}.correction small,.correction #feedback{color:#80520d}.unclear{background:#e6edfc!important;border-color:#9badde!important}.unclear small{color:#415c91}.fix{border-top:1px dashed #c9a563;padding-top:14px;color:#714b12;font-weight:600}#conversation:empty{display:none}@media(max-width:650px){main{padding:24px 24px 35px}.tag{display:none}.brand{font-size:33px}#state{font-size:10px}.heading{margin:52px 0 60px 8px}.heading:after{font-size:55px;right:0;top:10px}h1{font-size:48px;letter-spacing:-2.6px}.eyebrow{font-size:8px}.muted{font-size:14px;max-width:80%;line-height:1.6}.card{padding:24px;margin-bottom:42px}.prompt,.speech{max-width:94%}.prompt{margin-left:0}h2{font-size:23px}#transcript{font-size:20px}.chat-prompt,.chat-answer{max-width:93%;padding:23px;margin-left:0;margin-right:0}.exchange{gap:30px;margin:48px 0}.exchange p{font-size:19px}.controls{gap:12px}.controls button{padding:17px 22px}#start{min-width:195px}#start span{margin-left:20px}footer{flex-wrap:wrap;gap:12px;line-height:1.5}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important}}
.wave-panel{margin:20px 0 8px}.wave-panel canvas{display:block;width:100%;height:66px;background:#a48aca09;border-radius:14px}.wave-panel span{display:block;margin-top:7px;font-size:11px;color:#7d6c94}
/* One scroll owner while messages expand; preserve the reader's place otherwise. */
html,body{overflow-x:clip}html{overflow-anchor:none}#conversation{display:flow-root}.exchange{box-sizing:border-box}.card.prompt{scroll-margin-top:32px}#speech{transition:background-color .35s ease,border-color .35s ease}
/* A more compact reading scale, with room left between the tilted cards. */
main{max-width:1040px;padding:28px 58px 42px}.brand{font-size:32px}.heading{margin:54px 0 58px 24px}h1{font-size:55px;letter-spacing:-3px}.heading:after{font-size:78px}.muted{font-size:14px}.card{padding:24px 28px;border-radius:22px;margin-bottom:42px}.prompt{max-width:79%}.speech{max-width:77%;min-height:145px}h2{font-size:25px;margin:18px 0 10px}#translation{font-size:14px;margin-bottom:17px}#transcript{font-size:20px}#feedback{font-size:12px;padding-top:13px}.subtle{font-size:12px}.exchange{margin:50px 0;gap:32px}.chat-prompt,.chat-answer{max-width:77%;padding:21px 26px;border-radius:21px}.exchange p{font-size:19px}.translation{font-size:12px}.wave-panel{margin:15px 0 6px}.wave-panel canvas{height:48px}.wave-panel span{font-size:10px}.controls{padding:18px 0}.controls button{font-size:14px;padding:15px 25px}#start{min-width:210px}footer{margin-top:22px}
@media(max-width:650px){main{padding:22px 23px 30px}.brand{font-size:29px}.heading{margin:40px 0 46px 6px}h1{font-size:40px;letter-spacing:-2px}.heading:after{font-size:46px}.muted{font-size:13px}.card{padding:20px;max-width:94%;margin-bottom:34px}h2{font-size:21px}#transcript{font-size:18px}.chat-prompt,.chat-answer{max-width:93%;padding:19px}.exchange p{font-size:17px}.exchange{gap:27px;margin:40px 0}.controls button{padding:14px 19px}#start{min-width:180px}#start span{margin-left:15px}}
#typing[hidden]{display:none}#typing{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:15px}.typing-label{font-size:13px;color:#75608f}.typing-dots{display:flex;gap:7px}.typing-dots i{width:9px;height:9px;border-radius:50%;background:#9675c8;animation:typing-bounce 1.05s ease-in-out infinite}.typing-dots i:nth-child(2){animation-delay:.14s}.typing-dots i:nth-child(3){animation-delay:.28s}.is-typing #prompt,.is-typing #translation,.is-typing #help,.is-typing #hint,.is-typing #replies,.is-typing #reply-ideas{visibility:hidden}.is-typing #help,.is-typing #replies{pointer-events:none}@keyframes typing-bounce{0%,65%,100%{transform:translateY(0);opacity:.45}30%{transform:translateY(-7px);opacity:1}}@media(prefers-reduced-motion:reduce){.typing-dots i{animation:none}}
#source:not(:empty){margin:14px 0;font-size:12px}#source a,.chat-prompt a{color:#675084;font-size:12px}.is-typing #source{visibility:hidden}
.ai-voice{height:52px;margin:8px 0 12px;opacity:0;transition:opacity .2s ease;pointer-events:none}.ai-voice.speaking{opacity:1}.ai-voice canvas{display:block;width:100%;height:34px}.ai-voice span{font-size:10px;color:#705091;letter-spacing:.5px}.is-typing .ai-voice{visibility:hidden}
.yap-avatar{position:absolute;width:135px;right:-145px;top:8px;transform-origin:50% 85%;animation:companion-float 4s ease-in-out infinite;pointer-events:none;filter:drop-shadow(0 7px 5px #69469217)}.yap-avatar svg{width:100%;display:block;overflow:visible}.talk-mouth{transform-box:fill-box;transform-origin:center;transform:scaleY(var(--mouth,.12));opacity:0}.talking .talk-mouth{opacity:1}.talking .smile-mouth{opacity:0}.wink-eye{opacity:0}.winking .eye-right{opacity:0}.winking .wink-eye{opacity:1}.avatar-eyes{transform-origin:90px 110px;animation:companion-blink 6s infinite}.yap-avatar.chatting{animation:companion-think 2s ease-in-out infinite}.yap-avatar.speaking{animation:companion-float 1.8s ease-in-out infinite}@keyframes companion-float{0%,100%{transform:translateY(0) rotate(3deg)}50%{transform:translateY(-7px) rotate(-3deg)}}@keyframes companion-think{0%,100%{transform:rotate(-5deg)}50%{transform:rotate(6deg) translateY(-4px)}}@keyframes companion-blink{0%,43%,47%,100%{transform:scaleY(1)}45%{transform:scaleY(.08)}}@media(max-width:650px){.yap-avatar{width:82px;right:-8px;top:-69px}.card.prompt{margin-top:70px;padding-top:29px}}@media(prefers-reduced-motion:reduce){.yap-avatar,.avatar-eyes{animation:none}}
.natural-alternative{margin-top:18px;padding:16px 18px;border-top:1px dashed #91bc85;background:#ffffff70;border-radius:12px}.natural-alternative p{font-size:18px;margin:8px 0}.alternative-reason{font-size:13px;line-height:1.6;color:#496345}
.english-translation{display:none}body.show-english .english-translation{display:block}#english-toggle{white-space:nowrap;font-size:12px}.is-typing .english-translation{visibility:hidden}@media(max-width:650px){header{flex-wrap:wrap;gap:14px}#english-toggle{margin-left:auto}#state{width:100%;text-align:right}}
.reply-length{display:flex;align-items:center;gap:4px;font-size:11px;white-space:nowrap}.reply-length span{margin-right:6px;color:#7b6f8a}.reply-length button{border:0;border-radius:16px;background:#f0ebf6;color:#625270;padding:8px 11px;cursor:pointer}.reply-length button[aria-pressed=true]{background:#654d85;color:white}header{flex-wrap:wrap}
.card.prompt>.reply-length{margin:15px 0 18px;gap:6px}.card.prompt>.reply-length+.reply-length{margin-top:-10px}.card.prompt>.reply-length span{font-size:11px}.is-typing>.reply-length{visibility:hidden}
.english-translation[hidden]{display:none!important}.english-translation:not([hidden]){display:block}.translation-toggle{display:inline-block;margin:10px 0 15px;font-size:12px}.is-typing .translation-toggle{visibility:hidden}
header{margin-bottom:45px}
@media(max-width:650px){header{margin-bottom:65px}}
.chat-answer .practice{font-size:13px;color:#80520d}
del{color:#a04435;background:#f9dcd4;text-decoration:line-through;text-decoration-thickness:2px;border-radius:4px;padding:0 2px}ins{color:#5a3a06;background:#ffd970;text-decoration:none;border-radius:4px;padding:0 2px;font-weight:700}
.fix-reason{font-size:14px;line-height:1.6;color:#80520d;margin-top:8px}.fix-actions{display:flex;align-items:center;gap:16px;flex-wrap:wrap;margin-top:14px}.play{width:34px;height:34px;flex:none;border-radius:50%;border:1px solid #d5ac54;background:#fff;color:#80520d;font-size:12px;cursor:pointer}
.fix-strip{margin:16px 0 8px;padding:18px 20px;border-radius:18px;background:#fff6dd;border:1px dashed #d5ac54}.fix-strip small{font-size:10px;letter-spacing:1.3px;font-weight:700;color:#80520d}.fix-strip p{font-family:'Noto Sans JP',sans-serif;font-size:20px;line-height:1.8;margin:8px 0 0;overflow-wrap:anywhere}.fix-strip .said{font-size:16px;color:#7e7789}.fix-strip .fix{border:0;padding:0;color:#714b12}
.pill{border:0;border-radius:30px;padding:10px 18px;background:#352943;color:#fff;font:600 13px 'DM Sans',sans-serif;cursor:pointer}
.lavender-avatar{width:160px;right:-170px;top:4px}.lavender-avatar svg{overflow:hidden}.lavender-avatar .face-mouth,.lavender-avatar .face-eyes{transition:none}@media(max-width:650px){.lavender-avatar{width:95px;right:-4px;top:-82px}}

.reply-length>span:first-child{color:#7b6f8a;font-size:11px}.reply-length .segmented{display:inline-flex;gap:2px;padding:3px;border-radius:999px;background:#e4dbf3}.reply-length .segmented button{background:transparent;border-radius:999px;padding:6px 13px;font:600 12px 'DM Sans',sans-serif;color:#625270;transition:background .15s}.reply-length .segmented button[aria-pressed=true]{background:#654d85;color:#fff;box-shadow:0 1px 3px #3023424d}
.prompt-actions{display:flex;flex-wrap:wrap;gap:8px}.chip{display:inline-flex;align-items:center;gap:6px;border:1px solid #d9cdee;border-radius:999px;background:#ffffffb3;color:#5b4778;padding:7px 13px;font:600 12px 'DM Sans',sans-serif;cursor:pointer;transition:transform .15s,background .15s}.chip:not(:disabled):hover{background:#fff;transform:translateY(-1px)}
.lavender-avatar[data-emotion="happy"],.lavender-avatar[data-emotion="laughing"]{filter:drop-shadow(0 6px 10px #e6bbcf70)}.lavender-avatar[data-emotion="sad"]{animation-duration:6s;filter:drop-shadow(0 5px 8px #949fca45)}.lavender-avatar[data-emotion="curious"]{rotate:-5deg}.lavender-avatar[data-emotion="surprised"]{scale:1.035}
@media(max-width:650px){.reply-length{flex-wrap:wrap;row-gap:6px}.reply-length .segmented button{padding:6px 9px}}

#prompt .spoken,#practice-body .spoken{color:#7a62a0;transition:color .25s}#prompt .reading,#practice-body .reading{background:#ffd970;color:#3a2a06;border-radius:4px;box-shadow:0 0 0 2px #ffd970}

/* Chat motion: Akane types in a small bubble, pending bubbles wait for their stamp, the tape re-sticks. */
.card.prompt.is-typing>:not(.cardtop):not(#typing):not(.yap-avatar){display:none}
.default-avatar{gap:8px}.default-avatar img{width:44px;height:44px;border-radius:50%;background:#f0eafa;object-fit:cover}
.avatars-modal{border:1px solid #d8c6eb;border-radius:22px;padding:20px;max-width:560px;width:calc(100% - 32px);max-height:90dvh;overflow:auto;background:#fffefa;color:#342944;box-shadow:0 20px 80px #31203b40}.avatars-modal::backdrop{background:#2e193d55}
.avatars-modal h2{margin:0 0 14px;font-size:20px}.avatar-grid{display:grid;grid-template-columns:repeat(5,1fr);gap:10px}
.avatar-tile{position:relative;padding:0;aspect-ratio:1;border:3px solid transparent;border-radius:16px;background:#f0eafa;overflow:hidden;cursor:pointer}.avatar-tile:hover{border-color:#d8c6eb}.avatar-tile:focus-visible{outline:2px solid #342944;outline-offset:2px}.avatar-tile img{display:block;width:100%;height:100%}.avatar-tile span{position:absolute;inset:auto 0 0;padding:2px 0;background:#fffefae0;color:#342944;font:600 12px/16px 'DM Sans',sans-serif;text-align:center}
.avatar-tile[aria-pressed="true"]{border-color:#7a57a8;background:#e4dbf3}.avatar-tile[aria-pressed="true"]:after{content:'✓';position:absolute;right:4px;top:4px;width:22px;height:22px;border-radius:50%;background:#7a57a8;color:#fff;font:700 13px/22px 'DM Sans',sans-serif;text-align:center}
.avatars-modal #avatars-done{display:block;margin:16px 0 0 auto}
@media(max-width:650px){.avatar-grid{grid-template-columns:repeat(3,1fr)}}
.card.prompt.is-typing #typing{position:static;justify-content:flex-start;padding:10px 0 2px}
.scribble{width:64px;height:20px;overflow:visible}
.scribble path{fill:none;stroke:#9675c8;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:110;animation:scribble 1.5s ease-in-out infinite}
@keyframes scribble{0%{stroke-dashoffset:110;opacity:1}60%{stroke-dashoffset:0;opacity:1}85%,100%{stroke-dashoffset:0;opacity:0}}
.chat-answer.pending small{color:#9a8fab;animation:pending-pulse 1.2s ease-in-out infinite}
@keyframes pending-pulse{50%{opacity:.4}}
.chat-answer small{display:inline-block}
.prompt.retape:before{animation:retape .6s cubic-bezier(.3,1.4,.5,1)}
@keyframes retape{0%{transform:rotate(8deg)}30%{transform:translateY(-9px) rotate(-5deg) scaleX(1.08)}65%{transform:translateY(1px) rotate(11deg)}100%{transform:rotate(8deg)}}
.yap-avatar svg{transform-origin:50% 85%}
.confetti{position:fixed;width:9px;height:13px;border-radius:2px;pointer-events:none;z-index:50}
#transcript{scroll-margin-bottom:112px}
/* While you talk, Akane's card shows just her words so the question and your transcript fit together. */
.card.prompt.is-recording>.reply-length,.card.prompt.is-recording .prompt-actions>:not(#help):not(#replies){display:none}
#reply-ideas{margin-top:12px;color:#66517d}.reply-idea{display:grid;grid-template-columns:1fr auto;column-gap:12px;width:100%;padding:10px 14px;border:0;border-top:1px dashed #d9cdee;background:none;color:inherit;font:inherit;text-align:start;cursor:pointer}.reply-idea>*{grid-column:1}.reply-idea span{margin:0 0 2px;font-size:18px;line-height:1.5;color:#352943}.reply-idea small{font-size:13px}.reply-idea:after{content:'➤';content:'➤'/'';grid-column:2;grid-row:1/span 2;align-self:center;color:#9675c8}.reply-idea:hover{background:#ffffff8c}.is-recording .reply-idea{pointer-events:none}.is-recording .reply-idea:after{display:none}
@media(prefers-reduced-motion:reduce){.scribble path{animation:none;stroke-dashoffset:0}.chat-answer.pending small{animation:none}.prompt.retape:before{animation:none}}
/* The chat drives its own scrolling; browser scroll anchoring would fight it. */
html{overflow-anchor:none}
/* Chat-sized messages: history bubbles and Akane's card are compact so many turns fit on one screen. */
#conversation{padding-bottom:22px}.exchange{margin:12px 0;gap:8px}.chat-prompt,.chat-answer{padding:10px 16px;border-radius:18px;max-width:68%;min-width:0;box-shadow:2px 3px 0 #30234208}.exchange small{font-size:9px}.exchange p{font-size:16px;line-height:1.6;margin:3px 0 0}.exchange .translation{margin-top:2px}.exchange .translation-toggle{margin:2px 0 0;font-size:11px}.exchange .natural-alternative{margin-top:8px;padding:8px 12px}.exchange .natural-alternative p{font-size:15px;margin:4px 0}.exchange .fix{padding-top:6px}
.card{padding:18px 24px;margin-bottom:26px}h2{font-size:21px;line-height:1.6;margin:10px 0 4px}.card.prompt .translation-toggle{margin:4px 0 6px}.ai-voice{height:34px;margin:2px 0 10px}.ai-voice canvas{height:22px}.card.prompt>.reply-length{margin:6px 0 8px}.speech{min-height:110px}#transcript{font-size:18px;line-height:1.6}.wave-panel{margin:8px 0 4px}.wave-panel canvas{height:40px}
@media(max-width:650px){.chat-prompt,.chat-answer{max-width:86%;padding:9px 14px}.exchange p{font-size:15px}.card{padding:16px 18px}h2{font-size:19px}#transcript{font-size:17px}}
/* The page's text is filled in by i18n.js, so nothing shows until then. */
html:not(.ready) body{visibility:hidden}
/* Onboarding: the very first visit picks the languages before anything else shows. */
body.onboarding{padding-left:0}body:not(.onboarding) #onboarding{display:none}body.onboarding main>:not(header):not(#onboarding),body.onboarding #sidebar,body.onboarding #scrim,body.onboarding header>:not(.brand){display:none!important}
.onboarding-choices{display:grid;gap:10px;margin:16px 0}.onboarding-choices:empty{display:none}.onboarding-choice{display:flex;justify-content:space-between;align-items:baseline;gap:12px;width:100%;padding:14px 18px;border:2px solid #352943;border-radius:14px;background:#fff;color:#352943;font:700 17px 'DM Sans',sans-serif;cursor:pointer;text-align:left}.onboarding-choice:hover,.onboarding-choice:focus-visible{background:#f0eafa}.onboarding-choice small{font:500 14px 'Noto Sans JP','DM Sans',sans-serif;color:#7b7585}
.onboarding-actions{display:flex;flex-wrap:wrap;align-items:center;gap:10px}.onboarding-actions #onboarding-start{order:2;margin:0}.onboarding-actions #onboarding-back{order:3}.onboarding-actions:not(:has(button:not([hidden]))){display:none}.onboarding-face{position:relative;width:170px;height:170px;margin:6px auto 0}.onboarding-face .lavender-avatar{position:static;width:100%}#onboarding h2:focus{outline:none}
.language-settings{margin:0 0 18px;padding-bottom:14px;border-bottom:1px dashed #d8d2e2}.language-settings .reply-length{margin:10px 0}
/* Setup screen: a chat starts by choosing how Akane talks; her first bubble appears only after Start. */
body:not(.choosing) #setup,body.choosing #conversation,body.choosing .card.prompt,body.choosing #speech,body.choosing .controls,body.choosing #new-chat{display:none}
.setup{max-width:620px;margin:24px auto 30px;background:#fff;transform:rotate(-1deg)}.setup h2{font-family:'DM Sans',sans-serif;font-size:24px;font-weight:700;letter-spacing:-.5px;margin:10px 0 2px}.setup-note{margin:0 0 16px;font-size:13px;color:#7b7585}.setup>.reply-length{margin:10px 0}
#begin,#onboarding-start{margin:20px 0 4px;border:0;border-radius:40px;padding:15px 26px;background:#352943;color:#fff;font:600 15px 'DM Sans',sans-serif;box-shadow:4px 5px 0 #d8c9f5;transform:rotate(-2deg);cursor:pointer;transition:transform .15s}#begin:hover,#onboarding-start:hover{transform:rotate(0) translateY(-2px)}#begin span,#onboarding-start span{margin-left:22px}
#new-chat{margin-left:6px}
@media(max-width:650px){.setup{margin:16px 0 24px;transform:none}#begin,#onboarding-start{width:100%}}
/* Chat history sidebar: always open on wide screens, a ☰ drawer on narrow ones. */
#sidebar{position:fixed;inset:0 auto 0 0;width:264px;z-index:20;display:flex;flex-direction:column;gap:8px;padding:22px 12px;background:#f7f3fc;border-right:1px solid #ece6f3;overflow-y:auto}body{padding-left:264px}
.side-new{border:1px solid #ddd3ea;border-radius:14px;background:#fff;padding:11px 14px;font:600 14px 'DM Sans',sans-serif;color:#352943;text-align:left;cursor:pointer;box-shadow:2px 3px 0 #d8c9f5;margin-bottom:14px}.side-new:hover{background:#fbf9fe}
#sidebar small{font-size:10px;font-weight:700;letter-spacing:1.6px;color:#766989;padding:0 10px}#chat-list{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:minmax(0,1fr);gap:2px}#no-chats{font-size:13px;color:#8a8196;padding:0 10px;margin:4px 0}#no-chats[hidden]{display:none}
.past-chat{display:block;width:100%;border:0;border-radius:10px;background:transparent;padding:9px 10px;font:400 13px 'Noto Sans JP',sans-serif;color:#352943;text-align:left;cursor:pointer;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.past-chat:hover{background:#efe8f8}.past-chat[aria-current=true]{background:#e6dcf6;font-weight:500}
#menu,#scrim{display:none}@media(min-width:1100px){#new-chat{display:none}}
@media(max-width:1099px){body{padding-left:0}#sidebar{transform:translateX(-100%);visibility:hidden;transition:transform .22s ease,visibility .22s;box-shadow:6px 0 24px #30234222}body.menu-open #sidebar{transform:none;visibility:visible;transition:transform .22s ease}#menu{display:inline-flex;font-size:16px;padding:6px 12px}body.menu-open #scrim{display:block;position:fixed;inset:0;z-index:19;background:#f7f3fcd9}}
@media(prefers-reduced-motion:reduce){#sidebar{transition:none}}
.account{margin-top:auto;padding-top:14px;display:grid;gap:10px}.account[hidden],#account [hidden],#delete-data[hidden],#corrections-sign-in[hidden],#words-sign-in[hidden],#memory-sign-in[hidden],.dict-save-note[hidden]{display:none}.account p{margin:0;padding:0 10px;font-size:12px;line-height:1.45;color:#766989}.account a{padding:0 10px;font-size:12px;color:#766989}
.sign-in{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;margin:0 0 10px}.sign-in svg{width:18px;height:18px;flex:none}#account-user{display:grid;gap:8px;justify-items:start}#account-email{width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:#352943;font-weight:600}#account-user .chip{margin-left:10px}#delete-data{margin-left:10px;color:#a3323f}
/* The ☰ stays on screen while scrolling, so history is one tap away mid-chat. */
@media(max-width:1099px){#menu{position:fixed;top:14px;left:14px;z-index:18;box-shadow:2px 3px 0 #d8c9f5}}@media(max-width:650px){header{padding-left:40px}}
/* Dictionary: a note card taped over the chat. The dialog stays unclipped for the tape and star; the sheet scrolls. */
#prompt,.chat-prompt p{cursor:text}
.dictionary-popup{--tilt:-1deg;border:0;padding:0;background:transparent;overflow:visible;max-width:440px;width:calc(100% - 32px);max-height:none;color:#342944;font-family:'DM Sans','Noto Sans JP',sans-serif;transform:rotate(var(--tilt))}
.dictionary-popup[open]{animation:dict-pop .4s cubic-bezier(.3,1.4,.5,1)}.dictionary-popup[open]::backdrop{background:#2e193d35;animation:dict-fade .25s ease}
.dictionary-popup:before{content:'';position:absolute;z-index:1;top:-12px;left:38%;width:86px;height:25px;background:#f7eaa6d0;transform:rotate(-5deg);pointer-events:none}
.dictionary-popup:after{content:'✳';position:absolute;right:-9px;bottom:-20px;font-size:46px;line-height:1;color:#bca7f5;pointer-events:none;animation:dict-twirl 14s linear infinite}
.dict-sheet{max-height:min(78vh,640px);overflow:auto;padding:22px 26px 20px;background:#fffefa;border:1px solid #e0d6ec;border-radius:22px;box-shadow:5px 7px 0 #d8c9f5;outline:0}
.dict-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}.dict-top .eyebrow{padding:6px 10px;font-size:9px}
.dictionary-close{width:36px;height:36px;flex:none;border:0;border-radius:50%;background:#f0ebf7;color:#625270;font:500 21px/1 'DM Sans',sans-serif;cursor:pointer;transition:transform .2s,background .15s}.dictionary-close:hover{background:#e6dcf6;transform:rotate(90deg)}
.dict-head{display:flex;align-items:flex-end;justify-content:space-between;gap:14px}.dict-title{min-width:0}
.dict-reading{margin:0 0 2px;font:500 14px/1.5 'Noto Sans JP',sans-serif;letter-spacing:1px;color:#7a62a0}
.dictionary-popup h2,.saved-word h3{display:inline;margin:0;font-size:33px;font-weight:600;line-height:1.4;background:linear-gradient(transparent 56%,#ffd970a6 56%,#ffd970a6 84%,transparent 84%);-webkit-box-decoration-break:clone;box-decoration-break:clone}
.dict-actions{display:flex;flex-wrap:wrap;justify-content:flex-end;align-items:center;gap:8px;flex:none}.dict-save{padding:9px 15px;font-size:12px;background:#fff;color:#5b4778;box-shadow:inset 0 0 0 1px #d9cdee;transition:transform .15s}.dict-save[aria-pressed=true]{background:#ffd970;color:#3a2a06;box-shadow:none}.dict-save:not(:disabled):hover{transform:translateY(-2px)}.dict-save:not(:disabled):active{transform:scale(.94)}.dict-save:disabled{opacity:.6}.dict-save-note{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:12px 0 0;font-size:13px;line-height:1.5;color:#a04435}
.dict-hear{flex:none;padding:9px 15px;font-size:12px;box-shadow:3px 4px 0 #d8c9f5;transform:rotate(-2deg);transition:transform .15s}.dict-hear:not(:disabled):hover{transform:rotate(0) translateY(-2px)}.dict-hear:not(:disabled):active{transform:scale(.94)}.dict-hear:disabled{animation:pending-pulse 1.2s ease-in-out infinite}
.dict-tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:14px}.dict-tag{padding:4px 11px;border-radius:999px;background:#eee7ff;color:#5b4778;font-size:12px;font-weight:600;overflow-wrap:anywhere}
.dict-meanings{list-style:none;counter-reset:meaning;margin:18px 0 0;padding:0;display:grid;gap:10px}.dict-meanings li{counter-increment:meaning;position:relative;padding-left:35px;font-size:15px;line-height:1.5;animation:dict-rise .32s ease both;animation-delay:calc(var(--i)*60ms)}
.dict-meanings li:before{content:counter(meaning);position:absolute;left:0;top:-1px;width:24px;height:24px;border-radius:50%;display:grid;place-items:center;background:#eee7ff;color:#5b4778;font-size:12px;font-weight:700;transform:rotate(-6deg)}.dict-meanings li:nth-child(3n+2):before{background:#f8efad;color:#645a32;transform:rotate(5deg)}.dict-meanings li:nth-child(3n):before{background:#e4f6df;color:#326b29;transform:rotate(-3deg)}
.dict-note{margin-top:18px;padding:12px 15px;border:1px dashed #d5ac54;border-radius:14px;background:#fff6dd;animation:dict-rise .32s .18s ease both}.dict-note small{font-size:9px;font-weight:700;letter-spacing:1.3px;color:#80520d}.dict-note p{margin:3px 0 0;font-size:13.5px;line-height:1.6;color:#5f4413}
.dict-source{display:block;margin-top:14px;padding-right:30px;font-size:11px;color:#8a8196}
.dict-loading{display:flex;align-items:center;gap:12px;margin:16px 0 8px;font-size:13px;color:#75608f}
.dict-oops{margin:16px 0 2px;font-size:15px;font-weight:600;color:#a04435}.dict-oops-why{margin:0 0 14px;font-size:13px;line-height:1.5;color:#7b7585}
@keyframes dict-pop{from{opacity:0;transform:translateY(16px) scale(.9) rotate(calc(var(--tilt) - 5deg))}}@keyframes dict-fade{from{opacity:0}}@keyframes dict-rise{from{opacity:0;transform:translateY(7px)}}@keyframes dict-twirl{to{rotate:360deg}}
@media(max-width:650px){.dictionary-popup{--tilt:0deg;margin:auto auto 18px;max-width:none}.dictionary-popup:after{font-size:34px;right:-5px;bottom:-13px}.dict-sheet{padding:18px 20px 16px}.dictionary-popup h2,.saved-word h3{font-size:28px}.dict-head{flex-wrap:wrap}.dict-actions{justify-content:flex-start}}
@media(prefers-reduced-motion:reduce){.dictionary-popup[open],.dictionary-popup[open]::backdrop,.dictionary-popup:after,.dict-meanings li,.dict-note,.dict-hear:disabled{animation:none}}
.interests{margin:18px 0}.interests-title{margin:0 0 2px;font-size:14px;font-weight:700;color:#352943}.interests-title small{margin-left:6px;font-size:11px;font-weight:500;color:#7b7585}.interests .setup-note{margin-bottom:10px}.interest-chips{display:flex;flex-wrap:wrap;gap:6px}.interest-chips:empty{display:none}.chip[aria-pressed=true],.chip[aria-pressed=true]:not(:disabled):hover{background:#654d85;border-color:#654d85;color:#fff}.interest-form{display:flex;gap:6px;margin:10px 0 8px}.interest-form input{flex:1;min-width:0;border:1px solid #d9cdee;border-radius:999px;padding:7px 14px;font:16px 'DM Sans',sans-serif;color:#352943;background:#fff}.interest-form input:disabled{opacity:.55}
/* Settings replaces whatever else was on screen; a chat underneath stays as it was. */
body:not(.settings-open) #settings,body.settings-open #setup,body.settings-open #conversation,body.settings-open .card.prompt,body.settings-open #speech,body.settings-open .controls,body.settings-open #new-chat,body:not(.corrections-open) #corrections,body.corrections-open #setup,body.corrections-open #conversation,body.corrections-open .card.prompt,body.corrections-open #speech,body.corrections-open .controls,body.corrections-open #new-chat,body:not(.words-open) #words,body.words-open #setup,body.words-open #conversation,body.words-open .card.prompt,body.words-open #speech,body.words-open .controls,body.words-open #new-chat,body:not(.memory-open) #memory,body.memory-open #setup,body.memory-open #conversation,body.memory-open .card.prompt,body.memory-open #speech,body.memory-open .controls,body.memory-open #new-chat{display:none}#settings-status{min-height:18px;margin:12px 0}
.human-check{border:0;padding:0;background:none;overflow:visible}
/* Corrections: the practice modal and the review page share the fix strip's look. */
.practice-modal{border:1px solid #d8c6eb;border-radius:22px;padding:24px;max-width:520px;width:calc(100% - 32px);max-height:85vh;overflow:auto;background:#fffefa;color:#342944;box-shadow:0 20px 80px #31203b40}.practice-modal::backdrop{background:#2e193d55}.practice-modal .fix-strip{margin:14px 0 0}.practice-modal .fix{font-size:24px}.practice-tip{margin:14px 0 0;font-size:14px;color:#7b7585}#practice-error{margin:8px 0 0;font-size:13px;color:#a04435}#practice-error:empty{display:none}
#corrections,#words,#memory{transform:none;max-width:720px}#corrections-status:empty,#words-status:empty,#memory-status:empty{display:none}#memory-done{margin-top:12px}#open-memory{margin-left:8px}.memory-avatar{margin:16px 0 8px;font-size:15px}.memory-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:8px 0;padding:12px 16px;border:1px solid #e0d6ec;border-radius:14px;background:#fffefa;color:#342944}.memory-row p{margin:0;font-size:14px;line-height:1.5;overflow-wrap:anywhere}.memory-row .chip{flex:none}#words-done{margin-top:12px}.saved-word{margin:16px 0 8px;padding:18px 20px;border:1px solid #e0d6ec;border-radius:18px;background:#fffefa;color:#342944}.saved-word .dict-source{padding-right:0}.saved-word-sentence{margin:12px 0 0;font:400 14px/1.7 'Noto Sans JP',sans-serif;color:#7b7585;overflow-wrap:anywhere}#practice-all{margin:0 0 14px}.correction-context{font-family:'Noto Sans JP',sans-serif;font-size:13px;color:#7b7585;margin-top:6px;overflow-wrap:anywhere}.correction-row.practiced{background:#f6f8f3;border-color:#c5d8bd}.correction-row.practiced small{color:#326b29}#corrections-done{margin-top:12px}
/* Upgrade card: Akane bounces behind the lavender band's bottom edge. The dialog's padding is the room for her head and also counts as backdrop for clicks. */
.upgrade-modal{border:0;padding:96px 14px 16px;background:transparent;overflow:auto;max-width:460px;width:100%;max-height:100dvh;color:#342944;font-family:'DM Sans','Noto Sans JP',sans-serif}.upgrade-modal[open]{animation:upgrade-pop .5s cubic-bezier(.3,1.5,.5,1)}.upgrade-modal::backdrop{background:#2e193d66;animation:dict-fade .25s ease}
.upgrade-sheet{position:relative;transform:rotate(-1.2deg);background:#fffefa;border:1px solid #e0d6ec;border-radius:26px;box-shadow:6px 8px 0 #d8c9f5;text-align:center}
.upgrade-hero{position:relative;display:flex;align-items:flex-end;justify-content:center;gap:6px;height:112px;padding:0 18px;background:#efe6fb;border-radius:25px 25px 0 0;border-bottom:2px dashed #cbb7ee}
.upgrade-face{flex:none;width:190px;height:190px;clip-path:inset(-40px 0 0 0)}.upgrade-face .lavender-avatar{position:static;width:100%;animation:upgrade-hop 1.5s ease-in-out infinite}
.upgrade-bubble{position:relative;flex:none;margin:0 0 38px;padding:10px 14px;background:#fff;border:2px solid #352943;border-radius:18px;font:700 16px 'Noto Sans JP',sans-serif;line-height:1.3;white-space:nowrap;transform-origin:0 70%;animation:upgrade-wiggle 3s ease-in-out infinite}.upgrade-bubble small{display:block;margin-top:2px;font:600 11px 'DM Sans',sans-serif;color:#654d85}.upgrade-bubble:after{content:'';position:absolute;left:-9px;bottom:16px;width:14px;height:14px;background:#fff;border-left:2px solid #352943;border-bottom:2px solid #352943;transform:rotate(45deg)}
.upgrade-spark{position:absolute;font-size:22px;line-height:1;color:#a98bf0;pointer-events:none;animation:upgrade-twinkle 2.4s ease-in-out infinite}.upgrade-spark:nth-child(1){top:-40px;left:30px}.upgrade-spark:nth-child(2){top:22px;left:22px;color:#f06292;animation-delay:.6s}.upgrade-spark:nth-child(3){top:-58px;right:44px;font-size:34px;animation-delay:1.2s}.upgrade-spark:nth-child(4){top:80px;right:18px;font-size:16px;color:#f5b800;animation-delay:1.8s}
.upgrade-body{padding:22px 30px 18px}.upgrade-body h2{margin:0 0 8px;font:700 27px/1.15 'DM Sans',sans-serif;letter-spacing:-.8px}.upgrade-body>p{margin:0;font-size:15px;line-height:1.5;color:#625270}
#upgrade-join{display:block;width:100%;margin:20px 0 0;border:0;border-radius:40px;padding:18px;background:#352943;color:#fff;font:700 16px 'DM Sans',sans-serif;box-shadow:4px 5px 0 #d8c9f5;transform:rotate(-1deg);cursor:pointer;transition:transform .15s}#upgrade-join:hover{transform:rotate(0deg) translateY(-2px)}#upgrade-join span{margin-left:10px}
.upgrade-body>#upgrade-status{margin-top:14px;font-size:13px;font-weight:600;color:#654d85}#upgrade-status:empty{display:none}#upgrade-later{margin-top:12px;border:0;padding:6px;background:none;color:#6f6879;font:500 13px 'DM Sans',sans-serif;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
@keyframes upgrade-pop{from{opacity:0;transform:translateY(24px) scale(.88)}}@keyframes upgrade-hop{0%,100%{translate:0 16px}50%{translate:0 3px;rotate:-2deg}}@keyframes upgrade-wiggle{0%,100%{rotate:2deg}50%{rotate:-2deg}}@keyframes upgrade-twinkle{0%,100%{opacity:.35;scale:.8}50%{opacity:1;scale:1.15}}
@media(max-width:650px){.upgrade-modal{padding-top:80px}.upgrade-hero{height:92px;gap:2px;padding:0 10px}.upgrade-face{width:150px;height:150px}.upgrade-bubble{margin-bottom:26px;font-size:14px}.upgrade-body{padding:18px 20px 14px}.upgrade-body h2{font-size:23px}}
@media(prefers-reduced-motion:reduce){.upgrade-modal[open],.upgrade-modal::backdrop,.upgrade-bubble,.upgrade-spark{animation:none}.upgrade-face .lavender-avatar{animation:none;translate:0 3px}}
.listen-only .prompt:not(.peek) #prompt,.listen-only .prompt:not(.peek) #translation{filter:blur(9px);user-select:none;-webkit-user-select:none;cursor:pointer}
/* Chat review: a page like Corrections, reached from the chip under the chat. A fix in a bubble waits behind Show fix. */
body:not(.review-open) #review,body.review-open #setup,body.review-open #conversation,body.review-open .card.prompt,body.review-open #speech,body.review-open .controls,body.review-open #new-chat{display:none}
#review{transform:none;max-width:720px}#review-status:empty{display:none}#review-done{margin:16px 8px 0 0}#review-back{margin-top:16px}.review-chip{margin-top:10px}.link{border:0;padding:0;background:none;font:inherit;color:#654d85;text-decoration:underline;cursor:pointer}
.review-heading{margin:20px 0 6px;font-size:11px;letter-spacing:.14em;font-weight:700;color:#7a5a12}.review-heading.better{color:#4a33b8}.review-heading.words{color:#326b29}
.done-well{margin:12px 0 4px;padding:12px 16px;border-radius:14px;background:#eef6ea;color:#2c5a24}.done-well small{font-size:11px;letter-spacing:.14em;font-weight:700}.done-well p{margin:4px 0 0;font-size:15px;line-height:1.5}
.fix-strip .said-plain{font-size:16px;color:#7e7789}.review-better{background:#f5f0fc;border-color:#ddd0f3}.review-word{background:#f6f8f3;border-color:#c5d8bd}.review-word small{color:#326b29}.review-word .reading{font-size:13px;font-weight:400;color:#7b7585}
.quiet-fix{margin-top:6px}.quiet-fix summary{cursor:pointer;font-size:13px;color:#7a5a12;list-style-position:inside}.quiet-fix[open] summary{margin-bottom:4px}
/* One sidebar holds every global place (brand, New chat, Review, Chats, You); the header only shows this chat. */
#sidebar{width:280px;gap:2px;padding:20px 12px 14px}body{padding-left:280px}
.side-top{display:flex;align-items:flex-start;flex-wrap:wrap;gap:6px 8px;padding:2px 10px 16px}.side-top .brand{font-size:30px;letter-spacing:-2px}.side-top .brand span{font-size:18px}.side-top .tag{display:block;order:3;flex-basis:100%;font-size:9px;color:#6f6680}
.side-close{display:none;margin-left:auto;width:44px;height:44px;align-items:center;justify-content:center;border:1px solid #ddd3ea;border-radius:50%;background:#fff;color:#352943;cursor:pointer}.side-close svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round}
#sidebar .side-heading{margin:16px 0 4px;padding:0 10px;font:700 13px/1.3 'DM Sans',sans-serif;letter-spacing:0;color:#352943}
.side-link{display:flex;align-items:center;gap:12px;width:100%;min-height:40px;border:0;border-radius:10px;background:transparent;padding:0 10px;font:400 14px 'DM Sans',sans-serif;color:#352943;text-align:left;cursor:pointer}.side-link:hover{background:#efe8f8}.side-link svg{width:18px;height:18px;flex:none;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
body.corrections-open #open-corrections,body.words-open #open-words,body.settings-open #open-settings,body.memory-open #open-settings{background:#e6dcf6;font-weight:600}
/* On a Review or You page that row is the selected one, so the open chat drops its highlight. */
body:is(.corrections-open,.words-open,.settings-open,.memory-open) .past-chat[aria-current=true]{background:transparent;font-weight:400}
.past-chat{padding:11px 10px}
.side-you{margin-top:auto;padding-top:10px;border-top:1px solid #e3dbee;display:grid;gap:8px}.side-you .account{margin-top:0;padding-top:0}
.you-link{min-height:52px;padding:6px 10px}.you-dot{width:34px;height:34px;border-radius:50%;background:#352943;color:#fffefa;display:flex;align-items:center;justify-content:center;flex:none}.you-dot svg{width:20px;height:20px}
.you-text{display:flex;flex-direction:column;gap:1px;min-width:0;flex:1}.you-text b{font-weight:600}.you-text span{font-size:12px;color:#6b5f7e}.you-link .chev{width:16px;height:16px;color:#6b5f7e}
/* Slim header that stays put; the full-bleed shadow paints the gutters so chat scrolls under it cleanly. */
header{position:sticky;top:0;z-index:5;flex-wrap:nowrap;gap:14px;padding-top:12px;padding-bottom:12px;background:#fffefa;box-shadow:0 0 0 100vmax #fffefa;clip-path:inset(0 -100vmax)}
body:not(.onboarding) header .brand{display:none}
.who{display:flex;flex-direction:column;min-width:0;line-height:1.3}.friend-name{font-size:17px;font-weight:700}header #state{margin-left:0;width:auto;text-align:left;font-size:12px}#new-chat{margin-left:auto}header .chip{flex:none;white-space:nowrap}.who>*{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
@media(max-width:1099px){body{padding-left:0}#sidebar{width:min(86vw,340px)}.side-close{display:inline-flex}.side-link{min-height:44px}#menu{position:static;width:44px;height:44px;justify-content:center;padding:0;flex:none}#new-chat{min-height:44px}header{padding-left:0}}
.ideas-think{display:flex;align-items:center;gap:10px;margin:0 0 6px;padding:0 14px;font-size:14px;color:#75608f}.ideas-bubbles{display:flex;align-items:flex-end;gap:4px;height:22px}.ideas-bubbles i{display:block;border-radius:50%;background:#fff;border:2px solid #9675c8;animation:idea-bubble 1.6s ease-in-out infinite}.ideas-bubbles i:nth-child(1){width:6px;height:6px}.ideas-bubbles i:nth-child(2){width:10px;height:10px;animation-delay:.2s}.ideas-bubbles i:nth-child(3){width:16px;height:16px;animation-delay:.4s}.idea-ghost{display:block;padding:12px 14px;border-top:1px dashed #d9cdee}.idea-ghost:before,.idea-ghost:after{content:'';display:block;height:16px;width:78%;border-radius:8px;background:linear-gradient(90deg,#d6c6ee 0,#fbf8ff 45%,#d6c6ee 90%) 0 0/250% 100%;animation:idea-shimmer 1.3s linear infinite}.idea-ghost:after{height:11px;width:46%;margin-top:7px;opacity:.7}.idea-ghost:nth-child(3):before{width:62%;animation-delay:.15s}.idea-ghost:nth-child(3):after{width:52%;animation-delay:.15s}.idea-ghost:nth-child(4):before{width:70%;animation-delay:.3s}.idea-ghost:nth-child(4):after{width:38%;animation-delay:.3s}@keyframes idea-bubble{0%,100%{transform:translateY(0) scale(1);opacity:.55}40%{transform:translateY(-6px) scale(1.12);opacity:1}}@keyframes idea-shimmer{from{background-position:100% 0}to{background-position:-150% 0}}@media(prefers-reduced-motion:reduce){.ideas-bubbles i,.idea-ghost:before,.idea-ghost:after{animation:none}}
::highlight(dict-word){background-color:#ffd97099;text-decoration:underline 2px #9165d3}
