/* Espaço para o botão “subir” — launcher e painel alinhados à direita */
.progress-wrap {
    right: 20px !important;
    left: auto !important;
    bottom: 20px !important;
}

.kerp-public-chat {
    --k-bg: #0f172a;
    --k-surface: #1e293b;
    --k-elevated: #334155;
    --k-border: rgba(148, 163, 184, 0.12);
    --k-border-strong: rgba(148, 163, 184, 0.22);
    --k-text: #f8fafc;
    --k-muted: #94a3b8;
    --k-subtle: #64748b;
    --k-emerald: #10b981;
    --k-emerald-dim: rgba(16, 185, 129, 0.16);
    --k-violet: #a5b4fc;
    --k-violet-dim: rgba(165, 180, 252, 0.2);
    --k-user-bubble: #c7d2fe;
    --k-user-bubble-text: #1e1b4b;
    --k-asst-bubble: #1e293b;
    --k-shine: linear-gradient(135deg, rgba(16, 185, 129, 0.12) 0%, rgba(99, 102, 241, 0.08) 100%);
    color: var(--k-text);
    font-family: "Poppins", system-ui, -apple-system, Segoe UI, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

.kerp-public-chat * {
    box-sizing: border-box;
}

.kerp-public-chat h1,
.kerp-public-chat h2,
.kerp-public-chat p {
    letter-spacing: normal;
    text-transform: none;
}

.kerp-public-chat [hidden] {
    display: none !important;
}

.kerp-public-chat-scroll,
.kerp-public-chat-messages,
.kerp-public-chat-contact,
.kerp-public-chat-textarea {
    scrollbar-width: thin;
    scrollbar-color: rgba(16, 185, 129, 0.55) rgba(30, 41, 59, 0.52);
}

.kerp-public-chat-scroll::-webkit-scrollbar,
.kerp-public-chat-messages::-webkit-scrollbar,
.kerp-public-chat-contact::-webkit-scrollbar,
.kerp-public-chat-textarea::-webkit-scrollbar {
    width: 6px;
}

.kerp-public-chat-scroll::-webkit-scrollbar-track,
.kerp-public-chat-messages::-webkit-scrollbar-track,
.kerp-public-chat-contact::-webkit-scrollbar-track,
.kerp-public-chat-textarea::-webkit-scrollbar-track {
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.52);
}

.kerp-public-chat-scroll::-webkit-scrollbar-thumb,
.kerp-public-chat-messages::-webkit-scrollbar-thumb,
.kerp-public-chat-contact::-webkit-scrollbar-thumb,
.kerp-public-chat-textarea::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: linear-gradient(180deg, rgba(16, 185, 129, 0.78), rgba(5, 150, 105, 0.72));
}

.kerp-public-chat-scroll::-webkit-scrollbar-thumb:hover,
.kerp-public-chat-messages::-webkit-scrollbar-thumb:hover,
.kerp-public-chat-contact::-webkit-scrollbar-thumb:hover,
.kerp-public-chat-textarea::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(52, 211, 153, 0.9), rgba(16, 185, 129, 0.82));
}

/* ——— Launcher (FAB) esmeralda, estilo app ——— */
.kerp-public-chat-launcher {
    position: fixed;
    right: 20px;
    left: auto;
    bottom: 72px;
    z-index: 99;
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(160deg, #10b981 0%, #059669 100%);
    color: #fff;
    box-shadow:
        0 20px 40px rgba(16, 185, 129, 0.35),
        0 8px 20px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.kerp-public-chat-launcher:hover,
.kerp-public-chat-launcher:focus-visible {
    filter: brightness(1.06);
    transform: translateY(-2px);
    outline: none;
}

.kerp-public-chat.is-open .kerp-public-chat-launcher {
    pointer-events: none;
    opacity: 0;
    transform: scale(0.88);
}

/* ——— Painel ——— */
.kerp-public-chat-panel {
    position: fixed;
    right: 20px;
    left: auto;
    bottom: 88px;
    z-index: 100;
    width: min(430px, calc(100vw - 40px));
    height: min(680px, calc(100dvh - 104px));
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--k-border-strong);
    border-radius: 24px;
    background: var(--k-bg);
    box-shadow: 0 32px 64px rgba(0, 0, 0, 0.5), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.kerp-public-chat.is-open .kerp-public-chat-panel {
    display: flex;
}

/* Top bar: logo + língua + fechar */
.kerp-public-chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px 8px;
    border-bottom: 1px solid var(--k-border);
    flex-shrink: 0;
}

.kerp-public-chat-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.kerp-public-chat-logo-mark {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    background: var(--k-shine);
    border: 1px solid var(--k-border);
    color: var(--k-emerald);
    flex-shrink: 0;
}

.kerp-public-chat-logo-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.kerp-public-chat-logo-text strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

.kerp-public-chat-logo-text small {
    font-size: 11px;
    font-weight: 500;
    color: var(--k-muted);
}

.kerp-public-chat-top-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.kerp-public-chat-lang {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 3px 4px;
    border-radius: 999px;
    background: rgba(30, 41, 59, 0.9);
    border: 1px solid var(--k-border);
}

.kerp-public-chat-lang span {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--k-subtle);
    padding: 0 2px 0 6px;
}

