/* assets/skills-ai.css — "Ask the AI tutor" chat under the feedback on /reading_skills and /listening_skills
   (9 Nov 2026, note 20). Uses the page kit tokens (assets/pages-ui.css), so day and night switch by themselves.
   Light on weak phones: no blur, motion only on transform/opacity, none with "reduce motion" or lite mode. */
.skai { margin-top: 4px; }
.skai-open { display: inline-flex; align-items: center; gap: 9px; width: 100%; justify-content: center; padding: 11px 14px; border-radius: 12px;
  border: 0; background: var(--r); color: #fff; font: inherit; font-size: 15px; cursor: pointer; box-shadow: 0 4px 14px -6px var(--r);
  transition: transform .15s; }
.skai-open b { font-weight: 800; }
.skai-open .bot { font-size: 20px; line-height: 1; animation: skaiBob 2.4s ease-in-out infinite; }
.skai-open:active { transform: scale(.98); }
.skai-open.soft { width: auto; background: var(--card); color: var(--r-ink); border: 1px solid var(--r); box-shadow: none; padding: 8px 12px; font-size: 14px; }
.skai-open.soft .bot { font-size: 17px; animation: none; }

.skai-pan { background: var(--card); color: var(--ink); border: 1px solid var(--r); border-radius: 14px; padding: 12px; display: flex; flex-direction: column; gap: 10px;
  animation: skaiIn .25s ease-out both; }
.skai-hi { margin: 0; font-size: 14.5px; }
.skai-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.skai-top { display: flex; align-items: center; gap: 10px; }
.skai-top .bot { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--r-soft); font-size: 20px; }
.skai-top div { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.25; }
.skai-top b { font-size: 15px; font-weight: 800; color: var(--r-ink); }
.skai-top small { color: var(--mute); font-size: 12.5px; }
.skai-x { flex: none; width: 32px; height: 32px; border-radius: 50%; border: 0; background: var(--sub); color: var(--mute); font-size: 20px; line-height: 1; cursor: pointer; }

.skai-log { display: flex; flex-direction: column; gap: 8px; }
.skai-log:empty { display: none; }
.skai-msg { max-width: 92%; padding: 9px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; animation: skaiIn .2s ease-out both; overflow-wrap: anywhere; }
.skai-msg p { margin: 0 0 6px; } .skai-msg p:last-child { margin-bottom: 0; }
.skai-msg ul { margin: 2px 0 6px; padding-left: 18px; } .skai-msg ul:last-child { margin-bottom: 0; }
.skai-msg li { margin: 2px 0; }
.skai-msg b { font-weight: 800; }
.skai-msg.me { align-self: flex-end; background: var(--r); color: #fff; border-bottom-right-radius: 4px; }
.skai-msg.ai { align-self: flex-start; background: var(--r-soft); color: var(--ink); border-bottom-left-radius: 4px; }
.skai-msg.ai b { color: var(--r-ink); }
.skai-msg.err { background: var(--bad-soft); color: var(--bad); }
.skai-dots { display: inline-flex; gap: 4px; padding: 4px 2px; }
.skai-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--r); opacity: .35; animation: skaiDot 1s infinite ease-in-out; }
.skai-dots i:nth-child(2) { animation-delay: .15s; } .skai-dots i:nth-child(3) { animation-delay: .3s; }

.skai-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.skai-chips button { border: 1px solid var(--line); background: var(--sub); color: var(--ink); border-radius: 999px; padding: 6px 11px; font: inherit; font-size: 13px; cursor: pointer; }
.skai-chips button:hover { border-color: var(--r); }
.skai-chips button:disabled, .skai-send:disabled { opacity: .5; cursor: default; }
.skai-form { display: flex; gap: 8px; align-items: flex-end; margin: 0; }
.skai-form textarea { flex: 1; min-width: 0; resize: none; min-height: 42px; max-height: 120px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--card); color: var(--ink); font: inherit; font-size: 16px; line-height: 1.35; }   /* 16px: phones do not zoom in */
.skai-form textarea:focus { outline: 2px solid var(--r); outline-offset: 0; border-color: var(--r); }
.skai-send { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--r); color: #fff; font-size: 17px; cursor: pointer; }
.skai-left { margin: 0; color: var(--mute); font-size: 12.5px; }

@keyframes skaiIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes skaiDot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@keyframes skaiBob { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(-2px) rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .skai-pan, .skai-msg, .skai-open .bot, .skai-dots i { animation: none; } .skai-dots i { opacity: .7; } }
html.lk-lite .skai-pan, html.lk-lite .skai-msg, html.lk-lite .skai-open .bot { animation: none; }
