.mhbot-shell {
    max-width: 920px;
    margin: 2rem auto;
    padding: 1.5rem;
    border: 1px solid #d8d8e0;
    border-radius: 16px;
    background: #ffffff;
    color: #1f1f29;
    box-shadow: 0 12px 32px rgba(31, 31, 41, 0.08);
}

.mhbot-shell [hidden] {
    display: none !important;
}

.mhbot-header {
    margin-bottom: 1.5rem;
}

.mhbot-kicker {
    margin: 0 0 0.25rem;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #5c3d99;
}

.mhbot-header h2 {
    margin-top: 0;
    margin-bottom: 0.5rem;
}

.mhbot-setup-panel,
.mhbot-brief-panel,
.mhbot-session-panel {
    display: grid;
    gap: 1rem;
}

.mhbot-field-group {
    display: grid;
    gap: 0.35rem;
}

.mhbot-field-group label {
    font-weight: 700;
}

.mhbot-field-group select,
.mhbot-text-form textarea {
    width: 100%;
    max-width: 100%;
    border: 1px solid #cfcfde;
    border-radius: 10px;
    padding: 0.75rem;
    font: inherit;
    background: #ffffff;
}

.mhbot-mode-choice fieldset {
    display: grid;
    gap: 0.65rem;
    margin: 0;
    padding: 0.85rem;
    border: 1px solid #e2e2ec;
    border-radius: 10px;
    background: #f8f7fb;
}

.mhbot-mode-choice legend {
    padding: 0 0.25rem;
    font-weight: 700;
}

.mhbot-mode-choice p {
    margin: 0;
    font-size: 0.94rem;
    line-height: 1.45;
}

.mhbot-radio-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.mhbot-radio-row input {
    margin: 0;
}

.mhbot-text-form textarea:disabled {
    background: #f4f4f8;
    color: #6b6b76;
    cursor: not-allowed;
}

.mhbot-checkbox-row {
    padding: 0.75rem;
    border: 1px solid #e2e2ec;
    border-radius: 10px;
    background: #f8f7fb;
}

.mhbot-checkbox-row p {
    margin: 0.4rem 0 0;
    font-size: 0.92rem;
}

.mhbot-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    border: 0;
    border-radius: 999px;
    padding: 0.75rem 1.2rem;
    background: #5c3d99;
    color: #ffffff;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
}

.mhbot-button:hover,
.mhbot-button:focus {
    background: #452b7f;
    color: #ffffff;
}

.mhbot-button:disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.mhbot-button-secondary {
    background: #4a4a55;
}

.mhbot-button-secondary:hover,
.mhbot-button-secondary:focus {
    background: #34343d;
}

.mhbot-setup-message {
    color: #8a1f1f;
    font-weight: 700;
}

.mhbot-brief-panel {
    padding: 1rem;
    border: 1px solid #e2e2ec;
    border-radius: 14px;
    background: #f8f7fb;
}

.mhbot-brief-header h3 {
    margin-top: 0;
    margin-bottom: 0.35rem;
}

.mhbot-brief-header p {
    margin-bottom: 0;
}

.mhbot-brief-content {
    padding: 1rem;
    border: 1px solid #dedee8;
    border-radius: 14px;
    background: #ffffff;
    line-height: 1.5;
}

.mhbot-brief-content p {
    margin: 0 0 0.85rem;
}

.mhbot-brief-content p:last-child {
    margin-bottom: 0;
}

.mhbot-brief-content h4,
.mhbot-brief-content h5 {
    margin: 1.1rem 0 0.45rem;
    font-weight: 700;
    color: #2e2352;
}

.mhbot-brief-content h4:first-child,
.mhbot-brief-content h5:first-child {
    margin-top: 0;
}

.mhbot-mode-notice,
.mhbot-fallback-notice,
.mhbot-session-notice {
    padding: 1rem;
    border-radius: 14px;
    line-height: 1.5;
}

.mhbot-mode-notice {
    border: 1px solid #d8caee;
    background: #f5f0ff;
    color: #2e2352;
}

.mhbot-fallback-notice {
    border: 1px solid #e7c7a7;
    background: #fff7ef;
    color: #4d3217;
}

.mhbot-session-notice {
    border: 1px solid #d8caee;
    background: #f5f0ff;
    color: #2e2352;
}

.mhbot-mode-notice h4,
.mhbot-fallback-notice h4 {
    margin: 0 0 0.35rem;
    color: inherit;
}

.mhbot-mode-notice p,
.mhbot-fallback-notice p,
.mhbot-session-notice p {
    margin: 0;
}

.mhbot-fallback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1rem;
}

.mhbot-brief-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: flex-end;
}

.mhbot-session-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.mhbot-session-meta span {
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    background: #eeeaf8;
    color: #2e2352;
    font-size: 0.9rem;
    font-weight: 700;
}

.mhbot-chat-window {
    min-height: 280px;
    max-height: 440px;
    overflow-y: auto;
    padding: 1rem;
    border: 1px solid #dedee8;
    border-radius: 14px;
    background: #fbfbfd;
}

.mhbot-message {
    max-width: 82%;
    margin-bottom: 0.75rem;
    padding: 0.75rem 0.9rem;
    border-radius: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.mhbot-message:last-child {
    margin-bottom: 0;
}

.mhbot-message-system {
    max-width: 100%;
    background: #eeeaf8;
    color: #2e2352;
}

.mhbot-message-user {
    margin-left: auto;
    background: #5c3d99;
    color: #ffffff;
}

.mhbot-message-bot {
    margin-right: auto;
    background: #ffffff;
    border: 1px solid #dedee8;
}

.mhbot-text-form {
    display: grid;
    gap: 0.75rem;
}

.mhbot-session-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0.75rem;
    border: 1px solid #e2e2ec;
    border-radius: 14px;
    background: #ffffff;
}

.mhbot-voice-panel,
.mhbot-feedback-panel {
    padding: 1rem;
    border: 1px solid #e2e2ec;
    border-radius: 14px;
    background: #f8f7fb;
}

.mhbot-voice-panel h3,
.mhbot-feedback-panel h3 {
    margin-top: 0;
}

.mhbot-voice-instructions {
    margin-top: 0;
    line-height: 1.5;
}

.mhbot-voice-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.mhbot-feedback-content {
    padding: 1rem;
    border: 1px solid #dedee8;
    border-radius: 14px;
    background: #ffffff;
    line-height: 1.5;
    white-space: pre-wrap;
}

.mhbot-message-bot strong,
.mhbot-feedback-panel strong {
    font-weight: 700;
}

.mhbot-message-bot em,
.mhbot-feedback-panel em {
    font-style: italic;
}

@media (max-width: 640px) {
    .mhbot-shell {
        margin: 1rem auto;
        padding: 1rem;
    }

    .mhbot-message {
        max-width: 100%;
    }

    .mhbot-button {
        width: 100%;
    }

    .mhbot-brief-actions,
    .mhbot-session-actions,
    .mhbot-voice-actions,
    .mhbot-fallback-actions {
        justify-content: stretch;
    }

    .mhbot-session-actions {
        display: grid;
        gap: 0.75rem;
    }
}