.kerp-public-chat-lang button {
    border: 0;
    padding: 4px 10px;
    border-radius: 999px;
    background: transparent;
    color: var(--k-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.kerp-public-chat-lang button.is-active {
    background: var(--k-violet-dim);
    color: #e0e7ff;
}

.kerp-public-chat-icon-button {
    width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 12px;
    background: transparent;
    color: var(--k-muted);
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.kerp-public-chat-icon-button:hover,
.kerp-public-chat-icon-button:focus-visible {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    outline: none;
}

/* Conteúdo com scroll (hero + form OU conversa) */
.kerp-public-chat-body {
    min-height: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Hero: saudação + avatares (antes do registo) */
.kerp-public-chat-hero {
    padding: 8px 16px 16px;
    flex-shrink: 0;
}

.kerp-public-chat-hero h1 {
    margin: 0 0 14px;
    max-width: 330px;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.18;
    letter-spacing: -0.03em;
    color: #fff;
}

.kerp-public-chat-agents {
    display: flex;
    align-items: center;
    gap: 0;
    margin-bottom: 8px;
}

.kerp-public-chat-agents-avatars {
    display: flex;
    align-items: center;
    margin-right: 10px;
}

.kerp-public-chat-agents-avatars i {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    border: 2px solid var(--k-bg);
    margin-left: -10px;
    background: linear-gradient(140deg, #6366f1, #8b5cf6);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    flex-shrink: 0;
}
.kerp-public-chat-agents-avatars i:first-child {
    margin-left: 0;
}
.kerp-public-chat-agents-avatars i:nth-child(2) {
    background: linear-gradient(140deg, #0ea5e9, #06b6d4);
}
.kerp-public-chat-agents-avatars i:nth-child(3) {
    background: linear-gradient(140deg, #f59e0b, #ef4444);
}

.kerp-public-chat-online {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--k-muted);
}

.kerp-public-chat-online i.dot {
    width: 7px;
    height: 7px;
    border-radius: 999px;
    background: var(--k-emerald);
    box-shadow: 0 0 0 3px var(--k-emerald-dim);
    flex-shrink: 0;
}

/* Cabeçalho modo conversa */
.kerp-public-chat-thread-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 6px 16px 10px;
    border-bottom: 1px solid var(--k-border);
    flex-shrink: 0;
}

.kerp-public-chat-thread-head .kerp-agent-ava {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(160deg, #1e293b, #0f172a);
    border: 1px solid var(--k-border);
    color: #a5b4fc;
    flex-shrink: 0;
}

.kerp-public-chat-thread-head .kerp-agent-ava::after {
    content: "";
    position: absolute;
    right: -1px;
    bottom: -1px;
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--k-emerald);
    border: 2px solid var(--k-bg);
}

.kerp-public-chat-thread-meta {
    min-width: 0;
    flex: 1;
}
.kerp-public-chat-thread-meta strong {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #fff;
}
.kerp-public-chat-thread-meta .kerp-online-row {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    font-size: 12px;
    color: var(--k-muted);
}
.kerp-public-chat-thread-meta .kerp-online-row i.dot {
    width: 6px;
    height: 6px;
    border-radius: 99px;
    background: var(--k-emerald);
}

/* ——— Views internas: início, mensagens e ajuda ——— */
.kerp-public-chat-home,
.kerp-public-chat-help,
.kerp-public-chat-contact {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 0 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.kerp-public-chat-help h2 {
    margin: 0 0 2px;
    font-size: 18px;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
}

.kerp-public-chat-help>p.muted {
    margin: 0 0 2px;
    font-size: 13px;
    line-height: 1.45;
    color: var(--k-muted);
}

.kerp-card {
    border: 1px solid var(--k-border);
    border-radius: 18px;
    padding: 16px;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.2) 100%);
}

.kerp-card--accent {
    position: relative;
    overflow: hidden;
}
.kerp-card--accent::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.kerp-card h2 {
    display: block;
    margin: 0 0 8px;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.35;
    color: #fff;
}
.kerp-card .eyebrow {
    margin: 0 0 8px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--k-subtle);
}
.kerp-card p.muted {
    display: block;
    margin: 0 0 14px;
    font-size: 12.5px;
    line-height: 1.55;
    color: var(--k-muted);
}
.kerp-card--recent p.muted {
    margin-bottom: 0;
}

.kerp-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 2px;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    color: var(--k-violet);
    cursor: pointer;
    transition: opacity 0.2s;
}
.kerp-card-cta:hover {
    opacity: 0.88;
}
.kerp-card-cta:focus-visible {
    outline: 2px solid var(--k-violet);
    outline-offset: 2px;
    border-radius: 4px;
}

.kerp-card--status p.status-ok {
    margin: 0 0 4px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--k-emerald);
}
.kerp-card--status p.time {
    margin: 0;
    font-size: 11.5px;
    color: var(--k-subtle);
}

.kerp-public-chat-search {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 42px;
    padding: 0 12px;
    border: 1px solid var(--k-border-strong);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: var(--k-muted);
}
.kerp-public-chat-search input {
    flex: 1;
    min-width: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font: inherit;
    font-size: 13px;
    outline: none;
}
.kerp-public-chat-search input::placeholder {
    color: var(--k-subtle);
}
.kerp-help-topics {
    display: grid;
    gap: 8px;
}
.kerp-help-topics button {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 0 12px;
    border: 1px solid var(--k-border-strong);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.72);
    color: #dbeafe;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
}
.kerp-help-topics button::after {
    content: "›";
    color: var(--k-violet);
    font-size: 20px;
    line-height: 1;
}
.kerp-help-topics button:hover,
.kerp-help-topics button:focus-visible {
    border-color: rgba(165, 180, 252, 0.32);
    background: rgba(30, 41, 59, 0.9);
    color: #fff;
    outline: none;
}

