:root{--paper:#fff8ec;--surface:#fffdf8;--ink:#202a32;--muted:#756f64;--orange:#f48935;--orange-dark:#a94f17;--peach:#ffe2bf;--line:#eadfca;--navy:#173e52;--blue:#3f78e8;--green:#168761;--red:#bd4c3a;--shadow:0 14px 40px rgba(68,48,24,.09);--radius:24px}
*{box-sizing:border-box}
html{background:#f1efe9;scroll-behavior:smooth}
body{margin:0;color:var(--ink);font:16px/1.5 Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;-webkit-font-smoothing:antialiased}
button,input{font:inherit;color:inherit}button{border:0;cursor:pointer;-webkit-tap-highlight-color:transparent}button:disabled{cursor:default;opacity:.48}button:focus-visible,input:focus-visible,a:focus-visible{outline:3px solid var(--navy);outline-offset:3px}
svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;vertical-align:middle}
h1,h2,h3,p{margin:0}h1{font-size:clamp(30px,7vw,42px);line-height:1.08;letter-spacing:-1.3px}h2{line-height:1.2}p{line-height:1.55}
.app-shell{width:min(100%,1280px);min-height:100dvh;margin:auto;background:var(--paper);display:grid;grid-template-columns:1fr;position:relative}
.desktop-brand{display:none}.screen{min-height:calc(100dvh - 84px)}.pad{padding:24px 20px 118px}
.page-header{margin-bottom:24px;max-width:720px}.page-header h1{margin:5px 0 9px}.eyebrow{color:var(--orange-dark);font-size:11px;font-weight:800;letter-spacing:1.4px}.sub{color:var(--muted);font-size:15px}.small{font-size:13px;color:var(--muted)}.mini{font-size:11px;color:var(--muted);font-weight:700;letter-spacing:1px}.center{text-align:center}.full{width:100%}.wide-gap{margin-top:24px}
.brand-lockup{display:flex;align-items:center;gap:10px}.brand-lockup>span:last-child{display:flex;flex-direction:column}.brand-lockup b{font-size:18px}.brand-lockup small{font-size:11px;color:var(--muted)}.brand-mark{width:39px;height:39px;border-radius:13px;background:var(--orange);color:#fff;display:grid;place-items:center;font-weight:900;letter-spacing:-1px}.brand-lockup.compact .brand-mark{width:34px;height:34px;border-radius:11px}
.primary{min-height:50px;padding:14px 22px;border-radius:16px;background:var(--orange);color:#321b0c;font-weight:800;display:flex;align-items:center;justify-content:center;gap:8px;box-shadow:0 8px 20px rgba(218,112,35,.18)}.primary:hover{background:#f69a4d}.secondary{min-height:48px;padding:12px 18px;border:1px solid var(--line);border-radius:16px;background:var(--surface);font-weight:700}.quiet{background:transparent;padding:12px;color:#825b37;text-decoration:underline;text-underline-offset:4px}.text-button{background:transparent;color:var(--orange-dark);font-weight:700}.icon-btn{width:44px;height:44px;border-radius:50%;background:#fffdf8;display:inline-flex;align-items:center;justify-content:center;flex:0 0 auto}.compact-btn{min-height:42px;padding:9px 13px;font-size:13px}.level-pill{display:inline-flex;border-radius:999px;padding:5px 9px;background:#fff0d8;color:#96501c;font-size:11px;font-weight:800}
nav{position:fixed;z-index:12;left:0;right:0;bottom:0;display:flex;justify-content:space-around;background:rgba(255,253,248,.96);border-top:1px solid var(--line);padding:9px 7px max(11px,env(safe-area-inset-bottom));backdrop-filter:blur(18px)}nav[hidden]{display:none}nav button{min-width:60px;padding:7px 6px;border-radius:15px;background:transparent;color:#8a8985;font-size:10px;display:flex;flex-direction:column;align-items:center;gap:3px}nav button.active{color:var(--orange-dark);background:#fff0d8}nav svg{width:21px;height:21px}
.daily-card{position:relative;overflow:hidden;background:var(--navy);color:white;border-radius:28px;padding:22px;margin:20px 0;min-height:310px;box-shadow:var(--shadow)}.daily-card .eyebrow{color:#ffd19e;margin-top:24px}.daily-card h2{font-size:31px;margin:5px 0}.daily-card p{color:#d7e2e7}.daily-card>div:first-child{position:relative;z-index:2;max-width:58%}.daily-card .primary{position:absolute;left:20px;right:20px;bottom:20px;z-index:3}.daily-portrait{position:absolute;right:-36px;top:-5px;width:66%;height:245px;border-radius:0 0 0 48%;overflow:hidden;opacity:.72}.daily-portrait img{width:100%;height:100%;object-fit:cover;object-position:center 22%}
.streak-row{display:grid;grid-template-columns:repeat(3,1fr);gap:9px;margin:20px 0 30px}.streak-row div{background:var(--surface);border:1px solid var(--line);border-radius:18px;padding:14px 8px;text-align:center}.streak-row b{font-size:21px;display:block}.streak-row span{font-size:11px;color:var(--muted)}
.section-heading{display:flex;justify-content:space-between;align-items:flex-end;gap:16px;margin:24px 0 12px}.section-heading h2{font-size:20px}.section-heading>span{font-size:12px;color:var(--muted)}.path-card{display:flex;align-items:center;gap:14px;background:var(--surface);border:1px solid var(--line);border-radius:20px;padding:16px;margin:10px 0}.path-card.current{border-color:#efa661;box-shadow:0 8px 24px rgba(103,72,34,.07)}.path-card.locked{opacity:.68}.path-card>div{flex:1}.path-card p{font-size:13px;color:var(--muted)}.path-card>button{width:42px;height:42px;border-radius:50%;background:var(--orange)}.path-number{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#fff0d8;color:var(--orange-dark);font-weight:800}
.tutor-list{display:grid;gap:14px}.tutor-row{display:grid;grid-template-columns:110px minmax(0,1fr);background:var(--surface);border:2px solid transparent;border-radius:22px;overflow:hidden;box-shadow:0 7px 24px rgba(73,54,30,.07)}.tutor-row.selected{border-color:#ef9e57}.tutor-list-photo{width:110px;height:100%;min-height:190px;object-fit:cover;object-position:center top;background:#f2b06b}.tutor-row-info{padding:15px;min-width:0;overflow-wrap:anywhere}.tutor-row h2{font-size:23px;margin:7px 0 4px}.tutor-row h2 small{font-size:14px;color:var(--muted)}.tutor-row p{font-size:13px;color:var(--muted)}.tutor-actions{display:flex;flex-direction:column;align-items:stretch;gap:7px;margin-top:14px}.tutor-actions .primary{flex:1}.tutor-actions .secondary{white-space:normal}.tutor-sprite{background-image:url('tutors-sheet.png');background-size:300% 200%;background-repeat:no-repeat}.tutor-sprite.s0{background-position:0 0}.tutor-sprite.s1{background-position:50% 0}.tutor-sprite.s2{background-position:100% 0}.tutor-sprite.s3{background-position:0 100%}.tutor-sprite.s4{background-position:50% 100%}.tutor-sprite.s5{background-position:100% 100%}.profile-avatar{display:block;width:116px;height:116px;margin:16px auto;border-radius:50%;object-fit:cover;background:#efad66}.profile-avatar.tutor-sprite{background-size:300% 200%}
.filter-row{display:flex;gap:8px;overflow:auto;margin:4px -20px 20px;padding:2px 20px}.filter{white-space:nowrap;border-radius:999px;padding:9px 14px;background:var(--surface);border:1px solid var(--line);font-size:13px}.filter.active{background:var(--navy);color:#fff;border-color:var(--navy)}.explore-feature{background:var(--surface);border-radius:24px;overflow:hidden;border:1px solid var(--line);box-shadow:var(--shadow)}.explore-feature>div:last-child{padding:18px}.explore-feature h2{margin:9px 0 4px}.explore-feature p{color:var(--muted);margin-bottom:15px}.explore-image{display:block;width:100%;height:220px;object-fit:cover;object-position:center 28%}.content-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:16px}.content-card{background:var(--surface);border:1px solid var(--line);border-radius:20px;overflow:hidden;padding-bottom:13px}.story-image{display:block;width:100%;height:130px;object-fit:cover;object-position:center 22%;margin-bottom:12px}.content-card span,.content-card h3,.content-card p{margin-left:13px;margin-right:13px}.content-card span{font-size:10px;color:var(--orange-dark);font-weight:800}.content-card h3{font-size:16px;margin-top:4px}.content-card p{font-size:12px;color:var(--muted);margin-top:4px}
.onboarding{min-height:100dvh;display:flex;flex-direction:column;padding:22px 20px max(20px,env(safe-area-inset-bottom))}.onboarding-top{display:flex;align-items:center;justify-content:space-between;gap:20px}.onboarding-top .step-progress{width:42%;margin:0}.onboarding-card{flex:1;padding:58px 0 28px}.onboarding-card h1{margin:7px 0 10px}.field-label{display:block;margin:38px 0 8px;font-weight:700}.large-input{width:100%;border:2px solid var(--line);border-radius:18px;padding:17px;background:var(--surface);font-size:18px}.large-input:focus{border-color:var(--blue)}.choice-list{display:grid;gap:11px;margin-top:30px}.choice{min-height:58px;border:2px solid transparent;border-radius:18px;background:var(--surface);padding:13px 16px;text-align:left;display:flex;align-items:center;justify-content:space-between;box-shadow:0 5px 18px rgba(59,48,36,.05)}.choice.selected{border-color:var(--blue);background:#f7faff}.choice svg{color:var(--blue)}.onboarding-actions{display:flex;gap:10px;align-items:center}.onboarding-actions .primary{flex:1}.onboarding-actions .secondary{min-width:92px}
.step-progress{display:flex;gap:5px;margin:8px 0}.step-progress span{height:5px;border-radius:6px;background:#e2ddcf;flex:1}.step-progress span.done{background:var(--blue)}
.lesson-screen{min-height:100dvh;background:var(--paper)}.lesson-header{height:78px;display:grid;grid-template-columns:44px 1fr 36px;align-items:center;gap:12px;padding:10px 18px;background:rgba(255,248,236,.97);position:sticky;top:0;z-index:5;border-bottom:1px solid var(--line)}.lesson-header>div>span{font-size:11px;color:var(--muted)}.lesson-header b{font-size:12px;color:var(--muted);text-align:right}.lesson-hero{height:310px;position:relative;overflow:hidden;background:var(--peach)}.lesson-hero img{width:100%;height:100%;object-fit:cover;object-position:center 20%}.lesson-badge{position:absolute;right:18px;bottom:18px;background:rgba(23,62,82,.9);color:#fff;border-radius:999px;padding:7px 12px;font-size:12px}.lesson-body{padding:28px 20px 42px;max-width:720px;margin:auto}.lesson-body h1{margin:6px 0}.lesson-zh{font-size:20px;color:var(--orange-dark);margin-bottom:13px}.lesson-body>h2{font-size:18px;margin:28px 0 12px}.goal-list{list-style:none;padding:0;margin:0 0 28px;display:grid;gap:12px}.goal-list li{display:flex;align-items:center;gap:9px}.goal-list svg{color:var(--green);width:19px}.lesson-body>.primary{width:100%;margin-top:24px}.phrase-list{display:grid;gap:11px;margin:26px 0}.phrase-card{display:grid;grid-template-columns:34px 1fr 30px;gap:12px;align-items:center;text-align:left;padding:15px;background:var(--surface);border:1px solid var(--line);border-radius:18px}.phrase-index{width:30px;height:30px;border-radius:50%;background:#fff0d8;display:grid;place-items:center;color:var(--orange-dark);font-weight:800}.phrase-card b{font-size:21px;display:block}.phrase-card small,.phrase-card em{display:block;font-style:normal;color:var(--muted);font-size:13px}.lesson-choices{margin-bottom:18px}.choice.correct{border-color:var(--green);background:#eefaf5}.choice.wrong{border-color:var(--red);background:#fff3f0}.feedback{border-radius:18px;padding:15px;margin-top:16px}.feedback.success{background:#e9f7f1;color:#105c45}.feedback.try-again{background:#fff0ec;color:#943c2d}.mission-portrait{height:300px;position:relative;overflow:hidden;background:var(--peach)}.mission-portrait img{width:100%;height:100%;object-fit:cover;object-position:center 20%}.mission-portrait>span{position:absolute;left:18px;bottom:18px;background:var(--navy);color:#fff;border-radius:999px;padding:7px 12px;font-size:12px}.mission-list{padding:0;list-style:none;display:grid;gap:12px;margin:24px 0}.mission-list li{display:flex;align-items:center;gap:12px}.mission-list li span{width:31px;height:31px;border-radius:50%;background:#fff0d8;color:var(--orange-dark);display:grid;place-items:center;font-weight:800}
.chat-layout{min-height:100dvh}.task-panel{display:none}.chat{display:flex;flex-direction:column;min-height:100dvh;background:var(--paper)}.chat-header{padding:16px 17px 11px;display:flex;gap:11px;align-items:center;position:sticky;top:0;background:rgba(255,248,236,.96);backdrop-filter:blur(14px);z-index:4}.chat-header h1{font-size:18px;letter-spacing:0}.chat-header .more{margin-left:auto}.avatar{width:43px;height:43px;border-radius:50%;object-fit:cover;object-position:center 15%;background:#efad66}.avatar.tutor-sprite{display:block;flex:0 0 43px;background-size:300% 200%}.mobile-task{margin:2px 20px 12px;padding:12px 14px;background:var(--navy);color:#fff;border-radius:15px}.mobile-task b,.mobile-task span{display:block}.mobile-task span{font-size:12px;color:#d7e2e7;margin-top:3px}.progress-label{display:flex;justify-content:space-between;font-size:12px;color:#897b66;margin:7px 22px}.progress{display:flex;gap:5px;margin:0 22px 18px}.progress span{height:5px;border-radius:5px;background:#e9ddc5;flex:1}.progress span.done{background:var(--orange)}.messages{padding:0 20px 18px;display:flex;flex-direction:column;gap:20px;flex:1;min-height:240px}.message{max-width:92%;animation:appear .2s ease}.bubble{border-radius:19px 19px 19px 6px;background:var(--surface);padding:15px 17px;box-shadow:0 3px 12px rgba(75,57,34,.06);border:1px solid var(--line)}.chinese{font-size:20px;line-height:1.6;letter-spacing:.2px;overflow-wrap:anywhere}.pinyin{font-size:13px;color:#847a6b;line-height:1.65;margin-top:5px}.translation{font-size:14px;color:#6d665a;margin-top:9px}.word{background:transparent;border-bottom:1px dashed #a88e68;padding:0;font-size:inherit}.message-tools{display:flex;align-items:center;gap:10px;margin:7px 3px 0}.message-tools button{background:none;color:#8a6a44;padding:4px;font-size:12px}.message-tools svg{width:17px}.message.user{align-self:flex-end}.user .bubble{background:var(--navy);color:#fff;border:0;border-radius:19px 19px 6px 19px}.correction{margin-top:9px;border:1px dashed #d39550;border-radius:15px;background:#fff0d8;padding:12px 14px}.correction b{font-size:11px;color:#9b5019;letter-spacing:.6px}.correction p{font-size:16px;margin:5px 0}.correction button{padding:3px 0;margin-right:12px;background:none;font-size:12px;color:#86521c;text-decoration:underline}.word-list{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}.word-list button{background:#ffecd1;color:#744417;border-radius:12px;padding:7px 10px;font-size:13px}.thinking{padding:8px 0}.composer{padding:13px 18px max(18px,env(safe-area-inset-bottom));background:rgba(255,248,236,.98);position:sticky;bottom:0;border-top:1px solid var(--line);z-index:3}.text-form{display:flex;gap:8px;margin-bottom:10px}.text-form input{min-width:0;flex:1;border:1px solid #d4c39e;border-radius:15px;padding:12px;background:var(--surface)}.text-form button{border-radius:14px;background:var(--orange);padding:10px 15px;font-weight:700}.suggested{width:100%;text-align:left;padding:11px 14px;background:#fffaf0;border:1px dashed #cdb486;border-radius:15px;font-size:15px;margin-bottom:10px}.suggested small{display:block;color:#8c7856;font-size:11px;margin-bottom:3px}.chat-error{background:#fff0ec;color:#963c2c;border-radius:13px;padding:10px 12px;margin-bottom:8px;display:flex;flex-direction:column;font-size:13px}.finish-button{width:100%;background:transparent;color:var(--orange-dark);font-weight:700;padding:11px}.voice-row{display:flex;justify-content:center;align-items:center;gap:25px;background:var(--surface);border-radius:20px;padding:9px}.mic{width:61px;height:61px;border-radius:50%;background:#ff9b3f;color:#3b210f;box-shadow:0 4px 14px rgba(209,123,50,.24)}.mic svg{width:28px;height:28px}.mic.listening,.hold-mic.listening{background:#c94a36;color:#fff;transform:scale(1.06);box-shadow:0 0 0 7px rgba(195,72,53,.14)}.voice-label{text-align:center;font-size:11px;margin-top:7px;color:#8b7758}.end-call{color:#a63f32;font-size:17px}.hold-mic{touch-action:none;user-select:none;-webkit-user-select:none}
.summary-icon{width:78px;height:78px;background:#ffe4bb;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:36px auto 20px}.summary-icon svg{width:34px;color:#a95519}.page-title{font-size:32px;margin:6px 0 9px}.summary-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:28px 0}.summary-stats div{padding:13px 7px;background:var(--surface);border:1px solid var(--line);border-radius:16px}.summary-stats b,.summary-stats span{display:block}.summary-stats b{font-size:20px}.summary-stats span{font-size:10px;color:var(--muted)}.section{margin:27px 0 10px;color:#8a7657;font-size:11px;letter-spacing:1px;font-weight:800}.saved-row{background:var(--surface);padding:15px;border:1px solid var(--line);border-radius:16px;margin:10px 0;display:flex;justify-content:space-between;align-items:center;gap:10px;text-align:left}.saved-row b{font-size:18px}.saved-row small{display:block;font-size:12px;color:var(--muted);margin-top:4px}.saved-row button{background:#ffecd1;color:#8b4e1c;padding:9px 11px;border-radius:12px;font-size:12px}.review-meta{display:flex;justify-content:space-between;align-items:center;margin:26px 0 16px;font-size:12px;color:#8b7a61}.flashcard{background:var(--surface);min-height:350px;border-radius:26px;text-align:center;padding:30px 16px;box-shadow:var(--shadow);display:flex;flex-direction:column;align-items:center;justify-content:center}.flashcard h2{font-size:38px;margin:20px 0 4px}.flashcard .pinyin{font-size:16px}.flashcard .icon-btn{background:#ffead0;color:#a75f27;margin:20px 0}.meaning{font-size:22px;margin:8px 0}.review-actions{display:flex;gap:12px;margin-top:18px}.review-actions>*{flex:1}.empty{padding:55px 10px;text-align:center}.empty>svg{width:42px;height:42px;color:#ad6d36}.empty h2{margin:18px 0 8px}.empty p{color:var(--muted);margin-bottom:24px}
.profile-summary{display:flex;align-items:center;gap:14px;background:var(--navy);color:#fff;border-radius:22px;padding:18px;margin:22px 0}.profile-initial{width:54px;height:54px;border-radius:50%;background:var(--orange);display:grid;place-items:center;font-size:23px;font-weight:800}.profile-summary p{font-size:12px;color:#d7e2e7}.settings-row{padding:17px 0;border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:space-between;gap:18px}.settings-row span{display:flex;flex-direction:column}.settings-row small{color:var(--muted);font-size:12px}.settings-row input{width:23px;height:23px;accent-color:var(--orange)}.notice{padding:14px;border-radius:15px;background:var(--surface);border:1px solid var(--line);color:#756a59;font-size:13px;line-height:1.55;margin:18px 0}.compact-title{font-size:19px;letter-spacing:0}.top{display:flex;align-items:center;justify-content:space-between;margin-bottom:24px}
dialog{border:0;border-radius:28px 28px 0 0;padding:24px 26px 34px;max-width:520px;width:100%;margin:auto auto 0;color:var(--ink);background:var(--surface);max-height:88dvh;overflow:auto;box-shadow:0 -10px 60px rgba(53,42,37,.16)}dialog::backdrop{background:rgba(31,34,36,.55)}.sheet-handle{width:38px;height:4px;border-radius:5px;background:#d8d2c7;margin:-11px auto 23px}.close-sheet{position:absolute;right:14px;top:12px;font-size:24px}.sheet-title{font-size:30px;margin:12px 0 5px}.sheet-english{font-size:19px;margin:18px 0}.sheet-example{background:#fff2d9;border-radius:16px;padding:16px;margin:18px 0}.sheet-example p{font-size:18px}.sheet-example small{display:block;color:#826f4c;font-size:13px;margin-top:7px}
#toast{position:fixed;bottom:100px;left:50%;transform:translateX(-50%);max-width:min(360px,88vw);width:max-content;background:var(--navy);color:#fff;padding:12px 17px;border-radius:14px;font-size:13px;opacity:0;pointer-events:none;transition:opacity .2s;z-index:30}#toast.show{opacity:1}
@keyframes appear{from{opacity:0;transform:translateY(7px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:768px){.pad{padding:38px 44px 120px}.screen{max-width:820px;margin:auto}.tutor-list{grid-template-columns:repeat(2,minmax(0,1fr))}.tutor-row{grid-template-columns:110px minmax(0,1fr)}.explore-feature{display:grid;grid-template-columns:42% 1fr}.explore-image{height:100%;min-height:270px}.story-image{height:190px}.onboarding{max-width:700px;margin:auto;padding-top:36px}.lesson-hero{height:390px}.mission-layout{display:grid;grid-template-columns:42% 1fr;min-height:calc(100dvh - 78px)}.mission-portrait{height:100%;min-height:600px}.mission-copy{display:flex;flex-direction:column;justify-content:center}.chat{max-width:760px;margin:auto;border-left:1px solid var(--line);border-right:1px solid var(--line)}}
@media(min-width:1024px){body{padding:24px}.app-shell{min-height:calc(100dvh - 48px);grid-template-columns:250px minmax(0,1fr);border-radius:30px;overflow:hidden;box-shadow:0 24px 80px rgba(54,44,31,.12)}.desktop-brand{display:flex;flex-direction:column;padding:28px 24px;background:var(--navy);color:#fff}.desktop-brand .brand-mark{color:#fff}.desktop-brand small{color:#bfd0d8}.desktop-brand>p{font-size:26px;line-height:1.25;font-weight:750;margin-top:68px}.desktop-level{margin-top:auto;color:#bfd0d8;font-size:12px}.app-shell>main{grid-column:2;min-width:0;max-height:calc(100dvh - 48px);overflow:auto}.screen{max-width:960px;min-height:auto}.pad{padding:44px 52px 100px}nav{position:absolute;left:0;top:190px;bottom:auto;right:auto;width:250px;background:transparent;border:0;display:flex;flex-direction:column;align-items:stretch;padding:0 16px;backdrop-filter:none}nav button{min-height:48px;flex-direction:row;justify-content:flex-start;gap:12px;padding:11px 15px;font-size:13px;color:#bdd0d8}nav button.active{background:rgba(255,255,255,.12);color:#fff}.daily-card{min-height:340px}.daily-portrait{width:48%;height:300px}.streak-row{max-width:600px}.chat-layout{display:grid;grid-template-columns:310px minmax(0,1fr);min-height:calc(100dvh - 48px);background:#f7f1e5}.task-panel{display:flex;flex-direction:column;padding:44px 30px;background:var(--navy);color:#fff}.task-panel .eyebrow{color:#ffc98f}.task-panel h2{font-size:29px;margin:8px 0 14px}.task-panel>p{color:#cedce2}.target-words{display:flex;flex-wrap:wrap;gap:7px;margin:28px 0}.target-words span{background:rgba(255,255,255,.12);border-radius:999px;padding:7px 10px;font-size:13px}.chat{width:100%;max-width:720px;min-height:calc(100dvh - 48px);border:0}.mobile-task{display:none}.lesson-header{padding-left:32px;padding-right:32px}.lesson-hero{height:440px}.lesson-body{padding:42px 48px 60px}.lesson-screen{min-height:calc(100dvh - 48px)}.onboarding{min-height:calc(100dvh - 48px);padding:44px 70px}.onboarding-card{padding-top:72px}}
@media(max-width:390px){.pad{padding-left:16px;padding-right:16px}.tutor-row{grid-template-columns:94px minmax(0,1fr)}.tutor-list-photo{width:94px}.tutor-row-info{padding:12px}.tutor-actions{flex-direction:column}.daily-card>div:first-child{max-width:70%}.daily-portrait{right:-60px}.content-grid{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){*{animation:none!important;scroll-behavior:auto!important;transition:none!important}}

/* In-flow sidebar keeps wrapped branding clear of navigation. */
.sidebar{display:contents}.sidebar>.desktop-level{display:none}
.path-card .lesson-play{display:grid;place-items:center;transition:background .25s,box-shadow .25s}
.play-shape{display:block;width:18px;height:18px;background:currentColor;clip-path:polygon(18% 5%,95% 50%,95% 50%,18% 95%);transition:clip-path .3s cubic-bezier(.4,0,.2,1),transform .3s}
.is-playing .play-shape{clip-path:polygon(12% 12%,88% 12%,88% 88%,12% 88%);transform:rotate(90deg)}
.lesson-play.is-playing{box-shadow:0 0 0 5px #f4893526}
@media(min-width:1024px){
.sidebar{display:flex;flex-direction:column;grid-column:1;grid-row:1;background:var(--navy);height:calc(100dvh - 48px);overflow-y:auto}
.sidebar .desktop-brand{padding:28px 24px 0;flex-shrink:0}.sidebar .desktop-brand>p{margin-top:32px}
.sidebar nav{position:static;width:auto;flex-shrink:0;margin:28px 16px 24px;padding:0}
.sidebar>.desktop-level{display:block;margin-top:auto;padding:0 24px 28px;color:#bfd0d8;font-size:12px}
.app-shell>main{grid-row:1}
}

/* Conversation fills the available pane, including chats without a mission. */
.chat-layout{min-width:0}.chat-layout .chat{width:100%;max-width:none;min-width:0}
.hold-mic{position:relative;transition:background .2s,color .2s,box-shadow .2s,transform .2s}
.hold-mic .recording-bars{display:none}
.hold-mic.listening{background:#bd3e36;color:#fff;box-shadow:0 0 0 6px #bd3e3620}
.hold-mic.listening>svg{display:none}
.hold-mic.listening .recording-bars{display:flex;height:26px;align-items:center;justify-content:center;gap:4px}
.recording-bars i{display:block;width:4px;height:18px;border-radius:4px;background:currentColor;animation:recording-wave .85s ease-in-out infinite alternate}
.recording-bars i:nth-child(2){animation-delay:-.4s;height:26px}.recording-bars i:nth-child(3){animation-delay:-.65s;height:22px}.recording-bars i:nth-child(4){animation-delay:-.2s;height:14px}
.hold-mic.listening::after{content:'';position:absolute;inset:-5px;border:2px solid #bd3e3666;border-radius:50%;animation:recording-ring 1.6s ease-out infinite;pointer-events:none}
.hold-mic.connecting{background:#e9bd72;color:#5c3b16}
@keyframes recording-wave{from{transform:scaleY(.4)}to{transform:scaleY(1)}}
@keyframes recording-ring{from{transform:scale(.9);opacity:.8}to{transform:scale(1.35);opacity:0}}
@media(min-width:1024px){.chat-layout{display:flex;flex-direction:column;background:var(--paper)}.chat-layout .task-panel{padding:20px 28px;flex-shrink:0}.task-panel h2{font-size:22px}.task-panel .target-words{margin:12px 0}.chat-layout .chat{flex:1;margin:0}.chat-layout .message{max-width:min(85%,720px)}}

/* New messages appear immediately; only the message list scrolls. */
.chat-layout{height:100dvh;min-height:0;overflow:hidden}.chat-layout .chat{height:100%;min-height:0;display:flex;flex-direction:column;overflow:hidden}
.chat .messages{min-height:0;overflow-y:auto;flex:1;scroll-behavior:auto;padding-top:10px}.chat .message{animation:none}
.chat-header,.chat .composer,.chat .progress,.chat .progress-label,.chat .mobile-task{flex-shrink:0}.chat .composer{position:relative;background:var(--paper)}
.chat .word{color:#a64a10;background:#fff0d8;font-weight:700;border-radius:4px}
.expression-list{display:grid;gap:8px;margin-top:12px}.expression-card{text-align:left;background:#fff1dd;border:1px solid #ead7b9;border-radius:14px;padding:12px 14px;display:grid;gap:5px}
.expression-example{font-size:17px;line-height:1.6;overflow-wrap:anywhere}.expression-example mark{color:#a33d15;background:#ffdfae;font-weight:750;border-radius:4px;padding:1px 3px}.expression-meaning{font-size:12px;color:#756249}.expression-save{font-size:11px;color:#96501c}.delivery-status{display:block;font-size:11px;opacity:.8;margin-top:6px}
@media(min-width:1024px){.chat-layout{height:calc(100dvh - 48px)}.chat-layout .chat{min-height:0}.chat-layout .task-panel{max-height:24vh;overflow:auto}}

.review-card-grid{display:grid;gap:20px}.review-detail{background:var(--surface);border:1px solid var(--line);border-radius:22px;padding:24px;box-shadow:var(--shadow);min-width:0;overflow-wrap:anywhere}
.review-detail header{display:flex;justify-content:space-between;align-items:center;margin-bottom:14px}.review-detail h2{font-size:25px;line-height:1.5;letter-spacing:.3px}.review-detail>.pinyin{font-size:15px;color:#a45c28;margin:8px 0}.review-meaning{font-size:17px;margin:14px 0 22px;color:var(--navy)}
.review-example{padding:18px;background:#fff1dd;border-radius:14px}.review-example p{font-size:19px;margin:9px 0 6px}.review-example small{color:var(--muted);line-height:1.6;display:block}.review-note{padding-top:18px;margin-top:18px;border-top:1px solid var(--line)}.review-note b{font-size:12px;color:var(--orange-dark)}.review-note p{font-size:14px;color:var(--muted);line-height:1.7;white-space:pre-line;margin-top:8px}
.messages .chinese,.messages .pinyin,.messages .translation,.expression-example{-webkit-touch-callout:none}.review-detail .icon-btn{background:#fff0d8;color:var(--orange-dark)}
@media(max-width:500px){.review-detail{padding:19px}.review-detail h2{font-size:22px}}

.language-support,.language-support>.pinyin,.language-support>.translation{display:block}.user .pinyin{color:#d3e3ed}.user .translation{color:#f5e1bd}.language-support .support-retry{display:inline-block;font-size:11px;margin-top:6px;cursor:pointer}
.practice-plan{display:flex;align-items:center;justify-content:space-between;gap:20px;margin:20px 0 26px;padding:20px 22px;border:1px solid var(--line);border-radius:20px;background:var(--surface)}.practice-plan.due{background:#fff0d8;border-color:#edb97b}.practice-plan h2{font-size:21px;margin:5px 0 7px}.practice-plan p{font-size:13px;color:var(--muted)}.practice-plan small{display:block;font-size:12px;margin-top:7px;color:#8b643b}.practice-plan button{flex-shrink:0}
.plan-form{display:grid;gap:18px;margin-top:24px}.plan-form label{display:grid;gap:7px;font-weight:700}.plan-form input,.plan-form select{padding:12px;border:1px solid var(--line);border-radius:12px;background:var(--paper);font:inherit}.plan-form [hidden]{display:none}
@media(max-width:600px){.practice-plan{align-items:stretch;flex-direction:column}.practice-plan button{width:100%}}
/* Course directory and persistent account entry */
.course-directory{margin-top:32px}.course-level{border:1px solid var(--line,#eadfcb);border-radius:20px;background:#fffdf8;margin:14px 0;overflow:hidden}.course-level>summary{cursor:pointer;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:22px;list-style:none}.course-level>summary::-webkit-details-marker{display:none}.course-level>summary>span{display:flex;gap:14px;align-items:center}.course-level>summary b{color:#a84a08;white-space:nowrap}.course-level>summary small{white-space:nowrap;color:#786e60}.course-level[open]>summary{border-bottom:1px solid #eadfcb}.level-lessons{padding:10px 16px}.level-lessons .path-card{box-shadow:none;margin:8px 0}.level-lessons .lesson-play{flex-shrink:0}.level-lessons .lesson-play svg{width:22px;height:22px}.account-avatar{position:fixed;right:42px;top:34px;z-index:30;width:42px;height:42px;padding:0;border-radius:50%;background:#fa882d;color:#172f3d;font-size:20px;font-weight:800;border:3px solid #fff8ec;box-shadow:0 2px 12px #173b4a20;overflow:hidden}.account-avatar img,.profile-initial img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.profile-initial{overflow:hidden}.page-header{padding-right:46px}#account-drawer{position:fixed;inset:0 0 0 auto;margin:0;width:min(460px,100vw);height:100dvh;max-height:100dvh;max-width:100vw;border:0;border-radius:24px 0 0 24px;background:#fff8ec;color:#1d2b34;padding:0;box-shadow:-12px 0 60px #15394726;overflow:auto}#account-drawer::backdrop{background:#183b4b40}.account-heading{position:sticky;top:0;z-index:1;display:flex;justify-content:space-between;align-items:center;padding:16px 24px;background:#fff8ec;border-bottom:1px solid #eadfcb}.account-heading h2{font-size:20px;margin:0}#account-content .screen{padding:24px;min-height:0}#account-content h1{font-size:30px}#account-content .page-header{padding:0}#account-content .practice-plan{display:block}#account-content .practice-plan button{margin-top:12px}#account-content .profile-summary{margin-top:20px}.avatar-editor{padding:0 24px 32px}.avatar-editor label{display:inline-block;cursor:pointer}.chat-header{padding-right:74px!important}
@media(max-width:1023px){.account-avatar{top:12px;right:14px;width:38px;height:38px}.course-level>summary{padding:18px}.course-level>summary>span{display:block}.course-level>summary>span>span{display:block;font-size:14px;margin-top:6px}.level-lessons{padding:8px}.level-lessons .path-card{padding:12px;gap:10px}.pad{padding-top:62px}}
.course-title{background:none;border:0;padding:3px 0;color:inherit;font:inherit;font-weight:750;text-align:left;cursor:pointer}.course-title:hover{text-decoration:underline;text-underline-offset:4px}.course-title:focus-visible{outline:2px solid #ed862c;outline-offset:4px}.profile-summary small{display:block;overflow-wrap:anywhere;color:#d5e4e8;margin-top:5px}.level-lessons .path-card>div{min-width:0;flex:1}
.account-avatar.is-guest{width:auto;min-width:116px;padding:0 18px;border-radius:999px;overflow:visible;font-size:13px;white-space:nowrap}
.profile-home-button{position:fixed;right:24px;top:34px;z-index:31;width:42px;height:42px;padding:0;border:3px solid #fff8ec;border-radius:50%;display:grid;place-items:center;background:#17495d;color:#fff;font-size:22px;box-shadow:0 2px 12px #173b4a20;overflow:hidden}.profile-home-button img{width:100%;height:100%;object-fit:cover;border-radius:50%}.account-avatar.is-guest{right:76px}.account-avatar:not(.is-guest){display:none}
@media(max-width:1023px){.account-avatar.is-guest{width:auto;min-width:108px;padding:0 15px;font-size:12px}}
.chat-layout .task-panel{display:none}.chat .mobile-task{display:block;margin-bottom:8px;padding:8px 12px}.chat .mobile-task span{display:none}.chat .mobile-task b{font-size:13px;font-weight:500}
.voice-controls{height:142px;flex:none}.voice-row{height:80px;box-sizing:border-box;display:grid;grid-template-columns:44px 64px 44px;gap:24px;justify-content:center;align-items:center}.voice-spacer{width:44px}.voice-status{height:32px;margin:4px 0 0;display:flex;align-items:center;justify-content:center;line-height:1.25;overflow:hidden}.voice-detail{height:26px;display:flex;align-items:center;justify-content:center;gap:12px}.voice-detail .voice-label{margin:0}.voice-detail .audio-enable{font-size:11px;padding:0}.mic.connecting{animation:connectPulse 1s ease-in-out infinite;background:#eab66f}.mic.speaking{background:#397b70;color:white;animation:connectPulse .9s ease-in-out infinite}.mic.speaking .recording-bars{display:flex}.mic.speaking>svg{display:none}.chat .suggested{height:70px;overflow:auto}.chat .finish-button{height:38px;min-height:38px;padding:6px}.chat .finish-button:disabled{opacity:.4}.signin-link{display:block;text-align:center;text-decoration:none;margin-top:24px}.chat .chat-error{flex-shrink:0}.chat .composer{padding-top:10px;padding-bottom:10px}
@keyframes connectPulse{50%{box-shadow:0 0 0 7px #e8a74a25}}
@media(prefers-reduced-motion:reduce){.mic.connecting,.mic.speaking{animation:none}}
.sentence-row{display:flex;align-items:center;gap:12px}.sentence-row .bubble{flex:1;min-width:0}.sentence-play{display:grid;place-items:center;flex:0 0 48px;width:48px;height:48px;padding:0;border-radius:50%;background:#ffead0;color:#9d460f;border:1px solid #f1c18b;transition:background .25s,box-shadow .25s}.sentence-play .play-shape{width:22px;height:22px}.sentence-play:hover,.sentence-play.is-playing{background:#fb8a2b;color:#21323d;box-shadow:0 3px 14px #df88362b}.sentence-play:focus-visible{outline:3px solid #1b4658;outline-offset:3px}.chat-layout .message:has(.sentence-row){max-width:min(100%,790px)}
@media(max-width:600px){.sentence-row{gap:8px}.sentence-play{flex-basis:44px;width:44px;height:44px}.sentence-row .bubble{padding:12px}}
@media(prefers-reduced-motion:reduce){.sentence-play,.sentence-play .play-shape{transition:none}}
.chat-footer{height:28px;display:flex;justify-content:space-between;align-items:center;gap:10px;font-size:11px;color:#8b7758}.chat-footer .clear-history{font-size:11px;padding:4px 0;color:#9f4c31}.support-loading{display:block;font-size:12px;color:#8b7758;margin-top:6px}.support-retry{font-size:12px!important}.chat .language-support button{max-width:100%}
.chat .suggested:has(.language-support){height:126px}.chat-footer .clear-history{min-height:28px}
/* Keep course progress clear of the persistent account button. */
.lesson-header{grid-template-columns:38px minmax(0,1fr) 28px;gap:9px;padding-right:76px}
.lesson-header>div{min-width:0}.lesson-header b{font-size:11px;white-space:nowrap}
.brand-mascot{width:48px;height:48px;object-fit:contain}
@media(min-width:1024px){
.lesson-header{padding-left:24px;padding-right:90px}
.desktop-brand .brand-lockup{flex-direction:column;align-items:center;gap:8px}
.desktop-brand .brand-mascot{width:104px;height:104px}
.desktop-brand .brand-lockup b{font-size:25px;line-height:1.2;letter-spacing:-.6px}
.sidebar .desktop-brand>p{font-size:17px;line-height:1.5;font-weight:600;text-align:center;margin:22px 0 0;color:#d4e3e8}
.sidebar nav{margin-top:24px}
}
.history-list{display:grid;gap:16px;margin-top:28px}.history-card{display:flex;align-items:stretch;border:1px solid var(--line);border-radius:22px;background:var(--surface);overflow:hidden}.history-open{min-width:0;flex:1;text-align:left;padding:23px;background:transparent;color:var(--ink)}.history-open:hover{background:#fff2dc}.history-meta{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap}.history-meta time{font-size:12px;color:var(--muted)}.history-card h2{font-size:20px;margin:15px 0 4px}.history-preview{margin:14px 0}.history-preview p{font-size:14px;line-height:1.65;margin:6px 0;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}.history-preview p span{font-size:11px;font-weight:700;color:var(--muted);margin-right:8px}.history-continue{font-size:12px;font-weight:700;color:var(--orange-dark)}.history-delete{align-self:center;margin:16px 20px 16px 0;padding:10px;border:1px solid #efd3cd;border-radius:12px;background:#fff5f2;color:#a83c2b;font-size:12px}.history-delete:hover{background:#ffe5de}#history-delete-dialog{margin:auto;border-radius:24px;width:calc(100% - 40px);max-width:460px;padding:28px}#history-delete-dialog h2{font-size:24px;margin:0 0 14px}#history-delete-dialog p{font-size:14px;color:var(--muted)}#history-delete-error{color:#a83c2b!important}.delete-dialog-actions{display:flex;justify-content:flex-end;gap:12px;margin-top:24px}.delete-dialog-actions button{font-size:14px;padding:12px 18px}@media(max-width:600px){.history-open{padding:16px}.history-delete{margin-right:10px;padding:8px}.history-card h2{font-size:18px}.history-meta{gap:6px}.history-meta .level-pill{font-size:10px}}
.compact-plan{padding:13px 18px;gap:16px;margin:16px 0 24px;border-radius:16px}.compact-plan .eyebrow{font-size:10px}.compact-plan h2{font-size:17px;margin:3px 0}.compact-plan p{font-size:12px;margin:0}.plan-encouragement{max-width:250px;text-align:right}.plan-encouragement b{font-size:16px;font-weight:600;color:var(--orange-dark)}.plan-encouragement small{font-size:12px;margin-top:3px;line-height:1.5}
.course-tutors{padding:24px 12px 18px;margin-bottom:24px;background:linear-gradient(180deg,#fffdf8,#ffefd8);border:1px solid var(--line);border-radius:26px;text-align:center;overflow:hidden}.course-tutors>.eyebrow{font-size:10px}.course-tutors>h2{font-size:24px;margin:6px 0 0}.coverflow{position:relative;height:260px;perspective:1000px;touch-action:pan-y;isolation:isolate;cursor:grab;user-select:none;-webkit-user-select:none}.coverflow.dragging{cursor:grabbing}.coverflow:focus-visible{outline:2px solid var(--orange);outline-offset:5px;border-radius:18px}.tutor-cover{position:absolute;left:50%;top:28px;width:164px;height:208px;margin-left:-82px;padding:0;border:3px solid #fff8ec;border-radius:24px;background:#f7e6cf;box-shadow:0 10px 24px #173e5229;overflow:hidden;transform:translateX(calc(var(--offset) * 82px)) scale(calc(1 - var(--distance) * .14)) rotateY(calc(var(--offset) * -12deg));filter:brightness(calc(1 - var(--distance) * .14));transition:transform .5s cubic-bezier(.22,.8,.3,1),filter .5s,border-color .5s,box-shadow .5s;will-change:transform}.tutor-cover img{width:100%;height:100%;object-fit:cover;object-position:center 15%;pointer-events:none}.tutor-cover[aria-pressed="true"]{border-color:var(--orange);box-shadow:0 14px 32px #a5522838}.tutor-cover:focus-visible{outline:3px solid var(--navy);outline-offset:4px}.coverflow-caption{display:flex;justify-content:center;align-items:center;gap:16px;min-height:68px}.coverflow-caption>div{width:330px;max-width:65%}.coverflow-caption h3{font-size:23px;margin:0}.coverflow-caption h3 span{font-size:16px;color:var(--muted);margin-left:5px}.coverflow-caption p{font-size:12px;color:var(--muted);margin:4px 0 0}.coverflow-caption .icon-btn{font-size:28px;background:#fffdf9}.course-tutor-hint{font-size:12px;color:var(--muted);margin:12px 0 0}
.panda-greeting{position:relative;background:transparent;border:0;padding:0;isolation:isolate;width:120px;height:110px;overflow:visible}.panda-greeting .brand-mascot{position:relative;z-index:2;display:block;width:110px;height:110px;transform-origin:50% 90%}.panda-bubble{position:absolute;right:-1px;top:3px;z-index:3;border-radius:14px 14px 14px 3px;padding:6px 9px;background:var(--orange);color:#152d38;font-weight:900;font-size:17px;line-height:1.2}.panda-greeting.greeting .brand-mascot{animation:panda-hello 1.8s ease-in-out}.panda-greeting.greeting .panda-bubble{animation:hello-rise 2.4s ease-out}.panda-greeting:focus-visible{outline:2px solid #ffbe75;outline-offset:6px;border-radius:20px}@keyframes panda-hello{0%,100%{transform:rotate(0) translateY(0)}15%,45%,75%{transform:rotate(-9deg) translateY(-3px)}30%,60%,90%{transform:rotate(7deg) translateY(-2px)}}@keyframes hello-rise{0%{opacity:0;transform:translate(-20px,48px) scale(.45);z-index:1}25%{opacity:.4;z-index:1}55%{opacity:1;transform:translate(0,-7px) scale(1.06);z-index:3}80%,100%{opacity:1;transform:translate(0,0) scale(1);z-index:3}}
@media(max-width:600px){.compact-plan{flex-direction:row;align-items:center;flex-wrap:wrap;padding:12px 14px;gap:10px}.plan-encouragement{text-align:left;max-width:none}.compact-plan h2{font-size:16px}.plan-encouragement b{font-size:14px}.course-tutors{padding:20px 8px 16px}.course-tutors>h2{font-size:20px}.coverflow{height:225px}.tutor-cover{width:138px;height:180px;margin-left:-69px;top:23px;transform:translateX(calc(var(--offset) * 61px)) scale(calc(1 - var(--distance) * .16)) rotateY(calc(var(--offset) * -12deg));border-radius:20px}.coverflow-caption{gap:8px}.coverflow-caption h3{font-size:21px}.course-tutor-hint{font-size:11px}}@media(prefers-reduced-motion:reduce){.tutor-cover{transition:none}.panda-greeting.greeting .brand-mascot,.panda-greeting.greeting .panda-bubble{animation:none}}
.app-shell>main{min-width:0}.coverflow-caption>div{min-width:0}.compact-plan>div{min-width:0}

.review-actions,.assessment-row,.assessment-actions,.feedback-compose{display:flex;gap:12px;align-items:center}.review-actions{margin:20px 0;flex-wrap:wrap}.review-actions button{width:auto}.assessment-row{justify-content:space-between}.assessment-actions{flex-shrink:0}.feedback-compose textarea{width:100%;font:inherit;padding:12px;border:1px solid #dfd2bc;border-radius:16px}.pronunciation-score{display:flex;align-items:center;gap:8px}.pronunciation-score i{width:10px;height:10px;border-radius:50%;background:#cf423c}.pronunciation-score.good i{background:#239961}.pronunciation-score.almost i{background:#dda51d}.assessment-record.recording{background:#ff8a26;animation:micPulse 1s infinite}.subscription-plans{display:grid;gap:12px}.profile-initial{touch-action:none;user-select:none;-webkit-user-select:none}

.language-options{display:grid;gap:12px}.settings-row[onclick]{width:100%;text-align:left;background:transparent;border:0;border-bottom:1px solid var(--line);cursor:pointer}.review-actions>.primary,.review-actions>.secondary{flex:1;min-width:170px}.assessment-row h3{font-size:22px}.assessment-actions .icon-btn{background:#fff1da}.assessment-list .small{line-height:1.6}

#sheet-title{padding-right:38px}.voice-row{position:relative}.voice-row .keyboard-chat{position:absolute;right:calc(50% + 52px)}
@media(min-width:768px){#sheet{width:min(640px,calc(100vw - 48px));max-width:640px;max-height:calc(100dvh - 48px);margin:auto;border-radius:28px;padding:32px 38px;box-sizing:border-box}#sheet .sheet-handle{display:none}#sheet .close-sheet{right:20px;top:18px}}
#auth-email,#auth-code,#delete-confirmation{display:block;width:100%;box-sizing:border-box;padding:12px 14px;margin:8px 0 14px;border:1px solid #d9c6a7;border-radius:12px;background:#fffdf9;font:inherit;color:#173d4d;min-height:44px}
#auth-code{letter-spacing:.25em;font-size:22px}
.checkout-status:not(:empty){margin:12px 0 16px;padding:12px 14px;border:1px solid #e8c48f;border-radius:14px;background:#fff2d9;color:#714419;font-size:14px}.checkout-status a{font-weight:800;color:#714419}

/* Membership uses a focused, Apple-inspired pricing surface. */
#sheet.membership-sheet{background:#f4f5f2;color:#151918}
.membership-sheet #sheet-body{display:grid;gap:22px}
.membership-sheet .close-sheet{width:36px;height:36px;display:grid;place-items:center;border-radius:50%;background:#e7e9e5;color:#303633;font-size:22px;line-height:1}
.membership-hero{text-align:center;padding:8px 48px 0}
.membership-hero .membership-kicker{font-size:11px;line-height:1.2;font-weight:850;letter-spacing:1.7px;color:#68716c}
.membership-hero h2{max-width:520px;margin:10px auto 8px;padding:0;font-size:clamp(29px,4.5vw,42px);line-height:1.04;letter-spacing:-1.5px}
.membership-hero>p:not(.membership-kicker){color:#5f6763;font-size:15px}
.membership-hero>span{display:inline-flex;margin-top:13px;padding:6px 10px;border-radius:999px;background:#e5e8e3;color:#59615d;font-size:11px;font-weight:750}
.membership-loading,.membership-notice{padding:22px;border:1px solid #dde1dc;border-radius:20px;background:#fff;text-align:center;color:#66706a}
.membership-error{color:#9a3f31;border-color:#edc7c0;background:#fff8f6}
.membership-plans{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.membership-plan{min-width:0;display:flex;flex-direction:column;gap:22px;padding:24px;border:1px solid #dfe3de;border-radius:24px;background:#fff;box-shadow:0 8px 28px rgba(23,31,27,.06)}
.membership-plan-featured{background:#111816;color:#f8faf7;border-color:#111816;box-shadow:0 18px 44px rgba(17,24,22,.2)}
.plan-label{font-size:10px;font-weight:850;letter-spacing:1.2px;color:#69726d}.membership-plan-featured .plan-label{color:#b8ff4f}
.membership-plan h3{margin:8px 0 4px;font-size:25px;letter-spacing:-.6px}.membership-plan p{font-size:13px;color:#707975}.membership-plan-featured p{color:#b8c0bc}
.membership-plan ul{display:grid;gap:9px;margin:0;padding:0;list-style:none;font-size:13px}.membership-plan li{position:relative;padding-left:18px}.membership-plan li::before{content:'•';position:absolute;left:2px;color:#81b82e;font-weight:900}.membership-plan-featured li::before{color:#b8ff4f}
.membership-cta{width:100%;min-height:46px;margin-top:auto;border-radius:999px;background:#b8ff4f;color:#121713;font-weight:850;box-shadow:0 8px 24px rgba(184,255,79,.16)}
.membership-cta:hover{background:#c6ff70}.membership-cta-light{background:#eff2ed;color:#151918;box-shadow:none}.membership-cta-light:hover{background:#e2e7df}
.membership-current{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:20px 22px;border:1px solid #dce2da;border-radius:22px;background:#fff}.membership-current h3{margin:7px 0 2px;font-size:17px}.membership-current p{font-size:13px;color:#68716c}.status-pill{display:inline-flex;padding:4px 8px;border-radius:999px;background:#e6f8d5;color:#3c6719;font-size:9px;font-weight:900;letter-spacing:1.1px}.membership-manage{flex-shrink:0;padding:11px 16px;border-radius:999px;background:#111816;color:#fff;font-size:12px;font-weight:800}
.membership-history{border-top:1px solid #daddd8;padding-top:5px}.membership-history summary{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:13px 2px;cursor:pointer;list-style:none;font-weight:800}.membership-history summary::-webkit-details-marker{display:none}.membership-history summary small{color:#77807b;font-weight:600}.membership-order-list{max-height:190px;overflow:auto;border:1px solid #dde1dc;border-radius:18px;background:#fff}.membership-order-list>div{display:flex;justify-content:space-between;gap:16px;padding:11px 14px;border-bottom:1px solid #edf0ec;font-size:12px}.membership-order-list>div:last-child{border-bottom:0}.membership-order-list b{text-transform:capitalize;color:#77807b}.membership-order-list .order-completed{color:#3d7218}.membership-order-list .order-active{color:#3d7218}.membership-order-list .order-setup_failed{color:#9a493b}
.membership-sheet .checkout-status:not(:empty){margin:0;border-color:#d7ded2;background:#fff;color:#3d493f}
@media(min-width:768px){#sheet.membership-sheet{width:min(820px,calc(100vw - 48px));max-width:820px;padding:34px 42px 38px}}
@media(max-width:620px){.membership-sheet #sheet-body{gap:17px}.membership-hero{padding:3px 22px 0}.membership-hero h2{font-size:30px}.membership-plans{grid-template-columns:1fr}.membership-plan{padding:20px;gap:16px}.membership-current{align-items:stretch;flex-direction:column}.membership-manage{width:100%;min-height:44px}}

/* Unified Panda Chinese visual system: calm Apple-like surfaces with botanical color. */
:root{
 --paper:#edf5ef;
 --surface:#fbfdfb;
 --ink:#111a16;
 --muted:#637169;
 --orange:#b8ff4f;
 --orange-dark:#225e45;
 --peach:#dcebe0;
 --line:#d4dfd7;
 --navy:#123c2e;
 --blue:#27765a;
 --green:#2f8a62;
 --shadow:0 18px 50px rgba(18,60,46,.10);
 --radius:28px
}
html{background:#b8cebf}
body{letter-spacing:-.01em}
h1,h2,h3{letter-spacing:-.035em}
.app-shell{background:var(--paper)}
.primary{border-radius:999px;background:var(--orange);color:#102017;box-shadow:0 9px 24px rgba(89,139,25,.15)}
.primary:hover{background:#c8ff78}
.secondary{border-color:var(--line);border-radius:999px;background:rgba(255,255,255,.72)}
.secondary:hover{background:#fff}
.icon-btn{background:#f4f8f4;color:#173f31}
.brand-mark,.profile-initial,.account-avatar{background:var(--orange);color:#133426}
.level-pill{background:#e0f0e4;color:#215b43}
.eyebrow,.section{color:#286149}
.sub,.small{color:var(--muted)}

/* Navigation and application frame */
.desktop-brand,.sidebar,.task-panel{background:var(--navy)}
.desktop-brand small,.desktop-level,.sidebar>.desktop-level,.sidebar .desktop-brand>p,.task-panel>p{color:#c7ddd1}
nav button{color:#bdd4c8}
nav button.active{background:rgba(184,255,79,.13);color:#d7ff9b}
nav button.active svg{color:var(--orange)}
@media(min-width:1024px){body{background:#b8cebf}.app-shell{border:1px solid rgba(255,255,255,.55);box-shadow:0 28px 90px rgba(9,43,31,.18)}.chat-layout{background:var(--paper)}}
@media(max-width:1023px){nav{background:rgba(251,253,251,.9);border-top-color:var(--line)}nav button.active{background:#dff0e3;color:#205a42}}

/* Learning home and course directory */
.daily-card{background:var(--navy);border:1px solid rgba(255,255,255,.08);box-shadow:0 22px 56px rgba(11,51,38,.22)}
.daily-card .eyebrow{color:#b8ff4f}.daily-card p{color:#cfe0d7}
.streak-row div,.path-card,.explore-feature,.content-card,.practice-plan,.course-level,.history-card,.review-detail,.saved-row,.summary-stats div{background:rgba(251,253,251,.86);border-color:var(--line);box-shadow:0 10px 30px rgba(18,60,46,.05)}
.path-card.current{border-color:#82bb69;box-shadow:0 12px 34px rgba(30,92,65,.1)}
.path-number,.phrase-index,.mission-list li span{background:#e1f1e5;color:#245f46}
.path-card>button,.panda-bubble{background:var(--orange);color:#123327}
.filter.active{background:var(--navy);border-color:var(--navy)}
.course-level>summary b,.history-continue,.text-button{color:#246047}
.course-tutors{background:#f7faf7;border-color:var(--line);box-shadow:0 14px 42px rgba(18,60,46,.07)}
.tutor-cover{border-color:#f7faf7;background:#dce9df;box-shadow:0 12px 30px rgba(18,60,46,.14)}
.tutor-cover[aria-pressed="true"]{border-color:var(--orange);box-shadow:0 16px 38px rgba(33,94,69,.2)}
.history-open:hover{background:#eef7f0}

/* Lessons and onboarding */
.onboarding,.lesson-screen,.chat{background:var(--paper)}
.choice,.phrase-card,.flashcard{background:rgba(251,253,251,.9);border-color:var(--line);box-shadow:0 10px 30px rgba(18,60,46,.06)}
.choice.selected{border-color:#4e9673;background:#f3faf5}
.choice svg,.goal-list svg{color:#2f8a62}
.step-progress span{background:#d6e1d9}.step-progress span.done,.progress span.done{background:#56a878}
.lesson-header,.chat-header,.composer{background:rgba(237,245,239,.92);border-color:var(--line);backdrop-filter:blur(20px)}
.lesson-badge,.mission-portrait>span{background:rgba(18,60,46,.92)}
.lesson-zh{color:#256348}
.feedback.success{background:#dff2e6;color:#175a3f}.feedback.try-again{background:#fff0ec;color:#943c2d}

/* Text and voice conversations */
.mobile-task{background:var(--navy)}
.mobile-task span{color:#c9ddd3}
.bubble{background:#fff;border-color:#d9e3dc;box-shadow:0 8px 26px rgba(18,60,46,.07)}
.user .bubble{background:var(--navy);color:#fff}
.user .pinyin{color:#cbe1d5}.user .translation{color:#e7f2eb}
.chat .word{color:#1f6748;background:#dff1e5}
.word-list button,.expression-card,.review-example,.sheet-example{background:#e6f3e9;color:#184d38;border-color:#cfe2d5}
.expression-example mark{color:#174e38;background:#cfeaca}
.correction{border-color:#83b398;background:#ebf5ed}.correction b,.correction button{color:#245f46}
.text-form input{border-color:#cbd9cf;background:#fff}
.text-form button,.mic{background:var(--orange);color:#102017}
.suggested{background:#f8fbf8;border-color:#9db9a8}.suggested small,.voice-label{color:#68796f}
.voice-row{background:#fbfdfb;border:1px solid var(--line);box-shadow:0 10px 32px rgba(18,60,46,.06)}
.sentence-play{background:#e1f1e5;color:#215f45;border-color:#c6dccd}
.sentence-play:hover,.sentence-play.is-playing{background:var(--orange);color:#123327}

/* Review, profile, account and sheets */
.summary-icon{background:#dff0e3;color:#245f46}.summary-icon svg{color:#245f46}
.review-detail>.pinyin,.review-note b{color:#286149}.review-meaning{color:#173f31}
.profile-summary{background:var(--navy)}.profile-summary p,.profile-summary small{color:#c9ddd3}
.settings-row{border-color:var(--line)}.settings-row input{accent-color:#358963}
.notice{background:#f8fbf8;color:#607067}
#account-drawer{background:#edf5ef;color:var(--ink);box-shadow:-18px 0 70px rgba(9,43,31,.2)}
#account-drawer::backdrop,dialog::backdrop{background:rgba(8,35,26,.48);backdrop-filter:blur(3px)}
.account-heading{background:rgba(237,245,239,.93);border-color:var(--line);backdrop-filter:blur(20px)}
dialog{background:#f8fbf8;box-shadow:0 28px 90px rgba(9,43,31,.22)}
.sheet-handle{background:#cad7ce}
#auth-email,#auth-code,#delete-confirmation,.large-input,.plan-form input,.plan-form select,.feedback-compose textarea{border-color:#cad9cf;background:#fff;color:var(--ink)}
#toast{background:var(--navy)}
.checkout-status:not(:empty){border-color:#c8dccd;background:#eef8f0;color:#28513d}.checkout-status a{color:#245f46}

/* Keep the membership surface in the same global palette. */
#sheet.membership-sheet{background:#f1f6f2}.membership-plan-featured{background:#102a21;border-color:#102a21}.membership-cta{background:#b8ff4f}.membership-hero>span{background:#dfeae2;color:#4e6156}.membership-current,.membership-plan,.membership-order-list{border-color:#d5e0d8}

/* The standalone Paddle handoff page follows the same system. */
body>.screen.pad{max-width:820px;margin:0 auto;min-height:100dvh;padding-top:clamp(52px,10vh,110px)}
body>.screen.pad>h1{font-size:clamp(40px,7vw,72px);letter-spacing:-.055em}
body>.screen.pad>p{max-width:680px;color:var(--muted)}
body>.screen.pad>a{display:inline-flex;margin-top:24px;padding:12px 18px;border:1px solid var(--line);border-radius:999px;background:#fff;color:#174d38;font-weight:750;text-decoration:none}

/* Final brand pass: preserve Panda Chinese's original warm palette. */
:root{--paper:#fff8ec;--surface:#fffdf8;--ink:#202a32;--muted:#756f64;--orange:#f48935;--orange-dark:#a94f17;--peach:#ffe2bf;--line:#eadfca;--navy:#173e52;--blue:#3f78e8;--green:#168761;--shadow:0 16px 44px rgba(68,48,24,.09)}
html,body{background:#f1efe9}
.app-shell,.onboarding,.lesson-screen,.chat{background:var(--paper)}
.primary,.text-form button,.mic,.path-card>button,.panda-bubble{background:var(--orange);color:#321b0c}
.primary:hover,.text-form button:hover{background:#f69a4d}
.secondary,.icon-btn{background:var(--surface);color:var(--ink);border-color:var(--line)}
.brand-mark,.profile-initial,.account-avatar{background:var(--orange);color:#173e52}
.level-pill,.path-number,.phrase-index,.mission-list li span,.summary-icon{background:#fff0d8;color:var(--orange-dark)}
.summary-icon svg,.eyebrow,.section,.course-level>summary b,.history-continue,.text-button,.review-detail>.pinyin,.review-note b{color:var(--orange-dark)}
.desktop-brand,.sidebar,.task-panel,.daily-card,.profile-summary,.mobile-task{background:var(--navy)}
.daily-card .eyebrow{color:#ffd19e}.daily-card p,.profile-summary p,.profile-summary small,.mobile-task span{color:#d7e2e7}
nav button{color:#bdd0d8}nav button.active{background:rgba(255,255,255,.12);color:#fff}nav button.active svg{color:currentColor}
@media(min-width:1024px){body{background:#f1efe9}.app-shell{border-color:rgba(255,255,255,.5);box-shadow:0 24px 80px rgba(54,44,31,.12)}.chat-layout{background:#f7f1e5}}
@media(max-width:1023px){nav{background:rgba(255,253,248,.96);border-top-color:var(--line)}nav button.active{background:#fff0d8;color:var(--orange-dark)}}
.streak-row div,.path-card,.explore-feature,.content-card,.practice-plan,.course-level,.history-card,.review-detail,.saved-row,.summary-stats div,.choice,.phrase-card,.flashcard{background:var(--surface);border-color:var(--line);box-shadow:0 9px 28px rgba(73,54,30,.06)}
.path-card.current{border-color:#efa661;box-shadow:0 10px 30px rgba(103,72,34,.08)}
.filter.active{background:var(--navy);border-color:var(--navy)}
.course-tutors{background:var(--surface);border-color:var(--line);box-shadow:0 12px 36px rgba(73,54,30,.07)}
.tutor-cover{border-color:var(--paper);background:#f7e6cf;box-shadow:0 10px 24px rgba(23,62,82,.16)}.tutor-cover[aria-pressed="true"]{border-color:var(--orange);box-shadow:0 14px 32px rgba(165,82,40,.22)}
.history-open:hover{background:#fff2dc}.choice.selected{border-color:var(--blue);background:#f7faff}.choice svg{color:var(--blue)}
.step-progress span{background:#e2ddcf}.step-progress span.done{background:var(--blue)}.progress span.done{background:var(--orange)}
.lesson-header,.chat-header,.composer{background:rgba(255,248,236,.95);border-color:var(--line)}
.lesson-zh{color:var(--orange-dark)}
.bubble{background:var(--surface);border-color:var(--line);box-shadow:0 5px 18px rgba(75,57,34,.06)}.user .bubble{background:var(--navy)}.user .pinyin{color:#d3e3ed}.user .translation{color:#f5e1bd}
.chat .word{color:#a64a10;background:#fff0d8}.word-list button,.expression-card,.review-example,.sheet-example{background:#fff1dd;color:var(--ink);border-color:#ead7b9}.expression-example mark{color:#a33d15;background:#ffdfae}
.correction{border-color:#d39550;background:#fff0d8}.correction b,.correction button{color:#86521c}
.text-form input{border-color:#d4c39e;background:var(--surface)}.suggested{background:#fffaf0;border-color:#cdb486}.voice-row{background:var(--surface);border-color:var(--line);box-shadow:none}
.sentence-play{background:#ffead0;color:#9d460f;border-color:#f1c18b}.sentence-play:hover,.sentence-play.is-playing{background:var(--orange);color:#21323d}
#account-drawer{background:var(--paper);color:var(--ink);box-shadow:-12px 0 60px rgba(21,57,71,.15)}.account-heading{background:rgba(255,248,236,.95);border-color:var(--line)}
dialog{background:var(--surface);box-shadow:0 26px 80px rgba(53,42,37,.2)}dialog::backdrop,#account-drawer::backdrop{background:rgba(31,34,36,.5)}
#auth-email,#auth-code,#delete-confirmation,.large-input,.plan-form input,.plan-form select,.feedback-compose textarea{border-color:#d9c6a7;background:#fffdf9;color:#173d4d}
#toast{background:var(--navy)}.checkout-status:not(:empty){border-color:#e8c48f;background:#fff2d9;color:#714419}.checkout-status a{color:#714419}

/* One interaction language for every control and card. */
button,.primary,.secondary,.icon-btn,.choice,.path-card,.history-card,.review-detail,.course-level,.practice-plan,.tutor-cover{transition:transform .2s cubic-bezier(.2,.75,.3,1),box-shadow .2s ease,background-color .2s ease,border-color .2s ease,color .2s ease}
button:not(:disabled):hover{transform:translateY(-1px)}
button:not(:disabled):active{transform:translateY(0) scale(.975)}
.choice:hover,.path-card:hover,.history-card:hover,.review-detail:hover,.practice-plan:hover{transform:translateY(-2px);box-shadow:0 15px 38px rgba(68,48,24,.1)}
button:focus-visible,input:focus-visible,a:focus-visible,summary:focus-visible{outline:3px solid rgba(63,120,232,.42);outline-offset:3px}
@media(prefers-reduced-motion:reduce){button,.primary,.secondary,.icon-btn,.choice,.path-card,.history-card,.review-detail,.course-level,.practice-plan,.tutor-cover{transition:none}.choice:hover,.path-card:hover,.history-card:hover,.review-detail:hover,.practice-plan:hover,button:not(:disabled):hover,button:not(:disabled):active{transform:none}}
.ai-setup-notice{margin:0 20px 14px;padding:13px 15px;border:1px solid #e4b67d;border-radius:16px;background:#fff0d8;color:#714419;display:grid;gap:3px;font-size:13px}.ai-setup-notice b{font-size:14px}.ai-setup-notice span{color:#82603e}

/* Chat mode controls: two independent hit targets with no absolute overlap. */
.voice-row{display:flex;grid-template-columns:none;gap:22px;justify-content:center;align-items:center}
.voice-row .keyboard-chat{position:static;right:auto;width:56px;height:56px;border:1px solid var(--line);box-shadow:0 4px 14px rgba(23,62,82,.08)}
.voice-row .hold-mic{position:relative;width:64px;height:64px;flex:0 0 64px}
.voice-row .keyboard-chat svg{width:24px;height:24px}
.hold-mic.setup-needed{animation:setupAttention .42s ease 2;background:#f48935;box-shadow:0 0 0 8px rgba(244,137,53,.16)}
@keyframes setupAttention{0%,100%{transform:translateX(0) scale(1)}25%{transform:translateX(-4px) scale(1.04)}75%{transform:translateX(4px) scale(1.04)}}
@media(prefers-reduced-motion:reduce){.hold-mic.setup-needed{animation:none}}
#sheet.membership-sheet{background:#f7f3eb}.membership-plan-featured{background:var(--navy);border-color:var(--navy)}.membership-plan-featured .plan-label,.membership-plan-featured li::before{color:#ffd19e}.membership-cta{background:var(--orange);color:#321b0c;box-shadow:0 8px 22px rgba(218,112,35,.18)}.membership-cta:hover{background:#f69a4d}.membership-hero>span{background:#efe7da;color:#6e6559}.membership-current,.membership-plan,.membership-order-list{border-color:var(--line)}

.profile-summary>div{min-width:0;overflow-wrap:anywhere}.profile-summary>div>b{white-space:normal}.profile-initial{flex-shrink:0}#profile-nickname{width:100%;box-sizing:border-box;margin-bottom:12px}

/* Physics-driven tutor Cover Flow. Transforms are written by requestAnimationFrame. */
.course-tutors{padding-inline:0;overflow:hidden}
.course-tutors>.eyebrow,.course-tutors>h2,.course-tutors>.course-tutor-hint{margin-left:16px;margin-right:16px}
.coverflow{height:286px;margin-top:4px;perspective:1200px;perspective-origin:50% 48%;overflow:visible;touch-action:pan-y;cursor:grab;contain:layout paint;transform-style:preserve-3d}
.coverflow.dragging{cursor:grabbing}
.coverflow .tutor-cover{left:50%;top:28px;width:184px;height:232px;margin:0;padding:0;border-width:3px;border-radius:27px;transform-origin:center center;backface-visibility:hidden;will-change:transform,opacity;transition:border-color .2s ease,box-shadow .2s ease,opacity .08s linear;filter:none}
.coverflow .tutor-cover[aria-pressed="true"]{box-shadow:0 22px 48px rgba(23,62,82,.24),0 3px 10px rgba(45,35,25,.12)}
.coverflow-caption{position:relative;z-index:110;margin-top:0;padding:0 14px}
.coverflow-caption .icon-btn:hover{transform:scale(1.04)}
.course-tutor-hint{margin-top:8px}
@media(max-width:600px){
 .coverflow{height:242px;margin-top:2px;perspective:950px}
 .coverflow .tutor-cover{top:24px;width:148px;height:192px;margin:0;border-radius:22px}
 .coverflow-caption{margin-top:0}.course-tutor-hint{padding:0 8px}
}
@media(prefers-reduced-motion:reduce){.coverflow .tutor-cover{transition:none}}

/* Product-grade authentication surface. */
#sheet.auth-sheet{width:min(1080px,calc(100vw - 40px));max-width:1080px;height:min(720px,calc(100dvh - 40px));max-height:720px;padding:0;overflow:hidden;border-radius:34px;background:#fffdf8}
#sheet.auth-sheet .close-sheet{z-index:5;background:rgba(255,255,255,.9)}
.auth-layout{display:grid;grid-template-columns:minmax(0,1fr) minmax(430px,.9fr);height:100%;min-height:620px}
.auth-visual{position:relative;display:flex;flex-direction:column;overflow:hidden;padding:36px 42px;background:#173e52;color:#fff}
.auth-brand{display:flex;align-items:center;gap:12px;position:relative;z-index:2}.auth-brand>img{width:48px;height:48px;object-fit:contain}.auth-brand span{display:grid}.auth-brand b{font-size:18px}.auth-brand small{font-size:11px;color:#c9dce4}
.auth-visual-copy{position:relative;z-index:2;margin-top:auto;margin-bottom:210px;max-width:430px}.auth-visual-copy .eyebrow{color:#f7b06f}.auth-visual-copy h2{margin:10px 0 14px;font-size:clamp(35px,4vw,54px);line-height:1.02;letter-spacing:-.05em}.auth-visual-copy>p:last-child{max-width:360px;color:#d5e3e8;font-size:15px}
.auth-panda{position:absolute;right:-36px;bottom:-58px;width:330px;height:330px;object-fit:contain;filter:drop-shadow(0 18px 30px rgba(0,0,0,.18))}
.auth-panel{display:grid;place-items:center;padding:58px 64px 42px;background:#fffdf8}.auth-form-wrap{width:100%;max-width:390px}.auth-logo{display:none;align-items:center;gap:9px;margin-bottom:34px}.auth-logo img{width:40px;height:40px;object-fit:contain}
.auth-panel header{margin-bottom:30px}.auth-panel h1{font-size:38px;line-height:1.05;letter-spacing:-.045em}.auth-panel header p{margin-top:9px;color:var(--muted);font-size:14px}
.auth-form{display:grid;gap:17px}.auth-field{display:grid;gap:7px;color:#39434a;font-size:12px;font-weight:750}.auth-field>input,.password-field{width:100%;min-height:52px;border:1px solid #d8d5cd;border-radius:14px;background:#fff;padding:0 15px;transition:border-color .18s,box-shadow .18s,background .18s}.auth-field>input:focus,.password-field:focus-within{outline:0;border-color:#788b96;box-shadow:0 0 0 3px rgba(23,62,82,.1)}.auth-field>input:disabled,.password-field:has(input:disabled){background:#f1f0ec;color:#9a9a96}
.password-field{display:flex;align-items:center;padding-right:6px}.password-field input{min-width:0;flex:1;height:50px;border:0;outline:0;background:transparent;font:inherit}.password-toggle{padding:8px 10px;border-radius:9px;background:transparent;color:#52636d;font-size:12px;font-weight:750}.password-toggle:hover{background:#f2f1ed}
.auth-options{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-top:-3px;color:#69747a;font-size:12px}.auth-options label{display:flex;align-items:center;gap:7px}.auth-options input{accent-color:var(--navy)}.auth-options button,.auth-footer button,.auth-switch{padding:2px;background:transparent;color:#284f62;font-weight:750}
.auth-status{min-height:18px;margin:-4px 0;color:#647077;font-size:12px}.auth-status.error{color:#a23b2f}.auth-status.success{color:#25704d}
.auth-submit,.google-button{width:100%;min-height:52px;border-radius:14px;font-weight:800}.auth-submit{background:var(--navy);color:#fff;box-shadow:0 8px 20px rgba(23,62,82,.13)}.auth-submit:hover{background:#214e64;transform:translateY(-1px)}.auth-submit:active{transform:scale(.985)}.auth-submit:disabled{background:#91a0a7;color:#eef1f2}
.auth-divider{display:flex;align-items:center;gap:12px;margin:22px 0;color:#9a9b98;font-size:11px}.auth-divider::before,.auth-divider::after{content:"";height:1px;flex:1;background:#e5e2db}
.google-button{display:flex;align-items:center;justify-content:center;gap:12px;border:1px solid #dad7d0;background:#fff;color:#30383c;box-shadow:none}.google-button img{width:18px;height:18px}.google-button:hover{background:#f7f6f2}
.auth-footer{margin-top:25px;text-align:center;color:#777d80;font-size:13px}.auth-legal{margin-top:24px;text-align:center;color:#a09e98;font-size:10px}.auth-loading,.auth-unavailable{display:grid;place-content:center;height:100%;min-height:360px;text-align:center}.auth-unavailable p{margin-top:10px;color:var(--muted)}
@media(max-width:760px){
 #sheet.auth-sheet{inset:0;width:100%;height:100dvh;max-width:none;max-height:none;border:0;border-radius:0;padding:0;background:#fffdf8}
 #sheet.auth-sheet .close-sheet{top:max(14px,env(safe-area-inset-top));right:14px}
 .auth-layout{display:block;min-height:100%}.auth-visual{display:none}.auth-panel{display:block;min-height:100%;padding:max(38px,calc(env(safe-area-inset-top) + 24px)) 22px max(32px,env(safe-area-inset-bottom))}.auth-form-wrap{max-width:440px;margin:0 auto}.auth-logo{display:flex}.auth-panel header{margin-bottom:26px}.auth-panel h1{font-size:34px}.auth-field>input,.password-field,.auth-submit,.google-button{min-height:54px}
}

#admin-content{overflow-wrap:anywhere}#admin-content p{white-space:pre-wrap}#admin-content .settings-row{width:100%;text-align:left}#admin-content .settings-row small{display:block}.admin-pages{display:flex;gap:12px;margin-top:16px}

/* Centered Apple-style dialog system. Every dialog is a complete, floating surface. */
dialog,#sheet,#history-delete-dialog,#account-drawer{
 position:fixed;
 inset:0;
 width:min(640px,calc(100vw - 32px));
 max-width:640px;
 height:max-content;
 max-height:calc(100dvh - 32px);
 margin:auto;
 padding:32px 36px 36px;
 box-sizing:border-box;
 overflow:auto;
 border:1px solid rgba(255,255,255,.78);
 border-radius:30px;
 background:rgba(255,253,248,.97);
 box-shadow:0 30px 90px rgba(30,32,32,.24),0 2px 8px rgba(30,32,32,.08);
 backdrop-filter:blur(24px) saturate(1.08);
}
dialog::backdrop,#account-drawer::backdrop{background:rgba(21,29,33,.48);backdrop-filter:blur(8px)}
.sheet-handle{display:none}
.close-sheet,#sheet .close-sheet{right:20px;top:18px;width:48px;height:48px;display:grid;place-items:center;border-radius:50%;background:#f1ede5;color:var(--ink);font-size:28px;font-weight:500;line-height:1;box-shadow:0 4px 14px rgba(30,32,32,.08)}
#sheet-body{min-width:0}
#sheet-title{margin-top:3px;padding-right:48px;line-height:1.08}

/* The account view uses the same centered dialog language instead of a side drawer. */
#account-drawer{width:min(820px,calc(100vw - 32px));max-width:820px;height:max-content;max-height:calc(100dvh - 32px);border-radius:30px;padding:0}
.account-heading{position:sticky;top:0;padding:22px 28px;background:rgba(255,253,248,.94);backdrop-filter:blur(20px);border-radius:30px 30px 0 0}
#account-content .screen{max-width:none;padding:28px 32px 36px}
.account-membership{display:grid;grid-template-columns:1fr minmax(250px,330px);align-items:center;gap:22px;margin:24px 0;padding:24px;border:1px solid var(--line);border-radius:24px;background:#fffdf9;box-shadow:0 10px 28px rgba(58,45,29,.06)}.account-membership .section{margin:0 0 6px}.account-membership h2{margin:0 0 5px;font-size:22px}.account-membership>div>p:last-child{color:var(--muted)}.account-subscribe{display:grid;grid-template-columns:1fr auto;gap:3px 14px;align-items:center;width:100%;padding:16px 18px;text-align:left;border-radius:18px;background:var(--orange);color:#321b0c;box-shadow:0 10px 24px rgba(218,112,35,.18)}.account-subscribe span{font-size:16px;font-weight:850}.account-subscribe small{font-size:12px;opacity:.78}.account-subscribe b{grid-column:2;grid-row:1/3;font-size:24px}.account-subscribe:hover{background:#f69a4d}
.recording-status{display:grid;grid-template-columns:12px 1fr;gap:2px 8px;align-items:center;margin-top:14px;padding:12px 14px;border-radius:14px;background:#fff1e4;color:#8a3c10}.recording-status i{grid-row:1/3;width:10px;height:10px;border-radius:50%;background:#d84f2c;animation:micPulse 1s infinite}.recording-status span{font-size:12px}.pronunciation-score{margin-top:14px;padding:13px 14px;border:1px solid var(--line);border-radius:14px;background:#fffaf2}
@media(max-width:700px){.account-membership{grid-template-columns:1fr}.account-subscribe{min-width:0}}

/* Reference-inspired membership layout, retaining Panda Chinese navy, cream and orange. */
#sheet.membership-sheet{width:min(1040px,calc(100vw - 36px));max-width:1040px;max-height:calc(100dvh - 36px);padding:34px 42px 40px;border-radius:32px;background:rgba(255,253,248,.985)}
.membership-sheet #sheet-body{gap:20px}
.membership-hero{padding:4px 60px 0}
.membership-hero .membership-kicker{color:var(--orange-dark);letter-spacing:1.9px}
.membership-hero h2{max-width:680px;margin:12px auto 9px;font-size:clamp(34px,5vw,54px);line-height:1;letter-spacing:-2.3px}
.membership-hero>p:not(.membership-kicker){max-width:620px;margin:0 auto;color:var(--muted);font-size:15px;line-height:1.6}
.membership-hero>span{margin-top:16px;background:#f0e9dc;color:#6b6256}
.membership-plans{grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;align-items:stretch}
.membership-plan{padding:22px;gap:19px;border-radius:22px;background:#fffdf9;border-color:var(--line);box-shadow:0 10px 30px rgba(58,45,29,.06)}
.membership-plan-featured{background:var(--navy);border-color:var(--navy);box-shadow:0 20px 46px rgba(23,62,82,.22);transform:translateY(-5px)}
.membership-plan-head{display:grid;gap:5px}.membership-plan-head>p{min-height:42px}
.membership-price{display:flex;align-items:baseline;gap:7px;margin-top:16px}.membership-price strong{font-size:34px;line-height:1;letter-spacing:-1.5px}.membership-price span{font-size:12px;color:var(--muted)}
.membership-plan-featured .membership-price span{color:#d2dde3}.popular-pill{align-self:flex-start;margin:-8px 0 1px;padding:5px 9px;border-radius:999px;background:#fff0d8;color:#8d4214;font-size:9px;font-weight:850;letter-spacing:1px}
.annual-value{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:10px}.annual-value b{font-size:16px}.annual-value span{padding:5px 9px;border-radius:999px;background:var(--orange);color:#321b0c;font-size:11px;font-weight:850}.plan-footnote{margin-top:auto;padding-top:14px;border-top:1px solid var(--line);font-size:11px!important;line-height:1.6}.membership-plan-featured .plan-footnote{border-top-color:rgba(255,255,255,.16)}
.membership-plan h3{font-size:28px;letter-spacing:-.8px}
.membership-plan p{line-height:1.5}
.membership-plan ul{gap:10px;line-height:1.45}
.membership-plan li::before{content:'✓';left:0;color:var(--orange-dark)}
.membership-plan-featured .plan-label,.membership-plan-featured li::before{color:#ffd19e}
.membership-plan-featured p{color:#d2dde3}
.membership-cta{min-height:48px;background:var(--orange);color:#321b0c;box-shadow:0 8px 22px rgba(218,112,35,.18)}
.membership-cta:hover{background:#f69a4d}
.membership-cta-light{background:#fff8ec;color:var(--ink);border:1px solid var(--line);box-shadow:none}
.membership-cta-light:hover{background:#fff1dc}
.membership-cta:disabled{opacity:.62;cursor:default;transform:none}
.membership-features{padding-top:17px;border-top:1px solid var(--line)}.membership-features>p{margin-bottom:11px;font-size:11px;font-weight:800;letter-spacing:.7px;text-transform:uppercase}.membership-plan-featured .membership-features{border-top-color:rgba(255,255,255,.16)}
.membership-current{background:#fffdf9;border-color:var(--line)}
.membership-manage{background:var(--navy)}
.membership-order-list{background:#fffdf9;border-color:var(--line)}
.membership-plans-disabled .membership-plan{opacity:.86}.membership-plans-disabled .membership-plan-trial{opacity:1}.membership-plans-disabled+.membership-notice{margin-top:14px}

/* A calm handoff page while Paddle opens its secure checkout overlay. */
body:has(>main.screen.pad){background:radial-gradient(circle at 20% 0,#fff2dc 0,transparent 38%),#f1efe9}
body>.screen.pad{min-height:100dvh;display:flex;flex-direction:column;justify-content:center;align-items:flex-start;padding:clamp(32px,7vw,72px);box-sizing:border-box}
body>.screen.pad>h1{margin:0 0 12px;color:var(--navy)}
body>.screen.pad>p{font-size:16px;line-height:1.65}

@media(max-width:760px){
 dialog,#sheet,#history-delete-dialog,#account-drawer{width:calc(100vw - 24px);max-width:none;max-height:calc(100dvh - 24px);margin:auto;padding:26px 22px 28px;border-radius:26px}
 #account-drawer{width:calc(100vw - 24px);padding:0;border-radius:26px}
 .account-heading{padding:18px 20px;border-radius:26px 26px 0 0}
 #account-content .screen{padding:20px 20px 28px}
 #sheet.membership-sheet{width:calc(100vw - 20px);max-height:calc(100dvh - 20px);padding:28px 18px 24px;border-radius:28px}
 .membership-hero{padding:2px 28px 0}.membership-hero h2{font-size:34px;letter-spacing:-1.4px}
 .membership-plans,.membership-plans-disabled{grid-template-columns:1fr}.membership-plan-featured{transform:none}
 .membership-current{align-items:stretch;flex-direction:column}.membership-manage{width:100%;min-height:44px}
}

@media(max-width:1023px){
 nav{justify-content:stretch;gap:4px;padding:8px 10px max(10px,env(safe-area-inset-bottom));box-shadow:0 -8px 26px rgba(62,48,30,.06)}
 nav button{flex:1;min-width:0;min-height:56px;padding:7px 4px;gap:4px;border-radius:17px;font-size:11px;font-weight:650;transition:background .18s,color .18s,transform .18s}
 nav button:active{transform:scale(.96)}nav button.active{background:#fff0d8;color:var(--orange-dark)}nav svg{width:24px;height:24px;stroke-width:1.9}
}
