/* Shared visual rhythm and accessible contrast, applied after the legacy theme. */
body[data-theme=dark]{--text-2:#c1cadd;--text-3:#a2adc5;--ui-shadow:0 8px 26px #00000012;--ui-accent:#45d5c5}
body[data-theme=light]{--text-2:#44516c;--text-3:#596780;--ui-shadow:0 6px 20px #162c5010;--ui-accent:#087e75}
.product-ui .appbar{gap:12px;padding-block:22px 18px;align-items:center}
.product-ui .appbar>div:first-child{min-width:0;flex:1}.product-ui .appbar h2{line-height:1.55;font-size:21px;overflow-wrap:anywhere}
.product-ui .appbar .sub{font-size:11px;line-height:1.8;margin-top:5px;color:var(--text-3)}
.product-ui .sect{margin-top:25px;margin-bottom:13px;gap:12px}.product-ui .sect h3{font-size:15px;line-height:1.7}
.product-ui .card{border-radius:23px;box-shadow:var(--ui-shadow)}
.product-ui a.card,.product-ui a.row,.product-ui a.artrow,.product-ui a.errrow{color:var(--text-1);text-decoration:none}
.product-ui .row,.product-ui .artrow,.product-ui .errrow{border-radius:18px;min-width:0;gap:12px}
.product-ui .row .rl,.product-ui .artrow .rl,.product-ui .errrow .rl{min-width:0;flex:1}
.product-ui .rl b{font-weight:700;line-height:1.7;overflow-wrap:anywhere}
.product-ui .rl>span{display:block;color:var(--text-3);font-size:11px;line-height:1.8;margin-top:5px}
.product-ui .tiny,.product-ui .t-caption{line-height:1.85}
.product-ui .btn,.product-ui .field{border-radius:15px}.product-ui .btn{font-weight:700;box-shadow:none;line-height:1.7}
.product-ui .btn-primary{background:linear-gradient(110deg,#087c89,#4855c7);color:#fff!important;border:1px solid transparent}
.product-ui .btn-ghost{border:1px solid var(--stroke);background:var(--surface);color:var(--text-1)}
.product-ui .field{border:1px solid var(--stroke);background:var(--surface);min-width:0;line-height:1.7}
.product-ui input::placeholder,.product-ui textarea::placeholder{color:var(--text-3);opacity:1}
.product-ui .iconbtn,.product-ui .cbtn{border-radius:13px}.product-ui .chipbtn{min-height:44px;border:1px solid var(--stroke);font-size:12px}
.product-ui button:disabled{cursor:not-allowed}.product-ui button[aria-busy=true]{cursor:wait}
.product-ui .ic{stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
.product-ui .sect h3>.ic,.product-ui .appbar h2>.ic{color:var(--ui-accent)}
.product-ui .iconbox,.product-ui .di,.product-ui .ci{color:var(--ui-accent)}
.product-ui .form-error{color:var(--text-1);border-inline-start:3px solid #d76175;background:#c5455c0c;border-radius:10px;padding:10px 12px;font-size:12px;line-height:1.8}
.product-ui .form-error:empty{display:none}.text-action{border:0;background:none;color:var(--ui-accent);padding:8px;min-height:44px;font-size:12px}
.ui-state{display:flex;flex-direction:column;align-items:center;gap:12px;padding:30px 22px;border:1px dashed var(--stroke);border-radius:22px;text-align:center;background:var(--surface)}
.ui-state>.ic{width:34px;height:34px;color:var(--text-3)}.ui-state h3{margin:0;font-size:16px}.ui-state p{font-size:12px;line-height:1.9;color:var(--text-3);margin:0}.ui-state .btn{width:100%;max-width:270px}.ui-state.compact{padding:18px}
.product-ui .empty-state,.product-ui .emptystate{line-height:1.9;color:var(--text-3)}
.product-ui .emptystate>b{display:block;margin-bottom:8px;color:var(--text-1)}
.product-ui .flame-body{fill:url(#flame-tint);stroke:currentColor;stroke-width:1.6}
.product-ui .flame-core{fill:currentColor;stroke:none}
.product-ui .streak-stat{color:var(--text-1);background:var(--surface);border-color:var(--stroke)}
.product-ui .streak-stat svg.ic{color:var(--ui-accent);fill:none;width:24px;height:24px;flex:0 0 24px;stroke-width:1.75;transform:none}
.product-ui .hero-kicker{color:var(--ui-accent)}.product-ui .lesson-hero-ic .ic{color:white!important}
.product-ui .tab .lb{font-size:11px}.product-ui .tab.on{color:var(--ui-accent)}
/* Directory cards must shrink inside their grid instead of forcing horizontal overflow. */
[data-page=explore] .dirlist{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:0}
[data-page=explore] .dircell{padding:15px 12px;gap:11px;min-width:0;min-height:104px;align-items:flex-start}
[data-page=explore] .dircell .di{width:40px!important;height:40px!important;flex-basis:40px;border-radius:13px!important}
[data-page=explore] .dircell .di .ic{width:24px;height:24px}
[data-page=explore] .dt{min-width:0;flex:1}[data-page=explore] .dt b{line-height:1.8;white-space:normal}[data-page=explore] .dt span{line-height:1.8;white-space:normal;font-size:10px}
[data-page=explore] .dircell.disabled{opacity:.65}
/* Reading libraries and exercises. */
.product-ui .artrow{padding:17px;display:flex;align-items:center}.product-ui .artrow .ac{width:42px;height:48px;flex:0 0 42px;border-radius:13px;color:var(--ui-accent)}
.product-ui .errrow{padding:15px;align-items:center}.product-ui .ipabox{width:43px;height:43px;flex:0 0 43px;display:grid;place-items:center;border-radius:13px;overflow:hidden;color:var(--ui-accent)}
.product-ui .ipabox .ic{width:24px;height:24px}
[data-page=reader] .card .en{font-size:16px;line-height:2!important}
[data-page=grammar_lesson] .card .en{line-height:1.9}.grammar-quiz{margin-top:24px}
[data-page=pronunciation_item] .card:first-child .en:first-child{font-size:30px!important;line-height:1.5;overflow-wrap:anywhere}
[data-page=pronunciation_item] #rec-status{font-size:12px;line-height:1.9}
/* Lookup and note-taking: one clear search row, then the content. */
[data-page=dictionary] #dict-result>.card{background:linear-gradient(145deg,#1ba99b0e,#6573c60c)!important;border-color:var(--stroke)!important}
[data-page=dictionary] #dict-result .en{font-family:var(--f-en,sans-serif);text-align:left!important}
[data-page=dictionary] #dict-result .en[style*="gold"]{color:var(--text-3)!important}
[data-page=dictionary] #dict-result .en:first-child{line-height:1.6;overflow-wrap:anywhere}
.dict-word-head{display:flex;direction:ltr;justify-content:space-between;align-items:flex-start}
[data-page=dictionary] #dict-go{background:linear-gradient(135deg,#087c89,#4855c7);color:white;box-shadow:none}
[data-page=dictionary] #recent-slot button{cursor:pointer;min-height:40px;padding:7px 13px}
[data-page=notes] #search-actions{border:0;background:none;padding:0;box-shadow:none;justify-content:flex-start}
[data-page=notes] .searchbar input{min-width:0}[data-page=notes] .note-card{display:block;text-decoration:none}.note-card .bidi-line{font-size:13px}
/* Compact, legible metrics and achievement cards. */
.progress-stats{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.progress-stats .mini{padding:15px 10px;margin:0;min-width:0}.progress-stats .mv{color:var(--text-1)!important;font-size:23px}.progress-stats .ml{font-size:11px;color:var(--text-3)}
[data-page=progress] .bdggrid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
[data-page=progress] .bcell{padding:18px 12px;min-height:135px;aspect-ratio:auto;opacity:1;background:var(--surface);border:1px solid var(--stroke);border-radius:19px;cursor:default}
[data-page=progress] .bcell.lock2{border-style:dashed;color:var(--text-3)}[data-page=progress] .bcell .be{background:#cfa65512;border:1px solid #cfa65533;border-radius:15px;width:46px;height:46px;display:grid;place-items:center;color:#b5822d}
[data-page=progress] .bcell small,[data-page=progress] .bcell p{font-size:10px;color:var(--text-3);line-height:1.8;margin-top:5px}
/* Settings retain native keyboard behaviour with clear switch states. */
[data-page=settings] .setrow{padding-block:14px;gap:14px}
[data-page=settings] .setrow input[type=checkbox]{appearance:none;width:42px;height:25px;flex:0 0 42px;border-radius:20px;border:1px solid var(--stroke);background:var(--surface-2);position:relative;cursor:pointer;transition:background .2s}
[data-page=settings] .setrow input[type=checkbox]:after{content:'';position:absolute;width:17px;height:17px;top:3px;right:3px;background:var(--text-3);border-radius:50%;transition:transform .2s}
[data-page=settings] .setrow input[type=checkbox]:checked{background:#087c74;border-color:#087c74}
[data-page=settings] .setrow input[type=checkbox]:checked:after{background:white;transform:translateX(-17px)}
[data-page=settings] .setrow input[type=checkbox]:focus-visible{outline:3px solid var(--ui-accent);outline-offset:3px}
[data-page=login] .welcome-theme,[data-page=register] .welcome-theme{justify-content:flex-end;padding:16px 20px}
[data-page=login] #welcome-theme button,[data-page=register] #welcome-theme button{border-color:var(--stroke);border-radius:14px;background:var(--surface);color:var(--text-2)}
[data-page=login] #email,[data-page=register] #email{direction:ltr;text-align:left}
.live-level{appearance:none;border:0;border-radius:8px;overflow:hidden;background:var(--surface-2);height:5px}.live-level::-webkit-progress-bar{background:var(--surface-2)}.live-level::-webkit-progress-value{background:var(--ui-accent);border-radius:8px}
.live-level::-webkit-meter-bar{background:var(--surface-2);border:0;border-radius:8px;height:5px;box-shadow:none}.live-level::-webkit-meter-optimum-value{background:var(--ui-accent);border-radius:8px}.live-level::-moz-meter-bar{background:var(--ui-accent);border-radius:8px}
@media(max-width:360px){[data-page=explore] .dircell{flex-direction:column;gap:9px;padding:13px;min-height:135px}[data-page=explore] .dircell .di{flex-basis:40px}.product-ui .appbar h2{font-size:19px}.product-ui .appbar{gap:8px}}
@media(min-width:900px){.phone{max-width:720px}.product-ui .screen>.pad,.product-ui .screen>.sect,.product-ui .screen>.appbar{padding-inline:30px}.product-ui .screen{scrollbar-gutter:stable}.product-ui .dirlist{grid-template-columns:repeat(3,minmax(0,1fr))}[data-page=explore] .dirlist{grid-template-columns:repeat(3,minmax(0,1fr))}.product-ui .bigtile{padding-block:20px}.product-ui .sheet{max-width:680px}.chat-page #chat-messages{padding-inline:28px!important}.profile-page{max-width:660px;margin-inline:auto}.flashcard-stage{max-width:560px;margin-inline:auto}.flashcard-grades{max-width:560px;margin-inline:auto}.live-hero{max-width:560px;margin-inline:auto}.audio-player{max-width:520px}[data-page=progress] .progress-stats{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(min-width:900px){.phone{max-width:720px!important}.phone:before{display:none}[data-page=explore] .dirlist{grid-template-columns:repeat(4,minmax(0,1fr))}[data-page=explore] .dircell{flex-direction:column;min-height:130px;gap:10px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation:none!important;transition:none!important}}
/* Weekly activity: real calendar dates and an explicit today marker. */
.product-ui .weekly-card{background:linear-gradient(135deg,#18b8a509,transparent),var(--surface);padding:20px}
.week-summary{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px;font-size:12px;color:var(--text-2)}.week-summary>b{font-size:20px;color:var(--text-1)}.week-summary small{font-size:11px;font-weight:500;color:var(--text-3)}
.week-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:7px;direction:rtl}
.week-day{display:flex;flex-direction:column;align-items:center;gap:10px;min-width:0;animation:week-appear .45s both;animation-delay:var(--day-delay)}
.week-name{font-size:11px;color:var(--text-3)}.week-date{position:relative;width:38px;height:42px;display:grid;place-items:center;border:1px solid var(--stroke);border-radius:14px;font-size:13px;font-weight:700;color:var(--text-2);background:var(--surface-2)}
.week-status{font-size:9px;min-height:16px;color:var(--text-3);white-space:nowrap}
.week-day.current .week-date{background:#087f78;color:white;border-color:#087f78;box-shadow:0 0 0 4px #18b8a512;animation:week-today 3s ease-in-out infinite}
.week-day.current .week-name,.week-day.current .week-status{color:var(--ui-accent);font-weight:700}
.week-day.complete .week-date{background:#159e8e18;color:var(--ui-accent);border-color:#159e8e55}.week-day.complete.current .week-date{background:#087f78;color:white}.week-date .ic{width:20px;height:20px}
.week-day.future .week-date{background:transparent;border-style:dashed;color:var(--text-3)}
.weekly-card>.muted{font-size:11px;border-top:1px solid var(--stroke);padding-top:15px;margin-top:15px!important}
/* The lesson trail uses actual task skills and completion states. */
.product-ui .steps5{display:block!important;margin:18px 0 8px;padding:0;min-height:0;overflow:visible}
.lesson-trail{border:1px solid var(--stroke);border-radius:22px;overflow:hidden;background:radial-gradient(ellipse at 85% 0%,#11b9a51a,transparent 70%),var(--surface)}
.trail-heading{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:16px 16px 0;color:var(--text-2);font-size:11px}.trail-heading b{font-size:20px;color:var(--ui-accent)}.trail-heading small{font-size:10px;font-weight:500;color:var(--text-2)}
.trail-scroll{overflow-x:auto;direction:rtl;scrollbar-width:thin;scrollbar-color:var(--stroke) transparent;outline-offset:-3px}
.trail-map{position:relative;height:214px;width:100%;margin-inline:auto;direction:ltr;max-width:none}
.trail-lines{position:absolute;inset:0;width:100%;height:214px;fill:none;stroke-width:3;stroke-linecap:round}
.trail-landscape{fill:#12b7a507;stroke:none}.trail-contour{stroke:#12b7a50c;stroke-width:1}.trail-track{stroke:var(--stroke);stroke-width:6;opacity:.55}.trail-fill{stroke:var(--ui-accent);stroke-width:4;stroke-dasharray:100;stroke-dashoffset:100;transition:stroke-dashoffset 1.4s cubic-bezier(.25,.7,.3,1);transition-delay:var(--trail-delay)}.progress-visible .trail-fill.filled{stroke-dashoffset:0}
.trail-spark{fill:var(--ui-accent);stroke:var(--surface);stroke-width:2;filter:drop-shadow(0 0 4px #10b8a5);opacity:0}.progress-visible .trail-spark{opacity:1}
.trail-stop{position:absolute;transform:translate(-50%,-25px);display:flex;align-items:center;flex-direction:column;gap:12px;width:70px;direction:rtl;z-index:1}
.trail-symbol{position:relative;display:grid;place-items:center;width:50px;height:50px;border-radius:50%;border:1px solid var(--stroke);color:var(--text-3);background:var(--surface);box-shadow:0 5px 0 var(--surface-2),0 9px 16px #0000000c}
.trail-symbol>.ic{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.progress-visible .trail-stop{animation:trail-arrive .65s cubic-bezier(.2,.75,.25,1) both;animation-delay:var(--stop-delay)}
.trail-label{font-size:10px;color:var(--text-2);white-space:nowrap;background:var(--surface);border-radius:7px;padding:2px 5px}.trail-stop.complete .trail-symbol{color:var(--ui-accent);background:linear-gradient(145deg,var(--surface),var(--surface-2));border:2px solid #0db4a270}
.trail-check{position:absolute;bottom:-2px;left:-2px;width:18px;height:18px;border-radius:50%;display:grid;place-items:center;background:#087f78;color:white;border:2px solid var(--surface)}.trail-check .ic{width:10px;height:10px}
.trail-stop.current .trail-symbol{color:white;background:linear-gradient(145deg,#1bb9a2,#08736e);border:2px solid #72e4ce;box-shadow:0 5px 0 #075f59,0 10px 20px #07857c35}
.trail-stop.current .trail-symbol:before{content:'';position:absolute;inset:-7px;border:2px solid transparent;border-top-color:var(--ui-accent);border-bottom-color:#14b8a525;border-radius:50%;opacity:.7}.progress-visible .trail-stop.current .trail-symbol:before{animation:trail-orbit 7s linear infinite}
.progress-visible .trail-stop.current .trail-symbol{animation:trail-beacon 3s ease-in-out infinite}.trail-stop.current .trail-label{color:var(--ui-accent);font-weight:700}
.trail-stop.finish .trail-symbol{border-style:dashed;background:var(--surface-2)}.trail-stop.finish.complete .trail-symbol{background:#087f78;color:white;border-style:solid;animation:trail-celebrate .7s ease-out}
.product-ui .trail-stop .trail-here{position:absolute;bottom:calc(100% + 15px);font-size:9px;font-weight:700;white-space:nowrap;padding:4px 9px;border-radius:8px;background:#087f78;color:#fff;box-shadow:0 3px 10px #087f7818}.trail-here:after{content:"";position:absolute;top:100%;left:calc(50% - 3px);border:3px solid transparent;border-top-color:#087f78}
.trail-next{display:flex;gap:12px;align-items:center;margin:0 12px 12px;padding:12px;border:1px solid var(--stroke);border-radius:15px;background:var(--surface)}.trail-next>.ic{width:18px;height:18px;padding:8px;box-sizing:content-box;flex-shrink:0;border-radius:11px;background:#14b8a510;color:var(--ui-accent)}.trail-next>div{min-width:0}.trail-next small{display:block;font-size:10px;color:var(--ui-accent);margin-bottom:4px}.trail-next strong{display:block;font-size:12px;line-height:1.9;color:var(--text-1);overflow-wrap:anywhere}
@keyframes trail-arrive{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}
@keyframes trail-orbit{to{rotate:360deg}}
@keyframes trail-beacon{50%{box-shadow:0 5px 0 #075f59,0 12px 28px #07857c50}}
@keyframes trail-celebrate{0%{scale:.8}60%{scale:1.12}100%{scale:1}}
@media(prefers-reduced-motion:reduce){.trail-spark{display:none}.trail-stop.current .trail-symbol:before{animation:none!important}}
.reduce-motion .trail-spark{display:none}
@keyframes week-appear{from{opacity:0;translate:0 6px}to{opacity:1;translate:0 0}}
@keyframes week-today{50%{box-shadow:0 0 0 6px #18b8a525}}
@media(max-width:350px){.product-ui .weekly-card{padding:16px 12px}.week-calendar{gap:3px}.week-date{width:30px;height:36px;border-radius:11px}.week-status{font-size:8px}.week-summary{font-size:11px}}

/* Chat has one scroll region and a composer in normal flex layout. */
body[data-page=chat]{overflow:hidden;overscroll-behavior:none}
#phone.chat-page{position:fixed!important;top:var(--chat-top,0)!important;left:50%;transform:translateX(-50%);height:var(--chat-height,100dvh)!important;display:flex!important;flex-direction:column;overflow:hidden;padding-top:env(safe-area-inset-top);box-sizing:border-box}
.chat-page>.viewport{position:relative!important;inset:auto!important;flex:1 1 0;min-height:0;height:auto!important;width:100%;order:1;overflow:hidden}
.chat-page .screen.withdock{position:relative!important;inset:auto!important;height:100%!important;min-height:0;padding-top:0!important;padding-bottom:12px!important;overflow-y:auto;overflow-x:hidden;overscroll-behavior-y:contain;-webkit-overflow-scrolling:touch;scroll-behavior:auto}
.chat-page .screen>.tailpad{display:none}.chat-page>.dockzone{position:relative!important;inset:auto!important;order:2;flex:0 0 auto;transform:none!important;animation:none!important;padding:10px 12px!important;backdrop-filter:none}
.chat-page>.tabbar{position:relative!important;inset:auto!important;order:3;flex:0 0 auto;transform:none!important;width:100%!important;margin:0!important}
.chat-page.keyboard-open>.tabbar{display:none!important}.chat-page.keyboard-open .composer-hint{display:none}.chat-page.keyboard-open .chat-tools{display:none!important}
.chat-page .composer{display:flex!important;align-items:flex-end;border-radius:22px!important;padding:7px!important;border-color:var(--stroke);background:linear-gradient(135deg,#13b8a508,transparent),var(--surface)!important;box-shadow:0 4px 18px #00000008!important}
.chat-page .composer:focus-within{border-color:var(--ui-accent);box-shadow:0 0 0 3px #13b8a510!important}
.chat-page #chat-input{min-width:0;width:0;min-height:44px;max-height:120px;font-size:16px!important;line-height:1.65;padding:10px 5px!important;overflow-y:auto;scroll-margin:0}
.chat-page .cbtn{flex:0 0 40px;min-width:40px!important;width:40px!important;height:44px!important;border-radius:14px!important}.chat-page .cbtn.send{background:#087f78!important}.chat-page .cbtn.send:disabled{opacity:.35}.chat-page .cbtn[hidden]{display:none!important}
.chat-page #chat-messages{padding-inline:14px!important}.chat-page .bub-msg{overflow-wrap:anywhere}.chat-page .bub-msg .bidi-line{margin:0 0 8px}.chat-page .bub-msg .bidi-line:last-child{margin-bottom:0}
/* Plan generation is a foreground state, never an error box below the fold. */
.plan-building{position:fixed;inset:0;margin:auto;padding:0;width:min(100% - 32px,460px);max-height:calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom));overflow:auto;border:1px solid var(--stroke);border-radius:30px;background:var(--bg-1);color:var(--text-1);box-shadow:0 25px 100px #0005}
.plan-building::backdrop{background:#050a19bb;backdrop-filter:blur(8px)}.plan-building-content{text-align:center;padding:32px 24px}.plan-build-art{height:145px;display:flex;align-items:center;justify-content:center;gap:12px}.plan-build-art>span{display:grid;place-items:center;width:65px;height:80px;background:var(--surface-2);border:1px solid var(--stroke);border-radius:20px;rotate:-8deg;animation:build-float 2.5s ease-in-out infinite}.plan-build-art>span:nth-child(2){background:#087f78;color:white;translate:0 -13px;rotate:0deg;animation-delay:.3s}.plan-build-art>span:nth-child(3){rotate:8deg;animation-delay:.6s}.plan-build-art .ic{width:30px;height:30px}.plan-build-kicker{color:var(--ui-accent);font-size:12px}.plan-building h2{font-size:22px;margin:12px 0;outline:none}.plan-building p{font-size:13px;line-height:2;color:var(--text-2)}.plan-building small{font-size:11px;line-height:1.8;color:var(--text-3)}.plan-build-motion{height:5px;background:var(--stroke);border-radius:10px;overflow:hidden;margin:24px 0 12px}.plan-build-motion i{display:block;width:35%;height:100%;border-radius:inherit;background:var(--ui-accent);animation:build-travel 1.8s ease-in-out infinite}.plan-build-status{font-weight:700}
@keyframes build-float{50%{transform:translateY(-8px)}}@keyframes build-travel{from{translate:280%}to{translate:-300%}}
/* Voice: state-driven ribbon, explicit session control, optional transcript. */
.live-hero{padding:24px 20px;border-radius:28px;--voice-energy:.15}.live-hero .live-kicker{color:var(--ui-accent);letter-spacing:0}.voice-stage{position:relative;height:185px;display:grid;place-items:center;isolation:isolate}.voice-glow{position:absolute;width:210px;height:120px;border-radius:45%;background:radial-gradient(ellipse,#11b8a528,transparent 70%);filter:blur(8px);z-index:-1}.voice-ribbon{display:flex;align-items:center;justify-content:center;gap:5px;height:120px;direction:ltr}.voice-ribbon i{display:block;width:7px;height:var(--height);border-radius:10px;background:linear-gradient(180deg,#16c5ae,#637de5);transform:scaleY(.25);transition:transform .18s ease,opacity .2s;opacity:.55}
.live-hero[data-state=listening] .voice-ribbon i,.live-hero[data-state=speaking] .voice-ribbon i{transform:scaleY(var(--voice-energy));opacity:1}.live-hero[data-state=speaking] .voice-ribbon{animation:voice-sway 2s ease-in-out infinite}.live-hero[data-state=connecting] .voice-ribbon i{animation:voice-connect 1s ease-in-out infinite;animation-delay:calc(var(--bar)*.055s)}
.voice-turn{min-height:24px;font-size:12px;color:var(--ui-accent);margin-top:8px}.voice-session-button{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;max-width:260px;margin:22px auto 16px;min-height:52px;border-radius:17px;border:1px solid #0b8d83;background:#087f78;color:#fff;font:inherit;font-weight:700;cursor:pointer;transition:background .2s}.voice-session-button .ic{width:22px;height:22px;stroke:currentColor;fill:none}.voice-session-button.recording{background:var(--surface);border-color:var(--stroke);color:var(--text-1)}.voice-session-button:disabled{opacity:.5}.live-hero .live-caption{color:var(--text-2)}
.voice-conversation{margin:18px auto 0;max-width:560px;border:1px solid var(--stroke);border-radius:20px;background:var(--surface);overflow:hidden}.voice-conversation summary{display:flex;align-items:center;gap:12px;padding:18px;cursor:pointer;list-style:none}.voice-conversation summary::-webkit-details-marker{display:none}.voice-conversation summary>.ic{width:24px;height:24px;color:var(--ui-accent)}.voice-conversation summary>span:first-of-type{flex:1}.voice-conversation summary b{display:block;font-size:14px}.voice-conversation summary small{display:block;margin-top:4px;font-size:10px;color:var(--text-3)}.voice-chevron{font-size:22px;transition:rotate .2s}.voice-conversation[open] .voice-chevron{rotate:180deg}.voice-conversation .live-transcript{padding:12px;max-height:50dvh;overflow:auto;overscroll-behavior:contain}.voice-conversation[open] .live-transcript{animation:week-appear .25s ease-out}
@keyframes voice-connect{50%{height:calc(var(--height)*.8);opacity:1}}@keyframes voice-sway{50%{translate:0 -3px}}

.chat-page #chat-input:focus{outline:none!important;box-shadow:none!important;border-radius:0!important}
.voice-ribbon i{height:calc(var(--height)*var(--voice-energy));min-height:6px;transform:none!important;border-radius:20px;transition:height .16s ease,opacity .2s}
.live-hero[data-state=idle]{--voice-energy:.5}.live-hero[data-state=idle] .voice-ribbon{animation:voice-sway 4s ease-in-out infinite}
.assessment-result .result-overview{position:relative;padding:28px 20px!important;border-radius:26px!important;background:radial-gradient(ellipse at 50% 0%,#13b8a526,transparent 70%),var(--surface)!important;overflow:hidden}
.assessment-result .levelbadge{width:92px;height:92px!important;border-radius:28px!important;display:grid;place-items:center;font-size:36px;box-shadow:0 10px 30px #10b8a520;border:1px solid #44d9bc66}
.result-overview.result-visible .levelbadge{animation:result-reveal .7s cubic-bezier(.2,.8,.2,1) both}.assessment-result .result-overview .tags{gap:8px;flex-wrap:wrap}.assessment-result .result-overview .tag{white-space:normal;line-height:1.8;font-size:11px}.assessment-result .result-overview .muted{font-size:12px;line-height:2.1;margin-top:18px!important}
.result-report{margin:25px 0}.result-report>h3{font-size:16px;display:flex;align-items:center;gap:8px}.result-report>h3 .ic{width:22px;height:22px;color:var(--ui-accent)}.result-report>.tiny{margin:8px 0 16px;color:var(--text-3)}.result-skills{display:grid;gap:12px}
.assessment-result .result-row{padding:18px;margin:0;border:1px solid var(--stroke);border-radius:19px;background:var(--surface);min-width:0}.assessment-result .result-label{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;margin-bottom:13px;font-size:13px}.result-fraction{font-size:21px;font-weight:700;color:var(--ui-accent)}.result-fraction small{font-size:11px;color:var(--text-3);font-weight:500}
.assessment-result .result-track{height:9px;display:flex;gap:3px;background:transparent;border-radius:8px;overflow:hidden}.assessment-result .result-track i{border-radius:8px;transform:scaleX(0);transform-origin:right;transition:transform .85s cubic-bezier(.2,.7,.2,1)}.assessment-result .result-track .correct{background:#0a9b87}.assessment-result .result-track .incorrect{background:#dc748e50}.result-visible .result-track i{transform:scaleX(1)}
.result-legend{display:flex;justify-content:space-between;margin-top:10px;font-size:10px;color:var(--text-2)}.result-legend span:first-child{color:var(--ui-accent)}.assessment-result .result-row>p{font-size:11px;color:var(--text-2);line-height:1.9}.assessment-result .result-row .muted{font-size:12px;line-height:2;overflow-wrap:anywhere}.assessment-result .result-row .skill-track{height:7px;margin:12px 0 16px}.assessment-result .result-row .skill-track i{transform:scaleX(0);transform-origin:right;transition:transform .85s}.assessment-result .result-visible .skill-track i{transform:scaleX(1)}
.assessment-result .plan-preferences-card{padding:22px!important;border-radius:24px;background:linear-gradient(145deg,#13b8a50a,transparent),var(--surface)}.plan-preferences-card label{display:block;font-size:16px;line-height:1.8}.plan-preferences-card p{font-size:12px;line-height:2;margin:10px 0 16px}.plan-preferences-card textarea{font-size:16px!important;line-height:1.9;min-height:135px;resize:vertical;box-sizing:border-box}.assessment-result #create-plan{margin-bottom:16px;font-size:14px;white-space:normal;line-height:1.8}
@keyframes result-reveal{from{opacity:0;transform:translateY(8px) scale(.92)}to{opacity:1;transform:none}}
/* Mobile polish: one scroll surface for chat, no transformed input ancestors. */
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html.chat-document,html.chat-document body{height:100%;overflow:hidden;position:fixed;inset:0;width:100%}
#phone.chat-page{left:0;right:0;transform:none!important;transition:none!important;animation:none!important}
.chat-page>.chat-header{order:0;flex:none;padding:12px 16px!important;background:var(--bg-1);z-index:2}
.chat-page .chat-tools{overflow-x:auto;scrollbar-width:none;flex-wrap:nowrap}.chat-page .chat-tools button{flex-shrink:0}
.chat-page .screen.withdock{transform:none!important;animation:none!important;scroll-padding:12px!important;overflow-anchor:none;scrollbar-gutter:auto}
.chat-page #chat-input{font-size:17px!important;line-height:1.55!important;transform:none!important;-webkit-text-size-adjust:100%;font-family:Vazirmatn,sans-serif;caret-color:var(--ui-accent)}
.chat-page>.dockzone{padding:9px 12px max(10px,env(safe-area-inset-bottom))!important}
.chat-page.keyboard-open>.dockzone{padding-bottom:8px!important}.chat-page.keyboard-open{padding-top:0!important}
.chat-page .composer-hint{margin-top:5px;font-size:10px}.chat-page .composer{border-radius:20px!important}
.product-ui .tabbar{height:calc(66px + env(safe-area-inset-bottom));padding:8px 8px max(4px,env(safe-area-inset-bottom));align-items:center}
.product-ui .tab{padding-top:2px;gap:3px;min-height:48px}.product-ui .tab.fab .fabmark{transform:translateY(-2px)!important;height:31px!important}.product-ui .tab.fab .fabmark .logomark{height:34px!important;width:28px!important}
/* Entry pages: a calm branded header and one clear form surface. */
.auth-page .screen{padding-bottom:max(28px,env(safe-area-inset-bottom))!important;background:radial-gradient(ellipse at 85% 5%,#11b8a51b,transparent 48%),radial-gradient(ellipse at 5% 40%,#7775ef10,transparent 40%)}
.auth-page .welcome-theme{justify-content:flex-start;padding:12px 20px 0}.auth-page .authhead{padding:10px 24px 24px;text-align:center;animation:entry-arrive .65s ease-out both}
.auth-art{position:relative;display:grid;place-items:center;width:106px;height:106px;margin:0 auto 20px;isolation:isolate}.auth-art>.logomark{width:46px!important;height:64px!important;z-index:1;filter:drop-shadow(0 8px 14px #00bba422)}
.auth-orbit{position:absolute;inset:0;border:1px solid #18bea72b;border-radius:34px;background:linear-gradient(145deg,#0bb7a513,#7875e90b);rotate:-12deg;animation:auth-float 6s ease-in-out infinite}
.auth-spark{position:absolute;right:-4px;bottom:0;width:34px;height:34px;display:grid;place-items:center;border:1px solid var(--stroke);border-radius:12px;background:var(--bg-1);color:var(--ui-accent);animation:auth-float 6s 1s ease-in-out infinite}.auth-spark .ic{width:18px;height:18px}
.auth-kicker{color:var(--ui-accent);font-size:11px;font-weight:600;display:block;margin-bottom:9px}.auth-page .authhead h1{font-size:25px;line-height:1.6;margin:0 0 8px}.auth-page .authhead .sub{font-size:12px;line-height:2;color:var(--text-3)}
.auth-page .auth-panel{margin:0 20px 24px;padding:24px!important;border:1px solid var(--stroke);border-radius:28px;background:var(--surface);box-shadow:0 18px 40px #00000006;animation:entry-arrive .6s .1s ease-out both}
.auth-page .fieldgroup{margin-bottom:19px}.auth-page label{display:block;margin-bottom:9px;font-size:12px;color:var(--text-2)}.auth-page .field{min-height:54px;font-size:17px!important;border-radius:15px;background:var(--bg-1);transition:border-color .2s,box-shadow .2s}.auth-page .field:focus{outline:none;border-color:var(--ui-accent);box-shadow:0 0 0 3px #12b8a514}.auth-page .btn-primary{min-height:54px;border-radius:16px;box-shadow:0 8px 20px #00bba415}.auth-page .auth-panel>p{line-height:2}.auth-page .auth-panel>p a{display:inline-block;padding:6px}
@keyframes auth-float{50%{translate:0 -5px;rotate:0deg}}@keyframes entry-arrive{from{opacity:0;translate:0 12px}to{opacity:1;translate:0 0}}
/* Results: a level medallion, distinct skill summaries and a personal next step. */
.assessment-result .result-overview{padding:24px 18px!important;background:radial-gradient(ellipse at 50% 25%,#0fb8a51c,transparent 65%),var(--surface)!important;border-color:#15b8a53a!important}
.result-kicker{display:flex;align-items:center;justify-content:center;gap:7px;font-size:11px;color:var(--ui-accent)}.result-kicker .ic{width:17px;height:17px}
.result-medallion{position:relative;display:grid;place-items:center;width:156px;height:156px;margin:18px auto 10px;isolation:isolate}.result-medallion:before,.result-medallion:after{content:'';position:absolute;inset:6px;border:1px solid #12b8a530;border-radius:50%;z-index:-1}.result-medallion:after{inset:0;border-color:transparent;border-top-color:#0cb7a5;border-bottom-color:#7978d577;animation:result-orbit 14s linear infinite}
.assessment-result .levelbadge{margin:0!important;width:112px;height:112px!important;border-radius:38px!important;font-size:42px;background:linear-gradient(145deg,#16d4b1,#0eaaa5)!important;color:#062d34!important;box-shadow:0 14px 30px #0cb7a522}
.result-level-name{font-size:21px;font-weight:800}.result-intro{font-size:12px;color:var(--text-2);line-height:2;margin:8px 0 20px}.result-capabilities{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px!important;margin:0!important}.assessment-result .result-capabilities .tag{display:flex;justify-content:center;padding:10px 4px;border-radius:13px;font-size:11px!important;white-space:normal}
.result-focus{display:flex;gap:10px;text-align:right;margin-top:20px;padding-top:18px;border-top:1px solid var(--stroke);line-height:1.9}.result-focus>.ic{width:20px;color:var(--ui-accent);margin-top:4px}.result-focus span{display:block;color:var(--text-3);font-size:11px}.result-focus b{font-size:12px;font-weight:500}
.result-summary h3{font-size:14px;display:flex;gap:8px;align-items:center;margin:0 0 12px}.result-summary h3 .ic{width:20px;color:var(--ui-accent)}.result-summary .muted{font-size:13px;line-height:2.1}.result-summary{margin-block:16px;border-radius:22px}
.assessment-result .result-report{margin:28px 0}.result-report>h3{font-size:18px}.result-report>.tiny{margin-bottom:20px}
.assessment-result .result-quantitative{display:flex;gap:16px;align-items:center;padding:18px 16px;border-radius:22px}.result-topic-detail{flex:1;min-width:0}.assessment-result .result-label{margin-bottom:10px;gap:6px;font-size:13px}.result-fraction{font-size:13px;font-weight:500;white-space:nowrap}.result-score-ring{width:62px;height:62px;flex:0 0 62px;position:relative;display:grid;place-items:center}.result-score-ring svg{width:62px;height:62px;position:absolute;inset:0;rotate:-90deg;fill:none;stroke:var(--stroke);stroke-width:3}.result-score-ring .score-arc{stroke:var(--ui-accent);stroke-dasharray:100;stroke-dashoffset:100;stroke-linecap:round;transition:stroke-dashoffset 1.2s cubic-bezier(.2,.7,.2,1)}.result-visible .score-arc{stroke-dashoffset:calc(100 - var(--score))}.result-score-ring span{font-size:16px;font-weight:700;direction:rtl}.result-score-ring small{font-size:9px;margin-right:2px}
.assessment-result .result-track{height:5px;gap:2px}.result-legend{font-size:10px;margin-top:8px}.assessment-result .result-written{padding:22px;border-radius:22px;background:linear-gradient(120deg,#12b8a506,transparent),var(--surface)}.result-skill-icon{display:inline-grid;place-items:center;width:35px;height:35px;background:#10b8a510;color:var(--ui-accent);border-radius:12px;margin-inline-end:10px;vertical-align:middle}.result-skill-icon .ic{width:19px;height:19px}.result-written>b{font-size:15px}.assessment-result .result-written .muted{padding-top:10px;font-size:13px;line-height:2.1}.assessment-result .result-written .skill-track{height:8px;margin-top:14px}
.assessment-result .plan-preferences-card{position:relative;padding:24px!important;border-radius:26px;border-color:#15b8a540;background:radial-gradient(ellipse at 100% 0%,#10b8a510,transparent 70%),var(--surface)}.preference-symbol{width:42px;height:42px;display:grid;place-items:center;border-radius:14px;background:#12b8a514;color:var(--ui-accent);margin-bottom:16px}.plan-preferences-card textarea{background:var(--bg-1);border-radius:16px;min-height:142px;padding:14px;line-height:1.9}.assessment-result #create-plan{min-height:56px;border-radius:18px;margin-top:18px!important}
.result-visible.result-row,.result-visible.result-summary,.result-visible.plan-preferences-card{animation:entry-arrive .55s ease-out both}
@keyframes result-orbit{to{rotate:360deg}}
@media(min-width:700px){.auth-page .auth-panel{max-width:420px;margin-inline:auto}.auth-page .authhead{padding-top:24px}.assessment-result .result-skills{grid-template-columns:repeat(2,minmax(0,1fr))}.result-written{grid-column:1/-1}}
@media(max-width:360px){.auth-page .auth-panel{padding:20px!important;margin-inline:14px}.auth-page .authhead h1{font-size:23px}.result-score-ring,.result-score-ring svg{width:50px;height:50px}.result-score-ring{flex-basis:50px}.assessment-result .result-quantitative{gap:10px}.assessment-result .result-label{font-size:12px}.assessment-result .result-capabilities .tag{font-size:10px!important}}
@media(prefers-reduced-motion:reduce){.auth-orbit,.auth-spark,.result-medallion:after{animation:none!important}.score-arc{transition:none!important}}
.reduce-motion .auth-orbit,.reduce-motion .auth-spark,.reduce-motion .result-medallion:after{animation:none!important}
.auth-page input[type=email]{direction:ltr;text-align:left;padding-left:16px;padding-right:48px}
@media(max-height:700px){.auth-page .authhead{padding-bottom:16px}.auth-art{width:76px;height:76px;margin-bottom:12px}.auth-art>.logomark{width:34px!important;height:48px!important}.auth-page .authhead h1{font-size:22px}.auth-page .auth-panel{padding:20px!important}.auth-page .fieldgroup{margin-bottom:14px}}