.kerp-public-chat-field {
    display: block;
    margin-top: 12px;
}
.kerp-public-chat-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--k-subtle);
}
.kerp-public-chat-input,
.kerp-public-chat-textarea {
    width: 100%;
    border: 1px solid var(--k-border);
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.6);
    color: #fff;
    font: inherit;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}
.kerp-public-chat-input {
    height: 44px;
    padding: 0 14px;
}
.kerp-public-chat-textarea {
    min-height: 46px;
    max-height: 120px;
    padding: 12px 14px;
    resize: none;
    line-height: 1.45;
}
.kerp-public-chat-input::placeholder,
.kerp-public-chat-textarea::placeholder {
    color: var(--k-subtle);
    opacity: 0.9;
}
.kerp-public-chat-input:focus,
.kerp-public-chat-textarea:focus {
    border-color: rgba(16, 185, 129, 0.45);
    background: rgba(15, 23, 42, 0.85);
}

.kerp-public-chat-primary {
    width: 100%;
    height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    border: 0;
    border-radius: 14px;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    cursor: pointer;
    font: inherit;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.3);
    transition: filter 0.2s, opacity 0.2s;
}
.kerp-public-chat-primary:hover,
.kerp-public-chat-primary:focus-visible {
    filter: brightness(1.05);
    outline: none;
}
.kerp-public-chat-primary:disabled,
.kerp-public-chat-send:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

/* ——— Conversa + bolhas ——— */
.kerp-public-chat-conversation {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1;
    overflow: hidden;
}

.kerp-public-chat-messages {
    min-height: 0;
    flex: 1;
    overflow-y: auto;
    padding: 14px 16px 10px;
}

.kerp-public-chat-messages-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.kerp-public-chat-empty {
    padding: 20px 16px;
    border: 1px dashed var(--k-border);
    border-radius: 18px;
    color: var(--k-muted);
    font-size: 13px;
    line-height: 1.6;
    text-align: center;
    background: rgba(30, 41, 59, 0.2);
}

