.tbs-ai-prompt-widget {
    --tbs-accent: #635bff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px 32px;
    width: 100%;
}

.tbs-ai-text-col {
    flex: 1 1 260px;
    min-width: 0;
}

.tbs-ai-action-col {
    flex: 0 1 auto;
    min-width: 0;
}

.tbs-ai-heading {
    margin: 0 0 6px;
    font-size: 19px;
    font-weight: 800;
    line-height: 1.35;
}

.tbs-ai-subheading {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* ট্যাবলেট/মোবাইলে টেক্সট উপরে, আইকন নিচে - স্ট্যাক হয়ে যাবে */
@media (max-width: 767px) {
    .tbs-ai-prompt-widget {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .tbs-ai-text-col,
    .tbs-ai-action-col {
        flex-basis: auto;
        width: 100%;
    }
}

/* ---------- Prompt box ---------- */
.tbs-ai-prompt-box {
    position: relative;
    width: min(360px, 100%);
    background: #f7f8fa;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
    padding: 16px 16px 12px;
    text-align: left;
    margin-bottom: 14px;
    transition: border-color .25s ease, box-shadow .25s ease;
}

.tbs-ai-prompt-box:focus-within {
    border-color: var(--tbs-accent);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--tbs-accent) 18%, transparent);
}

.tbs-ai-prompt-input {
    display: block;
    width: 100%;
    resize: none;
    border: none;
    background: transparent;
    outline: none;
    font-family: inherit;
    font-size: 15px;
    line-height: 1.6;
    color: #1f2937;
    min-height: 48px;
    overflow: hidden;
}

.tbs-ai-prompt-tools {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px dashed rgba(17, 24, 39, 0.08);
}

.tbs-ai-char-count {
    margin-right: auto;
    font-size: 12px;
    color: #9ca3af;
    font-variant-numeric: tabular-nums;
}

.tbs-ai-prompt-input.tbs-near-limit+.tbs-ai-prompt-tools .tbs-ai-char-count {
    color: #f59e0b;
}

.tbs-ai-tool-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 1px solid rgba(17, 24, 39, 0.1);
    background: #ffffff;
    color: #4b5563;
    border-radius: 999px;
    cursor: pointer;
    transition: transform .15s ease, color .2s ease, border-color .2s ease;
}

.tbs-ai-tool-btn:hover {
    color: var(--tbs-accent);
    border-color: var(--tbs-accent);
    transform: translateY(-1px);
}

.tbs-ai-tool-btn:active {
    transform: translateY(0) scale(0.94);
}

.tbs-ai-tool-btn.tbs-spin svg {
    animation: tbs-ai-spin .5s ease;
}

.tbs-ai-copy-feedback {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #111827;
    color: #fff;
    font-size: 11px;
    line-height: 1;
    white-space: nowrap;
    padding: 5px 8px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
}

.tbs-ai-copy-feedback::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-top-color: #111827;
}

.tbs-ai-tool-btn.tbs-copied .tbs-ai-copy-feedback {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ---------- Suggestion chips ---------- */
.tbs-ai-suggestions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 4px;
}

.tbs-ai-chip {
    border: 1px solid rgba(17, 24, 39, 0.12);
    background: #fff;
    color: #374151;
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 999px;
    cursor: pointer;
    transition: background .2s ease, color .2s ease, border-color .2s ease, transform .15s ease;
}

.tbs-ai-chip:hover {
    background: var(--tbs-accent);
    border-color: var(--tbs-accent);
    color: #fff;
    transform: translateY(-1px);
}

.tbs-ai-chip.tbs-chip-active {
    background: var(--tbs-accent);
    border-color: var(--tbs-accent);
    color: #fff;
}

/* ---------- Icons ---------- */
.tbs-ai-icons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.tbs-ai-icon-btn {
    --tbs-brand: var(--tbs-accent);
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 1px solid rgba(17, 24, 39, 0.08);
    background: #fff;
    border-radius: 14px;
    cursor: pointer;
    /* CSS-only entrance animation - কোনো JS-এর ওপর নির্ভর করে না, তাই
       Elementor এডিটরের প্রিভিউ iframe-এ (যেখানে JS নাও চলতে পারে) icon
       চিরস্থায়ীভাবে অদৃশ্য হয়ে থাকার ঝুঁকি নেই। */
    animation: tbs-ai-fade-in .45s ease both;
    transition: transform .3s ease,
        box-shadow .2s ease,
        border-color .2s ease,
        background .2s ease,
        filter .2s ease;
}

