.simplex-chat {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 1000;
    font-family: inherit;
}

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

.simplex-chat-toggle {
    width: 64px;
    height: 64px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    cursor: pointer;
    overflow: visible;
}

.simplex-chat-toggle img {
    display: block;
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.simplex-chat-panel {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: min(360px, calc(100vw - 32px));
    height: min(480px, calc(100vh - 120px));
    border: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
    border-radius: 16px;
    background: var(--card, white);
    box-shadow: var(--shadow, 0 8px 22px rgba(0, 0, 0, .18));
    overflow: hidden;
}

.simplex-chat-header {
    min-height: 62px;
    padding: 10px 12px 10px 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
}

.simplex-chat-header div {
    display: flex;
    flex-direction: column;
}

.simplex-chat-header span {
    color: var(--muted, #62696e);
    font-size: 12px;
    margin-top: 2px;
}

.simplex-chat-header span.online {
    color: #16813a;
}

.simplex-chat-header span.offline {
    color: #9b2335;
}

.simplex-chat-header button {
    border: 0;
    background: transparent;
    font-size: 26px;
    cursor: pointer;
    color: inherit;
}

.simplex-chat-error {
    margin: 0;
    padding: 8px 12px;
    color: #9b2335;
    font-size: 13px;
}

.simplex-chat-messages {
    height: calc(100% - 122px);
    overflow-y: auto;
    padding: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.simplex-chat-message {
    max-width: 82%;
    padding: 8px 10px;
    border-radius: 12px;
    border: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
    align-self: flex-start;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.simplex-chat-message.from-operator {
    background: var(--soft-accent, rgba(223, 72, 154, .12));
    align-self: flex-end;
}

.simplex-chat-offline {
    min-height: 60px;
    margin: 0;
    display: flex;
    align-items: center;
    padding: 8px 16px;
    border-top: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
    color: var(--muted, #62696e);
    font-size: 13px;
}

.simplex-chat-form {
    height: 60px;
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 8px;
    border-top: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
}

.simplex-chat-form input,
.simplex-chat-name-form input {
    height: 42px;
    border: 1px solid var(--soft-border, rgba(0, 0, 0, .12));
    border-radius: 10px;
    padding: 0 10px;
}

.simplex-chat-form input {
    flex: 1;
    min-width: 0;
}

.simplex-chat-form button,
.simplex-chat-name-form button {
    height: 42px;
    border: 0;
    border-radius: 10px;
    background: var(--accent, #df489a);
    color: white;
    cursor: pointer;
}

.simplex-chat-form button {
    padding: 0 12px;
}

.simplex-chat-name-form {
    height: calc(100% - 62px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 20px;
}