.kerp-msg-group {
    display: flex;
    margin-bottom: 4px;
    max-width: 100%;
}
.kerp-msg-group.is-visitor {
    flex-direction: column;
    align-items: flex-end;
    margin-left: 8%;
}
.kerp-msg-group.is-assistant {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    margin-right: 4%;
}

.kerp-msg-ava {
    width: 32px;
    height: 32px;
    border-radius: 12px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--k-surface);
    border: 1px solid var(--k-border);
    color: #a5b4fc;
    font-size: 10px;
    font-weight: 800;
    align-self: flex-end;
    margin-bottom: 2px;
}

.kerp-msg-stack {
    display: flex;
    flex-direction: column;
    min-width: 0;
    flex: 1;
    align-items: flex-start;
}
.kerp-msg-group.is-visitor .kerp-msg-stack {
    align-items: flex-end;
}

.kerp-msg-label {
    font-size: 10.5px;
    font-weight: 600;
    color: var(--k-subtle);
    margin-bottom: 4px;
    padding: 0 2px;
}

.kerp-public-chat-bubble {
    max-width: 100%;
    padding: 11px 14px;
    border-radius: 20px 20px 20px 6px;
    font-size: 14px;
    line-height: 1.58;
    white-space: pre-wrap;
    word-break: break-word;
}

