.wim-app,
.wim-app * {
    box-sizing: border-box;
}

.wim-app {
    display: grid;
    grid-template-columns: 340px minmax(0, 1fr);
    min-height: 680px;
    max-height: 760px;
    border: 1px solid #dcdcde;
    border-radius: 16px;
    overflow: hidden;
    background: #ffffff;
    color: #1d2327;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.08);
}

.wim-sidebar {
    display: grid;
    grid-template-rows: auto auto 1fr;
    min-width: 0;
    border-right: 1px solid #dcdcde;
    background: #f6f7f7;
}

.wim-sidebar-header,
.wim-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px;
    border-bottom: 1px solid #dcdcde;
    background: #ffffff;
}

.wim-sidebar-header h2,
.wim-chat-header h3 {
    margin: 0;
    color: #1d2327;
    font-size: 18px;
    line-height: 1.25;
}

.wim-muted,
.wim-chat-header span {
    display: block;
    margin-top: 4px;
    color: #646970;
    font-size: 13px;
}

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

.wim-new-chat {
    padding: 14px;
    border-bottom: 1px solid #dcdcde;
    background: #ffffff;
}

.wim-new-chat label {
    display: block;
    margin-bottom: 8px;
    color: #1d2327;
    font-size: 13px;
    font-weight: 700;
}

.wim-search-row {
    display: flex;
    gap: 8px;
}

.wim-search-row input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2327;
}

.wim-user-results {
    display: grid;
    gap: 8px;
    max-height: 260px;
    margin-top: 12px;
    overflow: auto;
}

.wim-thread-list,
.wim-message-list {
    overflow: auto;
    min-width: 0;
}

.wim-thread-list {
    padding: 12px;
}

.wim-message-list {
    padding: 24px;
    background: linear-gradient(180deg, #fbfbfc 0%, #ffffff 100%);
}

.wim-chat-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
    min-width: 0;
}

.wim-empty-state,
.wim-placeholder,
.wim-help-text {
    display: grid;
    gap: 6px;
    padding: 22px;
    border: 1px dashed #c3c4c7;
    border-radius: 14px;
    color: #646970;
    background: #ffffff;
}

.wim-help-text {
    display: block;
    padding: 12px;
    font-size: 13px;
}

.wim-help-text.is-error {
    border-color: #f0b8bd;
    color: #b32d2e;
    background: #fcf0f1;
}

.wim-placeholder {
    min-height: 320px;
    place-content: center;
    text-align: center;
}

.wim-placeholder h3,
.wim-placeholder p {
    margin: 0;
}

.wim-composer {
    display: flex;
    align-items: flex-end;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid #dcdcde;
    background: #ffffff;
}

.wim-composer textarea {
    width: 100%;
    min-height: 44px;
    max-height: 140px;
    resize: none;
    padding: 11px 14px;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    background: #ffffff;
    color: #1d2327;
    font: inherit;
    line-height: 1.45;
}

.wim-composer textarea:focus,
.wim-search-row input:focus {
    border-color: #2271b1;
    outline: 2px solid rgba(34, 113, 177, 0.16);
}

.wim-button,
.wim-icon-button {
    min-height: 40px;
    padding: 0 16px;
    border: 0;
    border-radius: 11px;
    background: #2271b1;
    color: #ffffff;
    cursor: pointer;
    font-weight: 700;
    line-height: 1;
}

.wim-icon-button {
    display: inline-grid;
    width: 40px;
    padding: 0;
    place-items: center;
    border-radius: 999px;
    font-size: 24px;
}

.wim-button:hover,
.wim-icon-button:hover {
    background: #135e96;
    color: #ffffff;
}

.wim-button:disabled,
.wim-composer textarea:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.wim-button-secondary {
    background: #f0f0f1;
    color: #1d2327;
}

.wim-button-secondary:hover {
    background: #dcdcde;
    color: #1d2327;
}

.wim-notice {
    padding: 14px 16px;
    border-radius: 10px;
    border: 1px solid #dcdcde;
    background: #ffffff;
}

.wim-notice-warning {
    border-color: #dba617;
    background: #fcf9e8;
}

.wim-api-status {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f0f0f1;
    color: #50575e;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.wim-api-status[data-state="success"] {
    background: #edfaef;
    color: #008a20;
}

.wim-api-status[data-state="error"] {
    background: #fcf0f1;
    color: #b32d2e;
}

.wim-thread-item,
.wim-user-result {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid transparent;
    border-radius: 14px;
    background: transparent;
    color: inherit;
    cursor: pointer;
    text-align: left;
}

.wim-user-result {
    grid-template-columns: 40px minmax(0, 1fr);
    border-color: #dcdcde;
    background: #ffffff;
}

.wim-thread-item:hover,
.wim-thread-item.is-active,
.wim-user-result:hover {
    border-color: #c3d9ee;
    background: #ffffff;
}

.wim-thread-item.is-active {
    box-shadow: inset 3px 0 0 #2271b1;
}

.wim-avatar {
    display: inline-grid;
    width: 42px;
    height: 42px;
    overflow: hidden;
    place-items: center;
    border-radius: 999px;
    background: #dcdcde;
    color: #1d2327;
    font-weight: 800;
}

.wim-user-result .wim-avatar {
    width: 38px;
    height: 38px;
}

.wim-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wim-thread-body,
.wim-thread-meta,
.wim-user-result span:last-child {
    min-width: 0;
}

.wim-thread-body strong,
.wim-thread-body small,
.wim-user-result strong,
.wim-user-result small {
    display: block;
}

.wim-thread-body strong,
.wim-user-result strong {
    overflow: hidden;
    color: #1d2327;
    font-size: 14px;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-thread-body small,
.wim-user-result small {
    overflow: hidden;
    margin-top: 4px;
    color: #646970;
    font-size: 12px;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-thread-meta {
    display: grid;
    justify-items: end;
    gap: 6px;
}

.wim-thread-meta em {
    display: inline-grid;
    min-width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 999px;
    background: #d63638;
    color: #ffffff;
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
}

.wim-thread-meta small {
    color: #8c8f94;
    font-size: 11px;
    white-space: nowrap;
}

.wim-message {
    display: flex;
    justify-content: flex-start;
    margin-bottom: 12px;
}

.wim-message.is-mine {
    justify-content: flex-end;
}

.wim-message-bubble {
    width: fit-content;
    max-width: min(70%, 680px);
    padding: 11px 12px;
    border: 1px solid #dcdcde;
    border-radius: 16px 16px 16px 4px;
    background: #ffffff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
}

.wim-message.is-mine .wim-message-bubble {
    border-color: #c3d9ee;
    border-radius: 16px 16px 4px 16px;
    background: #f0f7ff;
}

.wim-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 6px;
}

.wim-message-meta strong {
    color: #1d2327;
    font-size: 12px;
    line-height: 1.2;
}

.wim-message-meta span {
    color: #8c8f94;
    font-size: 11px;
    white-space: nowrap;
}

.wim-message-content {
    color: #1d2327;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
}

@media (max-width: 900px) {
    .wim-app {
        grid-template-columns: 300px minmax(0, 1fr);
    }
}

@media (max-width: 782px) {
    .wim-app {
        grid-template-columns: 1fr;
        max-height: none;
    }

    .wim-sidebar {
        max-height: 360px;
        border-right: 0;
        border-bottom: 1px solid #dcdcde;
    }

    .wim-message-list {
        min-height: 360px;
    }

    .wim-message-bubble {
        max-width: 88%;
    }

    .wim-chat-header,
    .wim-header-actions {
        align-items: flex-start;
        flex-direction: column;
    }

    .wim-header-actions {
        width: 100%;
    }
}

.wim-attachment-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    background: #f6f7f7;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.wim-attachment-button:hover {
    border-color: #2271b1;
    background: #ffffff;
}

.wim-attachments {
    display: grid;
    gap: 10px;
    margin-top: 8px;
}

.wim-attachment-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    min-width: min(320px, 100%);
    padding: 10px;
    border: 1px solid #dcdcde;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.78);
}

.wim-attachment-preview {
    grid-column: 1 / -1;
    display: block;
    overflow: hidden;
    border-radius: 10px;
    background: #f0f0f1;
}

.wim-attachment-preview img {
    display: block;
    width: 100%;
    max-height: 240px;
    object-fit: cover;
}

.wim-attachment-info {
    min-width: 0;
}

.wim-attachment-info strong,
.wim-attachment-info span {
    display: block;
}

.wim-attachment-info strong {
    overflow: hidden;
    color: #1d2327;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-attachment-info span {
    margin-top: 3px;
    color: #646970;
    font-size: 12px;
}

.wim-attachment-download {
    align-self: center;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    background: #f0f0f1;
    color: #2271b1;
    font-size: 12px;
    font-weight: 800;
    line-height: 32px;
    text-decoration: none;
}

.wim-attachment-download:hover {
    background: #dcdcde;
    color: #135e96;
}

/* Support Chat Widget */
.wim-support-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.wim-support-bubble {
    width: 62px;
    height: 62px;
    border: 0;
    border-radius: 999px;
    background: #111827;
    color: #ffffff;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.28);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.wim-support-bubble:hover {
    transform: translateY(-2px);
    box-shadow: 0 22px 52px rgba(15, 23, 42, 0.35);
}

.wim-support-bubble-icon {
    font-size: 26px;
    line-height: 1;
}

.wim-support-bubble-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 12px;
    line-height: 20px;
}

.wim-support-panel {
    position: absolute;
    right: 0;
    bottom: 76px;
    width: min(380px, calc(100vw - 32px));
    max-height: min(640px, calc(100vh - 120px));
    border-radius: 22px;
    overflow: hidden;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.28);
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.wim-support-header {
    padding: 18px 20px;
    background: linear-gradient(135deg, #111827, #374151);
    color: #ffffff;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
}

.wim-support-header h3 {
    margin: 0;
    font-size: 18px;
    line-height: 1.25;
    color: inherit;
}

.wim-support-header p {
    margin: 5px 0 0;
    font-size: 13px;
    opacity: 0.84;
}

.wim-support-close {
    border: 0;
    background: rgba(255, 255, 255, 0.12);
    color: #ffffff;
    width: 32px;
    height: 32px;
    border-radius: 999px;
    cursor: pointer;
    font-size: 22px;
    line-height: 28px;
}

.wim-support-body {
    padding: 16px;
    background: #f8fafc;
}

.wim-support-status {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 14px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #475569;
    font-size: 13px;
}

.wim-support-status[data-status-type="error"] {
    color: #991b1b;
    background: #fef2f2;
    border-color: #fecaca;
}

.wim-support-status[data-status-type="success"] {
    color: #166534;
    background: #f0fdf4;
    border-color: #bbf7d0;
}

.wim-support-prechat {
    display: grid;
    gap: 10px;
}

.wim-support-prechat label {
    display: grid;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
}

.wim-support-prechat input,
.wim-support-prechat textarea,
.wim-support-composer textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #cbd5e1;
    border-radius: 13px;
    padding: 10px 12px;
    font: inherit;
    background: #ffffff;
    color: #111827;
    outline: none;
}

.wim-support-prechat input:focus,
.wim-support-prechat textarea:focus,
.wim-support-composer textarea:focus {
    border-color: #111827;
    box-shadow: 0 0 0 3px rgba(17, 24, 39, 0.09);
}

.wim-support-chat {
    display: grid;
    gap: 12px;
}

.wim-support-messages {
    max-height: 320px;
    overflow: auto;
    padding: 10px;
    border-radius: 16px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.wim-support-empty {
    color: #64748b;
    font-size: 13px;
    text-align: center;
    padding: 22px 8px;
}

.wim-support-message {
    display: flex;
    margin: 8px 0;
}

.wim-support-message-mine {
    justify-content: flex-end;
}

.wim-support-message-bubble {
    max-width: 78%;
    padding: 10px 12px;
    border-radius: 16px;
    background: #e5e7eb;
    color: #111827;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.wim-support-message-mine .wim-support-message-bubble {
    background: #111827;
    color: #ffffff;
    border-bottom-right-radius: 5px;
}

.wim-support-composer {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: end;
    gap: 8px;
}

.wim-support-composer textarea {
    resize: none;
    min-height: 44px;
    max-height: 120px;
}

@media (max-width: 600px) {
    .wim-support-widget {
        right: 16px;
        bottom: 16px;
    }

    .wim-support-panel {
        right: -8px;
        bottom: 74px;
        width: calc(100vw - 32px);
    }
}

/* Support Widget hardening hotfix — v0.9.1
   Keeps the widget visually isolated from RTL pages and aggressive theme/global form styles. */
.wim-support-widget,
.wim-support-widget * {
    box-sizing: border-box !important;
}

.wim-support-widget {
    direction: ltr !important;
    text-align: left !important;
    isolation: isolate !important;
    color-scheme: light !important;
    line-height: 1.4 !important;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif !important;
}

.wim-support-widget * {
    direction: ltr !important;
    text-align: left !important;
    font-family: inherit !important;
    letter-spacing: normal !important;
    text-transform: none !important;
}

.wim-support-widget [hidden] {
    display: none !important;
}

.wim-support-widget button,
.wim-support-widget input,
.wim-support-widget textarea {
    -webkit-appearance: none !important;
    appearance: none !important;
    box-shadow: none;
    font: inherit !important;
}

.wim-support-widget .wim-support-panel {
    display: block !important;
    width: min(380px, calc(100vw - 32px)) !important;
    max-height: min(640px, calc(100vh - 120px)) !important;
    overflow: hidden !important;
}

.wim-support-widget .wim-support-header {
    display: flex !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 14px !important;
}

.wim-support-widget .wim-support-header h3,
.wim-support-widget .wim-support-header p {
    margin-left: 0 !important;
    margin-right: 0 !important;
    text-align: left !important;
}

.wim-support-widget .wim-support-close {
    flex: 0 0 auto !important;
    display: inline-grid !important;
    place-items: center !important;
    width: 32px !important;
    min-width: 32px !important;
    max-width: 32px !important;
    height: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: rgba(255, 255, 255, 0.12) !important;
    color: #ffffff !important;
    font-size: 22px !important;
    font-weight: 400 !important;
    line-height: 1 !important;
}

.wim-support-widget .wim-support-body {
    max-height: calc(min(640px, calc(100vh - 120px)) - 82px) !important;
    overflow-y: auto !important;
    padding: 16px !important;
}

.wim-support-widget .wim-support-status {
    display: block !important;
    width: 100% !important;
    margin: 0 0 12px !important;
    line-height: 1.45 !important;
}

.wim-support-widget .wim-support-prechat,
.wim-support-widget .wim-support-chat {
    display: grid !important;
}

.wim-support-widget .wim-support-prechat {
    gap: 10px !important;
}

.wim-support-widget .wim-support-prechat label {
    display: grid !important;
    gap: 5px !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #475569 !important;
    font-size: 12px !important;
    font-weight: 700 !important;
    line-height: 1.3 !important;
}

.wim-support-widget .wim-support-prechat label span {
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}

.wim-support-widget .wim-support-prechat input,
.wim-support-widget .wim-support-prechat textarea,
.wim-support-widget .wim-support-composer textarea {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 13px !important;
    background: #ffffff !important;
    color: #111827 !important;
    padding: 10px 12px !important;
    outline: none !important;
    line-height: 1.45 !important;
}

.wim-support-widget .wim-support-prechat input {
    min-height: 44px !important;
    height: 44px !important;
}

.wim-support-widget .wim-support-prechat textarea {
    min-height: 94px !important;
    resize: vertical !important;
}

.wim-support-widget .wim-button,
.wim-support-widget .wim-support-start,
.wim-support-widget .wim-support-composer button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 16px !important;
    border: 0 !important;
    border-radius: 13px !important;
    background: #111827 !important;
    color: #ffffff !important;
    cursor: pointer !important;
    font-size: 14px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
    text-decoration: none !important;
}

