.mutqin-help {
    --help-navy: #092d3a;
    --help-ink: #142e37;
    --help-teal: #19556a;
    --help-paper: #f4f8f9;
    --help-line: #cbdde3;
    --help-gold: #ffe362;
    --help-edge: max(14px, calc(env(safe-area-inset-left) + 10px));
    --help-bottom: max(14px, calc(env(safe-area-inset-bottom) + 10px));
}

.mutqin-help [hidden],
.mutqin-help-faq[hidden] {
    display: none;
}

:where(.mutqin-help) button,
:where(.mutqin-help) input,
.mutqin-help-faq {
    font: inherit;
}

.mutqin-help button,
.mutqin-help-faq {
    cursor: pointer;
}

.mutqin-help button:disabled {
    cursor: wait;
    opacity: .72;
}

.mutqin-help :focus-visible,
.mutqin-help-faq:focus-visible {
    outline: 2px solid #26738a;
    outline-offset: 3px;
}

.mutqin-help-faq {
    display: block;
    min-height: 44px;
    margin: 18px auto 0;
    padding: 8px 16px;
    border: 1px solid #bfd3d9;
    border-radius: 10px;
    background: #fff;
    color: #174b5d;
    font-weight: 800;
}

.mutqin-help-launch,
.mutqin-help-panel {
    position: fixed;
    z-index: 110;
    inset-inline-end: var(--help-edge);
    inset-block-end: var(--help-bottom);
}

.mutqin-help-launch {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 46px;
    padding: 8px 14px;
    border: 1px solid var(--help-gold);
    border-radius: 10px;
    background: var(--help-navy);
    color: #fff;
    font-weight: 800;
    box-shadow: 0 5px 18px #082a3738;
}

.mutqin-help-launch svg {
    color: var(--help-gold);
}

.mutqin-help-launch:is(:hover, :focus-visible) {
    background: var(--help-teal);
}

.mutqin-help-panel {
    display: flex;
    flex-direction: column;
    inset-block-end: calc(var(--help-bottom) + var(--help-keyboard-inset, 0px));
    width: min(380px, calc(100vw - var(--help-edge) - 14px));
    height: 515px;
    max-height: calc(100vh - var(--help-bottom) - 10px);
    max-height: calc(var(--help-viewport-height, 100dvh) - var(--help-bottom) - 10px);
    padding: 0;
    overflow: hidden;
    border-radius: 16px;
    background: var(--help-paper);
    color: var(--help-ink);
    box-shadow: 0 10px 38px #082a3744;
}

.mutqin-help-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 13px 16px;
    background: var(--help-navy);
    color: #fff;
}

.mutqin-help-header h2 {
    color: var(--help-gold);
    font-size: 20px;
    font-weight: 900;
    line-height: 1.25;
}

.mutqin-help-header p {
    margin-block-start: 3px;
    color: #dbeef3;
    font-size: 14px;
    line-height: 1.4;
}

.mutqin-help-close {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
}

.mutqin-help-header :focus-visible {
    outline-color: var(--help-gold);
}

.mutqin-help-header h2:focus {
    outline: none;
}

.mutqin-help-close:hover {
    background: #164758;
}

.mutqin-help-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 14px 14px 18px;
    scrollbar-color: #91aeb9 var(--help-paper);
    scrollbar-width: thin;
}

.mutqin-help-body:focus-visible {
    outline-offset: -3px;
}

.mutqin-help-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-block-end: 14px;
}

.mutqin-help-suggestions button {
    min-height: 40px;
    padding: 5px 10px;
    border: 1px solid var(--help-line);
    border-radius: 9px;
    background: #fff;
    color: var(--help-teal);
    font-size: 14px;
    font-weight: 700;
}

.mutqin-help-suggestions button:hover,
.mutqin-help-faq:hover {
    background: #e7f2f6;
}

.mutqin-help-log {
    display: flex;
    flex-direction: column;
    gap: 9px;
}

.mutqin-help-message {
    max-inline-size: 96%;
    padding: 9px 12px;
    border-radius: 12px;
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: anywhere;
}

.mutqin-help-question {
    align-self: flex-start;
    background: var(--help-teal);
    color: #fff;
}

.mutqin-help-reply {
    align-self: flex-end;
    border: 1px solid var(--help-line);
    background: #fff;
    color: var(--help-ink);
}

.mutqin-help-pending {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-end;
    background: #e7f2f6;
    color: var(--help-teal);
}

.mutqin-help-pending::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

@media (prefers-reduced-motion: no-preference) {
    .mutqin-help-pending::before {
        animation: mutqin-help-pulse .85s ease-in-out infinite alternate;
    }
}

@keyframes mutqin-help-pulse {
    from { opacity: .38; }
    to { opacity: 1; }
}

.mutqin-help-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 14px;
    margin-block-start: 6px;
}

.mutqin-help-choice {
    min-height: 44px;
    padding: 5px 12px;
    border: 1px solid var(--help-line);
    border-radius: 8px;
    background: var(--help-paper);
    color: var(--help-teal);
    font-size: 14px;
    font-weight: 800;
}

.mutqin-help-choice:hover {
    background: #e7f2f6;
}

.mutqin-help-choice[aria-disabled="true"] {
    cursor: wait;
    opacity: .72;
}

.mutqin-help-actions a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    color: var(--help-teal);
    font-weight: 800;
    text-underline-offset: .2em;
}

.mutqin-help-form {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    border-block-start: 1px solid var(--help-line);
    background: #fff;
}

.mutqin-help-form input {
    flex: 1;
    min-width: 0;
    min-height: 44px;
    padding: 8px 10px;
    border: 1px solid #9ab6c0;
    border-radius: 8px;
    background: #fff;
    color: var(--help-ink);
    font-size: 16px;
}

.mutqin-help-form input::placeholder {
    color: #4e6470;
}

.mutqin-help-form button {
    min-height: 44px;
    padding: 8px 14px;
    border: 0;
    border-radius: 8px;
    background: var(--help-navy);
    color: #fff;
    font-weight: 800;
}

.mutqin-help-form button:hover {
    background: var(--help-teal);
}