.kerp-msg-group.is-assistant .kerp-public-chat-bubble {
    background: var(--k-asst-bubble);
    color: #f1f5f9;
    border: 1px solid rgba(148, 163, 184, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.kerp-msg-group.is-visitor .kerp-public-chat-bubble {
    background: var(--k-user-bubble);
    color: var(--k-user-bubble-text);
    border: 0;
    border-radius: 20px 20px 6px 20px;
    font-weight: 500;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.kerp-public-chat-time {
    display: block;
    margin-top: 6px;
    font-size: 10.5px;
    color: var(--k-subtle);
}
.kerp-msg-group.is-visitor .kerp-public-chat-time {
    text-align: right;
    color: #475569;
    padding-right: 2px;
}

/* Thinking */
.kerp-public-chat-thinking {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 16px 6px 52px;
    padding: 10px 14px;
    border-radius: 20px 20px 20px 6px;
    border: 1px solid var(--k-border);
    background: var(--k-surface);
    color: var(--k-muted);
    font-size: 13px;
}

.kerp-public-chat-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(148, 163, 184, 0.3);
    border-top-color: var(--k-emerald);
    border-radius: 99px;
    animation: kerpChatSpin 0.75s linear infinite;
}

/* Compositor do input: ícones decorativos + campo + enviar */
.kerp-public-chat-footer {
    border-top: 1px solid var(--k-border);
    background: rgba(15, 23, 42, 0.95);
    padding: 8px 12px 6px;
    flex-shrink: 0;
}
.kerp-public-chat-error,
.kerp-public-chat-status {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.45;
}
.kerp-public-chat-error {
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid rgba(251, 113, 133, 0.3);
    background: rgba(244, 63, 94, 0.1);
    color: #fecdd3;
}
.kerp-public-chat-status {
    color: var(--k-subtle);
}
form.kerp-public-chat-input-shell {
    display: flex;
    align-items: center;
    gap: 0;
    min-height: 54px;
    padding: 3px 4px 3px 8px;
    border-radius: 18px;
    border: 1px solid var(--k-border);
    background: var(--k-surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}
form.kerp-public-chat-input-shell:focus-within {
    border-color: rgba(16, 185, 129, 0.35);
    box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.12);
}
.kerp-input-decor {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 0 2px 0 0;
    color: var(--k-subtle);
    opacity: 0.5;
    pointer-events: none;
    flex-shrink: 0;
}
.kerp-input-decor svg {
    display: block;
}
.kerp-public-chat-form {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    gap: 0;
}
.kerp-public-chat-textarea {
    flex: 1;
    min-width: 0;
    min-height: 40px;
    height: 40px;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0;
    padding: 9px 6px 7px 4px;
    max-height: 74px;
    overflow-y: auto;
}
.kerp-public-chat-send {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 13px;
    background: linear-gradient(180deg, #10b981 0%, #059669 100%);
    color: #fff;
    cursor: pointer;
    margin: 1px;
    transition: filter 0.2s, opacity 0.2s;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.kerp-public-chat-send:hover:not(:disabled),
.kerp-public-chat-send:focus-visible {
    filter: brightness(1.08);
    outline: none;
}

/* Bottom nav */
.kerp-public-chat-bottomnav {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 6px 4px 8px;
    border-top: 1px solid var(--k-border);
    background: rgba(2, 6, 23, 0.45);
    flex-shrink: 0;
}
.kerp-public-chat-bottomnav button {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 5px 10px;
    border: 0;
    background: none;
    color: var(--k-subtle);
    font: inherit;
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    border-radius: 12px;
    transition: color 0.2s, background 0.2s;
    flex: 1;
    max-width: 100px;
}
.kerp-public-chat-bottomnav button svg {
    display: block;
    opacity: 0.7;
    transition: opacity 0.2s, color 0.2s;
}
.kerp-public-chat-bottomnav button.is-active {
    color: #c7d2fe;
    background: rgba(165, 180, 252, 0.1);
}
.kerp-public-chat-bottomnav button.is-active svg {
    opacity: 1;
    color: #a5b4fc;
}
.kerp-public-chat-bottomnav button:hover:not(:disabled) {
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.04);
}
.kerp-bottomnav-txt {
    display: block;
    font-size: 10.5px;
    font-weight: 600;
    line-height: 1.2;
    margin-top: 1px;
}

@keyframes kerpChatSpin {
    to {
        transform: rotate(360deg);
    }
}

@media (max-width: 520px) {
    .progress-wrap {
        right: 16px !important;
        left: auto !important;
        bottom: 16px !important;
    }
    .kerp-public-chat-launcher {
        right: 16px;
        left: auto;
        bottom: 68px;
    }
    .kerp-public-chat-panel {
        left: 10px;
        right: 10px;
        bottom: max(10px, env(safe-area-inset-bottom));
        width: auto;
        height: calc(100dvh - 20px - env(safe-area-inset-bottom));
        max-height: none;
        border-radius: 18px;
    }
    .kerp-public-chat-topbar {
        padding: 9px 10px 7px;
    }
    .kerp-public-chat-logo-mark,
    .kerp-public-chat-icon-button {
        width: 32px;
        height: 32px;
        border-radius: 11px;
    }
    .kerp-public-chat-logo-text strong {
        font-size: 14px;
    }
    .kerp-public-chat-logo-text small,
    .kerp-public-chat-thread-meta .kerp-online-row {
        font-size: 10.5px;
    }
    .kerp-public-chat-hero {
        padding: 8px 10px 12px;
    }
    .kerp-public-chat-hero h1 {
        max-width: 300px;
        font-size: 20px;
        line-height: 1.15;
        white-space: normal;
    }
    .kerp-public-chat-agents {
        flex-wrap: wrap;
        row-gap: 6px;
    }
    .kerp-card h2,
    .kerp-public-chat-help h2 {
        line-height: 1.3;
    }
    .kerp-public-chat-lang span {
        display: none;
    }
    .kerp-public-chat-lang button {
        padding: 3px 9px;
        font-size: 11px;
    }
    .kerp-public-chat-thread-head {
        padding: 6px 12px 8px;
        gap: 10px;
    }
    .kerp-public-chat-thread-head .kerp-agent-ava {
        width: 38px;
        height: 38px;
        border-radius: 13px;
    }
    .kerp-public-chat-messages {
        padding: 12px 10px 8px;
    }
    .kerp-msg-ava {
        width: 28px;
        height: 28px;
        border-radius: 10px;
    }
    .kerp-msg-group.is-visitor {
        margin-left: 2%;
    }
    .kerp-msg-group.is-assistant {
        gap: 6px;
        margin-right: 0;
    }
    .kerp-public-chat-bubble {
        padding: 10px 12px;
        font-size: 13.5px;
        line-height: 1.55;
    }
    .kerp-public-chat-footer {
        padding: 7px 10px 5px;
    }
    form.kerp-public-chat-input-shell {
        min-height: 50px;
        border-radius: 17px;
    }
    .kerp-public-chat-textarea {
        min-height: 38px;
        height: 38px;
        max-height: 68px;
        padding-top: 8px;
    }
    .kerp-public-chat-send {
        width: 40px;
        height: 40px;
        flex-basis: 40px;
    }
    .kerp-public-chat-bottomnav {
        padding: 4px 3px 6px;
    }
    .kerp-public-chat-bottomnav button {
        padding: 4px 8px;
    }
    .kerp-public-chat-bottomnav button svg {
        width: 18px;
        height: 18px;
    }
    .kerp-bottomnav-txt {
        font-size: 10px;
    }
}