.wim-support-widget .wim-support-start {
    width: 100% !important;
}

.wim-support-widget .wim-support-bubble {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 62px !important;
    min-width: 62px !important;
    height: 62px !important;
    min-height: 62px !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #111827 !important;
    color: #ffffff !important;
}

.wim-support-widget .wim-support-composer {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    align-items: end !important;
    gap: 8px !important;
}

@media (max-width: 600px) {
    .wim-support-widget .wim-support-panel {
        right: -8px !important;
        bottom: 74px !important;
        width: calc(100vw - 32px) !important;
    }
}

.wim-voice-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    background: #f6f7f7;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.wim-voice-button:hover:not(:disabled),
.wim-support-voice-button:hover:not(:disabled) {
    border-color: #2271b1;
    background: #ffffff;
}

.wim-voice-button:disabled,
.wim-support-voice-button:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

.wim-voice-button[data-wim-recording="true"],
.wim-support-voice-button[data-wim-recording="true"] {
    border-color: #dc2626;
    background: #fee2e2;
    color: #991b1b;
}

.wim-voice-card audio,
.wim-support-widget .wim-voice-card audio {
    display: block;
    width: 100%;
    min-width: 220px;
}

.wim-support-widget .wim-support-composer {
    grid-template-columns: auto minmax(0, 1fr) auto !important;
}

.wim-support-widget .wim-support-voice-button {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 44px !important;
    height: auto !important;
    width: auto !important;
    margin: 0 !important;
    padding: 0 12px !important;
    border: 1px solid #cbd5e1 !important;
    border-radius: 13px !important;
    background: #ffffff !important;
    color: #111827 !important;
    cursor: pointer !important;
    font-size: 13px !important;
    font-weight: 800 !important;
    line-height: 1 !important;
}

.wim-support-widget .wim-support-message .wim-attachments {
    margin-top: 0 !important;
}

.wim-support-widget .wim-support-message .wim-attachment-card {
    min-width: 0 !important;
    border-color: rgba(203, 213, 225, 0.75) !important;
    background: rgba(255, 255, 255, 0.55) !important;
}

.wim-support-widget .wim-support-composer .wim-support-voice-button {
    border: 1px solid #cbd5e1 !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.wim-support-widget .wim-support-composer .wim-support-voice-button[data-wim-recording="true"] {
    border-color: #dc2626 !important;
    background: #fee2e2 !important;
    color: #991b1b !important;
}

/* Signed-in widget launcher hotfix — v0.10.1 */
.wim-support-widget .wim-support-panel[hidden] {
    display: none !important;
}

.wim-support-widget .wim-support-panel-messenger {
    width: min(920px, calc(100vw - 32px)) !important;
    max-height: min(760px, calc(100vh - 96px)) !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-body {
    max-height: calc(min(760px, calc(100vh - 96px)) - 82px) !important;
}

.wim-support-signed-in {
    display: grid !important;
    gap: 12px !important;
}

.wim-support-user-card {
    display: grid !important;
    gap: 2px !important;
    padding: 12px !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 14px !important;
    background: #ffffff !important;
    color: #111827 !important;
}

.wim-support-user-card strong {
    font-size: 14px !important;
    line-height: 1.3 !important;
}

.wim-support-user-card span {
    color: #64748b !important;
    font-size: 12px !important;
}

.wim-support-launcher-actions {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
}

.wim-support-widget .wim-support-launcher-actions .wim-button,
.wim-support-widget .wim-support-launcher-actions .wim-button-secondary {
    width: auto !important;
    min-width: 0 !important;
    text-decoration: none !important;
}

.wim-support-widget .wim-support-launcher-actions .wim-button-secondary {
    background: #ffffff !important;
    color: #111827 !important;
    border: 1px solid #cbd5e1 !important;
}

.wim-support-inline-messenger {
    margin-top: 4px !important;
}

.wim-support-inline-messenger .wim-app {
    width: 100% !important;
    min-height: 540px !important;
    max-height: min(640px, calc(100vh - 240px)) !important;
    border-radius: 16px !important;
    box-shadow: none !important;
    text-align: left !important;
    direction: ltr !important;
}

.wim-support-inline-messenger .wim-sidebar-header,
.wim-support-inline-messenger .wim-chat-header {
    padding: 14px !important;
}

.wim-support-inline-messenger .wim-new-chat {
    padding: 12px !important;
}

.wim-support-inline-messenger .wim-message-list,
.wim-support-inline-messenger .wim-thread-list {
    min-height: 0 !important;
}

@media (max-width: 760px) {
    .wim-support-widget .wim-support-panel-messenger {
        right: -8px !important;
        width: calc(100vw - 32px) !important;
    }

    .wim-support-inline-messenger .wim-app {
        grid-template-columns: 1fr !important;
        min-height: 620px !important;
    }

    .wim-support-inline-messenger .wim-sidebar {
        min-height: 260px !important;
        border-right: 0 !important;
        border-bottom: 1px solid #dcdcde !important;
    }
}

/* Group Chat Foundation */
.wim-new-chat-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
}

.wim-new-chat-header strong {
    color: #1d2327;
    font-size: 14px;
}

.wim-new-chat-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    margin-bottom: 12px;
    padding: 4px;
    border-radius: 12px;
    background: #f0f0f1;
}

.wim-new-chat-tabs button {
    min-height: 34px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: #50575e;
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
}

