#kstudent-chat {
    --ksc-wine: #421622;
    --ksc-gold: #edc062;
    --ksc-cream: #fcf8f0;
    position: fixed;
    bottom: max(22px, env(safe-area-inset-bottom));
    left: 22px;
    z-index: 9998;
    font: 15px/1.5 Helvetica, Arial, sans-serif;
    color: #302026;
}
#kstudent-chat *, #kstudent-chat *::before { box-sizing: border-box; }
#kstudent-chat [hidden] { display: none !important; }
#kstudent-chat button { cursor: pointer; font: inherit; border: 0; }
#kstudent-chat button:focus-visible, #kstudent-chat input:focus-visible, #kstudent-chat a:focus-visible {
    outline: 3px solid #a76317;
    outline-offset: 3px;
}
#kstudent-chat .ksc-launch {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    padding: 0;
    border: 2px solid var(--ksc-gold);
    border-radius: 50%;
    color: var(--ksc-gold);
    background: var(--ksc-wine);
    box-shadow: 0 6px 24px #42162240;
}
#ksc-panel {
    position: absolute;
    bottom: 70px;
    left: 0;
    width: min(378px, calc(100vw - 36px));
    max-height: calc(100dvh - 110px);
    overflow: auto;
    border-radius: 18px;
    border: 1px solid #e7d4be;
    background: var(--ksc-cream);
    box-shadow: 0 15px 50px #2f101640;
}
#ksc-panel header, #ksc-panel header span { display: flex; align-items: center; gap: 10px; }
#ksc-panel header { justify-content: space-between; padding: 12px 16px; background: var(--ksc-wine); color: #fff; }
#ksc-panel header svg { color: var(--ksc-gold); }
#ksc-panel .ksc-close { width: 40px; height: 40px; padding: 0; color: #fff; background: transparent; font-size: 25px; }
#ksc-panel .ksc-intake, #ksc-panel .ksc-conversation { margin: 0; padding: 16px; }
#ksc-panel .ksc-intake p { margin: 0 0 12px; }
#ksc-panel .ksc-intake label { display: block; margin: 0 0 12px; font-weight: 600; }
#ksc-panel input { width: 100%; min-width: 0; padding: 9px 12px; color: #302026; background: white; border: 1px solid #b9a7a1; border-radius: 8px; font: inherit; }
#ksc-panel .ksc-intake input { display: block; margin-top: 4px; }
#ksc-panel .ksc-intake button, #ksc-panel .ksc-message button { border-radius: 8px; background: var(--ksc-wine); color: #fff; padding: 10px 14px; font-weight: 700; }
#ksc-panel small { display: block; margin-top: 10px; }
#ksc-panel .ksc-log { height: min(265px, 38vh); overflow: auto; display: flex; flex-direction: column; gap: 9px; overflow-wrap: anywhere; }
#ksc-panel .ksc-bubble { align-self: flex-start; max-width: 94%; margin: 0; padding: 9px 12px; background: #f2e6d7; border-radius: 11px; }
#ksc-panel .ksc-user { align-self: flex-end; background: var(--ksc-wine); color: white; }
#ksc-panel .ksc-bubble a { display: block; color: #662338; margin-top: 5px; text-decoration: underline; font-weight: 700; }
#ksc-panel .ksc-quick { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 0; }
#ksc-panel .ksc-quick button { border: 1px solid #af8b72; border-radius: 16px; background: white; color: var(--ksc-wine); padding: 4px 10px; font-size: 13px; }
#ksc-panel .ksc-message { display: flex; margin: 0; gap: 6px; }
#ksc-panel .ksc-message button { display: grid; place-items: center; min-width: 44px; padding: 0; }
@media (max-width: 480px) { #kstudent-chat { left: 14px; } }
