/* ilmCode AI chat widget: student panel + public site (moved out of student.css 2026-11-10). */
.ai-fab { position: fixed; right: 20px; bottom: 20px; z-index: 50; display: flex; align-items: center; gap: 8px; border: 0; border-radius: 999px; padding: 8px 18px 8px 8px; background: var(--ink); color: #fff; font: inherit; font-weight: 700; cursor: pointer; box-shadow: 0 10px 30px rgba(15, 23, 42, .3); }
.ai-fab img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 3px; }
.ai-box { position: fixed; right: 20px; bottom: 86px; z-index: 51; width: min(400px, calc(100vw - 24px)); height: min(600px, calc(100vh - 120px)); background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 24px 60px rgba(15, 23, 42, .25); display: flex; flex-direction: column; overflow: hidden; }
.ai-box[hidden] { display: none; }
.ai-box header { display: flex; align-items: center; gap: 10px; padding: 12px 12px 12px 14px; background: var(--grad); color: #fff; }
.ai-box header img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 3px; }
.ai-box header div { flex: 1; line-height: 1.25; }
.ai-box header small { display: block; opacity: .85; font-size: .78rem; }
.ai-x { background: rgba(255, 255, 255, .18); border: 0; color: #fff; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; cursor: pointer; }
.ai-x svg { width: 16px; height: 16px; }
.ai-log { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: #f8f7fd; }
.ai-msg { max-width: 88%; padding: 10px 13px; border-radius: 14px; font-size: .93rem; line-height: 1.6; word-wrap: break-word; }
.ai-msg.bot { background: #fff; border: 1px solid var(--line); border-top-left-radius: 4px; align-self: flex-start; }
.ai-msg.me { background: #7c3aed; color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.ai-msg p { margin: 0 0 .5em; } .ai-msg p:last-child { margin: 0; }
.ai-msg ul, .ai-msg ol { margin: 0 0 .5em; padding-left: 1.2em; }
.ai-msg h1, .ai-msg h2, .ai-msg h3 { font-size: 1rem; margin: .4em 0; }
.ai-msg code { background: #f1f0fb; padding: 0 4px; border-radius: 4px; }
.ai-msg.typing i { display: inline-block; width: 7px; height: 7px; margin: 0 2px; border-radius: 50%; background: #b8b0dc; animation: aiDot 1s infinite; }
.ai-msg.typing i:nth-child(2) { animation-delay: .15s; } .ai-msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes aiDot { 0%, 80%, 100% { opacity: .3; } 40% { opacity: 1; } }
.ai-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ai-chips button { border: 1px solid #d9d2f7; background: #fff; color: var(--violet); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .85rem; cursor: pointer; }
.ai-form { display: flex; gap: 8px; padding: 10px; border-top: 1px solid var(--line); background: #fff; }
.ai-form textarea { flex: 1; resize: none; border: 1px solid #d5d9e6; border-radius: 12px; padding: 10px 12px; font: inherit; max-height: 120px; }
.ai-form .btn { min-height: 44px; }
@media (max-width: 900px) {
  .ai-fab { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); right: 12px; padding: 6px 14px 6px 6px; }
  .ai-box { right: 12px; left: 12px; width: auto; bottom: calc(140px + env(safe-area-inset-bottom, 0px)); height: min(560px, calc(100vh - 200px)); }
}
@media (prefers-reduced-motion: reduce) { .ai-msg.typing i { animation: none; } }
/* public site: sits above the mobile "ভর্তি হন" bar */
@media (max-width: 760px) {
  body:not(.student) .ai-fab { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); right: 12px; padding: 6px 14px 6px 6px; }
  body:not(.student) .ai-box { right: 12px; left: 12px; width: auto; bottom: calc(144px + env(safe-area-inset-bottom, 0px)); height: min(540px, calc(100vh - 190px)); }
}
