button.no-floating-button__bomi {
    border: 0;
    padding: 0;
    cursor: pointer;
}

.bomi-qa {
    position: fixed;
    inset: auto max(12px, env(safe-area-inset-right)) max(16px, env(safe-area-inset-bottom)) auto;
    width: min(412px, calc(100% - 24px));
    height: min(620px, calc(100dvh - 32px));
    margin: 0;
    padding: 0;
    max-width: none;
    max-height: none;
    overflow: hidden;
    border: 1px solid #e2e8f3;
    border-radius: 24px;
    background: #fff;
    color: #161616;
    font-size: 15px;
    box-shadow: 0 16px 48px rgba(16, 31, 65, .22);
    font-family: Pretendard, var(--family-ko-base, sans-serif);
    letter-spacing: -.012em;
    line-height: 1.6;
}

.bomi-qa[open] {
    display: flex;
    flex-direction: column;
}

.bomi-qa::backdrop {
    background: rgba(12, 20, 51, .22);
}

.bomi-qa__header {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 13px 16px;
    background: #111b44;
    color: #fff;
}

.bomi-qa__header h2 {
    flex: 1;
    margin: 0;
    color: #fff;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -.02em;
}

.bomi-qa__avatar,
.bomi-qa__avatar img {
    display: block;
    width: 36px;
    height: 36px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
}

.bomi-qa__header-actions {
    display: flex;
    flex: none;
    gap: 2px;
}

.bomi-qa__header form {
    margin: 0;
}

.bomi-qa__header button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.bomi-qa__header button:hover {
    background: rgba(255, 255, 255, .15);
}

.bomi-qa__messages {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 20px 16px;
    overscroll-behavior: contain;
    background: #f6f8fc;
}

.bomi-qa__bubble {
    width: fit-content;
    max-width: 94%;
    margin: 0 0 12px;
    padding: 12px 14px;
    border-radius: 6px 17px 17px 17px;
    background: #fff;
    line-height: 1.65;
    line-break: strict;
    word-break: keep-all;
    overflow-wrap: anywhere;
    border: 1px solid #e2e9f4;
}

.bomi-qa__bubble--question {
    margin-inline-start: auto;
    background: #e5eeff;
    color: #163a75;
    border: 0;
    border-radius: 17px 6px 17px 17px;
}

.bomi-qa__bubble p {
    margin: 0;
    text-wrap: pretty;
}

.bomi-qa__bubble p + p {
    margin-block-start: 8px;
}

.bomi-qa__bubble a {
    color: #1854ad;
    font-weight: 700;
    text-decoration: underline;
}

.bomi-qa__topics {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 10px 14px;
    border-top: 1px solid #e2e8f3;
    background: #fff;
    flex-shrink: 0;
    overflow-x: auto;
    scrollbar-width: none;
}

.bomi-qa__topics button {
    padding: 7px 11px;
    border: 1px solid #c5d9fb;
    border-radius: 999px;
    background: #f4f7fd;
    color: #184d99;
    font: inherit;
    font-size: 13px;
    cursor: pointer;
    flex: 0 0 auto;
    border-color: #e1e8f4;
    white-space: nowrap;
    font-weight: 600;
}

.bomi-qa__topics button:hover {
    border-color: #1854ad;
    background: #1854ad;
    color: #fff;
}

.bomi-qa button:focus-visible,
.bomi-qa a:focus-visible {
    outline: 2px solid #3c82f6;
    outline-offset: 2px;
}

.bomi-qa__composer {
    display: flex;
    flex: 0 0 auto;
    gap: 7px;
    padding: 5px;
    border-top: 1px solid #e2e8f3;
    background: #fff;
    margin: 0 12px 12px;
    border: 1px solid #dbe4f3;
    border-radius: 15px;
    align-items: stretch;
}

.bomi-qa__composer input {
    flex: 1;
    min-width: 0;
    padding: 8px 9px;
    border: 0;
    border-radius: 9px;
    background: #fff;
    color: #161616;
    font: inherit;
    font-size: 16px;
    border-color: #e1e8f4;
}

.bomi-qa__composer input:focus-visible {
    outline: 2px solid #3c82f6;
    outline-offset: 1px;
}

.bomi-qa__composer button {
    flex: 0 0 auto;
    padding: 0 13px;
    border: 0;
    border-radius: 10px;
    background: #1854ad;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    font-size: 14px;
}

.bomi-qa__welcome p:last-child {
    margin-bottom: 0;
    color: #41506c;
}

