.chatbot-launcher {
    position: fixed;
    right: 24px;
    bottom: 88px;
    z-index: 1400;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 999px;
    padding: 0;
    overflow: hidden;
    background: #123786;
    color: #fff;
    box-shadow: 0 12px 28px rgba(255, 112, 67, 0.3);
    cursor: pointer;
}

.chatbot-launcher-logo {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.06);
}

.chatbot-launcher.is-hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(12px);
}

.chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 158px;
    z-index: 1400;
    width: min(420px, calc(100vw - 32px));
    height: 620px;
    display: none;
    flex-direction: column;
    background: #fffaf5;
    border: 1px solid rgba(255, 160, 127, 0.28);
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(59, 41, 33, 0.18);
}

.chatbot-panel.is-open {
    display: flex;
}

.chatbot-header {
    padding: 18px 18px 14px;
    background: linear-gradient(180deg, #fff1e5 0%, #fff9f3 100%);
    border-bottom: 1px solid rgba(255, 160, 127, 0.22);
}

.chatbot-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.chatbot-identity {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
}

.chatbot-avatar {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    object-fit: cover;
    border-radius: 50%;
    background: #123786;
    border: 2px solid rgba(18, 55, 134, 0.15);
    box-shadow: 0 6px 14px rgba(18, 55, 134, 0.14);
}

.chatbot-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chatbot-title {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    color: #2f2a26;
}

.chatbot-subtitle {
    margin: 4px 0 0;
    font-size: 12px;
    color: #78665d;
}

.chatbot-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #7e5b4c;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.chatbot-minimize {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: #7e5b4c;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.chatbot-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background:
        radial-gradient(circle at top left, rgba(255, 214, 188, 0.18), transparent 32%),
        linear-gradient(180deg, #fffdfb 0%, #fff9f4 100%);
}

.chatbot-message {
    position: relative;
    margin-bottom: 12px;
    max-width: 92%;
    padding: 12px 14px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    box-shadow: 0 8px 18px rgba(75, 50, 44, 0.06);
}

.chatbot-message.has-copy {
    padding-right: 44px;
}

.chatbot-message.has-speech {
    padding-right: 76px;
}

.chatbot-copy,
.chatbot-speak {
    position: absolute;
    top: 6px;
    right: 7px;
    width: 28px;
    height: 28px;
    padding: 5px;
    border: 0;
    border-radius: 8px;
    background: rgba(70, 56, 51, 0.08);
    color: #705f59;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
    z-index: 2;
}

.chatbot-speak {
    right: 39px;
}

.chatbot-copy svg,
.chatbot-speak svg {
    display: block;
    width: 100%;
    height: 100%;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
}

.chatbot-message:hover .chatbot-copy,
.chatbot-message:hover .chatbot-speak,
.chatbot-copy:focus-visible,
.chatbot-speak:focus-visible,
.chatbot-copy.is-copied,
.chatbot-copy.is-error,
.chatbot-speak.is-speaking,
.chatbot-speak.is-error {
    opacity: 1;
    transform: translateY(0);
}

.chatbot-copy:hover,
.chatbot-speak:hover {
    background: rgba(70, 56, 51, 0.15);
}

.chatbot-copy.is-copied {
    color: #2e7d32;
}

.chatbot-copy.is-error {
    color: #b3261e;
}

.chatbot-speak.is-speaking {
    color: #d84315;
    background: rgba(216, 67, 21, 0.14);
}

.chatbot-speak.is-error {
    color: #b3261e;
}

.chatbot-message.bot {
    background: #ffffff;
    color: #463833;
    border-top-left-radius: 0px;
}

.chatbot-message.bot.is-typing::after {
    content: '';
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    vertical-align: -0.12em;
    background: #d86740;
    animation: chatbot-caret-blink 0.75s steps(1) infinite;
}

@keyframes chatbot-caret-blink {
    50% {
        opacity: 0;
    }
}

.chatbot-message.user {
    display: block;
    margin-left: auto;
    background: linear-gradient(135deg, #ff7043, #ff8f3f);
    color: #fff;
    border-radius: 18px;
    border-top-right-radius: 0px;
    width: fit-content;
    height: fit-content;
    text-align: right;
    overflow-wrap: anywhere;
}

.chatbot-message.user .chatbot-copy,
.chatbot-message.user .chatbot-speak {
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

@media (hover: none) {
    .chatbot-copy,
    .chatbot-speak {
        opacity: 0.72;
        transform: none;
    }
}

.chatbot-message p,
.chatbot-message ul {
    margin: 0 0 10px;
}

.chatbot-message ul {
    padding-left: 18px;
}

.chatbot-message a {
    color: #d84315 !important;
    font-weight: 600;
    text-decoration: underline;
}

.chatbot-message.user a {
    color: #fff !important;
}

.chatbot-content-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 12px 0;
    border: 1px solid rgba(75, 50, 44, 0.12);
    border-radius: 12px;
    background: #fff;
}

.chatbot-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 12px 0;
}

.chatbot-suggestion {
    border: 1px solid rgba(255, 160, 127, 0.32);
    background: rgba(255, 255, 255, 0.92);
    color: #8f4a34;
    border-radius: 999px;
    padding: 7px 11px;
    font-size: 12px;
    cursor: pointer;
}

.chatbot-inline-actions {
    display: flex;
    gap: 8px;
    margin: 10px 0 6px;
    flex-wrap: wrap;
}

.chatbot-inline-actions.chatbot-service-actions {
    align-items: stretch;
    flex-direction: column;
}

.chatbot-service-actions .chatbot-choice {
    text-align: left;
    width: 100%;
}

.chatbot-choice {
    border: 0;
    border-radius: 999px;
    padding: 8px 14px;
    background: linear-gradient(135deg, #ff7043, #ff9800);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(255, 112, 67, 0.16);
}

.chatbot-school-picker {
    display: grid;
    gap: 8px;
    margin-top: 10px;
}

.chatbot-school-search {
    width: 100%;
    border: 1px solid rgba(161, 129, 112, 0.35);
    border-radius: 12px;
    padding: 10px 12px;
    background: #fff;
    color: #3f3733;
    font: inherit;
    outline: none;
}

.chatbot-school-search:focus {
    border-color: #ff7043;
    box-shadow: 0 0 0 3px rgba(255, 112, 67, 0.12);
}

.chatbot-school-options {
    display: grid;
    gap: 6px;
    max-height: 220px;
    overflow-y: auto;
}

.chatbot-school-option,
.chatbot-school-missing {
    width: 100%;
    border: 1px solid rgba(255, 112, 67, 0.24);
    border-radius: 12px;
    padding: 9px 10px;
    background: #fff;
    color: #59443c;
    text-align: left;
    cursor: pointer;
}

.chatbot-school-option {
    display: grid;
    gap: 3px;
}

.chatbot-school-option:hover,
.chatbot-school-option:focus,
.chatbot-school-missing:hover,
.chatbot-school-missing:focus {
    border-color: #ff7043;
    background: #fff7ef;
}

.chatbot-school-option small,
.chatbot-school-status {
    color: #8b6f67;
    font-size: 11px;
}

.chatbot-school-missing {
    border-style: dashed;
    color: #a2472c;
    font-weight: 700;
}

.chatbot-school-picker input:disabled,
.chatbot-school-picker button:disabled {
    cursor: default;
    opacity: 0.58;
}

.chatbot-form {
    padding: 14px;
    border-top: 1px solid rgba(255, 160, 127, 0.22);
    background: #fff7ef;
}

.chatbot-input-row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: end;
}

.chatbot-input {
    flex: 1;
    min-height: 64px;
    max-height: 140px;
    resize: vertical;
    border: 1px solid rgba(161, 129, 112, 0.25);
    border-radius: 16px;
    padding: 14px 14px;
    font-size: 14px;
    background: #fff;
    color: #3f3733;
    outline: none;
}

.chatbot-submit {
    min-width: 96px;
    height: 50px;
    border: 0;
    border-radius: 16px;
    background: linear-gradient(135deg, #ff7043, #ff9800);
    color: #fff;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(255, 112, 67, 0.22);
}

.chatbot-note {
    margin-top: 10px;
    font-size: 11px;
    color: #8b6f67;
}

@media (max-width: 767px) {
    .chatbot-launcher {
        right: 16px;
        bottom: 76px;
    }

    .chatbot-panel {
        right: 16px;
        bottom: 146px;
        width: calc(100vw - 32px);
        height: 74vh;
    }
}
