:root {
    --sheko-ink: #172033;
    --sheko-muted: #667085;
    --sheko-line: #d8e0ea;
    --sheko-panel: #ffffff;
    --sheko-user: #dcfce7;
    --sheko-ai: #eef6ff;
    --sheko-brand: #0f766e;
    --sheko-brand-2: #1d4ed8;
}

.sheko-widget,
.sheko-widget * {
    box-sizing: border-box;
}

.sheko-widget {
    width: min(420px, 100%);
    min-height: 560px;
    display: grid;
    grid-template-rows: auto 1fr auto;
    overflow: hidden;
    border: 1px solid var(--sheko-line);
    border-radius: 8px;
    background: var(--sheko-panel);
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.14);
    color: var(--sheko-ink);
    font-family: Arial, Helvetica, sans-serif;
}

.sheko-widget.is-floating {
    position: fixed;
    right: 20px;
    bottom: 86px;
    z-index: 99998;
    max-height: min(640px, calc(100vh - 120px));
}

.sheko-widget.is-collapsed {
    display: none;
}

.sheko-launcher {
    position: fixed;
    right: 20px;
    bottom: 20px;
    z-index: 99999;
    width: 58px;
    height: 58px;
    border: 0;
    border-radius: 50%;
    background: var(--sheko-brand);
    color: #fff;
    font-size: 22px;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 12px 30px rgba(15, 118, 110, 0.32);
}

.sheko-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 16px;
    background: linear-gradient(135deg, var(--sheko-brand), var(--sheko-brand-2));
    color: #fff;
}

.sheko-title {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sheko-avatar {
    width: 36px;
    height: 36px;
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    font-weight: 800;
}

.sheko-title strong,
.sheko-title span {
    display: block;
}

.sheko-title span {
    color: rgba(255, 255, 255, 0.82);
    font-size: 13px;
}

.sheko-close {
    width: 34px;
    height: 34px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
}

.sheko-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px;
    overflow-y: auto;
    background: #f8fafc;
}

.sheko-message {
    width: fit-content;
    max-width: 82%;
    border: 1px solid var(--sheko-line);
    border-radius: 8px;
    padding: 10px 12px;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    line-height: 1.45;
    font-size: 14px;
}

.sheko-message.ai {
    align-self: flex-start;
    background: var(--sheko-ai);
}

.sheko-message.user {
    align-self: flex-end;
    background: var(--sheko-user);
}

.sheko-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    padding: 12px;
    border-top: 1px solid var(--sheko-line);
    background: #fff;
}

.sheko-input {
    min-height: 44px;
    max-height: 110px;
    resize: none;
    border: 1px solid var(--sheko-line);
    border-radius: 8px;
    padding: 10px 11px;
    font: inherit;
}

.sheko-send {
    min-width: 50px;
    height: 44px;
    border: 0;
    border-radius: 8px;
    background: var(--sheko-brand);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.sheko-send:disabled {
    opacity: 0.55;
    cursor: wait;
}

@media (max-width: 560px) {
    .sheko-widget.is-floating {
        inset: auto 10px 78px 10px;
        width: auto;
        min-height: min(560px, calc(100vh - 100px));
    }

    .sheko-launcher {
        right: 14px;
        bottom: 14px;
    }
}
