:root{--bg-outer:#eef0f4;--bg-app:#fff9ef;--ink:#2b2b3a;--ink-soft:#6b6b80;--accent:#ff8a3d;--accent-dark:#e86f1f;--blue:#5ab4ff;--kid-bubble:#d6efff;--jj-bubble:#ffe9c7;--danger:#e5484d}*{box-sizing:border-box}html,body,#root{height:100%;margin:0}body{background:var(--bg-outer);color:var(--ink);-webkit-text-size-adjust:100%;font-family:Nunito,Segoe UI,system-ui,-apple-system,sans-serif;overflow:hidden}button{font:inherit;cursor:pointer}.app-shell{justify-content:center;height:100dvh;display:flex}.phone{background:var(--bg-app);width:100%;max-width:430px;height:100dvh;padding-top:env(safe-area-inset-top);padding-bottom:env(safe-area-inset-bottom);flex-direction:column;margin:0 auto;display:flex;overflow:hidden;box-shadow:0 0 0 1px #0000000d,0 8px 32px #00000014}.login{text-align:center;flex-direction:column;flex:1;justify-content:center;align-items:center;gap:8px;padding:24px;display:flex}.login-mascot{font-size:72px}.login h1{margin:0;font-size:24px}.login-sub{color:var(--ink-soft);margin:0 0 12px;font-size:15px}.login form{text-align:left;flex-direction:column;gap:10px;width:100%;display:flex}.login label{font-size:15px;font-weight:700}.login input{background:#fff;border:2px solid #d9d9e3;border-radius:14px;min-height:48px;padding:0 14px;font-size:18px}.login button{background:var(--accent);color:#fff;border:0;border-radius:16px;min-height:52px;font-size:18px;font-weight:800}.login button:disabled{opacity:.5}.login-error{color:var(--danger);margin:0;font-size:15px}.home{flex-direction:column;flex:1;min-height:0;display:flex}.app-header{flex:none;align-items:center;gap:8px;padding:8px 12px;display:flex}.app-header h1{white-space:nowrap;text-overflow:ellipsis;flex:1;min-width:0;margin:0;font-size:20px;overflow:hidden}.logo{font-size:26px}.net{color:var(--ink-soft);align-items:center;gap:5px;font-size:13px;display:inline-flex}.net-dot{background:#3ecf8e;border-radius:50%;width:9px;height:9px}.net-off .net-dot{background:var(--danger)}.icon-btn{background:0 0;border:0;border-radius:50%;min-width:44px;min-height:44px;font-size:22px}.mascot{flex:none;justify-content:center;height:150px;transition:height .25s;display:flex;position:relative}.mascot svg{width:auto;height:100%;overflow:visible}.mascot-compact{height:72px}.mouth-open{display:none}.mascot-speaking .mouth-open,.mascot-happy .mouth-open{transform-origin:100px 148px;animation:.45s ease-in-out infinite alternate talk;display:block}.mascot-speaking .mouth-closed,.mascot-happy .mouth-closed{display:none}.mascot-idle .mascot-body{animation:3.2s ease-in-out infinite float}.mascot-happy .mascot-body{animation:.6s ease-in-out infinite alternate bounce}.mascot-listening .ear{transform-box:fill-box;transform-origin:bottom;animation:.8s ease-in-out infinite alternate perk}.mascot-thinking .eyes{transform:translateY(-6px)}.mascot-waves{pointer-events:none;display:none;position:absolute;inset:0}.mascot-listening .mascot-waves{border:3px solid #5ab4ff8c;border-radius:50%;width:130px;margin:12px auto;animation:1.2s ease-out infinite ripple;display:block}.mascot-dots{gap:4px;display:none;position:absolute;top:6px;right:calc(50% - 90px)}.mascot-thinking .mascot-dots{display:flex}.mascot-dots span{background:var(--blue);border-radius:50%;width:9px;height:9px;animation:1s infinite blink}.mascot-dots span:nth-child(2){animation-delay:.2s}.mascot-dots span:nth-child(3){animation-delay:.4s}@keyframes float{50%{transform:translateY(-5px)}}@keyframes bounce{to{transform:translateY(-8px)}}@keyframes talk{to{transform:scaleY(.35)}}@keyframes perk{to{transform:rotate(-6deg)}}@keyframes ripple{0%{opacity:.9;transform:scale(.8)}to{opacity:0;transform:scale(1.3)}}@keyframes blink{50%{opacity:.2}}.topics{flex:none;padding:4px 12px 8px}.chips{flex-wrap:wrap;gap:6px;display:flex}.chip{min-height:44px;color:var(--ink);background:#fff;border:2px solid #ffe0b5;border-radius:22px;align-items:center;gap:4px;padding:0 12px;font-size:14px;font-weight:700;display:inline-flex}.chip-active{background:var(--accent);border-color:var(--accent);color:#fff}.topic-current{align-items:center;gap:10px;display:flex}.link-btn{min-height:44px;color:var(--accent-dark);background:0 0;border:0;padding:0 8px;font-size:14px;font-weight:700;text-decoration:underline}.chat{overscroll-behavior:contain;flex-direction:column;flex:1;gap:10px;min-height:0;padding:8px 12px;display:flex;overflow:hidden auto}.bubble{overflow-wrap:anywhere;border-radius:20px;max-width:85%;padding:10px 14px}.bubble p{margin:0}.bubble-jj{background:var(--jj-bubble);border-bottom-left-radius:6px;align-self:flex-start}.bubble-kid{background:var(--kid-bubble);border-bottom-right-radius:6px;align-self:flex-end}.bubble-interim{opacity:.6}.bubble .en{font-size:19px;font-weight:700;line-height:1.3}.bubble .vi{color:var(--ink-soft);margin-top:4px;font-size:15px;line-height:1.35}.typing{gap:5px;padding:4px 2px;display:inline-flex}.typing i{background:#c9a46a;border-radius:50%;width:9px;height:9px;animation:1s infinite blink}.typing i:nth-child(2){animation-delay:.2s}.typing i:nth-child(3){animation-delay:.4s}.controls{background:#fff;border-top:1px solid #f0e6d6;flex-direction:column;flex:none;align-items:center;gap:2px;padding:8px 12px 6px;display:flex}.status{text-align:center;min-height:24px;margin:0;font-size:16px;font-weight:700}.control-row{justify-content:space-between;align-items:center;width:100%;max-width:320px;padding:4px 0;display:flex}.mic{background:var(--accent);color:#fff;width:84px;height:84px;box-shadow:0 6px 0 var(--accent-dark);border:0;border-radius:50%;font-size:38px;transition:transform .1s}.mic:active{box-shadow:0 3px 0 var(--accent-dark);transform:translateY(3px)}.mic-on{background:var(--danger);animation:1.1s ease-in-out infinite pulse;box-shadow:0 6px #b8353a}.mic-busy{background:#c9c9d6;box-shadow:0 6px #a5a5b5}.side-btn{width:60px;min-height:52px;color:var(--ink);background:#f4efe6;border:0;border-radius:16px;flex-direction:column;justify-content:center;align-items:center;font-size:22px;display:flex}.side-btn small{font-size:12px;font-weight:700}.side-btn:disabled{opacity:.4}.new-chat{min-height:44px}@keyframes pulse{50%{transform:scale(1.06)}}@media (prefers-reduced-motion:reduce){*,:before,:after{transition:none!important;animation:none!important}}.parent{flex-direction:column;flex:1;gap:8px;min-height:0;padding:16px;display:flex;overflow-y:auto}.parent h1{margin:0 0 4px;font-size:22px}.parent h2{margin:12px 0 4px;font-size:18px}.parent .hint{color:var(--ink-soft);margin:0 0 8px;font-size:15px}.parent section{flex-direction:column;align-items:flex-start;display:flex}.p-btn{background:#fff;border:2px solid #ffe0b5;border-radius:14px;min-height:48px;padding:0 18px;font-size:16px;font-weight:700}.p-primary{background:var(--accent);border-color:var(--accent);color:#fff}.p-btn:disabled{opacity:.6}.result{overflow-wrap:anywhere;background:#f4efe6;border-radius:12px;margin:8px 0 0;padding:10px 12px;font-size:15px}.result p{margin:0 0 4px}.result.ok{background:#e3f7ec}.result.bad{background:#fdeaea}.radios{flex-direction:column;gap:4px;display:flex}.radios label{align-items:center;gap:10px;min-height:44px;font-size:16px;display:flex}.radios input{width:22px;height:22px}.parent-actions{flex-wrap:wrap;gap:10px;margin-top:16px;display:flex}.switch-row{align-items:center;gap:10px;min-height:44px;font-size:16px;font-weight:700;display:flex}.switch-row input{width:24px;height:24px}
