/* Hanzi Studio brand system v5 (Mây Long). Loaded last; legacy layout keeps working.
   Shape rule: buttons and chips are pills, cards 20px, inputs 14px, icon tiles 26%. */
:root{
  --brand:#6b5ce7;--brand-strong:#5543d7;--lilac:#a78bfa;--jade:#29aa95;--sun:#f6c453;--blossom:#ff8fa3;--sky:#6f8fff;
  --bg:#f6f5ff;--surface:#fff;--muted-bg:#f0eefc;--paper:#fff;--stroke:#e7e4f7;--txt:#221d4b;--muted:#6d6990;--quiet:#9a96b8;
  --primary:#6b5ce7;--primary-strong:#5543d7;--primary-light:#efecff;--teal:#1f8f7d;--teal-light:#e2f6f1;
  --shadow:0 10px 30px rgba(76,61,180,.07);--shadow-lift:0 18px 44px rgba(76,61,180,.14);
  --grad-brand:linear-gradient(135deg,#8b7cf6 0%,#6b5ce7 55%,#5a8bff 100%);
  --grad-soft:linear-gradient(135deg,#f3efff 0%,#ece9ff 50%,#e6f0ff 100%);
  --ease-out:cubic-bezier(.16,1,.3,1);--ease-spring:cubic-bezier(.34,1.56,.64,1);
  --font:'Be Vietnam Pro',system-ui,-apple-system,'Segoe UI',sans-serif;
}
[data-theme="dark"]{
  --bg:#12102a;--surface:#1c1938;--muted-bg:#262247;--paper:#221e42;--stroke:#332e5c;--txt:#f2f0ff;--muted:#bab5dc;--quiet:#8f89b8;
  --primary:#a99fff;--primary-strong:#c2baff;--primary-light:#2d2858;--teal:#5cd8bf;--teal-light:#1d3b3b;
  --shadow:0 12px 34px rgba(0,0,0,.28);--shadow-lift:0 20px 48px rgba(0,0,0,.4);
  --grad-soft:linear-gradient(135deg,#221d47 0%,#1f1b40 55%,#1a2345 100%);
}
body{font-family:var(--font);letter-spacing:-.005em;background:var(--bg)}
h1,h2,h3,h4{letter-spacing:-.02em}
.btn{border-radius:999px;font-weight:700;transition:transform .2s var(--ease-out),box-shadow .2s,background .2s,border-color .2s}
.btn:hover{transform:translateY(-1px)}.btn:active{transform:translateY(1px) scale(.98)}
.btn-primary{background:var(--brand-strong);border-color:var(--brand-strong);color:#fff;box-shadow:0 8px 20px rgba(85,67,215,.28)}
.btn-primary:hover{background:#4a38c9}
[data-theme="dark"] .btn-primary{background:#6b5ce7;border-color:#6b5ce7}
.panel,.metric{border-radius:20px}
:focus-visible{outline:3px solid var(--lilac);outline-offset:3px}

/* ---------- App shell ---------- */
.brand{padding:0 6px 24px}
.brandmark{width:100%;justify-content:flex-start!important}
.brandmark img{width:176px!important;height:auto!important;max-width:100%}
.brand>div:not(.brandmark){display:none}
.navlabel{margin-top:14px}
.navbtn{border-radius:14px;font-weight:600;gap:12px;padding:8px 12px;min-height:44px}
.navbtn .nav-text{flex:1;min-width:0}
.navbtn.active{background:var(--primary-light);color:var(--primary);box-shadow:inset 3px 0 0 var(--brand)}
/* 3D brand icons (assets/icons, badges, decor) replace the old glyph tiles. */
.nav-ico{width:28px;height:28px;flex:none;object-fit:contain;filter:drop-shadow(0 3px 5px rgba(76,61,180,.18));transition:transform .25s var(--ease-spring)}
.navbtn:hover .nav-ico,.navbtn.active .nav-ico{transform:scale(1.1) rotate(-4deg)}
.topbar{background:color-mix(in srgb,var(--surface) 86%,transparent);backdrop-filter:saturate(160%) blur(14px);-webkit-backdrop-filter:saturate(160%) blur(14px)}
.account-chip{display:inline-flex;align-items:center;gap:9px;height:44px;padding:0 14px 0 5px;border:1px solid var(--stroke);border-radius:999px;background:var(--surface);color:var(--txt);font-weight:700;font-size:12px}
.account-chip .avatar{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:var(--grad-brand);color:#fff;font-size:12px;font-weight:800;overflow:hidden}
.account-chip .avatar img{width:100%;height:100%;object-fit:cover}
.account-chip small{display:block;color:var(--muted);font-size:10px;font-weight:600}
.account-chip:hover{border-color:var(--lilac)}
@media(max-width:670px){.account-chip{padding:0 4px}.account-chip .chip-text{display:none}}

/* Skill tiles (home) */
.skill-strip{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:12px;margin:26px 0 6px}
.skill-tile{display:grid;justify-items:center;gap:8px;padding:14px 8px 12px;border:1px solid var(--stroke);border-radius:20px;background:var(--surface);color:var(--txt);font-weight:700;font-size:12px;transition:transform .25s var(--ease-spring),box-shadow .25s}
.skill-tile img{width:52px;height:47px;object-fit:contain;filter:drop-shadow(0 6px 10px rgba(76,61,180,.18))}
.skill-tile:hover{transform:translateY(-4px);box-shadow:var(--shadow-lift)}

/* ---------- Public layout (welcome, auth) ---------- */
body.public-mode .sidebar,body.public-mode .topbar,body.public-mode .bottom-nav{display:none!important}
body.public-mode .app{display:block}
body.public-mode .body{max-width:none;padding:0}
.public-page{min-height:100dvh}
.pub-wrap{width:min(1240px,100%);margin:0 auto;padding:0 clamp(16px,4vw,40px)}
.pub-nav{position:sticky;top:0;z-index:40;background:color-mix(in srgb,var(--bg) 82%,transparent);backdrop-filter:saturate(160%) blur(14px);-webkit-backdrop-filter:saturate(160%) blur(14px);border-bottom:1px solid transparent;transition:border-color .3s}
.pub-nav.is-stuck{border-bottom-color:var(--stroke)}
.pub-nav .pub-wrap{display:flex;align-items:center;gap:20px;height:72px}
.pub-logo{display:block;border:0;background:none;padding:0;cursor:pointer}
.pub-logo img{height:56px;width:auto;display:block}
.pub-links{display:flex;gap:4px;margin-left:auto}
.pub-links button{border:0;background:none;color:var(--muted);font-weight:600;font-size:14px;padding:10px 14px;border-radius:999px}
.pub-links button:hover{color:var(--txt);background:var(--muted-bg)}
.pub-actions{display:flex;gap:8px;align-items:center}
.icon-round{width:44px;height:44px;border-radius:50%;border:1px solid var(--stroke);background:var(--surface);color:var(--txt);display:grid;place-items:center}
.btn-lg{min-height:52px;padding:14px 26px;font-size:15px}
@media(max-width:860px){.pub-links{display:none}.pub-actions{margin-left:auto}}

.pub-hero{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.08fr);gap:clamp(24px,4vw,56px);align-items:center;padding:clamp(28px,5vw,64px) 0 clamp(40px,6vw,80px)}
.pub-eyebrow{display:inline-flex;align-items:center;gap:8px;margin:0 0 18px;padding:7px 14px;border-radius:999px;background:var(--primary-light);color:var(--primary);font-size:13px;font-weight:700}
.pub-hero h1{font-size:clamp(36px,5.2vw,62px);line-height:1.08;margin:0 0 18px;font-weight:800;letter-spacing:-.035em;color:var(--txt)}
.pub-hero h1 em{font-style:normal;background:linear-gradient(100deg,#6b5ce7,#29aa95);-webkit-background-clip:text;background-clip:text;color:transparent}
.pub-lead{font-size:clamp(16px,1.6vw,18px);line-height:1.65;color:var(--muted);max-width:46ch;margin:0 0 28px}
.pub-cta{display:flex;gap:12px;flex-wrap:wrap}
.pub-hero-art{position:relative;isolation:isolate}
.pub-scene{width:100%;height:auto;aspect-ratio:1026/582;object-fit:cover;border-radius:28px;box-shadow:var(--shadow-lift);display:block}
.pub-hero-art:before{content:'';position:absolute;inset:-18px -18px auto auto;width:70%;height:80%;border-radius:36px;background:var(--grad-brand);opacity:.16;z-index:-1;transform:rotate(4deg)}
.word-card{position:absolute;left:-22px;bottom:-26px;display:grid;gap:2px;padding:14px 20px 14px 16px;border-radius:20px;background:var(--surface);border:1px solid var(--stroke);box-shadow:var(--shadow-lift);min-width:168px}
.word-card .hz{font-size:30px;font-weight:700;line-height:1.1}
.word-card .py{color:var(--primary);font-weight:700}
.word-card .vi{color:var(--muted);font-size:13px}
.word-card button{position:absolute;right:10px;top:10px;width:34px;height:34px;border-radius:50%;border:0;background:var(--primary-light);color:var(--primary);display:grid;place-items:center}
.hero-sticker{position:absolute;right:-14px;top:-30px;width:clamp(92px,11vw,132px);height:auto;cursor:pointer;filter:drop-shadow(0 12px 18px rgba(76,61,180,.22))}
@media(max-width:900px){.pub-hero{grid-template-columns:1fr}.pub-hero-art{margin:8px 6px 30px}.word-card{left:8px}}

.pub-section{padding:clamp(48px,7vw,96px) 0}
.pub-section h2{font-size:clamp(28px,3.4vw,42px);line-height:1.15;margin:0 0 14px;font-weight:800;letter-spacing:-.03em;max-width:22ch}
.pub-section .pub-sub{color:var(--muted);font-size:16px;line-height:1.65;max-width:60ch;margin:0 0 36px}
.bento{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));grid-auto-rows:minmax(210px,auto);gap:18px}
.bento-cell{position:relative;overflow:hidden;border-radius:24px;padding:26px;border:1px solid var(--stroke);background:var(--surface);display:flex;flex-direction:column;gap:10px}
.bento-cell h3{margin:0;font-size:21px;font-weight:800}
.bento-cell p{margin:0;color:var(--muted);line-height:1.6;max-width:38ch}
.bento-cell .tile-icon{width:58px;height:52px;object-fit:contain}
.bento-cell .cell-mascot{position:absolute;right:10px;bottom:-6px;width:clamp(120px,14vw,170px);height:auto;transition:transform .5s var(--ease-spring)}
.bento-cell:hover .cell-mascot{transform:translateY(-8px) rotate(-3deg)}
.cell-a{grid-column:span 4;grid-row:span 2;background:linear-gradient(150deg,#efeaff,#e3e9ff);padding-right:clamp(26px,22vw,280px)}
.cell-a .cell-mascot{width:clamp(170px,22vw,280px)}
.cell-b{grid-column:span 2;background:linear-gradient(160deg,#e3f7f1,#d4f1ea)}
.cell-c{grid-column:span 2;background:linear-gradient(160deg,#fff0f3,#ffe3ea)}
.cell-d{grid-column:span 6;background:linear-gradient(110deg,#fff6df,#fff0c9);padding-right:clamp(26px,20vw,240px);min-height:180px}
[data-theme="dark"] .cell-a{background:linear-gradient(150deg,#2a2457,#232a55)}
[data-theme="dark"] .cell-b{background:linear-gradient(160deg,#173a37,#16312f)}
[data-theme="dark"] .cell-c{background:linear-gradient(160deg,#3d2236,#331d30)}
[data-theme="dark"] .cell-d{background:linear-gradient(110deg,#3a3020,#30281b)}
.level-chips{display:flex;flex-wrap:wrap;gap:8px;margin-top:auto}
.level-chips span{padding:6px 12px;border-radius:999px;background:var(--surface);border:1px solid var(--stroke);font-weight:700;font-size:13px}
.fact-row{display:flex;flex-wrap:wrap;gap:22px;margin-top:auto}
.fact-row strong{display:block;font-size:30px;font-weight:800;color:var(--primary);font-variant-numeric:tabular-nums}
.fact-row span{color:var(--muted);font-size:13px}
@media(max-width:900px){.bento{grid-template-columns:1fr}.cell-a,.cell-b,.cell-c,.cell-d{grid-column:auto;grid-row:auto;padding-right:26px;padding-bottom:150px}.bento-cell .cell-mascot,.cell-a .cell-mascot{width:140px}}

.skill-grid{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:14px}
.skill-grid .skill-tile{padding:20px 10px 16px;font-size:14px}
.skill-grid .skill-tile img{width:66px;height:60px}
@media(max-width:760px){.skill-grid{grid-template-columns:repeat(3,minmax(0,1fr))}}
@media(max-width:420px){.skill-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

.roles{display:grid;grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);gap:clamp(24px,4vw,56px);align-items:center}
.role-tabs{display:inline-flex;padding:5px;border-radius:999px;background:var(--muted-bg);gap:4px;margin-bottom:24px;flex-wrap:wrap}
.role-tabs button{border:0;background:none;padding:10px 18px;border-radius:999px;font-weight:700;color:var(--muted)}
.role-tabs button[aria-selected="true"]{background:var(--surface);color:var(--txt);box-shadow:var(--shadow)}
.role-panel ul{list-style:none;margin:0;padding:0;display:grid;gap:14px}
.role-panel li{display:grid;grid-template-columns:28px 1fr;gap:12px;line-height:1.55;color:var(--txt)}
.role-panel li:before{content:'';width:28px;height:28px;border-radius:50%;background:var(--teal-light) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2329aa95' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/14px no-repeat}
.role-panel[hidden]{display:none}
.role-stage{position:relative;display:grid;place-items:center;min-height:360px;border-radius:32px;background:var(--grad-soft);border:1px solid var(--stroke)}
.role-stage img{width:min(300px,70%);height:auto;filter:drop-shadow(0 18px 24px rgba(76,61,180,.2))}
.role-note{margin-top:22px;color:var(--muted);font-size:14px}
@media(max-width:900px){.roles{grid-template-columns:1fr}.role-stage{min-height:260px;order:-1}}

.steps{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px;counter-reset:step;position:relative}
.step{position:relative;padding:28px 24px 26px;border-radius:24px;background:var(--surface);border:1px solid var(--stroke)}
.step img{width:84px;height:84px;object-fit:contain;margin:-58px 0 8px -6px;display:block}
.step h3{margin:0 0 8px;font-size:19px}
.step p{margin:0;color:var(--muted);line-height:1.6}
.steps-wrap{padding-top:40px}
@media(max-width:820px){.steps{grid-template-columns:1fr;gap:56px}}

.pub-final{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:28px;padding:34px clamp(24px,4vw,48px);border-radius:32px;background:var(--grad-brand);color:#fff;overflow:hidden}
.pub-final h2{color:#fff;margin:0 0 6px;font-size:clamp(24px,3vw,34px)}
.pub-final p{margin:0;color:#ece9ff;line-height:1.6}
.pub-final img{width:128px;height:auto;margin:-10px 0 -40px}
.pub-final .btn{background:#fff;color:#3b2fb0;border-color:#fff}
@media(max-width:760px){.pub-final{grid-template-columns:1fr;text-align:left}.pub-final img{margin:0}}
.pub-footer{padding:36px 0 48px;color:var(--muted);font-size:14px}
.pub-footer .pub-wrap{display:flex;flex-wrap:wrap;gap:18px 28px;align-items:center;justify-content:space-between;border-top:1px solid var(--stroke);padding-top:28px}
.pub-footer img{height:46px;width:auto}
.pub-footer nav{display:flex;gap:6px;flex-wrap:wrap}
.pub-footer nav button,.pub-footer nav a{border:0;background:none;color:var(--muted);padding:8px 10px;border-radius:999px;font-weight:600;font-size:inherit;text-decoration:none}
.pub-footer nav button:hover,.pub-footer nav a:hover{color:var(--txt)}

/* ---------- Auth ---------- */
.auth-shell{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);min-height:100dvh}
.auth-brand{position:relative;overflow:hidden;display:flex;flex-direction:column;padding:28px clamp(24px,4vw,56px);background:var(--grad-soft);border-right:1px solid var(--stroke)}
.auth-brand .pub-logo img{height:64px}
.auth-back{align-self:flex-start;margin-bottom:22px}
.auth-stage{position:relative;flex:1;display:grid;place-items:center;min-height:300px}
.auth-stage:before{content:'';position:absolute;width:min(380px,80%);aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 35% 30%,rgba(255,255,255,.9),rgba(167,139,250,.35) 60%,transparent 72%)}
[data-theme="dark"] .auth-stage:before{background:radial-gradient(circle at 35% 30%,rgba(169,159,255,.35),rgba(107,92,231,.16) 60%,transparent 72%)}
.auth-mascot{position:relative;width:min(300px,62%);height:auto;filter:drop-shadow(0 22px 28px rgba(76,61,180,.25))}
.auth-bubble{position:absolute;top:8%;right:6%;max-width:220px;padding:12px 16px;border-radius:20px 20px 20px 6px;background:var(--surface);border:1px solid var(--stroke);box-shadow:var(--shadow-lift);font-weight:700;line-height:1.45}
.auth-points{list-style:none;padding:0;margin:8px 0 0;display:grid;gap:10px;color:var(--txt);font-weight:600}
.auth-points li{display:flex;gap:10px;align-items:center}
.auth-points img{width:34px;height:31px;object-fit:contain}
.auth-main{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:40px clamp(16px,4vw,56px);gap:18px}
.auth-card{width:min(440px,100%);padding:clamp(24px,3vw,36px);border-radius:28px;background:var(--surface);border:1px solid var(--stroke);box-shadow:var(--shadow-lift)}
.auth-card h1{font-size:28px;margin:0 0 6px;font-weight:800}
.auth-card .auth-intro{margin:0 0 22px;color:var(--muted);line-height:1.6}
.seg{display:grid;grid-template-columns:1fr 1fr;padding:5px;border-radius:999px;background:var(--muted-bg);margin-bottom:24px}
.seg button{border:0;background:none;border-radius:999px;padding:10px;font-weight:700;color:var(--muted)}
.seg button[aria-selected="true"]{background:var(--surface);color:var(--txt);box-shadow:var(--shadow)}
.auth-form{display:grid;gap:16px}
.auth-form label{display:grid;gap:7px;font-weight:600;font-size:14px}
.auth-form input{width:100%;min-height:50px;padding:12px 14px;border-radius:14px;border:1.5px solid var(--stroke);background:var(--bg);color:var(--txt);font-size:15px;transition:border-color .2s,box-shadow .2s}
.auth-form input:focus{outline:none;border-color:var(--brand);box-shadow:0 0 0 4px rgba(107,92,231,.18)}
.auth-form .hint{font-size:12px;color:var(--muted);font-weight:500}
.pw-field{position:relative}
.pw-field{display:grid;gap:7px}
.pw-control{position:relative}
.pw-field input{padding-right:52px}
.pw-toggle{position:absolute;right:4px;top:50%;transform:translateY(-50%);width:44px;height:44px;border:0;border-radius:12px;background:none;color:var(--muted);display:grid;place-items:center}
.seg button,.auth-row .text-link,.auth-confirmation>.text-link{min-height:44px}
.auth-confirmation{display:grid;gap:14px}
.auth-confirmation p{margin:0}
.auth-confirm-email{overflow-wrap:anywhere;font-weight:700;color:var(--primary-strong)}
.auth-confirmation ol{margin:0;padding-left:22px;line-height:1.7;color:var(--muted)}
.auth-form[aria-busy="true"] .btn-primary{cursor:wait}
.auth-form .btn-primary{width:100%;min-height:52px;font-size:15px}
.auth-row{display:flex;justify-content:flex-end;margin-top:-6px}
.text-link{border:0;background:none;color:var(--primary);font-weight:700;padding:6px 2px;text-decoration:underline;text-underline-offset:3px}
.auth-divider{display:flex;align-items:center;gap:12px;color:var(--muted);font-size:13px;margin:20px 0 14px}
.auth-divider:before,.auth-divider:after{content:'';flex:1;height:1px;background:var(--stroke)}
.auth-card .btn{width:100%}
#auth-panel [data-cloud="google"]{background:var(--surface);color:var(--txt);border-color:var(--stroke);transition:transform .2s var(--ease-out),box-shadow .2s}
.auth-status{margin:16px 0 0;padding:12px 14px;border-radius:14px;background:var(--muted-bg);line-height:1.55;font-size:14px}
.auth-status:empty{display:none}
.auth-status.cloud-error{background:#fff0f2;color:#9b2238}
[data-theme="dark"] .auth-status.cloud-error{background:#41202e;color:#ffc2cd}
.auth-guest{color:var(--muted)}
.auth-fineprint{margin:16px 0 0;color:var(--muted);font-size:13px;line-height:1.55}
@media(max-width:900px){.auth-shell{grid-template-columns:1fr}.auth-brand{border-right:0;border-bottom:1px solid var(--stroke);padding-bottom:12px}.auth-stage{min-height:200px}.auth-mascot{width:170px}.auth-points{display:none}.auth-bubble{top:4%;right:2%;font-size:13px}}
@media(max-width:670px){.auth-brand{display:none}.auth-main{padding:20px 15px}.auth-card{padding:24px 20px;border-radius:22px}.auth-card h1{font-size:25px}}
@media(prefers-reduced-motion:reduce){.auth-card .btn,.auth-form input{transition:none}}

/* ---------- Classroom ---------- */
.class-hero{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:20px;padding:24px 28px;margin-bottom:20px;border-radius:24px;background:var(--grad-soft);border:1px solid var(--stroke);overflow:hidden}
.class-hero h2{margin:0 0 6px;font-size:26px;font-weight:800}
.class-hero p{margin:0;color:var(--muted);line-height:1.6;max-width:60ch}
.class-hero img{width:120px;height:120px;object-fit:contain;margin:-12px 0 -24px}
.role-badge{display:inline-flex;margin-bottom:10px;padding:5px 12px;border-radius:999px;background:var(--surface);border:1px solid var(--stroke);font-size:12px;font-weight:700;color:var(--primary)}
.gate{display:grid;justify-items:start;gap:12px;padding:8px 0}
.gate h3{margin:0}
.gate p{margin:0;color:var(--muted);line-height:1.6}
#workspace-status:empty{display:none}
#workspace-status{padding:12px 14px;border:1px solid var(--stroke);border-radius:14px;background:var(--muted-bg);margin:0 0 16px}
#workspace-status.cloud-error{border-color:var(--blossom)}
@media(max-width:600px){.class-hero{grid-template-columns:1fr}.class-hero img{display:none}}

/* ---------- Mascot motion ---------- */
@keyframes ml-float{0%,100%{transform:translateY(0) rotate(0)}50%{transform:translateY(-10px) rotate(-1.5deg)}}
@keyframes ml-pop{0%{transform:scale(.82);opacity:.4}70%{transform:scale(1.06)}100%{transform:scale(1);opacity:1}}
@keyframes ml-wiggle{0%,100%{transform:rotate(0)}25%{transform:rotate(-6deg)}75%{transform:rotate(6deg)}}
@keyframes ml-rise{from{opacity:0;transform:translateY(22px)}to{opacity:1;transform:none}}
@media(prefers-reduced-motion:no-preference){
  .float{animation:ml-float 5s ease-in-out infinite}
  .float-slow{animation:ml-float 7s ease-in-out infinite}
  .is-popping{animation:ml-pop .45s var(--ease-spring)}
  .hero-sticker:hover{animation:ml-wiggle .6s ease-in-out}
  .js-reveal .reveal{opacity:0;transform:translateY(22px);transition:opacity .7s var(--ease-out),transform .7s var(--ease-out)}
  .js-reveal .reveal.is-in{opacity:1;transform:none}
  .pub-hero-copy>*{animation:ml-rise .7s var(--ease-out) both}
  .pub-hero-copy>*:nth-child(2){animation-delay:.06s}.pub-hero-copy>*:nth-child(3){animation-delay:.12s}.pub-hero-copy>*:nth-child(4){animation-delay:.18s}
  .pub-hero-art{animation:ml-rise .9s .1s var(--ease-out) both}
}

/* Layout fixes after visual review */
.brandmark{width:100%!important;height:auto!important;border:0!important;padding:0!important;cursor:pointer}
.pub-tight{padding-top:0}
.public-page{overflow-x:clip}
.pub-nav .pub-logo img{height:64px}
.auth-brand .pub-logo img{height:clamp(72px,9vw,104px)}
@media(max-width:900px){.cell-b,.cell-c{padding-bottom:26px}}
.auth-fineprint a{color:var(--primary);font-weight:600}

/* ---------- Feature navigation v6: banner heroes, badges, 3D icons ---------- */
/* Banner art is a light pastel scene with Mây Long on the right; copy sits on the left in fixed dark ink
   on desktop and below the art (theme colours) on phones. */
.art-hero{position:relative;overflow:hidden;display:flex;align-items:center;min-height:clamp(250px,24vw,320px);margin-bottom:20px;border:1px solid var(--stroke);border-radius:20px;background:#efeafe}
.art-hero-media img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;object-position:right center}
.art-hero-copy{position:relative;max-width:min(560px,56%);padding:clamp(24px,4vw,48px);color:#221d4b}
.art-hero-copy h1,.art-hero-copy h3{margin:0 0 10px;color:#221d4b;font-size:clamp(28px,3.2vw,42px);line-height:1.12;letter-spacing:-.03em;font-weight:800}
.art-hero-copy p{margin:0 0 22px;color:#4a4573;font-size:15px;line-height:1.6;max-width:44ch}
.art-hero-actions{display:flex;flex-wrap:wrap;gap:10px}
.art-hero-actions .btn{min-height:46px;padding:12px 22px;white-space:nowrap}
.art-hero-actions .btn:not(.btn-primary){background:#fff;color:#3d33a8;border-color:#ddd7fb}
[data-theme="dark"] .art-hero-media img{filter:brightness(.94)}
@media(max-width:700px){
  .art-hero{flex-direction:column;align-items:stretch;min-height:0;background:var(--surface)}
  .art-hero-media{display:block;height:210px;background:#efeafe}
  .art-hero-media img{position:static;height:100%;object-position:center 35%}
  .art-hero-copy{max-width:none;padding:20px;color:var(--txt)}
  .art-hero-copy h1,.art-hero-copy h3{color:var(--txt);font-size:26px}
  .art-hero-copy p{color:var(--muted);font-size:14px;margin-bottom:16px}
  .art-hero-actions .btn{flex:1 1 auto;justify-content:center}
}
/* Badges (home) */
.home-badges{display:grid;grid-template-columns:minmax(180px,.7fr) 2fr;align-items:center;gap:20px;margin:0 0 6px;padding:18px 22px;border:1px solid var(--stroke);border-radius:20px;background:var(--grad-soft)}
.home-badges h2{margin:0;font-size:18px;font-weight:800}
.home-badges p{margin:6px 0 0;color:var(--muted);font-size:13px;line-height:1.5}
.badge-row{list-style:none;margin:0;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px}
.badge-card{display:grid;justify-items:center;gap:4px;padding:12px 8px;border-radius:16px;background:var(--surface);border:1px solid var(--stroke);text-align:center}
.badge-card img{width:44px;height:48px;object-fit:contain;filter:grayscale(1) opacity(.45);transition:filter .3s,transform .3s var(--ease-spring)}
.badge-card strong{font-size:13px}
.badge-card span{font-size:11px;color:var(--muted);line-height:1.35}
.badge-card.is-won img{filter:drop-shadow(0 6px 10px rgba(246,196,83,.35))}
.badge-card.is-won span{color:var(--teal);font-weight:700}
.badge-card.is-won:hover img{transform:scale(1.08) rotate(-4deg)}
@media(max-width:860px){.home-badges{grid-template-columns:1fr}.badge-row{grid-template-columns:repeat(2,minmax(0,1fr))}}
/* Arena mode cards and mobile bottom nav use the same 3D icon set. */
.pro-mode-ico{display:block;width:56px;height:56px;object-fit:contain;margin-bottom:18px;filter:drop-shadow(0 6px 10px rgba(76,61,180,.18));transition:transform .25s var(--ease-spring)}
.pro-mode:hover .pro-mode-ico{transform:translateY(-2px) scale(1.06) rotate(-4deg)}
.bnav-ico{width:26px;height:26px;object-fit:contain;transition:transform .25s var(--ease-spring)}
.bottom-nav button{min-height:52px;font-size:10px}
.bottom-nav button.active .bnav-ico{transform:translateY(-2px) scale(1.12)}
.bottom-nav button:not(.active) .bnav-ico{filter:saturate(.75)}
/* Decor and badge art has no tile of its own; a fixed pale tile keeps every icon square and readable in dark mode. */
.ico-obj{box-sizing:border-box;padding:3px;border-radius:26%;background:linear-gradient(135deg,#f6f3ff,#e4defe);box-shadow:inset 0 0 0 1px rgba(107,92,231,.12)}
.pro-mode-ico.ico-obj{padding:8px}
.art-hero-copy h1,.art-hero-copy h3,.art-hero-copy p{text-wrap:pretty}
/* Phones: practice modes become compact rows (icon left, text right) instead of half-screen cards. */
@media(max-width:560px){
  .pro-mode-grid{grid-template-columns:1fr!important;gap:10px}
  .pro-mode{display:grid;grid-template-columns:52px 1fr;column-gap:14px;align-items:start;min-height:0;padding:16px}
  .pro-mode-ico{grid-row:span 3;width:52px;height:52px;margin:0}
  .pro-mode p{min-height:0;margin:0}
  .pro-mode footer{grid-column:2;margin-top:8px}
}
@media(prefers-reduced-motion:reduce){.nav-ico,.bnav-ico,.pro-mode-ico,.badge-card img{transition:none!important}}

/* ---------- AI tutor (Trợ giảng AI) ---------- */
.tutor-head{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:16px;margin-bottom:18px;padding:16px 20px;border:1px solid var(--stroke);border-radius:20px;background:var(--grad-soft)}
.tutor-head img{width:72px;height:72px;object-fit:contain}
.tutor-head h1{margin:0;font-size:clamp(20px,2.4vw,26px);font-weight:800}
.tutor-head p{margin:4px 0 0;color:var(--muted);font-size:14px;line-height:1.5}
.tutor-quota{padding:8px 14px;border-radius:999px;background:var(--surface);border:1px solid var(--stroke);font-size:12px;font-weight:700;color:var(--primary);white-space:nowrap}
.tutor-quota:empty{display:none}
#tutor-body{padding:18px;border:1px solid var(--stroke);border-radius:20px;background:var(--surface)}
.tutor-tabs{max-width:320px;margin-bottom:16px}
.tutor-log{display:flex;flex-direction:column;gap:12px;min-height:280px;max-height:min(56vh,560px);overflow-y:auto;padding:4px 2px 12px}
.tutor-msg{max-width:min(78ch,86%);padding:12px 16px;border-radius:18px;line-height:1.6;font-size:15px;overflow-wrap:anywhere}
.tutor-msg p{margin:0 0 6px}.tutor-msg p:last-child{margin:0}.tutor-msg ul{margin:4px 0;padding-left:20px}
.tutor-msg.from-user{align-self:flex-end;background:var(--brand-strong);color:#fff;border-bottom-right-radius:6px}
.tutor-msg.from-tutor{align-self:flex-start;background:var(--muted-bg);color:var(--txt);border-bottom-left-radius:6px}
.tutor-empty{display:grid;gap:12px;justify-items:start;color:var(--muted)}
.tutor-chips{display:flex;flex-wrap:wrap;gap:8px}
.tutor-chips .chip{min-height:40px;padding:8px 14px;border:1px solid var(--stroke);border-radius:999px;background:var(--surface);color:var(--txt);font-weight:600;font-size:13px;cursor:pointer}
.tutor-chips .chip:hover{border-color:var(--lilac);color:var(--primary)}
.tutor-form{display:grid;gap:10px;margin-top:8px}
.tutor-form textarea,.tutor-form input{width:100%;box-sizing:border-box;border:1px solid var(--stroke);border-radius:14px;padding:12px 14px;font:inherit;font-size:15px;background:var(--bg);color:var(--txt);resize:vertical}
.tutor-form textarea:focus,.tutor-form input:focus{outline:none;border-color:var(--primary);box-shadow:0 0 0 3px var(--primary-light)}
.tutor-actions{display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.tutor-status{min-height:20px;margin:10px 0 0;font-size:13px;color:var(--muted)}
.tutor-note{margin:12px 0 0;font-size:12px;line-height:1.6;color:var(--muted)}
.tutor-note a{color:var(--primary)}
.tutor-score{display:grid;grid-template-columns:auto 1fr;gap:18px;align-items:center;margin-top:18px;padding:16px;border-radius:18px;background:var(--muted-bg)}
.score-ring{width:96px;height:96px;border-radius:50%;display:grid;place-content:center;text-align:center;background:radial-gradient(closest-side,var(--surface) 78%,transparent 80%),conic-gradient(var(--jade) calc(var(--score)*1%),var(--stroke) 0)}
.score-ring strong{font-size:28px;line-height:1}.score-ring span{font-size:11px;color:var(--muted)}
.tutor-corrected{margin:0 0 4px;font-size:22px;font-weight:700}
.tutor-errors{list-style:none;margin:12px 0 0;padding:0;display:grid;gap:8px}
.tutor-errors li{display:grid;gap:2px;padding:10px 14px;border-left:3px solid var(--blossom);border-radius:10px;background:var(--surface);font-size:14px}
.tutor-perfect{margin:12px 0 0;color:var(--teal);font-weight:700}
@media(max-width:640px){
  .tutor-head{grid-template-columns:auto 1fr}.tutor-head img{width:56px;height:56px}.tutor-quota{grid-column:1/-1;justify-self:start}
  #tutor-body{padding:14px}.tutor-msg{max-width:92%}.tutor-score{grid-template-columns:1fr;justify-items:start}
}

/* ---------- Library levels and stages ---------- */
.hsk-levels,.level-jump{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 14px}
.level-jump{align-items:center;padding:12px 14px;border:1px solid var(--stroke);border-radius:16px;background:var(--grad-soft);margin-bottom:18px}
.level-jump span{font-weight:700;font-size:13px;margin-right:4px}
.level-chip{min-height:44px;padding:8px 16px;border:1px solid var(--stroke);border-radius:999px;background:var(--surface);color:var(--txt);font-weight:700;font-size:14px;cursor:pointer;transition:border-color .2s,background .2s,color .2s}
.level-chip:hover{border-color:var(--lilac);color:var(--primary)}
.level-chip[aria-pressed="true"]{background:var(--brand-strong);border-color:var(--brand-strong);color:#fff}
.syllabus-search{max-width:560px}
.stage-intro{color:var(--muted);margin:4px 0 12px}
.stage-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(190px,1fr));gap:12px}
.stage-tile{display:grid;gap:6px;text-align:left;padding:14px 16px;border:1px solid var(--stroke);border-radius:18px;background:var(--surface);color:var(--txt);cursor:pointer;transition:transform .2s var(--ease-out),border-color .2s,box-shadow .2s}
.stage-tile:hover{transform:translateY(-2px);border-color:var(--lilac);box-shadow:var(--shadow-lift)}
.stage-tile.is-done{border-color:var(--jade);background:var(--teal-light)}
.stage-name{font-weight:800;font-size:16px}
.stage-range{font-size:12px;color:var(--muted)}
.stage-words{font-size:16px;color:var(--primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.stage-meter{height:6px;border-radius:999px;background:var(--muted-bg);overflow:hidden}
.stage-meter span{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,var(--jade),#46c6ae)}
.stage-foot{font-size:12px;color:var(--muted)}.stage-foot strong{color:#c2410c}
[data-theme="dark"] .stage-foot strong{color:#fdba74}
.stage-bar{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:4px 0 14px}
.stage-bar strong{font-size:17px}
.hs-full-level{margin:10px 0 14px}
/* ---------- One "listen" control everywhere ---------- */
.btn-listen{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:44px;padding:10px 18px;border:1px solid #9fdccf;border-radius:999px;background:var(--teal-light);color:#11665a;font-weight:700;cursor:pointer}
.btn-listen:hover{background:#cdeee6;border-color:var(--jade)}
[data-theme="dark"] .btn-listen{color:#8ef0dc;border-color:#2f6b62}
[data-theme="dark"] .btn-listen:hover{background:#244a49}
.ico-listen{width:20px;height:20px;flex:none;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5Zm4 4a5 5 0 0 1 0 6m3-9a9 9 0 0 1 0 12'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M11 5 6 9H3v6h3l5 4V5Zm4 4a5 5 0 0 1 0 6m3-9a9 9 0 0 1 0 12'/%3E%3C/svg%3E") center/contain no-repeat}
.syllabus-table .btn-listen{padding:8px 14px}
.mini-icon.mini-listen{color:#11665a;background:var(--teal-light)}
[data-theme="dark"] .mini-icon.mini-listen{color:#8ef0dc}
@media(max-width:640px){
  .hsk-levels{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px;scrollbar-width:thin}
  .hsk-levels .level-chip{flex:none}
  #syllabus-panel .cloud-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}
  #syllabus-panel .cloud-actions .btn{width:auto;margin:0;padding:10px 12px}
  .stage-grid{grid-template-columns:1fr 1fr;gap:10px}.stage-tile{padding:12px}
}

/* ---------- Voice practice (Gemini Live) ---------- */
.ico-mic{width:20px;height:20px;flex:none;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E") center/contain no-repeat}
.voice-modes{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:14px}
.voice-context{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px;margin-bottom:14px;padding:10px 14px;border-radius:14px;background:var(--primary-light);font-size:14px}
.voice-stage{display:grid;justify-items:center;gap:10px;padding:18px 0 8px;text-align:center}
.voice-mic{display:inline-flex;align-items:center;gap:10px;min-height:64px;padding:14px 30px;border:0;border-radius:999px;background:var(--brand-strong);color:#fff;font-weight:800;font-size:17px;cursor:pointer;box-shadow:0 10px 24px rgba(85,67,215,.3);transition:transform .2s var(--ease-spring),background .2s}
.voice-mic .ico-mic{width:24px;height:24px}
.voice-mic:hover{transform:translateY(-1px)}.voice-mic:disabled{opacity:.7;cursor:progress}
.voice-mic.is-live{background:#d6336c;box-shadow:0 0 0 0 rgba(214,51,108,.5)}
@media(prefers-reduced-motion:no-preference){.voice-mic.is-live{animation:voice-pulse 1.6s ease-out infinite}}
@keyframes voice-pulse{0%{box-shadow:0 0 0 0 rgba(214,51,108,.45)}100%{box-shadow:0 0 0 18px rgba(214,51,108,0)}}
.voice-note{margin:0;max-width:60ch;font-size:13px;color:var(--muted)}
.voice-log{display:grid;gap:8px;min-height:180px;max-height:min(46vh,460px);overflow-y:auto;margin-top:12px;padding:12px;border-radius:16px;background:var(--bg)}
.voice-line{margin:0;padding:8px 12px;border-radius:14px;max-width:88%;line-height:1.6;font-size:15px;overflow-wrap:anywhere}
.voice-line span{display:block;font-size:11px;font-weight:700;color:var(--muted)}
.voice-line.you{justify-self:end;background:var(--primary-light)}
.voice-line.tutor{justify-self:start;background:var(--surface);border:1px solid var(--stroke)}
.voice-line.interim{opacity:.6}
.voice-empty{margin:0;color:var(--muted);font-size:14px}
.vl-ai-link{font-weight:800}
@media(max-width:640px){.voice-modes{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}.voice-modes .level-chip{flex:none}.voice-mic{width:100%;justify-content:center}}
.tutor-tabs{grid-template-columns:repeat(3,1fr);max-width:440px}

/* ---------- Flashcard deck picker ---------- */
.deck-picker{display:grid;gap:8px;margin:0 0 18px}
.deck-picker>span{font-size:13px;font-weight:700;color:var(--muted)}
.deck-chips{display:flex;flex-wrap:wrap;gap:8px}
#page-study.deck-hsk>:not(.page-heading):not(.deck-picker):not(#study-syllabus-slot){display:none!important}
#study-syllabus-slot .hsk-hero{display:none}
#study-syllabus-slot #syllabus-panel{margin-top:0}
.review-hsk{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px;margin:0 0 20px;padding:16px 20px;border:1px solid var(--stroke);border-radius:20px;background:var(--grad-soft)}
.review-hsk p{margin:4px 0 0;color:var(--muted);font-size:13px}
@media(max-width:640px){.deck-chips{flex-wrap:nowrap;overflow-x:auto;padding-bottom:4px}.deck-chips .level-chip{flex:none}}
/* Stroke order dialog (src/strokes.js) */
.stroke-dialog{padding:0;border:1px solid var(--stroke);border-radius:20px;background:var(--surface);color:var(--txt);width:min(420px,calc(100vw - 32px));box-shadow:var(--shadow)}
.stroke-dialog::backdrop{background:rgba(18,16,42,.45)}
.stroke-body{padding:20px;display:grid;gap:12px}
.stroke-head{display:flex;align-items:center;justify-content:space-between;gap:12px}
.stroke-head h2{margin:0;font-size:20px}
.stroke-stage{justify-self:center;border:1px dashed var(--stroke);border-radius:16px;background:var(--paper,var(--surface));touch-action:none;min-width:180px;min-height:180px;display:grid;place-items:center}
.stroke-stage svg{display:block}
.stroke-status{margin:0;min-height:1.5em;font-weight:600}
.stroke-note{margin:0;font-size:13px;color:var(--muted)}
.stroke-dialog [aria-pressed="true"].btn{background:var(--primary-light);border-color:var(--primary);color:var(--primary-strong)}
.stroke-dialog [hidden]{display:none!important}
/* Tatoeba example sentences on library cards (src/syllabus.js) */
.syllabus-examples{margin-top:12px;text-align:left}
.syllabus-examples h4{margin:0 0 6px}
.syllabus-examples ul{list-style:none;margin:0;padding:0;display:grid;gap:10px}
.syllabus-examples li{border:1px solid var(--stroke);border-radius:14px;padding:10px 12px}
.syllabus-examples li p{margin:2px 0}
.example-zh{font-size:20px;display:flex;align-items:center;gap:8px;flex-wrap:wrap}
/* Flashcard study uses the existing brand tokens; library routes retain their navigation. */
.study-deck-select{display:flex;gap:14px;align-items:center}
.study-deck-select img{flex:none;object-fit:contain}
.study-deck-select label{display:grid;gap:6px;flex:1;max-width:510px;font-size:13px;font-weight:700}
.study-deck-select select{width:100%;min-height:48px;font-size:16px}
#study-deck-note{margin:0 0 0 58px;max-width:65ch;color:var(--muted);font-size:13px;line-height:1.6}
#page-study .page-heading{margin-bottom:20px}
.study-workspace .flashcard{height:330px;min-height:300px}
.study-workspace .flip-stage{margin-top:10px}
.study-workspace .card-hint,.study-workspace .card-head,.study-workspace .study-info,.study-workspace .nav-arrows span{color:var(--muted)}
.study-workspace .example-label,.study-workspace .example-py,.study-workspace .example-vi{color:var(--muted);font-size:13px}
.study-workspace .card-face[aria-hidden="true"]{visibility:hidden}
.study-workspace .nav-arrows{margin-top:12px}
.study-workspace .nav-arrow{min-width:44px;min-height:44px}
.study-workspace .field-select label{display:block;font-size:13px}
.study-workspace .field-select{align-items:start;flex-direction:column;gap:6px}
.study-workspace .icon-btn{min-width:44px;min-height:44px}
.study-primary{display:none}
#study-syllabus-slot .study-primary{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:16px}
#study-syllabus-slot .hsk-levels{display:none}
#study-syllabus-slot .syllabus-search,#study-syllabus-slot #syllabus-content>.cloud-actions{display:none}
#study-syllabus-slot .show-study-tools .syllabus-search{display:grid}
#study-syllabus-slot .show-study-tools #syllabus-content>.cloud-actions{display:flex}
.syllabus-source-details{margin-top:20px;color:var(--muted);font-size:13px;line-height:1.7}
.syllabus-source-details summary{cursor:pointer;min-height:44px;display:flex;align-items:center;font-weight:700;text-decoration:underline}
.study-workspace{container-type:inline-size;width:100%;min-width:0}
.original-study{width:100%;min-width:0;margin:0}
.study-workspace .card-center{justify-content:safe center}
.study-workspace .card-head{text-transform:uppercase}
.study-workspace .card-head abbr{text-decoration:none}
.study-workspace select[id$="study-chapter"]{width:190px}
.study-workspace .card-hanzi,.study-workspace .card-back-hanzi{margin:0}
.study-workspace .card-meaning p{margin:0;font:inherit;line-height:inherit}
.study-workspace .card-meaning>p.panel-sub{color:inherit}
.study-workspace .rating[hidden]{display:none!important}
.study-workspace .rate-btn{min-height:48px}
.study-workspace .card-hint[role="button"]{min-height:44px}
.study-workspace .flashcard{scroll-margin-block:210px 110px}
.study-card-skeleton{min-height:330px;display:grid;place-items:center;margin:16px 0;background:var(--paper);border:1px solid var(--stroke);border-radius:25px;color:var(--muted)}
.classic-study{--rating-red-text:#a52e43;--rating-orange-text:#9b4a12;--rating-teal-text:#126f60}
[data-theme="dark"] .classic-study{--rating-red-text:var(--red);--rating-orange-text:var(--orange);--rating-teal-text:var(--teal)}
.classic-study .rate-btn.again{color:var(--rating-red-text)}
.classic-study .rate-btn.hard{color:var(--rating-orange-text)}
.classic-study .rate-btn.good{color:var(--primary-strong)}
.classic-study .rate-btn.easy{color:var(--rating-teal-text)}
.classic-study .status-pip.learning{color:var(--rating-orange-text)}
.classic-study .status-pip.mastered{color:var(--rating-teal-text)}
.has-study-card #syllabus-panel{background:transparent;border:0;box-shadow:none;padding:0}
@container(max-width:760px){.study-layout{grid-template-columns:1fr}.study-aside{display:none}}
#syllabus-results .cloud-form:has([data-syl="quiz-answer"]){display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}
#syllabus-results [data-syl="quiz-answer"]{justify-content:center;min-height:48px}
@media(max-width:767px){
 .study-workspace .study-layout{grid-template-columns:1fr}
 .study-workspace .study-aside{display:none}
 .study-workspace .flashcard{height:300px;min-height:280px}
 .study-workspace .rating{display:grid;grid-template-columns:1fr 1fr}
 .study-workspace .rate-btn{min-height:48px}
 #study-deck-note{margin-left:0}
 #study-syllabus-slot #syllabus-panel{padding:16px}
}
@media(prefers-reduced-motion:reduce){.study-workspace .flashcard-inner{transition:none}#page-study .thin-progress div{transition:none}}
.report-dialog{width:min(520px,calc(100vw - 32px));max-height:calc(100dvh - 32px);overflow:auto;padding:24px;border:1px solid var(--stroke);border-radius:20px;background:var(--surface);color:var(--txt)}
.report-dialog::backdrop{background:rgba(18,16,42,.5)}
.report-dialog h2{margin:0;font-size:22px}
.report-dialog textarea,.vocab-report-item textarea{box-sizing:border-box;width:100%;min-height:80px;background:var(--paper);color:var(--txt);border:1px solid var(--stroke);border-radius:12px;padding:12px;font:inherit}
.vocab-report-item{padding:16px 0;border-bottom:1px solid var(--stroke);display:grid;gap:12px}
.vocab-report-item label{display:grid;gap:8px}
.report-question{margin-top:20px;color:var(--muted)}
#syllabus-container [hidden]{display:none!important}
.example-recording{margin-top:12px;padding-top:12px;border-top:1px solid var(--stroke)}
.example-recording audio{width:100%;max-width:420px;min-height:44px}
#page-study .deck-picker{position:sticky;top:88px;z-index:3;background:var(--bg);padding:10px 0}
#study-syllabus-slot #syllabus-panel{background:transparent;border:0;box-shadow:none;padding:0!important}
#page-study :is(button,select,[tabindex]){scroll-margin-block:220px 110px}
@media(max-width:767px){#page-study .deck-picker{top:70px}.study-deck-select{gap:10px}.study-deck-select label{font-size:12px}#study-deck-note{font-size:12px}}
.syllabus-study-card{scroll-margin-block:210px 100px}
@media(max-width:767px){
 .study-workspace .study-tools{display:grid;grid-template-columns:minmax(0,1fr)}
 .study-workspace .tool-left{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));min-width:0}
 .study-workspace .field-select{min-width:0;width:100%}
 .study-workspace .field-select select{width:100%;max-width:100%;min-height:44px}
 .study-workspace .tool-right{justify-content:flex-end}
 #page-study .page-heading{margin-bottom:8px}
 #page-study .page-heading h2{font-size:18px;margin-bottom:8px}
}

@media(prefers-reduced-motion:reduce){.study-workspace .flashcard-inner{transition:none}.study-workspace .thin-progress div{transition:none}}