@keyframes tbs-ai-fade-in {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.tbs-ai-icon-btn:nth-child(1) {
    animation-delay: .02s;
}

.tbs-ai-icon-btn:nth-child(2) {
    animation-delay: .06s;
}

.tbs-ai-icon-btn:nth-child(3) {
    animation-delay: .10s;
}

.tbs-ai-icon-btn:nth-child(4) {
    animation-delay: .14s;
}

.tbs-ai-icon-btn:nth-child(5) {
    animation-delay: .18s;
}

.tbs-ai-icon-btn:nth-child(6) {
    animation-delay: .22s;
}

.tbs-ai-icon-btn:nth-child(7) {
    animation-delay: .26s;
}

.tbs-ai-icon-btn:nth-child(8) {
    animation-delay: .30s;
}

.tbs-ai-icon-btn:hover,
.tbs-ai-icon-btn:focus-visible {
    border-color: var(--tbs-brand);
    background-color: var(--tbs-hover-bg, var(--tbs-bg, revert));
    box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--tbs-brand) 45%, transparent);
    transform: translateY(-3px);
}

/* ---- Filled (colorful badge) mode - matches the reference screenshot ---- */
.tbs-icon-fill-yes .tbs-ai-icon-btn {
    background-color: var(--tbs-brand);
    border-color: transparent;
}

.tbs-icon-fill-yes .tbs-ai-icon-btn .tbs-ai-icon-inner i {
    color: #fff;
}

.tbs-icon-fill-yes .tbs-ai-icon-btn .tbs-ai-icon-inner svg {
    fill: #fff;
}

.tbs-icon-fill-yes .tbs-ai-icon-btn:hover,
.tbs-icon-fill-yes .tbs-ai-icon-btn:focus-visible {
    border-color: transparent;
    filter: brightness(1.08);
    box-shadow: 0 8px 18px -6px color-mix(in srgb, var(--tbs-brand) 60%, transparent);
}

.tbs-ai-icon-btn:active,
.tbs-ai-icon-btn.tbs-ai-clicked {
    transform: translateY(-1px) scale(0.94);
}

.tbs-ai-icon-btn:focus-visible {
    outline: 2px solid var(--tbs-brand);
    outline-offset: 3px;
}

.tbs-ai-icon-inner {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}

.tbs-ai-icon-inner i {
    font-size: 22px;
    color: #111827;
    transition: color .25s ease;
}

.tbs-ai-icon-btn:hover .tbs-ai-icon-inner i {
    color: var(--tbs-brand);
}

.tbs-ai-icon-inner img {
    width: 80%;
    height: 80%;
    object-fit: contain;
}

.tbs-ai-icon-inner svg {
    width: 22px;
    height: 22px;
}

/* Ripple pulse when clicked */
.tbs-ai-icon-btn::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--tbs-brand) 45%, transparent);
    opacity: 0;
}

.tbs-ai-icon-btn.tbs-ai-clicked::after {
    animation: tbs-ai-ripple .55s ease-out;
}

.tbs-ai-tooltip {
    position: absolute;
    bottom: calc(100% + 10px);
    left: 50%;
    transform: translateX(-50%) translateY(4px);
    background: #111827;
    color: #fff;
    font-size: 12px;
    line-height: 1;
    white-space: nowrap;
    padding: 6px 10px;
    border-radius: 6px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 2;
}

.tbs-ai-tooltip::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: #111827;
}

.tbs-ai-icon-btn:hover .tbs-ai-tooltip,
.tbs-ai-icon-btn:focus-visible .tbs-ai-tooltip {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

@keyframes tbs-ai-ripple {
    0% {
        box-shadow: 0 0 0 0 color-mix(in srgb, var(--tbs-brand) 45%, transparent);
        opacity: 1;
    }

    100% {
        box-shadow: 0 0 0 18px color-mix(in srgb, var(--tbs-brand) 0%, transparent);
        opacity: 0;
    }
}

@keyframes tbs-ai-spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(180deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .tbs-ai-prompt-widget * {
        animation: none !important;
        transition: none !important;
    }

    .tbs-ai-icons .tbs-ai-icon-btn {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 480px) {
    .tbs-ai-icon-btn {
        width: 46px;
        height: 46px;
    }

    .tbs-ai-heading {
        font-size: 17px;
    }
}