.fsp-form .fsp-ai {
    display: grid;
    grid-template-columns: 36px minmax(0, 1fr) auto;
    align-items: center;
    column-gap: 16px;
    row-gap: 10px;
    margin-top: 14px;
    padding: 18px 20px;
    border: 1px solid #d4dced;
    border-radius: 14px;
    background: linear-gradient(120deg, #f5f7fc 0%, #edf1fa 65%, #f3f5fb 100%);
    box-shadow: 0 4px 16px rgba(54, 73, 132, .07), inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.fsp-form .fsp-ai-panel-icon {
    width: 36px;
    height: 36px;
    align-self: start;
    margin-top: 2px;
}
.fsp-form .fsp-ai-copy {
    min-width: 0;
}
.fsp-form .fsp-ai-heading {
    margin: 0 0 6px;
    padding: 0;
    color: #364984;
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.35;
}
.fsp-form .fsp-ai-help {
    margin: 0;
    padding: 0;
    color: #65708b;
    font-size: 13px;
    line-height: 1.6;
}
.fsp-form .fsp-ai-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    min-width: 0;
    margin: 0;
}
.fsp-form .fsp-ai-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: auto;
    min-height: 44px;
    padding: 10px 16px;
    border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 10px;
    background: #364984;
    box-shadow: 0 4px 10px rgba(54, 73, 132, .14), inset 0 1px 0 rgba(255, 255, 255, .18);
    color: #fff;
    font: inherit;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
    white-space: nowrap;
    transition: box-shadow .2s ease;
}
.fsp-form .fsp-ai-actions .fsp-ai-format:hover:not(:disabled) {
    box-shadow: 0 6px 16px rgba(54, 73, 132, .25), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.fsp-form .fsp-ai-actions button[hidden] {
    display: none;
}
.fsp-form .fsp-ai-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    fill: currentColor;
}
.fsp-form .fsp-ai-actions .fsp-ai-undo {
    min-height: 32px;
    padding: 6px 12px;
    border: 1px solid #cad4ec;
    background: transparent;
    color: #364984;
    box-shadow: none;
    font-size: 13px;
}
.fsp-form .fsp-ai-actions button:disabled {
    opacity: .55;
    cursor: not-allowed;
}
.fsp-form .fsp-ai-actions .fsp-ai-format.is-formatting:disabled {
    opacity: 1;
}
.fsp-form .fsp-ai-format:not(.is-formatting):not(:disabled) .fsp-ai-icon,
.fsp-form .fsp-ai-format:not(.is-formatting):not(:disabled) .fsp-ai-format-label {
    animation: fsp-ai-text-pulse 2.2s ease-in-out infinite;
}
.fsp-form .fsp-ai-format.is-formatting .fsp-ai-icon {
    display: none;
}
@keyframes fsp-ai-text-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: .65; }
}
.fsp-form .fsp-ai-actions button:focus-visible {
    outline: 2px solid #364984;
    outline-offset: 3px;
}
.fsp-form .fsp-ai-loading[hidden] {
    display: none;
}
.fsp-form .fsp-ai-loading {
    display: inline-block;
    box-sizing: border-box;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: fsp-ai-spin .8s linear infinite;
}
@keyframes fsp-ai-spin {
    to { transform: rotate(360deg); }
}
@media (prefers-reduced-motion: reduce) {
    .fsp-form .fsp-ai-format .fsp-ai-icon,
    .fsp-form .fsp-ai-format .fsp-ai-format-label,
    .fsp-form .fsp-ai-loading {
        animation: none;
    }
}
.fsp-form .fsp-ai-status {
    grid-column: 2 / -1;
    margin: 0;
    color: #62708f;
    font-size: 13px;
    line-height: 1.5;
    font-weight: bold;
}
.fsp-form .fsp-ai-status:empty {
    display: none;
}
.fsp-form .fsp-ai-status[data-error="true"] {
    color: #c62828;
}
@media (max-width: 760px) {
    .fsp-form .fsp-ai {
        grid-template-columns: 36px minmax(0, 1fr);
        column-gap: 14px;
        padding: 18px;
    }
    .fsp-form .fsp-ai-panel-icon {
        width: 36px;
        height: 36px;
    }
    .fsp-form .fsp-ai-actions {
        grid-column: 2 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}
@media (max-width: 480px) {
    .fsp-form .fsp-ai {
        grid-template-columns: 32px minmax(0, 1fr);
        column-gap: 12px;
        padding: 18px;
    }
    .fsp-form .fsp-ai-panel-icon {
        width: 32px;
        height: 32px;
    }
    .fsp-form .fsp-ai-heading {
        font-size: 16px;
    }
    .fsp-form .fsp-ai-help {
        font-size: 13px;
    }
    .fsp-form .fsp-ai-actions,
    .fsp-form .fsp-ai-status {
        grid-column: 1 / -1;
    }
    .fsp-form .fsp-ai-actions .fsp-ai-format {
        width: 100%;
        min-height: 44px;
        padding: 10px 16px;
        font-size: 14px;
    }
}