.wim-new-chat-tabs button.is-active {
    background: #ffffff;
    color: #1d2327;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

.wim-new-chat-panel {
    display: grid;
    gap: 10px;
}

.wim-new-chat-panel[hidden] {
    display: none;
}

.wim-group-title-input {
    width: 100%;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid #c3c4c7;
    border-radius: 10px;
    background: #ffffff;
    color: #1d2327;
}

.wim-group-title-input:focus {
    border-color: #2271b1;
    outline: 2px solid rgba(34, 113, 177, 0.16);
}

.wim-group-selected {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.wim-group-selected .wim-help-text {
    width: 100%;
    margin: 0;
}

.wim-group-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%;
    min-height: 30px;
    padding: 0 8px 0 10px;
    border: 1px solid #c3d9ee;
    border-radius: 999px;
    background: #f0f7ff;
    color: #1d2327;
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
}

.wim-group-chip span {
    overflow: hidden;
    max-width: 190px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-group-chip b {
    display: inline-grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 999px;
    background: #dcdcde;
    color: #1d2327;
    font-size: 13px;
    line-height: 1;
}

.wim-create-group-button {
    width: 100%;
    margin-top: 2px;
}

.wim-user-result:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* v0.12.0 — User directory and moderation */
.wim-thread-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.wim-thread-actions[hidden] {
    display: none;
}

.wim-button-small {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
}

.wim-message-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.wim-message-actions button {
    min-height: 26px;
    padding: 0 8px;
    border: 1px solid #dcdcde;
    border-radius: 999px;
    background: #ffffff;
    color: #50575e;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
}

.wim-message-actions button:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.wim-user-results .wim-help-text {
    margin: 0;
}

/* v0.15.0 — Support operator inbox improvements */
.wim-support-inbox-controls {
    border-bottom: 1px solid #e5e7eb;
    padding: 12px;
    background: #f8fafc;
}

.wim-support-inbox-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.wim-support-inbox-title strong {
    color: #0f172a;
    font-size: 13px;
}

.wim-support-inbox-title span {
    color: #64748b;
    font-size: 11px;
}

.wim-support-filter-grid {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.wim-support-filter-grid button {
    appearance: none;
    background: #ffffff;
    border: 1px solid #dbe3ef;
    border-radius: 10px;
    color: #334155;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    line-height: 1.1;
    padding: 8px 6px;
    text-align: center;
}

.wim-support-filter-grid button.is-active,
.wim-support-filter-grid button:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
}

.wim-message.is-internal-note {
    justify-content: center;
}

.wim-message.is-internal-note .wim-message-bubble {
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    box-shadow: none;
    color: #92400e;
    max-width: 78%;
}

.wim-message.is-internal-note .wim-message-meta strong {
    color: #92400e;
}

.wim-message.is-internal-note .wim-message-content {
    color: #78350f;
    font-style: italic;
}

/* v0.15.0 — UI polish, modal actions, and stronger LTR isolation */
.wim-app,
.wim-app * {
    direction: ltr;
    text-align: left;
}

.wim-app button,
.wim-app input,
.wim-app textarea,
.wim-app select {
    font: inherit;
}

.wim-app button {
    appearance: none;
}

.wim-app .wim-button.is-danger,
.wim-modal .wim-button.is-danger {
    background: #b91c1c;
    color: #ffffff;
}

.wim-app .wim-button.is-danger:hover,
.wim-modal .wim-button.is-danger:hover {
    background: #991b1b;
    color: #ffffff;
}

.wim-thread-body small b {
    display: inline-flex;
    align-items: center;
    min-height: 18px;
    padding: 0 7px;
    border-radius: 999px;
    background: #eef2ff;
    color: #3730a3;
    font-size: 10px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.wim-thread-item .wim-thread-body small {
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wim-active-thread-meta h3 {
    overflow: hidden;
    max-width: 520px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-active-thread-meta span {
    max-width: 720px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-new-chat {
    max-height: 520px;
    overflow: auto;
}

.wim-user-results::-webkit-scrollbar,
.wim-thread-list::-webkit-scrollbar,
.wim-message-list::-webkit-scrollbar,
.wim-support-widget .wim-support-body::-webkit-scrollbar,
.wim-support-widget .wim-support-messages::-webkit-scrollbar {
    width: 8px;
}

.wim-user-results::-webkit-scrollbar-thumb,
.wim-thread-list::-webkit-scrollbar-thumb,
.wim-message-list::-webkit-scrollbar-thumb,
.wim-support-widget .wim-support-body::-webkit-scrollbar-thumb,
.wim-support-widget .wim-support-messages::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(100, 116, 139, 0.35);
}

.wim-modal-layer,
.wim-modal-layer * {
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

.wim-modal-layer {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    padding: 18px;
    background: rgba(15, 23, 42, 0.52);
    backdrop-filter: blur(4px);
}

.wim-modal {
    width: min(460px, 100%);
}

.wim-modal-card {
    overflow: hidden;
    margin: 0;
    border: 1px solid rgba(148, 163, 184, 0.35);
    border-radius: 18px;
    background: #ffffff;
    color: #0f172a;
    box-shadow: 0 28px 70px rgba(15, 23, 42, 0.30);
}

.wim-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.wim-modal-header h3 {
    margin: 0;
    color: #0f172a;
    font-size: 16px;
    line-height: 1.25;
}

.wim-modal-header button {
    display: inline-grid;
    width: 32px;
    height: 32px;
    padding: 0;
    place-items: center;
    border: 0;
    border-radius: 999px;
    background: #e5e7eb;
    color: #334155;
    cursor: pointer;
    font-size: 20px;
    line-height: 1;
}

.wim-modal-body {
    display: grid;
    gap: 14px;
    padding: 18px;
}

.wim-modal-body p {
    margin: 0;
    color: #475569;
    font-size: 14px;
    line-height: 1.55;
}

.wim-modal-field {
    display: grid;
    gap: 7px;
    margin: 0;
}

.wim-modal-field span {
    color: #334155;
    font-size: 12px;
    font-weight: 800;
}

.wim-modal-field textarea,
.wim-modal-field input,
.wim-modal-field select {
    width: 100%;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    background: #ffffff;
    color: #0f172a;
    outline: none;
    padding: 10px 12px;
    line-height: 1.45;
}

.wim-modal-field textarea {
    resize: vertical;
}

.wim-modal-field textarea:focus,
.wim-modal-field input:focus,
.wim-modal-field select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.wim-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 14px 18px 18px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.wim-support-widget .wim-support-panel {
    transform-origin: right bottom;
    animation: wimPanelIn 0.16s ease-out;
}

@keyframes wimPanelIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wim-support-widget .wim-support-message-bubble {
    box-shadow: 0 6px 18px rgba(15, 23, 42, 0.06) !important;
}

.wim-support-message-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 5px;
    opacity: 0.78;
}

.wim-support-message-meta strong,
.wim-support-message-meta span {
    color: inherit !important;
    font-size: 10px !important;
    line-height: 1.2 !important;
}

.wim-support-message-meta span {
    white-space: nowrap;
}

.wim-support-widget .wim-support-signed-in .wim-support-status,
.wim-support-widget .wim-support-status {
    overflow-wrap: anywhere;
}

.wim-support-widget .wim-support-launcher-actions {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.wim-support-widget .wim-support-launcher-actions .wim-button {
    width: 100% !important;
    min-height: 42px !important;
    text-align: center !important;
}

.wim-support-widget .wim-support-inline-messenger .wim-thread-body small b {
    background: #eef2ff !important;
    color: #3730a3 !important;
}

@media (max-width: 782px) {
    .wim-active-thread-meta h3,
    .wim-active-thread-meta span {
        max-width: 100%;
        white-space: normal;
    }

    .wim-composer {
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
    }

    .wim-composer textarea {
        min-width: 0;
    }
}

@media (max-width: 520px) {
    .wim-support-widget .wim-support-launcher-actions {
        grid-template-columns: 1fr !important;
    }

    .wim-modal-footer {
        flex-direction: column-reverse;
    }

    .wim-modal-footer .wim-button {
        width: 100%;
    }
}


/* v0.17.0 — Demo UX bug fix and mobile pass */
.wim-mobile-back {
    display: none;
    align-items: center;
    justify-content: center;
    min-width: 38px;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid #dbe3ef;
    border-radius: 999px;
    background: #ffffff;
    color: #0f172a;
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
    line-height: 1;
}

.wim-mobile-back:hover {
    border-color: #2271b1;
    color: #2271b1;
}

.wim-app {
    width: 100%;
    isolation: isolate;
}

.wim-chat-header {
    min-width: 0;
}

.wim-active-thread-meta {
    min-width: 0;
    flex: 1 1 auto;
}

.wim-header-actions {
    min-width: 0;
    flex: 0 0 auto;
}

.wim-composer .wim-button,
.wim-composer .wim-voice-button,
.wim-composer .wim-attachment-button {
    flex: 0 0 auto;
}

.wim-voice-button {
    min-height: 44px;
    padding: 0 14px;
    border: 1px solid #c3c4c7;
    border-radius: 12px;
    background: #f6f7f7;
    color: #1d2327;
    cursor: pointer;
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
}

.wim-voice-button:hover:not(:disabled),
.wim-voice-button[data-wim-recording="true"] {
    border-color: #b91c1c;
    background: #fef2f2;
    color: #b91c1c;
}

.wim-thread-item,
.wim-user-result,
.wim-new-chat-tabs button,
.wim-support-filter-grid button {
    -webkit-tap-highlight-color: transparent;
}

@media (max-width: 782px) {
    .wim-app {
        position: relative;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: minmax(0, 1fr);
        height: min(760px, calc(100dvh - 28px));
        min-height: 600px;
        max-height: none;
    }

    .wim-sidebar,
    .wim-chat-panel {
        grid-column: 1;
        grid-row: 1;
        min-height: 0;
        max-height: none;
        height: 100%;
    }

    .wim-sidebar {
        display: grid;
        border-right: 0;
        border-bottom: 0;
    }

    .wim-chat-panel {
        display: none;
    }

    .wim-app.is-chat-open .wim-sidebar {
        display: none;
    }

    .wim-app.is-chat-open .wim-chat-panel {
        display: grid;
    }

    .wim-mobile-back {
        display: inline-flex;
    }

    .wim-chat-header {
        display: flex;
        align-items: center;
        flex-direction: row;
        gap: 10px;
        padding: 12px;
    }

    .wim-header-actions {
        width: auto;
        align-items: flex-end;
        flex: 0 0 auto;
    }

    .wim-thread-actions {
        max-width: 100%;
        justify-content: flex-end;
    }

    .wim-thread-actions .wim-button-small {
        min-height: 28px;
        padding: 0 8px;
        font-size: 11px;
    }

    .wim-api-status,
    .wim-header-actions [data-wim-refresh] {
        display: none;
    }

    .wim-active-thread-meta h3,
    .wim-active-thread-meta span {
        max-width: calc(100vw - 190px);
    }

    .wim-sidebar-header {
        padding: 14px;
    }

    .wim-new-chat {
        max-height: calc(100dvh - 180px);
        padding: 12px;
    }

    .wim-thread-list {
        min-height: 0;
        padding: 10px;
    }

    .wim-message-list {
        min-height: 0;
        padding: 14px 12px;
    }

    .wim-message-bubble {
        max-width: 92%;
    }

    .wim-composer {
        position: sticky;
        bottom: 0;
        z-index: 2;
        display: grid;
        grid-template-columns: auto auto minmax(0, 1fr) auto;
        gap: 8px;
        padding: 10px;
        background: #ffffff;
        box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.06);
    }

    .wim-composer textarea {
        min-height: 42px;
        padding: 10px 12px;
    }

    .wim-composer .wim-button,
    .wim-voice-button,
    .wim-attachment-button {
        min-height: 42px;
        padding: 0 11px;
        font-size: 12px;
    }

    .wim-support-inline-messenger .wim-app {
        height: min(680px, calc(100dvh - 190px)) !important;
        min-height: 540px !important;
    }
}

@media (max-width: 520px) {
    .wim-app {
        min-height: 560px;
        height: calc(100dvh - 20px);
        border-radius: 14px;
    }

    .wim-sidebar-header h2,
    .wim-chat-header h3 {
        font-size: 16px;
    }

    .wim-muted,
    .wim-chat-header span {
        font-size: 12px;
    }

    .wim-thread-item {
        grid-template-columns: 40px minmax(0, 1fr) auto;
        padding: 9px;
    }

    .wim-avatar {
        width: 38px;
        height: 38px;
    }

    .wim-attachment-card {
        grid-template-columns: 1fr;
    }

    .wim-attachment-download {
        justify-self: start;
    }

    .wim-composer {
        grid-template-columns: auto auto minmax(0, 1fr);
    }

    .wim-composer [data-wim-send-button] {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (max-width: 480px) {
    body.wim-support-widget-open {
        overflow: hidden;
    }

    .wim-support-widget {
        right: 12px !important;
        bottom: 12px !important;
        left: auto !important;
    }

    .wim-support-widget .wim-support-panel {
        position: fixed !important;
        right: 10px !important;
        bottom: 78px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100dvh - 96px) !important;
        border-radius: 18px !important;
    }

    .wim-support-widget .wim-support-panel-messenger {
        top: 10px !important;
        bottom: 10px !important;
        max-height: none !important;
    }

    .wim-support-widget .wim-support-body {
        max-height: none !important;
    }

    .wim-support-inline-messenger .wim-app {
        height: calc(100dvh - 190px) !important;
        min-height: 460px !important;
        border-radius: 14px !important;
    }

    .wim-support-launcher-actions {
        display: grid !important;
    }

    .wim-support-widget .wim-support-launcher-actions .wim-button,
    .wim-support-widget .wim-support-launcher-actions .wim-button-secondary {
        width: 100% !important;
        justify-content: center !important;
    }
}

/* v0.19.0 — Layout hardening, viewport-safe panels, and scroll containment */
html body.wim-support-widget-open {
    overflow-x: hidden !important;
}

.wim-app {
    max-width: 100% !important;
    width: 100% !important;
    height: min(760px, calc(100dvh - 150px));
    min-height: 620px;
    grid-template-columns: minmax(280px, 340px) minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    overflow: hidden !important;
}

.wim-app.wim-app-compact {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 16px !important;
}

.wim-sidebar,
.wim-chat-panel,
.wim-thread-list,
.wim-message-list,
.wim-new-chat,
.wim-composer,
.wim-composer textarea,
.wim-active-thread-meta,
.wim-header-actions {
    min-width: 0 !important;
}

.wim-sidebar,
.wim-chat-panel {
    min-height: 0 !important;
    overflow: hidden !important;
}

.wim-thread-list,
.wim-message-list {
    min-height: 0 !important;
    overscroll-behavior: contain;
}

.wim-chat-header {
    flex-wrap: nowrap !important;
    min-height: 72px;
}

.wim-active-thread-meta h3,
.wim-active-thread-meta span {
    max-width: 100% !important;
}

.wim-thread-actions {
    justify-content: flex-end;
}

.wim-thread-actions .wim-button-small,
.wim-message-actions button {
    border-radius: 999px !important;
}

.wim-message-bubble {
    max-width: min(76%, 680px) !important;
    min-width: 0 !important;
}

.wim-message.is-internal-note .wim-message-bubble {
    max-width: min(82%, 720px) !important;
}

.wim-message-content,
.wim-attachment-info strong,
.wim-attachment-info span {
    overflow-wrap: anywhere;
}

.wim-voice-card audio,
.wim-support-widget .wim-voice-card audio {
    min-width: 0 !important;
    max-width: 100% !important;
}

/* Logged-in floating messenger: make the popup behave like a viewport-safe app shell. */
.wim-support-widget .wim-support-panel-messenger {
    position: fixed !important;
    top: 20px !important;
    right: 24px !important;
    bottom: 96px !important;
    left: auto !important;
    width: min(980px, calc(100vw - 48px)) !important;
    height: auto !important;
    max-height: none !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-header {
    flex: 0 0 auto !important;
    min-height: 82px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-body {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    padding: 16px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-status,
.wim-support-widget .wim-support-panel-messenger .wim-support-user-card,
.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
    flex: 0 0 auto !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-status,
.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-user-card {
    display: none !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-signed-in {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    display: flex !important;
    flex-direction: column !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
    margin-bottom: 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    overflow: hidden !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger[hidden] {
    display: none !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-app {
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    width: 100% !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-sidebar,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-chat-panel {
    min-height: 0 !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-message-list,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-thread-list,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-new-chat {
    min-height: 0 !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-composer {
    flex-shrink: 0 !important;
}

@media (max-width: 980px) {
    .wim-app {
        grid-template-columns: minmax(260px, 310px) minmax(0, 1fr) !important;
    }

    .wim-support-widget .wim-support-panel-messenger {
        left: 16px !important;
        right: 16px !important;
        width: auto !important;
    }
}

@media (max-width: 782px) {
    .wim-app {
        grid-template-columns: 1fr !important;
        height: min(740px, calc(100dvh - 28px)) !important;
        min-height: 560px !important;
    }

    .wim-app.wim-app-compact {
        height: 100% !important;
        min-height: 0 !important;
    }

    .wim-support-widget .wim-support-panel-messenger {
        top: 10px !important;
        right: 10px !important;
        bottom: 86px !important;
        left: 10px !important;
        width: auto !important;
        border-radius: 18px !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-body {
        padding: 10px !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
        grid-template-columns: 1fr !important;
    }

    .wim-message-bubble {
        max-width: 92% !important;
    }
}

@media (max-width: 520px) {
    .wim-app {
        height: calc(100dvh - 20px) !important;
        min-height: 520px !important;
    }

    .wim-app.wim-app-compact {
        height: 100% !important;
        min-height: 0 !important;
    }

    .wim-support-widget .wim-support-panel-messenger {
        top: 8px !important;
        right: 8px !important;
        bottom: 82px !important;
        left: 8px !important;
    }

    .wim-composer {
        grid-template-columns: auto auto minmax(0, 1fr) !important;
    }

    .wim-composer [data-wim-send-button] {
        grid-column: 1 / -1 !important;
        width: 100% !important;
    }
}


/* v1.1.0 — UI / Product Polish: app-like shell, refined design system, and responsive visual pass */
.wim-app,
.wim-support-widget,
.wim-modal-layer {
    --wim-bg: #f3f6fb;
    --wim-surface: #ffffff;
    --wim-surface-soft: #f8fafc;
    --wim-surface-strong: #eef3f9;
    --wim-border: #d8e2ef;
    --wim-border-strong: #c5d3e4;
    --wim-text: #0f172a;
    --wim-text-soft: #52607a;
    --wim-text-muted: #708199;
    --wim-primary: #15263f;
    --wim-primary-2: #223b63;
    --wim-primary-soft: #e9f1ff;
    --wim-primary-line: #b7cdf4;
    --wim-success-bg: #ecfdf3;
    --wim-success-text: #157347;
    --wim-danger-bg: #fef2f2;
    --wim-danger-text: #b42318;
    --wim-warning-bg: #fff8e6;
    --wim-warning-text: #9a6700;
    --wim-shadow: 0 22px 60px rgba(15, 23, 42, 0.12);
    --wim-shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.07);
    --wim-radius-xl: 24px;
    --wim-radius-lg: 18px;
    --wim-radius-md: 14px;
    --wim-radius-sm: 12px;
}

.wim-app {
    width: min(100%, 1280px) !important;
    margin: 0 auto;
    border: 1px solid var(--wim-border) !important;
    border-radius: var(--wim-radius-xl) !important;
    background: var(--wim-surface) !important;
    box-shadow: var(--wim-shadow) !important;
    color: var(--wim-text);
}

.wim-app:not(.wim-app-compact) {
    min-height: 680px !important;
    height: min(820px, calc(100dvh - 120px)) !important;
}

.wim-sidebar {
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fc 100%) !important;
    border-right: 1px solid var(--wim-border) !important;
}

.wim-sidebar-header,
.wim-chat-header {
    padding: 18px 20px !important;
    background: rgba(255, 255, 255, 0.9) !important;
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--wim-border) !important;
}

.wim-sidebar-header h2,
.wim-chat-header h3,
.wim-new-chat-header strong {
    color: var(--wim-text) !important;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.wim-sidebar-header h2 {
    font-size: 32px !important;
}

.wim-chat-header h3 {
    font-size: 26px !important;
}

.wim-muted,
.wim-chat-header span,
.wim-support-inbox-title span,
.wim-thread-body small,
.wim-user-result small,
.wim-help-text {
    color: var(--wim-text-soft) !important;
}

.wim-icon-button,
.wim-button {
    min-height: 42px !important;
    border-radius: 14px !important;
    border: 1px solid transparent;
    background: linear-gradient(180deg, var(--wim-primary), var(--wim-primary-2)) !important;
    color: #fff !important;
    box-shadow: 0 8px 18px rgba(21, 38, 63, 0.18);
    transition: transform .16s ease, box-shadow .16s ease, background .16s ease, border-color .16s ease;
}

.wim-icon-button {
    width: 42px !important;
    border-radius: 16px !important;
    font-size: 22px !important;
}

.wim-button:hover,
.wim-icon-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(21, 38, 63, 0.2);
    background: linear-gradient(180deg, #1b3153, #274776) !important;
}

.wim-button-secondary,
.wim-attachment-button,
.wim-voice-button,
.wim-message-actions button,
.wim-thread-actions .wim-button-small,
.wim-mobile-back,
.wim-support-filter-grid button,
.wim-new-chat-tabs button,
.wim-attachment-download {
    background: var(--wim-surface) !important;
    color: var(--wim-text) !important;
    border: 1px solid var(--wim-border) !important;
    box-shadow: none !important;
}

.wim-button-secondary:hover,
.wim-attachment-button:hover,
.wim-voice-button:hover:not(:disabled),
.wim-message-actions button:hover,
.wim-thread-actions .wim-button-small:hover,
.wim-mobile-back:hover,
.wim-support-filter-grid button:hover,
.wim-new-chat-tabs button:hover,
.wim-attachment-download:hover {
    background: var(--wim-primary-soft) !important;
    color: var(--wim-primary) !important;
    border-color: var(--wim-primary-line) !important;
}

.wim-api-status {
    background: #eef2f7 !important;
    color: var(--wim-text-soft) !important;
    border: 1px solid var(--wim-border) !important;
}

.wim-api-status[data-state="success"] {
    background: var(--wim-success-bg) !important;
    color: var(--wim-success-text) !important;
    border-color: #b7ebc9 !important;
}

.wim-thread-list,
.wim-message-list {
    padding: 16px !important;
}

.wim-message-list {
    background: radial-gradient(circle at top, #fbfdff 0%, #f7faff 35%, #f4f8fd 100%) !important;
}

.wim-new-chat,
.wim-support-inbox-controls {
    padding: 14px !important;
    background: rgba(255,255,255,0.74) !important;
    border-bottom: 1px solid var(--wim-border) !important;
}

.wim-new-chat {
    border-top: 1px solid rgba(255,255,255,0.7);
}

.wim-search-row input,
.wim-group-title-input,
.wim-composer textarea,
.wim-modal-field textarea,
.wim-modal-field input,
.wim-modal-field select,
.wim-support-prechat input,
.wim-support-prechat textarea,
.wim-support-composer textarea {
    border: 1px solid var(--wim-border) !important;
    border-radius: 14px !important;
    background: #fff !important;
    color: var(--wim-text) !important;
    box-shadow: inset 0 1px 2px rgba(15,23,42,0.02);
}

.wim-search-row input:focus,
.wim-group-title-input:focus,
.wim-composer textarea:focus,
.wim-modal-field textarea:focus,
.wim-modal-field input:focus,
.wim-modal-field select:focus,
.wim-support-prechat input:focus,
.wim-support-prechat textarea:focus,
.wim-support-composer textarea:focus {
    border-color: #7da2df !important;
    outline: none !important;
    box-shadow: 0 0 0 4px rgba(34, 113, 177, 0.10) !important;
}

.wim-new-chat-tabs,
.wim-support-filter-grid {
    gap: 8px !important;
}

.wim-new-chat-tabs {
    background: transparent !important;
    padding: 0 !important;
}

.wim-new-chat-tabs button,
.wim-support-filter-grid button {
    min-height: 40px !important;
    border-radius: 12px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.wim-new-chat-tabs button.is-active,
.wim-support-filter-grid button.is-active {
    background: linear-gradient(180deg, var(--wim-primary), var(--wim-primary-2)) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 18px rgba(21, 38, 63, 0.16);
}

.wim-thread-item,
.wim-user-result {
    gap: 12px !important;
    padding: 13px !important;
    border: 1px solid transparent !important;
    border-radius: 18px !important;
    background: rgba(255,255,255,0.78) !important;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.03);
    transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease, background .16s ease;
}

.wim-thread-item:hover,
.wim-thread-item.is-active,
.wim-user-result:hover {
    transform: translateY(-1px);
    border-color: var(--wim-primary-line) !important;
    background: #fff !important;
    box-shadow: var(--wim-shadow-soft);
}

.wim-thread-item.is-active {
    box-shadow: inset 4px 0 0 var(--wim-primary), var(--wim-shadow-soft) !important;
}

.wim-avatar {
    background: linear-gradient(180deg, #dce7f5, #c7d8ef) !important;
    color: var(--wim-primary) !important;
    border: 1px solid rgba(21,38,63,0.08);
}

.wim-thread-body strong,
.wim-user-result strong {
    color: var(--wim-text) !important;
    font-size: 14px !important;
    font-weight: 800;
}

.wim-thread-meta em {
    min-width: 26px !important;
    height: 26px !important;
    background: linear-gradient(180deg, #ef4444, #dc2626) !important;
    font-weight: 900;
}

.wim-thread-meta small,
.wim-message-meta span {
    color: var(--wim-text-muted) !important;
}

.wim-placeholder,
.wim-empty-state,
.wim-help-text,
.wim-support-status,
.wim-support-user-card,
.wim-modal-card {
    border-color: var(--wim-border) !important;
}

.wim-placeholder,
.wim-empty-state {
    border-style: solid !important;
    background: linear-gradient(180deg, #fff 0%, #fbfdff 100%) !important;
    box-shadow: 0 8px 20px rgba(15,23,42,0.03);
}

.wim-composer {
    padding: 16px 18px !important;
    background: rgba(255,255,255,0.95) !important;
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--wim-border) !important;
}

.wim-message {
    margin-bottom: 16px !important;
}

.wim-message-bubble {
    border: 1px solid var(--wim-border) !important;
    border-radius: 22px 22px 22px 8px !important;
    background: rgba(255,255,255,0.96) !important;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.05) !important;
    padding: 12px 14px !important;
}

.wim-message.is-mine .wim-message-bubble {
    border-color: #c9d9f3 !important;
    border-radius: 22px 22px 8px 22px !important;
    background: linear-gradient(180deg, #eef5ff, #e8f0fc) !important;
}

.wim-message-meta strong,
.wim-message-content,
.wim-attachment-info strong,
.wim-attachment-info span {
    color: var(--wim-text) !important;
}

.wim-message-content {
    font-size: 14px !important;
    line-height: 1.6 !important;
}

.wim-attachment-card {
    padding: 12px !important;
    border-radius: 16px !important;
    border: 1px solid var(--wim-border) !important;
    background: rgba(255,255,255,0.72) !important;
}

.wim-attachment-preview,
.wim-support-messages,
.wim-support-prechat,
.wim-support-chat,
.wim-support-inline-messenger .wim-app,
.wim-support-inline-messenger {
    border-radius: 18px !important;
}

.wim-message-actions {
    border-top: 1px solid rgba(112,129,153,0.14) !important;
    margin-top: 10px !important;
    padding-top: 10px !important;
}

.wim-message-actions button,
.wim-thread-actions .wim-button-small {
    min-height: 30px !important;
    padding: 0 10px !important;
    font-weight: 800 !important;
}

.wim-support-widget {
    right: 22px !important;
    bottom: 22px !important;
}

.wim-support-bubble {
    width: 64px !important;
    height: 64px !important;
    background: linear-gradient(180deg, #18273f, #253d63) !important;
    border: 1px solid rgba(255,255,255,0.16) !important;
    box-shadow: 0 22px 52px rgba(15,23,42,0.28) !important;
}

.wim-support-bubble-icon {
    font-size: 28px !important;
}

.wim-support-panel {
    width: min(420px, calc(100vw - 32px)) !important;
    border-radius: 24px !important;
    border: 1px solid rgba(195, 211, 228, 0.8) !important;
    box-shadow: 0 32px 80px rgba(15, 23, 42, 0.20) !important;
}

.wim-support-header {
    padding: 20px 22px !important;
    background: linear-gradient(135deg, #15263f, #2b456f) !important;
}

.wim-support-header h3 {
    font-size: 19px !important;
    font-weight: 800 !important;
    letter-spacing: -0.02em;
}

.wim-support-header p {
    margin-top: 6px !important;
    font-size: 13px !important;
    opacity: 0.88 !important;
}

.wim-support-close {
    width: 36px !important;
    height: 36px !important;
    background: rgba(255,255,255,0.14) !important;
}

.wim-support-body {
    padding: 18px !important;
    background: linear-gradient(180deg, #f7fbff 0%, #f4f8fc 100%) !important;
}

.wim-support-status,
.wim-support-user-card,
.wim-support-messages,
.wim-support-prechat,
.wim-support-chat {
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.wim-support-status {
    border-radius: 16px !important;
    padding: 12px 14px !important;
}

.wim-support-user-card {
    border-radius: 16px !important;
    padding: 14px !important;
}

.wim-support-launcher-actions {
    gap: 10px !important;
}

.wim-support-inline-messenger {
    margin-top: 2px !important;
}

.wim-support-inline-messenger .wim-app {
    border-radius: 20px !important;
    border-color: rgba(216,226,239,0.92) !important;
    background: #fbfdff !important;
}

.wim-support-prechat {
    gap: 12px !important;
}

.wim-support-prechat label {
    gap: 6px !important;
    font-size: 12px !important;
    font-weight: 800 !important;
}

.wim-support-messages {
    max-height: 340px !important;
    padding: 12px !important;
}

.wim-support-message {
    margin: 12px 0 !important;
}

.wim-support-message-bubble {
    max-width: 84% !important;
    padding: 11px 13px !important;
    border-radius: 18px 18px 18px 8px !important;
    background: #edf2f7 !important;
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05) !important;
}

.wim-support-message-mine .wim-support-message-bubble {
    background: linear-gradient(180deg, #15263f, #223b63) !important;
    color: #fff !important;
    border-bottom-right-radius: 8px !important;
}

.wim-support-composer {
    gap: 10px !important;
}

.wim-support-composer .wim-button,
.wim-support-start {
    min-height: 46px !important;
    border-radius: 14px !important;
}

.wim-support-voice-button,
.wim-support-composer .wim-support-voice-button {
    border-radius: 14px !important;
}

.wim-modal-card {
    border-radius: 22px !important;
}

.wim-modal-header {
    background: linear-gradient(180deg, #f8fbff, #f3f7fd) !important;
}

.wim-modal-header h3 {
    font-weight: 800 !important;
}

.wim-modal-footer {
    background: linear-gradient(180deg, #fff, #fbfdff) !important;
}

@media (max-width: 1180px) {
    .wim-sidebar-header h2 {
        font-size: 28px !important;
    }

    .wim-chat-header h3 {
        font-size: 22px !important;
    }
}

@media (max-width: 782px) {
    .wim-app,
    .wim-app:not(.wim-app-compact) {
        width: 100% !important;
        height: min(100dvh - 20px, 760px) !important;
        min-height: 560px !important;
        border-radius: 18px !important;
    }

    .wim-sidebar-header,
    .wim-chat-header,
    .wim-composer {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }

    .wim-sidebar-header h2 {
        font-size: 24px !important;
    }

    .wim-chat-header h3 {
        font-size: 18px !important;
    }

    .wim-thread-list,
    .wim-message-list {
        padding: 12px !important;
    }

    .wim-support-widget .wim-support-panel,
    .wim-support-widget .wim-support-panel-messenger {
        border-radius: 20px !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-body {
        padding: 10px !important;
    }

    .wim-support-inline-messenger .wim-app {
        border-radius: 16px !important;
    }
}

@media (max-width: 520px) {
    .wim-sidebar-header h2 {
        font-size: 22px !important;
    }

    .wim-chat-header h3 {
        font-size: 17px !important;
    }

    .wim-message-bubble,
    .wim-support-message-bubble {
        max-width: 92% !important;
    }

    .wim-support-widget {
        right: 12px !important;
        bottom: 12px !important;
    }

    .wim-support-body,
    .wim-support-header {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
}


/* v1.2.0 — Compact popup UX pass: smaller signed-in messenger panel and tighter popup ergonomics */
.wim-support-widget .wim-support-panel-messenger {
    width: min(520px, calc(100vw - 40px)) !important;
    max-width: calc(100vw - 40px) !important;
    top: auto !important;
    bottom: 92px !important;
    right: 22px !important;
    left: auto !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(660px, calc(100dvh - 116px)) !important;
    border-radius: 22px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-header {
    min-height: 76px !important;
    padding: 16px 18px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-header h3 {
    font-size: 17px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-header p {
    font-size: 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-body {
    padding: 14px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-status {
    padding: 10px 12px !important;
    margin-bottom: 10px !important;
    font-size: 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-user-card {
    padding: 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
    grid-template-columns: 1fr 1fr !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions .wim-button,
.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions .wim-button-secondary {
    min-height: 40px !important;
    padding: 0 12px !important;
    border-radius: 12px !important;
    font-size: 13px !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
    width: min(780px, calc(100vw - 40px)) !important;
    max-width: calc(100vw - 40px) !important;
    height: min(640px, calc(100dvh - 116px)) !important;
    max-height: min(640px, calc(100dvh - 116px)) !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-header,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-header {
    min-height: 70px !important;
    padding: 14px 16px !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-header h3,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-header h3 {
    font-size: 16px !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-body,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-body {
    padding: 10px !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-launcher-actions,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-launcher-actions {
    grid-template-columns: auto auto !important;
    justify-content: flex-start !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-launcher-actions .wim-button,
.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-launcher-actions .wim-button-secondary,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-launcher-actions .wim-button,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-launcher-actions .wim-button-secondary {
    width: auto !important;
    min-width: 160px !important;
    min-height: 36px !important;
    font-size: 12px !important;
    padding: 0 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-app {
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr) !important;
    border-radius: 16px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-sidebar-header,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-chat-header {
    padding: 12px 14px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-sidebar-header h2 {
    font-size: 20px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-chat-header h3 {
    font-size: 18px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-new-chat,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-inbox-controls,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-thread-list,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-message-list {
    padding: 10px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-thread-item,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-user-result {
    padding: 10px !important;
    border-radius: 14px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-avatar {
    width: 36px !important;
    height: 36px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-thread-body strong,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-user-result strong {
    font-size: 13px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-thread-body small,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-user-result small {
    font-size: 11px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-message-bubble {
    max-width: min(82%, 520px) !important;
    padding: 10px 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-placeholder {
    min-height: 220px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-composer {
    padding: 10px !important;
    gap: 8px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-composer textarea {
    min-height: 40px !important;
    max-height: 100px !important;
    padding: 9px 12px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-composer .wim-button,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-voice-button,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-attachment-button {
    min-height: 38px !important;
    font-size: 12px !important;
    border-radius: 12px !important;
}

@media (max-width: 980px) {
    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
    .wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
        width: min(700px, calc(100vw - 28px)) !important;
    }
}

@media (max-width: 782px) {
    .wim-support-widget .wim-support-panel-messenger,
    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
    .wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
        top: auto !important;
        right: 10px !important;
        left: 10px !important;
        bottom: 82px !important;
        width: auto !important;
        max-width: none !important;
        height: min(82dvh, 700px) !important;
        max-height: min(82dvh, 700px) !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
        grid-template-columns: 1fr !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-app {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 520px) {
    .wim-support-widget .wim-support-panel-messenger,
    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
    .wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
        left: 8px !important;
        right: 8px !important;
        bottom: 76px !important;
        border-radius: 18px !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-header,
    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-header {
        padding: 12px 14px !important;
    }

    .wim-support-widget .wim-support-panel-messenger .wim-support-header h3 {
        font-size: 15px !important;
    }
}

/* v1.3.0 — Final UI Fine Tuning: demo-grade visual details, empty states, compact actions, and polish */
.wim-app {
    --wim-glow: 0 0 0 1px rgba(255,255,255,0.55) inset;
}

.wim-app:not(.wim-app-compact) {
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(21,38,63,.28), rgba(125,162,223,.16), rgba(21,38,63,.18)) border-box !important;
}

.wim-sidebar-header,
.wim-chat-header,
.wim-composer {
    box-shadow: var(--wim-glow);
}

.wim-sidebar-header h2::after,
.wim-support-header h3::after {
    content: "";
    display: block;
    width: 34px;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, #7da2df, rgba(125,162,223,0));
}

.wim-support-header h3::after {
    width: 28px;
    height: 2px;
    margin-top: 7px;
    background: linear-gradient(90deg, rgba(255,255,255,.88), rgba(255,255,255,0));
}

.wim-icon-button::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: radial-gradient(circle at 35% 20%, rgba(255,255,255,.30), rgba(255,255,255,0) 36%);
    pointer-events: none;
}

.wim-icon-button,
.wim-support-bubble,
.wim-button {
    position: relative;
    overflow: hidden;
}

.wim-button::after,
.wim-support-bubble::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,.18) 45%, transparent 70%);
    transform: translateX(-120%);
    transition: transform .42s ease;
    pointer-events: none;
}

.wim-button:hover::after,
.wim-support-bubble:hover::after {
    transform: translateX(120%);
}

.wim-thread-item::before {
    content: "";
    width: 6px;
    height: 6px;
    align-self: center;
    justify-self: center;
    grid-column: 1;
    grid-row: 1;
    margin-left: -2px;
    border-radius: 999px;
    background: transparent;
    box-shadow: none;
    z-index: 2;
}

.wim-thread-item.is-active::before {
    background: #22c55e;
    box-shadow: 0 0 0 4px rgba(34,197,94,.13);
}

.wim-thread-body small b {
    min-height: 20px !important;
    padding: 0 8px !important;
    border: 1px solid rgba(79, 70, 229, 0.12);
}

.wim-thread-body small b:empty {
    display: none;
}

.wim-message-bubble {
    position: relative;
}

.wim-message-bubble::before {
    content: "";
    position: absolute;
    bottom: 10px;
    left: -5px;
    width: 10px;
    height: 10px;
    border-left: 1px solid var(--wim-border);
    border-bottom: 1px solid var(--wim-border);
    background: inherit;
    transform: rotate(45deg);
}

.wim-message.is-mine .wim-message-bubble::before {
    right: -5px;
    left: auto;
    border-left: 0;
    border-bottom: 0;
    border-right: 1px solid #c9d9f3;
    border-top: 1px solid #c9d9f3;
}

.wim-message.is-internal-note .wim-message-bubble::before {
    display: none;
}

.wim-message-meta {
    opacity: .92;
}

.wim-message-meta strong {
    font-weight: 900 !important;
}

.wim-message-meta span::before {
    content: "•";
    margin-right: 6px;
    color: #b6c2d2;
}

.wim-placeholder,
.wim-empty-state {
    position: relative;
    overflow: hidden;
}

.wim-placeholder::before,
.wim-empty-state::before {
    content: "💬";
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 20px;
    background: linear-gradient(180deg, #eef5ff, #e5edf8);
    color: #1b3153;
    box-shadow: 0 10px 24px rgba(15,23,42,.07);
    font-size: 24px;
}

.wim-empty-state::before {
    width: 42px;
    height: 42px;
    margin: 0 0 8px;
    border-radius: 15px;
    font-size: 20px;
}

.wim-placeholder h3 {
    color: var(--wim-text);
    font-size: 28px;
    line-height: 1.2;
    letter-spacing: -0.03em;
}

.wim-placeholder p,
.wim-empty-state span {
    color: var(--wim-text-soft);
}

.wim-help-text.is-error {
    border-color: #f3c2c2 !important;
    background: linear-gradient(180deg, #fff8f8, #fef2f2) !important;
    color: var(--wim-danger-text) !important;
}

.wim-voice-button[data-wim-recording="true"],
.wim-support-voice-button[data-wim-recording="true"] {
    animation: wimRecordingPulse 1.1s ease-in-out infinite;
}

@keyframes wimRecordingPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(185,28,28,.20); }
    50% { box-shadow: 0 0 0 7px rgba(185,28,28,0); }
}

.wim-attachment-card { backdrop-filter: blur(4px); }
.wim-attachment-preview img { border-radius: 12px; }
.wim-attachment-download::before { content: "↓ "; font-weight: 900; }

.wim-support-filter-grid button { min-height: 42px !important; }
.wim-support-filter-grid button[data-wim-inbox-filter="support_mine"],
.wim-support-filter-grid button[data-wim-inbox-filter="support_unassigned"] { line-height: 1.25 !important; }

.wim-support-inbox-title strong::before {
    content: "●";
    margin-right: 7px;
    color: #22c55e;
    font-size: 10px;
    vertical-align: 1px;
}

.wim-modal-layer { animation: wimModalFade .14s ease-out; }
.wim-modal-card { animation: wimModalPop .16s ease-out; }

@keyframes wimModalFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes wimModalPop {
    from { opacity: 0; transform: translateY(8px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.wim-modal-header button:hover {
    background: #dbe7f6 !important;
    color: var(--wim-primary) !important;
}

.wim-support-panel {
    background:
        linear-gradient(#ffffff, #ffffff) padding-box,
        linear-gradient(135deg, rgba(21,38,63,.25), rgba(125,162,223,.18)) border-box !important;
}

.wim-support-bubble-badge { box-shadow: 0 0 0 3px #fff; }

.wim-support-empty::before {
    content: "No conversations yet";
    display: block;
    margin-bottom: 4px;
    color: var(--wim-text);
    font-weight: 800;
}

.wim-support-message-meta strong { font-weight: 900 !important; }
.wim-support-composer { padding-top: 2px; }
.wim-support-composer textarea,
.wim-composer textarea { scrollbar-width: thin; }

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-filter-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-filter-grid button {
    min-height: 36px !important;
    padding: 6px !important;
    font-size: 11px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-placeholder::before {
    width: 44px;
    height: 44px;
    margin-bottom: 12px;
    border-radius: 16px;
    font-size: 20px;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-placeholder h3 { font-size: 22px !important; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-placeholder p { font-size: 13px !important; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-api-status { display: none !important; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-header-actions [data-wim-refresh] { min-width: 0 !important; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-new-chat-tabs button { min-height: 34px !important; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-group-chip { max-width: 100%; }
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-group-chip span { max-width: 120px; }

@media (max-width: 782px) {
    .wim-placeholder h3 { font-size: 23px; }
    .wim-placeholder::before { width: 46px; height: 46px; border-radius: 17px; font-size: 21px; }
    .wim-message-bubble::before { display: none; }
    .wim-message-bubble { border-radius: 18px !important; }
    .wim-message.is-mine .wim-message-bubble { border-radius: 18px !important; }
}

@media (max-width: 520px) {
    .wim-placeholder h3 { font-size: 20px; }
    .wim-placeholder p { font-size: 13px; }
    .wim-support-bubble { width: 58px !important; height: 58px !important; }
    .wim-support-bubble-icon { font-size: 24px !important; }
}


/* v1.4.0 — Smart polling and connection status UX */
.wim-api-status {
    position: relative;
    padding-left: 28px !important;
}

.wim-api-status::before {
    content: "";
    position: absolute;
    left: 10px;
    top: 50%;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: currentColor;
    transform: translateY(-50%);
    opacity: .72;
}

.wim-api-status[data-state="default"]::before {
    animation: wimStatusBlink 1.2s ease-in-out infinite;
}

.wim-api-status[data-state="error"]::before {
    animation: wimStatusPulseError 1.1s ease-in-out infinite;
}

@keyframes wimStatusBlink {
    0%, 100% { opacity: .35; }
    50% { opacity: 1; }
}

@keyframes wimStatusPulseError {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(180,35,24,.28);
    }
    50% {
        box-shadow: 0 0 0 6px rgba(180,35,24,0);
    }
}

.wim-app[data-wim-ready="true"] .wim-thread-list,
.wim-app[data-wim-ready="true"] .wim-message-list {
    scroll-behavior: smooth;
}

.wim-support-widget .wim-support-inline-messenger .wim-api-status {
    padding-left: 24px !important;
}


/* v1.5.0 — Support Operator Experience: visitor context and quick replies */
.wim-support-context-card {
    display: grid;
    gap: 12px;
    margin: 0 0 16px;
    padding: 14px;
    border: 1px solid var(--wim-border, #d8e2ef);
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(248,250,252,.96));
    box-shadow: 0 10px 24px rgba(15,23,42,.05);
}

.wim-support-context-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.wim-support-context-head strong {
    color: var(--wim-text, #0f172a);
    font-size: 14px;
    font-weight: 900;
}

.wim-support-context-head small {
    color: var(--wim-text-muted, #708199);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wim-support-context-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}

.wim-support-context-grid span {
    display: grid;
    gap: 3px;
    min-width: 0;
    padding: 9px 10px;
    border: 1px solid rgba(216,226,239,.78);
    border-radius: 14px;
    background: #fff;
    color: var(--wim-text, #0f172a);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.wim-support-context-grid b {
    color: var(--wim-text-muted, #708199);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .04em;
}

.wim-support-context-grid a {
    color: var(--wim-primary, #15263f);
    text-decoration: none;
    font-weight: 800;
}

.wim-support-context-grid a:hover {
    text-decoration: underline;
}

.wim-quick-replies {
    display: grid;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px;
    border: 1px solid rgba(183,205,244,.72);
    border-radius: 18px;
    background: linear-gradient(180deg, #f7fbff, #eef5ff);
}

.wim-quick-replies strong {
    color: var(--wim-text, #0f172a);
    font-size: 12px;
    font-weight: 900;
}

.wim-quick-replies div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.wim-quick-replies button {
    min-height: 34px;
    padding: 0 11px;
    border: 1px solid rgba(183,205,244,.92);
    border-radius: 999px;
    background: #fff;
    color: var(--wim-primary, #15263f);
    cursor: pointer;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
    transition: transform .16s ease, border-color .16s ease, background .16s ease;
}

.wim-quick-replies button:hover {
    transform: translateY(-1px);
    border-color: var(--wim-primary, #15263f);
    background: #f8fbff;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-context-card,
.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-quick-replies {
    margin-bottom: 10px !important;
    padding: 10px !important;
    border-radius: 14px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-context-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-support-context-grid span {
    padding: 8px !important;
    font-size: 11px !important;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-quick-replies div {
    flex-wrap: nowrap !important;
    overflow-x: auto;
    padding-bottom: 2px;
}

.wim-support-widget .wim-support-panel-messenger .wim-support-inline-messenger .wim-quick-replies button {
    flex: 0 0 auto;
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 782px) {
    .wim-support-context-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .wim-quick-replies div {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 3px;
    }

    .wim-quick-replies button {
        flex: 0 0 auto;
        max-width: 240px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
}

@media (max-width: 520px) {
    .wim-support-context-grid {
        grid-template-columns: 1fr;
    }
}

/* v1.6.0 — Product UI rebuild: compact app shell, usable mobile navigation, and corner-widget redesign */
.wim-app,
.wim-support-widget,
.wim-modal-layer {
    --wim-v2-navy: #102a4c;
    --wim-v2-navy-strong: #0a1d36;
    --wim-v2-blue: #2563eb;
    --wim-v2-blue-soft: #edf4ff;
    --wim-v2-bg: #f4f7fb;
    --wim-v2-panel: #ffffff;
    --wim-v2-soft: #f7f9fc;
    --wim-v2-border: #dce5f0;
    --wim-v2-border-strong: #c9d6e6;
    --wim-v2-text: #111c2f;
    --wim-v2-muted: #64748b;
    --wim-v2-subtle: #94a3b8;
    --wim-v2-success: #16a36a;
    --wim-v2-danger: #dc3545;
    --wim-v2-radius: 16px;
    --wim-v2-shadow: 0 24px 70px rgba(15, 35, 64, .16);
    --wim-v2-shadow-soft: 0 8px 24px rgba(15, 35, 64, .07);
}

.wim-visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Main messenger shell */
.wim-app {
    display: grid !important;
    grid-template-columns: 292px minmax(0, 1fr) !important;
    grid-template-rows: minmax(0, 1fr) !important;
    width: min(100%, 1180px) !important;
    height: clamp(620px, 78dvh, 760px) !important;
    min-height: 620px !important;
    max-height: 760px !important;
    margin: 0 auto !important;
    overflow: hidden !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 20px !important;
    background: var(--wim-v2-panel) !important;
    color: var(--wim-v2-text) !important;
    box-shadow: var(--wim-v2-shadow) !important;
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif !important;
    font-size: 14px !important;
    line-height: 1.45 !important;
}

.wim-app:not(.wim-app-compact) {
    height: clamp(620px, 78dvh, 760px) !important;
    min-height: 620px !important;
}

.wim-app::before,
.wim-app::after {
    display: none !important;
}

.wim-sidebar {
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    overflow: hidden !important;
    border-right: 1px solid var(--wim-v2-border) !important;
    background: #fbfcfe !important;
}

.wim-chat-panel {
    display: grid !important;
    grid-template-rows: 68px minmax(0, 1fr) 68px !important;
    min-height: 0 !important;
    overflow: hidden !important;
    background: var(--wim-v2-panel) !important;
}

.wim-sidebar-header,
.wim-chat-header {
    min-height: 68px !important;
    padding: 12px 14px !important;
    gap: 10px !important;
    border-bottom: 1px solid var(--wim-v2-border) !important;
    background: rgba(255, 255, 255, .96) !important;
    box-shadow: none !important;
    backdrop-filter: blur(10px);
}

.wim-sidebar-brand {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 10px;
}

.wim-brand-mark,
.wim-active-avatar-brand {
    position: relative;
    display: inline-grid !important;
    flex: 0 0 auto;
    width: 38px !important;
    height: 38px !important;
    place-items: center;
    border-radius: 12px !important;
    background: linear-gradient(145deg, #183a69, var(--wim-v2-navy-strong)) !important;
    box-shadow: 0 7px 16px rgba(16, 42, 76, .20);
}

.wim-brand-mark::before,
.wim-active-avatar-brand::before {
    content: "";
    width: 17px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 5px;
    box-sizing: border-box;
}

.wim-brand-mark::after,
.wim-active-avatar-brand::after {
    content: "";
    position: absolute;
    left: 12px;
    bottom: 9px;
    width: 5px;
    height: 5px;
    border-left: 2px solid #fff;
    border-bottom: 2px solid #fff;
    transform: skewY(-35deg);
}

.wim-sidebar-header h2,
.wim-chat-header h3,
.wim-placeholder h3 {
    margin: 0 !important;
    color: var(--wim-v2-text) !important;
    font-weight: 780 !important;
    letter-spacing: -.025em !important;
}

.wim-sidebar-header h2 {
    font-size: 19px !important;
    line-height: 1.15 !important;
}

.wim-chat-header h3 {
    font-size: 17px !important;
    line-height: 1.2 !important;
}

.wim-sidebar-header h2::after,
.wim-support-header h3::after {
    display: none !important;
}

.wim-muted,
.wim-chat-header span {
    margin-top: 3px !important;
    color: var(--wim-v2-muted) !important;
    font-size: 11.5px !important;
    line-height: 1.35 !important;
}

.wim-icon-button {
    position: relative !important;
    display: inline-grid !important;
    flex: 0 0 auto !important;
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    place-items: center !important;
    border: 0 !important;
    border-radius: 12px !important;
    background: var(--wim-v2-navy) !important;
    color: #fff !important;
    box-shadow: 0 7px 16px rgba(16, 42, 76, .18) !important;
    font-size: 21px !important;
    font-weight: 500 !important;
}

.wim-icon-button:hover {
    transform: translateY(-1px) !important;
    background: var(--wim-v2-navy-strong) !important;
}

.wim-sidebar-search {
    flex: 0 0 auto;
    padding: 10px 12px 8px;
    background: #fbfcfe;
}

.wim-thread-search-field {
    position: relative;
    display: block;
}

.wim-thread-search-field input {
    width: 100% !important;
    height: 38px !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 0 12px 0 37px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: var(--wim-v2-text) !important;
    box-shadow: none !important;
    font: inherit !important;
    font-size: 12px !important;
    outline: none !important;
}

.wim-thread-search-field input:focus {
    border-color: #8fb2eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .10) !important;
}

.wim-search-icon {
    position: absolute;
    z-index: 1;
    top: 50%;
    left: 13px;
    width: 14px;
    height: 14px;
    border: 1.8px solid #718199;
    border-radius: 999px;
    transform: translateY(-57%);
    pointer-events: none;
}

.wim-search-icon::after {
    content: "";
    position: absolute;
    right: -4px;
    bottom: -3px;
    width: 6px;
    height: 1.8px;
    border-radius: 2px;
    background: #718199;
    transform: rotate(45deg);
}

.wim-new-chat,
.wim-support-inbox-controls {
    flex: 0 0 auto !important;
    padding: 10px 12px !important;
    border-bottom: 1px solid var(--wim-v2-border) !important;
    background: #fff !important;
}

.wim-new-chat {
    max-height: min(450px, 58dvh) !important;
    overflow: auto !important;
}

.wim-new-chat-header {
    margin-bottom: 9px !important;
}

.wim-new-chat-header strong,
.wim-support-inbox-title strong {
    color: var(--wim-v2-text) !important;
    font-size: 12.5px !important;
    font-weight: 800 !important;
}

.wim-support-inbox-title {
    margin-bottom: 8px !important;
}

.wim-support-inbox-title strong::before {
    content: "" !important;
    display: inline-block;
    width: 7px;
    height: 7px;
    margin-right: 7px;
    border-radius: 999px;
    background: var(--wim-v2-success);
    box-shadow: 0 0 0 3px rgba(22, 163, 106, .10);
}

.wim-support-inbox-title span {
    color: var(--wim-v2-subtle) !important;
    font-size: 10.5px !important;
}

.wim-new-chat-tabs,
.wim-support-filter-grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
    margin: 0 !important;
}

.wim-new-chat-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    margin-bottom: 11px !important;
}

.wim-new-chat-tabs button,
.wim-support-filter-grid button {
    min-height: 31px !important;
    padding: 5px 7px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 9px !important;
    background: #fff !important;
    color: #43516a !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
    font-weight: 750 !important;
    line-height: 1.1 !important;
}

.wim-new-chat-tabs button.is-active,
.wim-support-filter-grid button.is-active {
    border-color: var(--wim-v2-navy) !important;
    background: var(--wim-v2-navy) !important;
    color: #fff !important;
    box-shadow: none !important;
}

.wim-new-chat-panel label {
    margin: 0 0 6px !important;
    color: #43516a !important;
    font-size: 11px !important;
}

.wim-search-row input,
.wim-group-title-input {
    min-height: 38px !important;
    padding: 0 11px !important;
    border-radius: 11px !important;
    font-size: 12px !important;
}

.wim-user-results {
    gap: 5px !important;
    max-height: 230px !important;
    margin-top: 8px !important;
}

.wim-thread-list {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    padding: 6px 8px 10px !important;
    overflow: auto !important;
    background: #fbfcfe !important;
}

.wim-thread-item,
.wim-user-result {
    display: grid !important;
    grid-template-columns: 40px minmax(0, 1fr) auto !important;
    gap: 9px !important;
    width: 100% !important;
    margin: 0 0 3px !important;
    padding: 9px 9px !important;
    border: 1px solid transparent !important;
    border-radius: 13px !important;
    background: transparent !important;
    box-shadow: none !important;
    transform: none !important;
    color: var(--wim-v2-text) !important;
}

.wim-user-result {
    grid-template-columns: 36px minmax(0, 1fr) !important;
    border-color: var(--wim-v2-border) !important;
    background: #fff !important;
}

.wim-thread-item::before {
    display: none !important;
}

.wim-thread-item:hover,
.wim-thread-item.is-active,
.wim-user-result:hover {
    transform: none !important;
    border-color: #bfd2ee !important;
    background: #f1f6ff !important;
    box-shadow: none !important;
}

.wim-thread-item.is-active {
    border-color: #adc7ed !important;
    background: #eaf2ff !important;
    box-shadow: inset 3px 0 0 var(--wim-v2-blue) !important;
}

.wim-thread-item[hidden] {
    display: none !important;
}

.wim-avatar,
.wim-active-avatar {
    display: inline-grid !important;
    width: 40px !important;
    height: 40px !important;
    overflow: hidden !important;
    place-items: center !important;
    border: 1px solid #cfdded !important;
    border-radius: 13px !important;
    background: linear-gradient(145deg, #eff4fb, #dce8f7) !important;
    color: var(--wim-v2-navy) !important;
    font-size: 13px !important;
    font-weight: 850 !important;
}

.wim-user-result .wim-avatar {
    width: 36px !important;
    height: 36px !important;
    border-radius: 11px !important;
}

.wim-avatar img,
.wim-active-avatar img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.wim-thread-body strong,
.wim-user-result strong {
    color: var(--wim-v2-text) !important;
    font-size: 12.5px !important;
    font-weight: 780 !important;
    line-height: 1.25 !important;
}

.wim-thread-body small,
.wim-user-result small {
    display: block !important;
    margin-top: 4px !important;
    overflow: hidden !important;
    color: var(--wim-v2-muted) !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    -webkit-line-clamp: unset !important;
}

.wim-thread-body small b {
    min-height: 17px !important;
    padding: 0 6px !important;
    border: 0 !important;
    border-radius: 999px !important;
    background: #e9eff9 !important;
    color: #38547a !important;
    font-size: 8.5px !important;
    font-weight: 850 !important;
}

.wim-thread-meta {
    align-content: center !important;
    gap: 5px !important;
}

.wim-thread-meta em {
    min-width: 20px !important;
    height: 20px !important;
    padding: 0 5px !important;
    background: var(--wim-v2-blue) !important;
    font-size: 9px !important;
}

.wim-thread-meta small {
    color: var(--wim-v2-subtle) !important;
    font-size: 9px !important;
}

.wim-thread-search-empty {
    display: grid;
    gap: 3px;
    margin: 8px;
    padding: 16px 12px;
    border: 1px dashed var(--wim-v2-border-strong);
    border-radius: 12px;
    background: #fff;
    color: var(--wim-v2-muted);
    text-align: center;
}

.wim-thread-search-empty strong {
    color: var(--wim-v2-text);
    font-size: 12px;
}

.wim-thread-search-empty span {
    font-size: 10.5px;
}

/* Chat header */
.wim-chat-header {
    display: flex !important;
    align-items: center !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    padding: 10px 14px !important;
}

.wim-active-thread-meta {
    display: flex !important;
    align-items: center !important;
    flex: 1 1 auto !important;
    min-width: 0 !important;
    gap: 10px !important;
}

.wim-active-thread-copy {
    display: block !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.wim-active-thread-copy > span,
.wim-active-subtitle {
    display: block !important;
    overflow: hidden !important;
    margin-top: 3px !important;
    color: var(--wim-v2-muted) !important;
    font-size: 10.5px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.wim-active-avatar {
    flex: 0 0 auto !important;
    border-radius: 12px !important;
}

.wim-header-actions {
    display: flex !important;
    align-items: center !important;
    flex: 0 0 auto !important;
    gap: 7px !important;
}

.wim-thread-actions {
    gap: 5px !important;
    flex-wrap: nowrap !important;
    max-width: 340px;
    overflow-x: auto;
    scrollbar-width: none;
}

.wim-thread-actions::-webkit-scrollbar {
    display: none;
}

.wim-thread-actions .wim-button-small {
    flex: 0 0 auto !important;
    min-height: 31px !important;
    padding: 0 9px !important;
    border-radius: 9px !important;
    font-size: 9.5px !important;
}

.wim-api-status {
    min-height: 29px !important;
    padding: 0 9px 0 24px !important;
    border: 1px solid #d6eadf !important;
    border-radius: 999px !important;
    background: #effaf4 !important;
    color: #24855b !important;
    font-size: 9.5px !important;
    font-weight: 750 !important;
}

.wim-api-status::before {
    left: 9px !important;
    width: 6px !important;
    height: 6px !important;
}

.wim-button,
.wim-button-secondary,
.wim-refresh-button {
    min-height: 36px !important;
    padding: 0 12px !important;
    border: 1px solid transparent !important;
    border-radius: 11px !important;
    background: var(--wim-v2-navy) !important;
    color: #fff !important;
    box-shadow: none !important;
    font-size: 11.5px !important;
    font-weight: 750 !important;
    line-height: 1 !important;
}

.wim-button:hover {
    transform: none !important;
    background: var(--wim-v2-navy-strong) !important;
    box-shadow: none !important;
}

.wim-button-secondary,
.wim-refresh-button {
    border-color: var(--wim-v2-border) !important;
    background: #fff !important;
    color: var(--wim-v2-text) !important;
}

.wim-button-secondary:hover,
.wim-refresh-button:hover {
    border-color: #b7c9e2 !important;
    background: #f3f7fc !important;
    color: var(--wim-v2-navy) !important;
}

.wim-refresh-button {
    width: 36px !important;
    min-width: 36px !important;
    padding: 0 !important;
    overflow: hidden !important;
    font-size: 0 !important;
}

.wim-refresh-button::before {
    content: "↻";
    font-size: 19px;
    font-weight: 500;
    line-height: 1;
}

/* Conversation canvas */
.wim-message-list {
    min-height: 0 !important;
    padding: 18px 20px !important;
    overflow: auto !important;
    background:
        radial-gradient(circle at 50% -20%, rgba(224, 235, 251, .56), transparent 40%),
        #f7f9fc !important;
}

.wim-placeholder,
.wim-empty-state {
    min-height: 0 !important;
    padding: 20px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 16px !important;
    background: rgba(255, 255, 255, .90) !important;
    box-shadow: none !important;
}

.wim-placeholder {
    width: min(560px, 100%);
    min-height: 240px !important;
    margin: 0 auto;
    place-content: center !important;
}

.wim-placeholder::before,
.wim-empty-state::before {
    width: 46px !important;
    height: 46px !important;
    margin: 0 auto 12px !important;
    border-radius: 15px !important;
    background: #edf3fb !important;
    box-shadow: none !important;
    font-size: 20px !important;
}

.wim-empty-state::before {
    width: 36px !important;
    height: 36px !important;
    margin: 0 0 7px !important;
    border-radius: 11px !important;
    font-size: 16px !important;
}

.wim-placeholder h3 {
    font-size: 20px !important;
    line-height: 1.25 !important;
}

.wim-placeholder p,
.wim-empty-state span {
    margin: 5px 0 0 !important;
    color: var(--wim-v2-muted) !important;
    font-size: 12px !important;
}

.wim-message {
    margin-bottom: 11px !important;
}

.wim-message-bubble {
    max-width: min(68%, 610px) !important;
    padding: 10px 12px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 16px 16px 16px 5px !important;
    background: #fff !important;
    color: var(--wim-v2-text) !important;
    box-shadow: 0 5px 15px rgba(15, 35, 64, .045) !important;
}

.wim-message-bubble::before {
    display: none !important;
}

.wim-message.is-mine .wim-message-bubble {
    border-color: var(--wim-v2-navy) !important;
    border-radius: 16px 16px 5px 16px !important;
    background: var(--wim-v2-navy) !important;
    color: #fff !important;
    box-shadow: 0 7px 18px rgba(16, 42, 76, .14) !important;
}

.wim-message-meta {
    gap: 10px !important;
    margin-bottom: 5px !important;
}

.wim-message-meta strong,
.wim-message-meta span {
    color: var(--wim-v2-muted) !important;
    font-size: 9.5px !important;
    line-height: 1.2 !important;
}

.wim-message-meta strong {
    color: #46556c !important;
    font-weight: 750 !important;
}

.wim-message-meta span::before {
    display: none !important;
}

.wim-message.is-mine .wim-message-meta strong,
.wim-message.is-mine .wim-message-meta span,
.wim-message.is-mine .wim-message-content,
.wim-message.is-mine .wim-attachment-info strong,
.wim-message.is-mine .wim-attachment-info span {
    color: rgba(255, 255, 255, .84) !important;
}

.wim-message.is-mine .wim-message-content {
    color: #fff !important;
}

.wim-message-content {
    color: var(--wim-v2-text) !important;
    font-size: 13px !important;
    line-height: 1.55 !important;
}

.wim-message-actions {
    margin-top: 7px !important;
    padding-top: 7px !important;
    border-top-color: rgba(100, 116, 139, .16) !important;
}

.wim-message-actions button {
    min-height: 25px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 9px !important;
}

.wim-message.is-mine .wim-message-actions button {
    border-color: rgba(255, 255, 255, .22) !important;
    background: rgba(255, 255, 255, .08) !important;
    color: #fff !important;
}

.wim-message.is-internal-note .wim-message-bubble {
    max-width: min(76%, 680px) !important;
    border: 1px dashed #e3b341 !important;
    background: #fff9e9 !important;
    color: #805d10 !important;
}

.wim-attachments {
    gap: 7px !important;
    margin-top: 7px !important;
}

.wim-attachment-card {
    min-width: min(270px, 100%) !important;
    padding: 8px !important;
    border-color: rgba(201, 214, 230, .9) !important;
    border-radius: 11px !important;
    background: rgba(255, 255, 255, .82) !important;
    box-shadow: none !important;
}

.wim-attachment-info strong {
    font-size: 11px !important;
}

.wim-attachment-info span {
    font-size: 9.5px !important;
}

.wim-attachment-download {
    min-height: 27px !important;
    padding: 0 8px !important;
    border-radius: 8px !important;
    font-size: 9.5px !important;
    line-height: 27px !important;
}

.wim-voice-card audio {
    height: 34px !important;
}

.wim-support-context-card,
.wim-quick-replies {
    gap: 8px !important;
    margin-bottom: 10px !important;
    padding: 10px !important;
    border-radius: 13px !important;
    box-shadow: none !important;
}

.wim-support-context-grid {
    gap: 6px !important;
}

.wim-support-context-grid span {
    padding: 7px 8px !important;
    border-radius: 9px !important;
    font-size: 10.5px !important;
}

.wim-quick-replies button {
    min-height: 29px !important;
    padding: 0 9px !important;
    font-size: 10px !important;
}

/* Composer */
.wim-composer {
    display: grid !important;
    grid-template-columns: auto auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 7px !important;
    min-height: 68px !important;
    padding: 10px 13px !important;
    border-top: 1px solid var(--wim-v2-border) !important;
    background: #fff !important;
    box-shadow: none !important;
}

.wim-composer textarea {
    min-width: 0 !important;
    min-height: 42px !important;
    max-height: 104px !important;
    padding: 10px 13px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 13px !important;
    background: #f9fbfd !important;
    color: var(--wim-v2-text) !important;
    box-shadow: none !important;
    font-size: 12.5px !important;
    line-height: 1.45 !important;
}

.wim-composer textarea:focus {
    border-color: #8fb2eb !important;
    background: #fff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .09) !important;
}

.wim-attachment-button,
.wim-voice-button {
    display: inline-grid !important;
    width: 42px !important;
    min-width: 42px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 !important;
    place-items: center !important;
    overflow: hidden !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    color: #41516a !important;
    box-shadow: none !important;
    font-size: 0 !important;
}

.wim-attachment-button::before,
.wim-voice-button::before {
    content: "";
    display: block;
    width: 18px;
    height: 18px;
    background: currentColor;
    mask-position: center;
    mask-repeat: no-repeat;
    mask-size: contain;
    -webkit-mask-position: center;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-size: contain;
}

.wim-attachment-button::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.7 6.3a4 4 0 0 0-5.66 0l-6.4 6.4a3 3 0 1 0 4.24 4.24l6.05-6.05a2 2 0 1 0-2.83-2.83l-5.7 5.7 1.42 1.41 5.7-5.7a.01.01 0 0 1 .02 0 .01.01 0 0 1 0 .02l-6.06 6.05a1 1 0 1 1-1.41-1.41l6.4-6.4a2 2 0 1 1 2.82 2.82l-6.4 6.4 1.42 1.42 6.4-6.4a4 4 0 0 0 0-5.66Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M17.7 6.3a4 4 0 0 0-5.66 0l-6.4 6.4a3 3 0 1 0 4.24 4.24l6.05-6.05a2 2 0 1 0-2.83-2.83l-5.7 5.7 1.42 1.41 5.7-5.7a.01.01 0 0 1 .02 0 .01.01 0 0 1 0 .02l-6.06 6.05a1 1 0 1 1-1.41-1.41l6.4-6.4a2 2 0 1 1 2.82 2.82l-6.4 6.4 1.42 1.42 6.4-6.4a4 4 0 0 0 0-5.66Z'/%3E%3C/svg%3E");
}

.wim-voice-button::before {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 14a3 3 0 0 0 3-3V5a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm-1 4.93V22h2v-3.07A8 8 0 0 0 20 11h-2a6 6 0 0 1-12 0H4a8 8 0 0 0 7 7.93Z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='black' d='M12 14a3 3 0 0 0 3-3V5a3 3 0 1 0-6 0v6a3 3 0 0 0 3 3Zm-1 4.93V22h2v-3.07A8 8 0 0 0 20 11h-2a6 6 0 0 1-12 0H4a8 8 0 0 0 7 7.93Z'/%3E%3C/svg%3E");
}

.wim-attachment-button:hover,
.wim-voice-button:hover:not(:disabled) {
    border-color: #b6cae5 !important;
    background: #f3f7fc !important;
    color: var(--wim-v2-navy) !important;
}

.wim-voice-button[data-wim-recording="true"] {
    border-color: #efb6bb !important;
    background: #fff2f3 !important;
    color: var(--wim-v2-danger) !important;
    font-size: 9px !important;
}

.wim-voice-button[data-wim-recording="true"]::before {
    display: none;
}

.wim-send-button {
    min-width: 68px !important;
    height: 42px !important;
    min-height: 42px !important;
    padding: 0 15px !important;
    border-radius: 12px !important;
}

.wim-composer [disabled] {
    opacity: .48 !important;
}

/* Compact corner support widget */
.wim-support-widget {
    right: 18px !important;
    bottom: 18px !important;
}

.wim-support-bubble {
    display: inline-grid !important;
    width: 56px !important;
    height: 56px !important;
    padding: 0 !important;
    place-items: center !important;
    border: 1px solid rgba(255, 255, 255, .18) !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, #173a69, var(--wim-v2-navy-strong)) !important;
    box-shadow: 0 16px 38px rgba(10, 29, 54, .27) !important;
}

.wim-support-bubble:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 20px 42px rgba(10, 29, 54, .32) !important;
}

.wim-support-bubble-icon,
.wim-support-bubble-icon svg {
    display: block !important;
    width: 25px !important;
    height: 25px !important;
}

.wim-support-bubble-icon svg {
    fill: #fff !important;
}

.wim-support-bubble-badge {
    top: -5px !important;
    right: -5px !important;
    min-width: 19px !important;
    height: 19px !important;
    padding: 0 5px !important;
    border: 2px solid #fff !important;
    background: #ef4444 !important;
    font-size: 9px !important;
    line-height: 15px !important;
}

.wim-support-widget .wim-support-panel,
.wim-support-widget .wim-support-panel-messenger {
    position: absolute !important;
    top: auto !important;
    right: 0 !important;
    bottom: 70px !important;
    left: auto !important;
    width: min(360px, calc(100vw - 24px)) !important;
    max-width: min(360px, calc(100vw - 24px)) !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: min(590px, calc(100dvh - 98px)) !important;
    overflow: hidden !important;
    border: 1px solid rgba(199, 213, 231, .95) !important;
    border-radius: 18px !important;
    background: #fff !important;
    box-shadow: var(--wim-v2-shadow) !important;
}

.wim-support-widget .wim-support-header,
.wim-support-widget .wim-support-panel-messenger .wim-support-header {
    display: flex !important;
    align-items: center !important;
    min-height: 64px !important;
    padding: 11px 12px 11px 14px !important;
    gap: 10px !important;
    background: linear-gradient(135deg, #173a69, var(--wim-v2-navy-strong)) !important;
    color: #fff !important;
}

.wim-support-header-copy {
    flex: 1 1 auto;
    min-width: 0;
}

.wim-support-title-row {
    display: flex;
    align-items: center;
    min-width: 0;
    gap: 8px;
}

.wim-support-widget .wim-support-header h3 {
    overflow: hidden;
    margin: 0 !important;
    color: #fff !important;
    font-size: 15px !important;
    font-weight: 780 !important;
    line-height: 1.2 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-support-widget .wim-support-header p {
    overflow: hidden;
    margin: 3px 0 0 !important;
    color: rgba(255, 255, 255, .76) !important;
    font-size: 10.5px !important;
    line-height: 1.3 !important;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-support-online {
    display: inline-flex !important;
    align-items: center;
    flex: 0 0 auto;
    gap: 5px;
    margin: 0 !important;
    color: rgba(255, 255, 255, .78) !important;
    font-size: 9px !important;
    font-weight: 700;
}

.wim-support-online::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 999px;
    background: #45d596;
    box-shadow: 0 0 0 3px rgba(69, 213, 150, .15);
}

.wim-support-widget .wim-support-close {
    display: inline-grid !important;
    flex: 0 0 auto !important;
    width: 31px !important;
    min-width: 31px !important;
    height: 31px !important;
    min-height: 31px !important;
    padding: 0 !important;
    place-items: center !important;
    border: 1px solid rgba(255, 255, 255, .12) !important;
    border-radius: 10px !important;
    background: rgba(255, 255, 255, .10) !important;
    color: #fff !important;
    font-size: 20px !important;
    line-height: 1 !important;
}

.wim-support-widget .wim-support-close:hover {
    background: rgba(255, 255, 255, .18) !important;
}

.wim-support-widget .wim-support-body,
.wim-support-widget .wim-support-panel-messenger .wim-support-body {
    display: block !important;
    max-height: calc(min(590px, calc(100dvh - 98px)) - 64px) !important;
    padding: 11px !important;
    overflow-y: auto !important;
    background: #f5f8fc !important;
}

.wim-support-widget .wim-support-status {
    width: 100% !important;
    margin: 0 0 9px !important;
    padding: 9px 10px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 11px !important;
    background: #fff !important;
    color: #54637a !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
    line-height: 1.4 !important;
}

.wim-support-user-card {
    display: flex !important;
    align-items: center !important;
    gap: 9px !important;
    padding: 9px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.wim-support-user-avatar {
    display: inline-grid;
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    place-items: center;
    border-radius: 11px;
    background: #e9f1fd;
    color: var(--wim-v2-navy);
    font-size: 12px;
    font-weight: 850;
}

.wim-support-user-copy {
    display: block;
    min-width: 0;
}

.wim-support-user-copy strong,
.wim-support-user-copy span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wim-support-user-copy strong {
    color: var(--wim-v2-text) !important;
    font-size: 11.5px !important;
    font-weight: 780 !important;
}

.wim-support-user-copy span {
    margin-top: 2px !important;
    color: var(--wim-v2-muted) !important;
    font-size: 9.5px !important;
}

.wim-support-widget .wim-support-launcher-actions,
.wim-support-widget .wim-support-panel-messenger .wim-support-launcher-actions {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    gap: 7px !important;
    margin: 8px 0 0 !important;
}

.wim-support-widget .wim-support-launcher-actions .wim-button,
.wim-support-widget .wim-support-launcher-actions .wim-button-secondary {
    min-height: 36px !important;
    padding: 0 9px !important;
    border-radius: 10px !important;
    font-size: 10.5px !important;
    text-align: center !important;
}

.wim-support-prechat {
    display: grid !important;
    gap: 7px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wim-support-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
}

.wim-support-widget .wim-support-prechat label {
    display: grid !important;
    gap: 4px !important;
    margin: 0 !important;
    color: #44536a !important;
    font-size: 9.5px !important;
    font-weight: 750 !important;
}

.wim-support-widget .wim-support-prechat label span {
    display: flex !important;
    align-items: center;
    gap: 4px;
    font-size: 9.5px !important;
}

.wim-support-widget .wim-support-prechat label small {
    color: var(--wim-v2-subtle) !important;
    font-size: 8.5px !important;
    font-weight: 500 !important;
}

.wim-support-widget .wim-support-prechat input,
.wim-support-widget .wim-support-prechat textarea,
.wim-support-widget .wim-support-composer textarea {
    width: 100% !important;
    min-height: 38px !important;
    margin: 0 !important;
    padding: 8px 10px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 10px !important;
    background: #fff !important;
    color: var(--wim-v2-text) !important;
    box-shadow: none !important;
    font-size: 10.5px !important;
    line-height: 1.35 !important;
}

.wim-support-widget .wim-support-prechat textarea {
    min-height: 68px !important;
    max-height: 100px !important;
    resize: vertical !important;
}

.wim-support-widget .wim-support-prechat input:focus,
.wim-support-widget .wim-support-prechat textarea:focus,
.wim-support-widget .wim-support-composer textarea:focus {
    border-color: #8fb2eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .09) !important;
}

.wim-support-widget .wim-support-start {
    width: 100% !important;
    min-height: 39px !important;
    margin-top: 1px !important;
    border-radius: 10px !important;
    font-size: 11px !important;
}

.wim-support-chat {
    display: grid !important;
    gap: 8px !important;
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wim-support-messages {
    max-height: 310px !important;
    padding: 8px !important;
    border: 1px solid var(--wim-v2-border) !important;
    border-radius: 12px !important;
    background: #fff !important;
    box-shadow: none !important;
}

.wim-support-empty {
    padding: 18px 7px !important;
    color: var(--wim-v2-muted) !important;
    font-size: 10.5px !important;
}

.wim-support-empty::before {
    margin-bottom: 3px !important;
    color: var(--wim-v2-text) !important;
    font-size: 11.5px !important;
}

.wim-support-message {
    margin: 7px 0 !important;
}

.wim-support-message-bubble {
    max-width: 82% !important;
    padding: 8px 10px !important;
    border-radius: 13px 13px 13px 4px !important;
    background: #edf2f8 !important;
    color: var(--wim-v2-text) !important;
    box-shadow: none !important;
    font-size: 11px !important;
    line-height: 1.45 !important;
}

.wim-support-message-mine .wim-support-message-bubble {
    border-radius: 13px 13px 4px 13px !important;
    background: var(--wim-v2-navy) !important;
    color: #fff !important;
}

.wim-support-message-meta {
    margin-bottom: 4px !important;
}

.wim-support-message-meta strong,
.wim-support-message-meta span {
    font-size: 8.5px !important;
}

.wim-support-composer {
    display: grid !important;
    grid-template-columns: auto minmax(0, 1fr) auto !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 !important;
}

.wim-support-widget .wim-support-composer textarea {
    min-width: 0 !important;
    min-height: 38px !important;
    max-height: 82px !important;
    resize: none !important;
}

.wim-support-widget .wim-support-voice-button,
.wim-support-widget .wim-support-send-button {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    min-height: 38px !important;
    padding: 0 !important;
    overflow: hidden !important;
    border-radius: 10px !important;
    font-size: 0 !important;
}

.wim-support-widget .wim-support-voice-button {
    border: 1px solid var(--wim-v2-border) !important;
    background: #fff !important;
    color: #41516a !important;
}

.wim-support-widget .wim-support-voice-button::before {
    content: "●";
    font-size: 12px;
}

.wim-support-widget .wim-support-send-button::before {
    content: "➤";
    font-size: 14px;
}

/* Logged-in popup expands only after the quick panel is requested. */
.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
    width: min(760px, calc(100vw - 36px)) !important;
    max-width: min(760px, calc(100vw - 36px)) !important;
    height: min(590px, calc(100dvh - 98px)) !important;
    max-height: min(590px, calc(100dvh - 98px)) !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-body,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-body {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
    max-height: none !important;
    padding: 8px !important;
    overflow: hidden !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-signed-in,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-signed-in {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    min-height: 0 !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-launcher-actions,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-launcher-actions {
    display: flex !important;
    flex: 0 0 auto !important;
    justify-content: flex-start !important;
    margin: 0 0 7px !important;
}

.wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger .wim-support-launcher-actions .wim-button,
.wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open .wim-support-launcher-actions .wim-button {
    width: auto !important;
    min-width: 0 !important;
    min-height: 31px !important;
    padding: 0 10px !important;
    font-size: 9.5px !important;
}

.wim-support-inline-messenger {
    flex: 1 1 auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
    border-radius: 14px !important;
}

.wim-support-inline-messenger .wim-app {
    grid-template-columns: 255px minmax(0, 1fr) !important;
    width: 100% !important;
    height: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-radius: 14px !important;
    box-shadow: none !important;
}

.wim-support-inline-messenger .wim-chat-panel {
    grid-template-rows: 58px minmax(0, 1fr) 58px !important;
}

.wim-support-inline-messenger .wim-sidebar-header,
.wim-support-inline-messenger .wim-chat-header {
    min-height: 58px !important;
    padding: 8px 10px !important;
}

.wim-support-inline-messenger .wim-brand-mark,
.wim-support-inline-messenger .wim-active-avatar {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
}

.wim-support-inline-messenger .wim-sidebar-header h2 {
    font-size: 15px !important;
}

.wim-support-inline-messenger .wim-chat-header h3 {
    font-size: 14px !important;
}

.wim-support-inline-messenger .wim-muted,
.wim-support-inline-messenger .wim-active-thread-copy > span {
    font-size: 9px !important;
}

.wim-support-inline-messenger .wim-sidebar-search {
    padding: 7px 8px 5px !important;
}

.wim-support-inline-messenger .wim-thread-search-field input {
    height: 33px !important;
    min-height: 33px !important;
    font-size: 10px !important;
}

.wim-support-inline-messenger .wim-new-chat,
.wim-support-inline-messenger .wim-support-inbox-controls {
    padding: 7px 8px !important;
}

.wim-support-inline-messenger .wim-support-filter-grid button {
    min-height: 27px !important;
    padding: 4px !important;
    font-size: 8.5px !important;
}

.wim-support-inline-messenger .wim-thread-list,
.wim-support-inline-messenger .wim-message-list {
    padding: 6px !important;
}

.wim-support-inline-messenger .wim-thread-item {
    grid-template-columns: 34px minmax(0, 1fr) auto !important;
    gap: 7px !important;
    padding: 7px !important;
    border-radius: 10px !important;
}

.wim-support-inline-messenger .wim-avatar {
    width: 34px !important;
    height: 34px !important;
    border-radius: 10px !important;
}

.wim-support-inline-messenger .wim-thread-body strong {
    font-size: 10.5px !important;
}

.wim-support-inline-messenger .wim-thread-body small {
    font-size: 8.5px !important;
}

.wim-support-inline-messenger .wim-placeholder {
    min-height: 180px !important;
}

.wim-support-inline-messenger .wim-placeholder h3 {
    font-size: 16px !important;
}

.wim-support-inline-messenger .wim-message-bubble {
    max-width: 82% !important;
    padding: 8px 9px !important;
}

.wim-support-inline-messenger .wim-message-content {
    font-size: 11px !important;
}

.wim-support-inline-messenger .wim-composer {
    min-height: 58px !important;
    padding: 7px !important;
}

.wim-support-inline-messenger .wim-composer textarea,
.wim-support-inline-messenger .wim-attachment-button,
.wim-support-inline-messenger .wim-voice-button,
.wim-support-inline-messenger .wim-send-button {
    min-height: 36px !important;
    height: 36px !important;
}

.wim-support-inline-messenger .wim-attachment-button,
.wim-support-inline-messenger .wim-voice-button {
    width: 36px !important;
    min-width: 36px !important;
}

.wim-support-inline-messenger .wim-send-button {
    min-width: 54px !important;
    padding: 0 10px !important;
    font-size: 9.5px !important;
}

/* Tablet and mobile: list and chat become separate app screens. */
@media (max-width: 900px) {
    .wim-app {
        grid-template-columns: 270px minmax(0, 1fr) !important;
    }

    .wim-thread-actions {
        max-width: 210px;
    }

    .wim-api-status {
        display: none !important;
    }
}

@media (max-width: 782px) {
    .wim-app,
    .wim-app:not(.wim-app-compact) {
        position: relative !important;
        display: grid !important;
        grid-template-columns: 1fr !important;
        grid-template-rows: minmax(0, 1fr) !important;
        width: 100% !important;
        height: min(720px, calc(100dvh - 16px)) !important;
        min-height: 520px !important;
        max-height: none !important;
        border-radius: 16px !important;
    }

    .wim-sidebar,
    .wim-chat-panel {
        grid-column: 1 !important;
        grid-row: 1 !important;
        width: 100% !important;
        height: 100% !important;
        min-height: 0 !important;
    }

    .wim-sidebar {
        display: flex !important;
        border: 0 !important;
    }

    .wim-chat-panel {
        display: none !important;
        grid-template-rows: 62px minmax(0, 1fr) 62px !important;
    }

    .wim-app.is-chat-open .wim-sidebar {
        display: none !important;
    }

    .wim-app.is-chat-open .wim-chat-panel {
        display: grid !important;
    }

    .wim-mobile-back {
        display: inline-grid !important;
        flex: 0 0 auto !important;
        width: 36px !important;
        min-width: 36px !important;
        height: 36px !important;
        min-height: 36px !important;
        padding: 0 !important;
        place-items: center !important;
        border: 1px solid var(--wim-v2-border) !important;
        border-radius: 11px !important;
        background: #fff !important;
        color: var(--wim-v2-text) !important;
    }

    .wim-sidebar-header,
    .wim-chat-header {
        min-height: 62px !important;
        padding: 9px 11px !important;
    }

    .wim-sidebar-header h2 {
        font-size: 17px !important;
    }

    .wim-chat-header h3 {
        font-size: 15px !important;
    }

    .wim-active-avatar {
        width: 36px !important;
        height: 36px !important;
    }

    .wim-active-thread-copy > span,
    .wim-active-subtitle {
        max-width: calc(100vw - 190px) !important;
        font-size: 9.5px !important;
    }

    .wim-header-actions {
        width: auto !important;
        align-items: center !important;
        flex-direction: row !important;
    }

    .wim-thread-actions {
        max-width: 110px;
    }

    .wim-header-actions [data-wim-refresh] {
        display: none !important;
    }

    .wim-message-list {
        min-height: 0 !important;
        padding: 12px 10px !important;
    }

    .wim-message-bubble {
        max-width: 88% !important;
    }

    .wim-placeholder {
        min-height: 210px !important;
    }

    .wim-composer {
        position: sticky !important;
        bottom: 0 !important;
        z-index: 3 !important;
        grid-template-columns: auto auto minmax(0, 1fr) auto !important;
        min-height: 62px !important;
        padding: 8px !important;
        gap: 6px !important;
        box-shadow: 0 -8px 22px rgba(15, 35, 64, .05) !important;
    }

    .wim-composer textarea,
    .wim-attachment-button,
    .wim-voice-button,
    .wim-send-button {
        height: 40px !important;
        min-height: 40px !important;
    }

    .wim-attachment-button,
    .wim-voice-button {
        width: 40px !important;
        min-width: 40px !important;
    }

    .wim-send-button {
        min-width: 58px !important;
        padding: 0 11px !important;
    }

    .wim-support-widget .wim-support-panel,
    .wim-support-widget .wim-support-panel-messenger {
        position: fixed !important;
        top: auto !important;
        right: 10px !important;
        bottom: 78px !important;
        left: 10px !important;
        width: auto !important;
        max-width: none !important;
        max-height: calc(100dvh - 94px) !important;
        border-radius: 17px !important;
    }

    .wim-support-widget .wim-support-body,
    .wim-support-widget .wim-support-panel-messenger .wim-support-body {
        max-height: calc(100dvh - 158px) !important;
    }

    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
    .wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
        top: 8px !important;
        right: 8px !important;
        bottom: 72px !important;
        left: 8px !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        max-height: none !important;
    }

    .wim-support-inline-messenger .wim-app {
        grid-template-columns: 1fr !important;
        height: 100% !important;
        min-height: 0 !important;
    }
}

@media (max-width: 520px) {
    .wim-app,
    .wim-app:not(.wim-app-compact) {
        height: calc(100dvh - 10px) !important;
        min-height: 500px !important;
        border-radius: 13px !important;
    }

    .wim-sidebar-search {
        padding: 8px 9px 6px;
    }

    .wim-support-filter-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }

    .wim-thread-list {
        padding: 5px 6px 8px !important;
    }

    .wim-thread-item {
        grid-template-columns: 38px minmax(0, 1fr) auto !important;
        padding: 8px !important;
    }

    .wim-avatar {
        width: 38px !important;
        height: 38px !important;
    }

    .wim-message-bubble {
        max-width: 91% !important;
    }

    .wim-composer {
        grid-template-columns: auto auto minmax(0, 1fr) auto !important;
    }

    .wim-composer [data-wim-send-button] {
        grid-column: auto !important;
        width: auto !important;
        min-width: 44px !important;
        padding: 0 10px !important;
        overflow: hidden !important;
        font-size: 0 !important;
    }

    .wim-composer [data-wim-send-button]::before {
        content: "➤";
        font-size: 13px;
    }

    .wim-support-widget {
        right: 12px !important;
        bottom: 12px !important;
    }

    .wim-support-bubble {
        width: 52px !important;
        height: 52px !important;
        border-radius: 16px !important;
    }

    .wim-support-bubble-icon,
    .wim-support-bubble-icon svg {
        width: 23px !important;
        height: 23px !important;
    }

    .wim-support-widget .wim-support-panel,
    .wim-support-widget .wim-support-panel-messenger {
        right: 7px !important;
        bottom: 70px !important;
        left: 7px !important;
        border-radius: 15px !important;
    }

    .wim-support-form-grid {
        grid-template-columns: 1fr;
    }

    .wim-support-widget .wim-support-header,
    .wim-support-widget .wim-support-panel-messenger .wim-support-header {
        min-height: 60px !important;
        padding: 9px 10px 9px 12px !important;
    }

    .wim-support-widget .wim-support-body,
    .wim-support-widget .wim-support-panel-messenger .wim-support-body {
        padding: 9px !important;
        max-height: calc(100dvh - 139px) !important;
    }

    .wim-support-widget.is-inline-messenger-open .wim-support-panel-messenger,
    .wim-support-widget .wim-support-panel-messenger.is-inline-messenger-open {
        top: 5px !important;
        right: 5px !important;
        bottom: 65px !important;
        left: 5px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wim-app *,
    .wim-support-widget *,
    .wim-modal-layer * {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}
