.sofl-ai-helper-button {
    position: fixed;
    right: 24px;
    bottom: 28px;
    z-index: 1060;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 48px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    background: linear-gradient(135deg, #101828 0%, #274060 52%, #c8a24a 100%);
    box-shadow: 0 18px 45px rgba(16, 24, 40, .28);
    font-weight: 800;
    letter-spacing: 0;
}

.sofl-ai-helper-button i {
    width: 28px;
    height: 28px;
    display: inline-grid;
    place-items: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
}

.sofl-ai-helper-button:hover,
.sofl-ai-helper-button:focus {
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 22px 55px rgba(16, 24, 40, .34);
}

.sofl-ai-helper-backdrop {
    position: fixed;
    inset: 0;
    z-index: 1065;
    background: rgba(15, 23, 42, .36);
    backdrop-filter: blur(3px);
}

.sofl-ai-helper-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 1070;
    width: min(460px, 100vw);
    display: flex;
    flex-direction: column;
    background: #fbfcff;
    box-shadow: -28px 0 70px rgba(15, 23, 42, .24);
    transform: translateX(104%);
    transition: transform .24s ease;
}

.sofl-ai-helper-panel.is-open {
    transform: translateX(0);
}

.sofl-ai-helper-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 24px;
    color: #fff;
    background:
        linear-gradient(135deg, rgba(16, 24, 40, .98), rgba(39, 64, 96, .96)),
        radial-gradient(circle at top right, rgba(200, 162, 74, .26), transparent 38%);
}

.sofl-ai-helper-title {
    display: flex;
    align-items: center;
    gap: 14px;
}

.sofl-ai-helper-title h2 {
    margin: 0;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 800;
}

.sofl-ai-helper-title p {
    margin: 2px 0 0;
    color: rgba(255, 255, 255, .74);
    font-size: .86rem;
}

.sofl-ai-helper-mark {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    border-radius: 16px;
    background: rgba(255, 255, 255, .12);
    color: #f4d06f;
}

.sofl-ai-helper-close {
    width: 38px;
    height: 38px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 50%;
    color: #fff;
    background: rgba(255, 255, 255, .08);
}

.sofl-ai-helper-body {
    flex: 1;
    overflow-y: auto;
    padding: 22px;
}

.sofl-ai-context-badge {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2px 10px;
    align-items: center;
    padding: 14px;
    border: 1px solid #e7edf6;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 30px rgba(31, 41, 55, .06);
}

.sofl-ai-context-badge i {
    grid-row: span 2;
    color: #c8a24a;
}

.sofl-ai-context-badge span {
    color: #667085;
    font-size: .74rem;
    font-weight: 800;
    text-transform: uppercase;
}

.sofl-ai-context-badge strong {
    color: #101828;
    font-size: .95rem;
    line-height: 1.35;
}

.sofl-ai-helper-form {
    display: grid;
    gap: 14px;
    margin-top: 18px;
}

.sofl-ai-helper-input {
    border-color: #d7deea;
    border-radius: 8px;
    resize: vertical;
}

.sofl-ai-helper-input:focus {
    border-color: #c8a24a;
    box-shadow: 0 0 0 .2rem rgba(200, 162, 74, .18);
}

.sofl-ai-prompt-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sofl-ai-prompt-chip {
    border: 1px solid #dde6f2;
    border-radius: 999px;
    padding: 8px 12px;
    color: #274060;
    background: #fff;
    font-size: .85rem;
    font-weight: 800;
    cursor: pointer;
}

.sofl-ai-prompt-chip:hover,
.sofl-ai-prompt-chip:focus {
    border-color: #c8a24a;
    color: #101828;
    background: #fff9e8;
}

.sofl-ai-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 46px;
    border: 0;
    border-radius: 8px;
    color: #101828;
    background: linear-gradient(135deg, #f4d06f, #c8a24a);
    font-weight: 900;
    box-shadow: 0 12px 28px rgba(200, 162, 74, .28);
}

.sofl-ai-submit-loading,
.sofl-ai-submit.is-loading .sofl-ai-submit-label {
    display: none;
}

.sofl-ai-submit.is-loading .sofl-ai-submit-loading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.sofl-ai-response-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid #e4eaf3;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 16px 40px rgba(31, 41, 55, .08);
}

.sofl-ai-response-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 12px;
    color: #101828;
    font-weight: 900;
}

.sofl-ai-clear-link {
    border: 0;
    padding: 0;
    color: #667085;
    background: transparent;
    font-size: .82rem;
    font-weight: 800;
}

.sofl-ai-response-body {
    color: #344054;
    line-height: 1.7;
}

.sofl-ai-related-grid {
    display: grid;
    gap: 10px;
    margin-top: 16px;
}

.sofl-ai-related-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px;
    border: 1px solid #e8eef6;
    border-radius: 8px;
    color: #101828;
    background: #f8fafc;
    text-decoration: none;
}