.bomi-qa__welcome strong {
    font-weight: 700;
    color: #142449;
}

.bomi-qa__welcome {
    border-color: #dce7fa;
    background: #fff;
}

.bomi-qa__topics-label {
    flex: 0 0 auto;
    margin: 0;
    padding: 11px 14px 0;
    border-top: 1px solid #e2e8f3;
    color: #425577;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
}

.bomi-qa__topics {
    border-top: 0;
    padding-block: 7px 11px;
}

.bomi-qa__home {
    display: none;
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding: 24px 18px;
    padding-block-end: clamp(24px, 100dvh - 560px, 76px);
    background: #ecf3ff;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__home {
    display: flex;
    flex-direction: column;
    justify-content: safe center;
    gap: 0;
}

.bomi-qa[data-bomi-view="home"] :is(.bomi-qa__messages, .bomi-qa__topics-label, .bomi-qa__topics, .bomi-qa__composer, [data-bomi-reset]),
.bomi-qa[data-bomi-view="faq"] :is(.bomi-qa__messages, .bomi-qa__composer) {
    display: none;
}

.bomi-qa__home-icon {
    display: none;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__header {
    background: #fff;
    color: #56637a;
    border-bottom: 1px solid #e8eef8;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__header h2 {
    color: inherit;
    font-size: 14px;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__avatar {
    display: none;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__header .bomi-qa__home-icon {
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 0;
}

.bomi-qa[data-bomi-view="home"] .bomi-qa__header button:hover {
    background: #ecf3ff;
}

.bomi-qa__home-intro {
    display: grid;
    grid-template-columns: 131px minmax(0, 1fr);
    align-items: center;
    gap: clamp(10px, 4vw, 20px);
}

.bomi-qa__mascot {
    position: relative;
    z-index: 1;
    width: 131px;
    height: 137px;
    pointer-events: none;
}

.bomi-qa__mascot-mask {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.bomi-qa__mascot img {
    position: absolute;
    display: block;
    width: auto;
    height: auto;
    max-width: none;
}

.bomi-qa__art--body { left: 35px; top: 115px; }
.bomi-qa__art--tie { left: 67px; top: 127px; }
.bomi-qa__art--tie-tip { left: 69px; top: 137px; }
.bomi-qa__art--head { left: 4px; top: 6px; transform: scaleX(-1); }
.bomi-qa__art--arm-left { left: 28px; top: 117px; }
.bomi-qa__art--arm-right { left: 70px; top: 120px; }
.bomi-qa__art--hand-left { left: 28px; top: 114px; }
.bomi-qa__art--hand-right { left: 82px; top: 105px; }

.bomi-qa__home-intro h3 {
    margin: 0;
    color: #121a2b;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    letter-spacing: -.025em;
    word-break: keep-all;
}

.bomi-qa__home-intro h3 span {
    display: block;
}

.bomi-qa__home-intro strong {
    color: #087ca5;
    font-weight: 800;
    background: linear-gradient(transparent 70%, #34bfdb26 70%);
}

.bomi-qa__home-intro p {
    margin: 10px 0 0;
    color: #354f6e;
    font-size: 13px;
    line-height: 1.55;
    word-break: keep-all;
}

.bomi-qa__start {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 10px 14px;
    border: 0;
    border-radius: 15px;
    background: #3498db;
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bomi-qa__start:hover {
    background: #2787c7;
}

.bomi-qa__shortcuts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 26px;
}

.bomi-qa__shortcuts > * {
    display: grid;
    align-content: center;
    justify-items: start;
    gap: 7px;
    min-height: 88px;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 11px;
    background: #f8f9ff;
    color: #18263f;
    text-align: start;
    text-decoration: none;
    font: inherit;
    font-size: 12px;
    cursor: pointer;
}

.bomi-qa__shortcuts > *:hover {
    border-color: #bcd2ee;
    background: #fff;
}

.bomi-qa__shortcuts strong,
.bomi-qa__shortcuts small {
    display: block;
    line-height: 1.35;
    word-break: keep-all;
}

.bomi-qa__shortcuts strong {
    font-weight: 700;
}

.bomi-qa__shortcuts small {
    margin-top: 3px;
    color: #58677e;
    font-size: 11px;
    font-weight: 500;
}

@media (max-width: 365px) {
    .bomi-qa__home-intro {
        grid-template-columns: 107px minmax(0, 1fr);
        gap: 9px;
    }

    .bomi-qa__mascot {
        transform: scale(.8);
        transform-origin: left bottom;
    }

    .bomi-qa__home-intro h3 {
        font-size: 15px;
    }
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics {
    display: grid;
    flex: 1;
    min-height: 0;
    align-content: start;
    gap: 8px;
    overflow: auto;
    padding: 12px 14px;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics button {
    padding: 10px 12px;
    border-radius: 10px;
    text-align: start;
    white-space: normal;
}

.bomi-qa__start img {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    object-fit: contain;
}

.bomi-qa__shortcuts img {
    filter: hue-rotate(12deg) saturate(.9);
    width: 26px;
    height: 26px;
    object-fit: contain;
}

/* Shared palette for the welcome, conversation, and FAQ views. */
.bomi-qa {
    --bomi-surface: #eaf1fc;
    --bomi-ink: #203953;
    --bomi-accent: #2172ad;
    --bomi-border: #dce7f6;
}

.bomi-qa .bomi-qa__header {
    border-bottom: 1px solid var(--bomi-border);
    background: #fff;
    color: var(--bomi-ink);
}

.bomi-qa .bomi-qa__header h2 {
    color: inherit;
    font-size: 14px;
}

.bomi-qa .bomi-qa__header button:hover {
    background: var(--bomi-surface);
}

.bomi-qa__home,
.bomi-qa__messages,
.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics {
    background: var(--bomi-surface);
}

.bomi-qa__home-intro strong {
    color: #087ca5;
}

.bomi-qa__composer button {
    background: var(--bomi-accent);
}

.bomi-qa__bubble {
    border-color: var(--bomi-border);
    color: var(--bomi-ink);
}

.bomi-qa__bubble--question {
    background: #d5e7fc;
    color: #174574;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics-label {
    padding: 15px 14px 4px;
    border-top: 0;
    background: var(--bomi-surface);
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics button {
    border-color: var(--bomi-border);
    background: #fff;
    color: var(--bomi-ink);
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics button:hover {
    border-color: #a0bee5;
    background: #f6faff;
}

.bomi-qa[data-bomi-view="chat"] .bomi-qa__topics button {
    background: #f1f6ff;
    color: var(--bomi-ink);
}

.bomi-qa[data-bomi-view="chat"] .bomi-qa__topics button:hover {
    background: #e3efff;
}

/* Give the conversation and question list distinct, readable layouts. */
.bomi-qa__faq-intro,
.bomi-qa__topic-arrow {
    display: none;
}

.bomi-qa[data-bomi-view="faq"] {
    background: var(--bomi-surface);
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__faq-intro {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    margin: 12px 14px 0;
    padding: 8px 12px;
    border: 1px solid var(--bomi-border);
    border-radius: 13px;
    background: #fff;
}

.bomi-qa__faq-intro img {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.bomi-qa__faq-intro h3 {
    margin: 0;
    color: var(--bomi-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 18px;
}

.bomi-qa__faq-intro p {
    margin: 1px 0 0;
    color: #526683;
    font-size: 12px;
    line-height: 15px;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics-label {
    display: none;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics button {
    display: grid;
    grid-template-columns: 26px minmax(0, 1fr) 12px;
    align-items: center;
    gap: 10px;
    min-height: 50px;
    border-radius: 13px;
    font-size: 13px;
    font-weight: 500;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topic-icon {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    background: #f1f5fc;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topic-arrow {
    display: block;
    color: #6c809a;
    font-size: 10px;
}

.bomi-qa__messages .bomi-qa__bubble:not(.bomi-qa__bubble--question) {
    position: relative;
    margin-inline-start: 37px;
    max-width: calc(100% - 37px);
    box-shadow: 0 2px 5px #2246780a;
}

.bomi-qa__messages .bomi-qa__message-avatar {
    position: absolute;
    display: block;
    padding: 3px;
    object-fit: contain;
    top: 0;
    left: -37px;
    width: 28px;
    height: 28px;
    border: 1px solid var(--bomi-border);
    border-radius: 50%;
    background: #fff;
}

.bomi-qa__thinking-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.bomi-qa__thinking-dots {
    display: flex;
    align-items: center;
    gap: 4px;
    height: 1.65em;
    color: var(--bomi-accent);
}

.bomi-qa__thinking-dots > span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    animation: bomi-qa-thinking 900ms ease-in-out infinite;
}

.bomi-qa__thinking-dots > span:nth-child(2) {
    animation-delay: 120ms;
}

.bomi-qa__thinking-dots > span:nth-child(3) {
    animation-delay: 240ms;
}

@keyframes bomi-qa-thinking {
    0%, 60%, 100% { opacity: .45; transform: translateY(0); }
    30% { opacity: 1; transform: translateY(-3px); }
}

@media (prefers-reduced-motion: reduce) {
    .bomi-qa__thinking-dots > span {
        animation: none;
    }
}

.bomi-qa__reply .bomi-qa__bubble > p:first-of-type {
    color: #183b62;
    font-weight: 700;
}

.bomi-qa__reply .bomi-qa__bubble a {
    display: inline-block;
    margin-top: 10px;
    padding: 5px 9px;
    border-radius: 8px;
    background: #edf4ff;
    font-size: 13px;
    text-decoration: none;
}

.bomi-qa__reply .bomi-qa__bubble a:hover {
    background: #dfedff;
}

.bomi-qa__bubble--answer {
    margin-block-end: 40px;
}

.bomi-qa__answer-tools {
    position: absolute;
    z-index: 1;
    inset-block-start: calc(100% + 6px);
    inset-inline-start: 3px;
    display: flex;
    align-items: center;
    width: max-content;
    max-width: calc(100% - 6px);
    padding: 1px 2px;
    border-radius: 8px;
    background: rgb(255 255 255 / .76);
    opacity: 0;
    pointer-events: none;
    transition: opacity 140ms ease;
}

.bomi-qa__bubble--answer:is([data-bomi-tools-open], :has(:focus-visible)) > .bomi-qa__answer-tools {
    opacity: 1;
    pointer-events: auto;
}

.bomi-qa[data-bomi-touch-input] .bomi-qa__bubble--answer {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

.bomi-qa[data-bomi-touch-input] .bomi-qa__bubble--answer a {
    -webkit-touch-callout: default;
}

.bomi-qa[data-bomi-touch-input] .bomi-qa__answer-tools {
    transition: none;
}

.bomi-qa__answer-actions {
    display: inline-flex;
    flex: none;
}

.bomi-qa__answer-actions button {
    display: grid;
    place-items: center;
    width: 28px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #586e89;
    font-size: 14px;
    cursor: pointer;
}

.bomi-qa__answer-actions button:hover,
.bomi-qa__answer-actions button[aria-pressed="true"] {
    color: #235d8c;
    background: #edf4fd;
}

.bomi-qa__answer-actions button[aria-pressed="true"] {
    animation: bomi-qa-vote 240ms ease-out;
}

@keyframes bomi-qa-vote {
    from { transform: scale(.9); }
    56% { transform: scale(1.12); }
    to { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce) {
    .bomi-qa__answer-actions button[aria-pressed="true"] {
        animation: none;
    }
}

.bomi-qa__answer-actions button:focus-visible {
    outline: 2px solid var(--bomi-accent);
    outline-offset: -2px;
}

.bomi-qa__answer-status {
    min-width: 0;
    color: #586e89;
    font-size: 12px;
    overflow-wrap: anywhere;
}

.bomi-qa__answer-status:not(:empty) {
    margin-inline: 5px 4px;
}

@media (hover: hover) and (pointer: fine) {
    .bomi-qa:not([data-bomi-touch-input]) .bomi-qa__bubble--answer:hover > .bomi-qa__answer-tools {
        opacity: 1;
        pointer-events: auto;
    }

    /* Keep the toolbar reachable from the bubble across the visual gap. */
    .bomi-qa__answer-tools::before {
        position: absolute;
        inset-inline: 0;
        inset-block-end: 100%;
        height: 6px;
        content: '';
    }
}

@media (prefers-reduced-motion: reduce) {
    .bomi-qa__answer-tools {
        transition: none;
    }
}

.bomi-qa__composer button {
    display: flex;
    align-items: center;
    gap: 6px;
}

.bomi-qa[data-bomi-view="chat"] .bomi-qa__topic-arrow {
    display: none;
}

/* Keep wheel and touch scrolling inside the open widget, including at its edges. */
html:has(.bomi-qa[open]),
body:has(.bomi-qa[open]) {
    overflow: hidden;
}

.bomi-qa,
.bomi-qa__home,
.bomi-qa__messages,
.bomi-qa__topics {
    overscroll-behavior: contain;
}

.bomi-qa[data-bomi-view="faq"] .bomi-qa__topics [data-bomi-chat-only] {
    display: none;
}
