.vchat-widget {
    --vchat-accent: #3b82f6;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.vchat-widget.is-floating {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 99999;
}

.vchat-widget__toggle {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.vchat-widget.is-floating.is-right {
    right: 20px;
}

.vchat-widget.is-floating.is-left {
    left: 20px;
}

.vchat-widget__launcher {
    appearance: none;
    -webkit-appearance: none;
    width: auto;
    min-width: 44px;
    height: auto;
    min-height: 25px;
    border: 0;
    border-radius: 999px;
    background: var(--vchat-accent);
    color: #fff;
    padding: 12px 16px;
    cursor: pointer;
    text-indent: 0 !important;
    white-space: nowrap;
    line-height: 1.2;
    font-size: 15px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    box-shadow: 0 12px 20px rgba(26, 44, 95, 0.18);
}

.vchat-widget__launcher-icon {
    font-size: 15px;
    line-height: 1;
    width: 16px;
    height: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.vchat-widget__launcher-label {
    line-height: 1.2;
}

.vchat-widget__launcher-icon-img {
    width: 16px;
    height: 16px;
    object-fit: contain;
    display: block;
}

.vchat-widget__panel {
    width: min(380px, calc(100vw - 24px));
    margin-top: 10px;
    border: 1px solid #dce5f4;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
    display: none;
    box-shadow: 0 10px 30px rgba(17, 34, 68, 0.15);
}

.vchat-widget__panel.is-open {
    display: block;
}

.vchat-widget__toggle:checked + .vchat-widget__launcher + .vchat-widget__panel {
    display: block;
}

.vchat-widget.is-inline .vchat-widget__panel {
    display: block;
    position: static;
    width: 100%;
    max-width: 430px;
}

.vchat-widget__head {
    background: var(--vchat-accent);
    color: #fff;
    padding: 12px 14px;
    font-weight: 600;
}

.vchat-widget__messages {
    min-height: 190px;
    max-height: 360px;
    overflow: auto;
    background: #f7f9ff;
    padding: 12px;
}

.vchat-widget__bubble {
    max-width: 85%;
    margin: 8px 0;
    padding: 8px 10px;
    border-radius: 10px;
    line-height: 1.45;
    font-size: 14px;
}

.vchat-widget__bubble--user {
    margin-left: auto;
    background: var(--vchat-accent);
    color: #fff;
}

.vchat-widget__bubble--bot {
    background: #fff;
    color: #102345;
    border: 1px solid #dce5f4;
}

.vchat-widget__bubble--typing .vchat-widget__bubble-text {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-width: 26px;
}

.vchat-widget__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.3;
    animation: vchat-dot 1s infinite ease-in-out;
}

.vchat-widget__dot:nth-child(2) {
    animation-delay: 0.15s;
}

.vchat-widget__dot:nth-child(3) {
    animation-delay: 0.3s;
}

@keyframes vchat-dot {
    0%, 80%, 100% {
        transform: translateY(0);
        opacity: 0.25;
    }
    40% {
        transform: translateY(-3px);
        opacity: 1;
    }
}

.vchat-widget__ts {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    opacity: 0.7;
}

.vchat-widget__composer {
    display: flex;
    gap: 8px;
    padding: 10px;
    border-top: 1px solid #e4ebf7;
}

.vchat-widget__input {
    flex: 1;
    border: 1px solid #d8e2f4;
    border-radius: 8px;
    padding: 8px 10px;
}

.vchat-widget__send {
    border: 0;
    border-radius: 8px;
    background: var(--vchat-accent);
    color: #fff;
    padding: 0 14px;
    cursor: pointer;
}

.vchat-widget__reply-lead {
    margin-bottom: 8px;
    white-space: pre-wrap;
}

.vchat-widget__reply-buttons {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
}

.vchat-widget__reply-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    text-decoration: none;
    border-radius: 8px;
    background: var(--vchat-accent);
    color: #fff;
    padding: 6px 10px;
    font-size: 13px;
    font-weight: 600;
}

.vchat-widget__reply-btn:hover,
.vchat-widget__reply-btn:focus {
    color: #fff;
    filter: brightness(0.95);
}

.vchat-widget__reply-image-link {
    display: inline-block;
    max-width: 100%;
}

.vchat-widget__reply-image {
    display: block;
    width: 140px;
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid #dce5f4;
}

.vchat-widget__reply-file {
    color: var(--vchat-accent);
    font-weight: 600;
    text-decoration: underline;
    word-break: break-word;
}

.vchat-widget__reply-json {
    margin: 0;
    padding: 8px;
    border-radius: 8px;
    background: #f0f4ff;
    border: 1px solid #dce5f4;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 12px;
    line-height: 1.45;
}

.vchat-widget.is-theme-dark .vchat-widget__panel {
    background: #0b152a;
    border-color: #1f2f4a;
}

.vchat-widget.is-theme-dark .vchat-widget__messages {
    background: #081227;
}

.vchat-widget.is-theme-dark .vchat-widget__bubble--bot {
    background: #16263f;
    color: #e7eefb;
    border-color: #223553;
}

.vchat-widget.is-theme-dark .vchat-widget__ts {
    color: #aac0df;
}

.vchat-widget.is-theme-dark .vchat-widget__composer {
    border-top-color: #1f2f4a;
}

.vchat-widget.is-theme-dark .vchat-widget__input {
    background: #15253f;
    color: #eef4ff;
    border-color: #243a5d;
}

.vchat-widget.is-theme-dark .vchat-widget__input::placeholder {
    color: #9ab0d1;
}

.vchat-widget.is-theme-dark .vchat-widget__reply-image {
    border-color: #223553;
}

.vchat-widget.is-theme-dark .vchat-widget__reply-file {
    color: #9fc3ff;
}

.vchat-widget.is-theme-dark .vchat-widget__reply-json {
    background: #0f1d35;
    border-color: #243a5d;
    color: #d6e5ff;
}