.sofl-ai-related-card:hover {
    color: #101828;
    border-color: #c8a24a;
    background: #fff;
}

.sofl-ai-related-card i {
    color: #c8a24a;
}

.sofl-ai-related-card strong {
    display: block;
    font-size: .92rem;
}

.sofl-ai-related-card span,
.sofl-ai-related-card small {
    display: block;
    color: #667085;
    font-size: .78rem;
}

.sofl-ai-related-card.is-placeholder {
    grid-template-columns: auto 1fr;
    color: #667085;
}

.sofl-ai-disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin-top: 16px;
    padding: 12px;
    border-radius: 8px;
    color: #5b6472;
    background: #f1f5f9;
    font-size: .82rem;
    font-weight: 700;
}

.sofl-ai-empty-state {
    margin-top: 18px;
    padding: 22px;
    border: 1px dashed #d6deeb;
    border-radius: 8px;
    text-align: center;
    background: #fff;
}

.sofl-ai-empty-icon {
    width: 46px;
    height: 46px;
    display: inline-grid;
    place-items: center;
    margin-bottom: 12px;
    border-radius: 16px;
    color: #c8a24a;
    background: #fff7df;
}

.sofl-ai-empty-state h3,
.sofl-ai-locked-state h3,
.sofl-ai-knowledge-gap h3 {
    margin: 0 0 8px;
    color: #101828;
    font-size: 1rem;
    font-weight: 900;
}

.sofl-ai-empty-state p,
.sofl-ai-locked-state p,
.sofl-ai-knowledge-gap p {
    margin: 0;
    color: #667085;
    line-height: 1.6;
}

.sofl-ai-empty-cta {
    display: inline-flex;
    margin-top: 14px;
    color: #274060;
    font-weight: 900;
    text-decoration: none;
}

.sofl-ai-locked-state {
    margin-top: 18px;
    padding: 24px;
    border: 1px solid #eadcae;
    border-radius: 8px;
    background: #fffaf0;
}

.sofl-ai-history {
    margin-top: 18px;
}

.sofl-ai-history-title {
    margin-bottom: 8px;
    color: #667085;
    font-size: .78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.sofl-ai-history-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.sofl-ai-history-list button {
    border: 1px solid #e3e9f2;
    border-radius: 999px;
    padding: 6px 10px;
    color: #475467;
    background: #fff;
    font-size: .78rem;
}

.sofl-ai-admin-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 18px;
    padding: 24px;
    margin-bottom: 20px;
    border-radius: 8px;
    color: #fff;
    background: linear-gradient(135deg, #101828, #274060);
    box-shadow: 0 20px 55px rgba(16, 24, 40, .18);
}

.sofl-ai-admin-hero h1 {
    color: #fff;
    margin: 0 0 6px;
    font-weight: 900;
}

.sofl-ai-admin-hero p {
    margin: 0;
    color: rgba(255, 255, 255, .72);
}

.sofl-ai-admin-table {
    overflow: hidden;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(31, 41, 55, .07);
}

.sofl-ai-admin-table thead th {
    color: #667085;
    background: #f8fafc;
    font-size: .78rem;
    text-transform: uppercase;
}

.sofl-ai-admin-table td span {
    display: block;
    color: #667085;
    font-size: .78rem;
}

.sofl-ai-question-cell {
    min-width: 320px;
    max-width: 540px;
    color: #101828;
    font-weight: 700;
}

.sofl-ai-module-pill,
.sofl-ai-status {
    display: inline-flex !important;
    align-items: center;
    width: max-content;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: .76rem;
    font-weight: 900;
}

.sofl-ai-module-pill {
    color: #274060 !important;
    background: #edf4fb;
}

.sofl-ai-status.is-answered {
    color: #087443 !important;
    background: #dcfae6;
}

.sofl-ai-status.is-unanswered {
    color: #b54708 !important;
    background: #fff3d6;
}

.sofl-ai-knowledge-gap {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 18px;
    border: 1px solid #eadcae;
    border-radius: 8px;
    background: #fffaf0;
}

.sofl-ai-gap-actions {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: flex-end;
    gap: 8px;
}

.sofl-ai-rules-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.sofl-ai-rule-card {
    padding: 18px;
    border: 1px solid #e6edf5;
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 10px 28px rgba(31, 41, 55, .06);
}

.sofl-ai-rule-edit {
    display: grid;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid #edf2f7;
}

@media (max-width: 767.98px) {
    .sofl-ai-helper-button {
        right: 16px;
        bottom: 18px;
        width: 52px;
        padding: 0;
        justify-content: center;
        border-radius: 50%;
    }

    .sofl-ai-helper-button span {
        display: none;
    }

    .sofl-ai-helper-panel {
        width: 100vw;
    }

    .sofl-ai-admin-hero,
    .sofl-ai-knowledge-gap {
        align-items: stretch;
        flex-direction: column;
    }

    .sofl-ai-gap-actions {
        justify-content: flex-start;
    }
}
