/* Text-only MIHO dialogue. The animated robot keeps its existing rig. */
.student-companion.is-open{z-index:1100}
.student-companion.is-open .student-companion-card{position:fixed;z-index:20;inset:auto 24px 24px auto;width:min(440px,calc(100vw - 32px));max-height:calc(100dvh - 100px);display:flex;flex-direction:column;animation:mihoCardIn .18s ease both}
.miho-card-head{flex-shrink:0;padding:16px}
.miho-card-head b{font-size:16px}
.miho-card-head small{font-size:11px;line-height:1.5}
.miho-card-head .student-companion-close{margin-left:auto;flex-shrink:0}
.student-companion-card .miho-context{flex-shrink:0;margin:10px 14px 0;padding:8px 10px}
.student-companion-card .miho-context strong{font-size:10px}
.student-companion-card .miho-context span{font-size:11px}
.student-companion-card .miho-thread{height:320px;min-height:120px;flex:1 1 auto;overscroll-behavior:contain}
.student-companion-card .miho-message{max-width:94%;gap:5px}
.student-companion-card .miho-message span{font-size:10px}
.student-companion-card .miho-message p{font-size:14px;line-height:1.65;overflow-wrap:anywhere}
.miho-message>small{color:#8aa4ba;font-size:10px}
.student-companion-card .miho-composer{grid-template-columns:minmax(0,1fr) 42px;flex-shrink:0;align-items:end;padding:10px;margin:0 12px}
.miho-text-field{display:grid;min-width:0;gap:5px}
.miho-text-field>span{font-size:10px;color:#8aa4ba}
.miho-composer textarea{box-sizing:border-box;width:100%;min-width:0;min-height:48px;max-height:120px;resize:vertical;padding:0;border:0;outline:none;background:transparent;color:#f0f8ff;font:500 14px/1.5 Manrope,system-ui,sans-serif}
.miho-composer textarea::placeholder{color:#8aa4ba}
.miho-send:disabled{cursor:wait;opacity:.45}
.miho-stop{grid-column:1/-1;justify-self:end;padding:6px 10px;border:1px solid #385675;border-radius:8px;background:transparent;color:#d8e9fb;font:inherit;font-size:12px;cursor:pointer}
.miho-stop[hidden]{display:none}
.miho-chat-footer{padding:10px 15px;color:#8aa4ba;font-size:10px;flex-shrink:0}
.miho-chat-error{padding:12px;border:1px solid #97445c;border-radius:12px;background:#381c2c;color:#ffd2df;font-size:13px;line-height:1.5}
.miho-chat-error p{margin:0 0 8px}
.miho-chat-error button{padding:6px 10px;border:1px solid #ad7cdd;border-radius:8px;background:#42235c;color:#fff;font:inherit;cursor:pointer}
html[data-theme="light"] .miho-composer textarea{color:#183047}
html[data-theme="light"] .miho-chat-error{background:#fff0f3;color:#7d1836}
html[data-theme="light"] .miho-stop{color:#263d56}
@media(max-width:700px){.student-companion.is-open .student-companion-card{inset:auto 12px 12px 12px;width:auto;max-height:calc(100dvh - 88px)}.student-companion-card .miho-thread{height:280px}.miho-composer textarea{font-size:16px}.miho-chat-footer{font-size:9px}}

/* Keep the explaining robot visible beside the conversation. */
.student-companion.is-open .student-companion-card{right:286px}
.student-companion.is-open .student-companion-robot{position:fixed;right:10px;bottom:8px;cursor:pointer}
.miho-sound-toggle{margin-left:auto;width:32px;height:32px;flex-shrink:0;border:1px solid #29455e;border-radius:10px;background:#122c43;color:#bceaff;cursor:pointer}
.miho-card-head .miho-sound-toggle+.student-companion-close{margin-left:0}
.miho-sound-toggle[aria-pressed="false"]{opacity:.65}
.miho-replay{justify-self:start;padding:3px 8px;border:1px solid #294d6b;border-radius:8px;background:transparent;color:#8ecff4;font:inherit;font-size:11px;cursor:pointer}
.miho-replay:disabled{opacity:.4;cursor:default}
.miho-chat-footer{display:flex;flex-wrap:wrap;align-items:center;gap:7px}
.miho-chat-footer button{border:1px solid #6157b3;border-radius:9px;background:#302661;color:#fff;padding:7px 10px;font:inherit;cursor:pointer}
.miho-chat-footer button[hidden]{display:none}
.student-companion[data-voice="speaking"] .miho-rig-mouth{transform:scaleY(calc(.2 + var(--miho-mouth-open,0)*1.6))}
.student-companion[data-voice="speaking"] .miho-piece-arm-left{animation:mihoExplainLeft 1.6s ease-in-out infinite alternate}
.student-companion[data-voice="speaking"] .miho-piece-arm-right{animation:mihoExplainRight 1.9s ease-in-out infinite alternate}
@keyframes mihoExplainLeft{from{transform:rotate(-18deg)}to{transform:rotate(-40deg)}}
@keyframes mihoExplainRight{from{transform:rotate(25deg)}to{transform:rotate(47deg)}}
@media(max-width:700px){
  .student-companion.is-open .student-companion-card{inset:auto 12px 12px 12px;height:calc(100dvh - 240px);max-height:calc(100dvh - 240px)}
  .student-companion.is-open .student-companion-robot{inset:68px 10px auto auto;width:138px;height:155px}
  .student-companion-card .miho-thread{height:220px;min-height:75px}
  .student-companion-card .miho-context{display:none}
}
@media(max-width:700px) and (max-height:650px){.student-companion.is-open .student-companion-card{height:calc(100dvh - 175px);max-height:calc(100dvh - 175px)}.student-companion.is-open .student-companion-robot{width:90px;height:98px;top:65px}.student-companion-card .miho-thread{min-height:35px}}
