.aipower-widget {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    font-family: "Segoe UI", sans-serif;
}

.aipower-widget__launcher {
    border: 0;
    border-radius: 999px;
    padding: 14px 18px;
    background: linear-gradient(135deg, #0f172a, #1d4ed8);
    color: #fff;
    font-weight: 700;
    box-shadow: 0 14px 40px rgba(15, 23, 42, 0.3);
    cursor: pointer;
}

.aipower-widget__panel {
    display: none;
    width: min(440px, calc(100vw - 32px));
    margin-top: 12px;
    border-radius: 20px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.22);
    border: 1px solid rgba(15, 23, 42, 0.08);
}

.aipower-widget.is-open .aipower-widget__panel {
    display: block;
}

.aipower-widget__header {
    padding: 16px 18px;
    background: #0f172a;
    color: #fff;
}

.aipower-widget__title {
    font-size: 16px;
    font-weight: 700;
}

.aipower-widget__subtitle {
    margin-top: 4px;
    font-size: 13px;
    opacity: 0.85;
}

.aipower-widget__quick {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px 0;
}

.aipower-widget__quick-btn {
    border: 1px solid rgba(29, 78, 216, 0.15);
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 12px;
    font-weight: 600;
    padding: 8px 12px;
    cursor: pointer;
}

.aipower-widget__messages {
    max-height: 320px;
    overflow-y: auto;
    padding: 16px;
    display: grid;
    gap: 12px;
    background: linear-gradient(180deg, #eff6ff, #ffffff);
}

.aipower-widget__bubble {
    padding: 12px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.45;
    white-space: pre-wrap;
}

.aipower-widget__bubble--user {
    background: #1d4ed8;
    color: #fff;
    margin-left: 32px;
}

.aipower-widget__bubble--assistant {
    background: #e2e8f0;
    color: #0f172a;
    margin-right: 32px;
}

.aipower-widget__status {
    min-height: 18px;
    padding: 0 16px 8px;
    font-size: 12px;
    color: #475569;
}

.aipower-widget__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 16px 12px;
}

.aipower-widget__action {
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    border: 0;
    cursor: pointer;
}

.aipower-widget__action--primary {
    background: #16a34a;
    color: #fff;
}

.aipower-widget__action--secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.aipower-widget__form {
    display: grid;
    gap: 10px;
    padding: 16px;
    border-top: 1px solid rgba(15, 23, 42, 0.08);
}

.aipower-widget__input {
    min-height: 88px;
    border: 1px solid #cbd5e1;
    border-radius: 14px;
    padding: 12px 14px;
    resize: vertical;
}

.aipower-widget__submit {
    border: 0;
    border-radius: 14px;
    padding: 12px 16px;
    background: #16a34a;
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

@media (max-width: 640px) {
    .aipower-widget {
        right: 12px;
        bottom: 12px;
    }

    .aipower-widget__panel {
        width: min(100vw - 24px, 420px);
    }
}
