.job-ai-agent-button {
    align-items: center;
    display: inline-flex;
    justify-content: center;
    min-height: 2rem;
    min-width: 2rem;
}

.job-ai-agent-button .primary-icon {
    height: 1.25rem;
    width: 1.25rem;
}

.job-ai-agent-button-mobile {
    margin-left: auto;
}

.job-ai-agent-modal {
    z-index: 10040;
}

.job-ai-agent-panel {
    background: var(--background-primary, #fff);
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-width: 42rem;
    overflow: hidden;
    width: min(42rem, 100vw);
}

.job-ai-agent-header {
    align-items: center;
    border-bottom: 1px solid var(--border-color, #e4e6eb);
    display: flex;
    justify-content: space-between;
    padding: 1rem 1.25rem;
}

.job-ai-agent-mark {
    height: 1.75rem;
    width: 1.75rem;
}

.job-ai-agent-close {
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font-size: 1.8rem;
    line-height: 1;
    padding: .25rem;
}

.job-ai-agent-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 1rem;
    overflow-y: auto;
    padding: 1.25rem;
}

.job-ai-agent-intro,
.job-ai-agent-result-card {
    display: flex;
    flex-direction: column;
    gap: .7rem;
}

.job-ai-agent-description,
.job-ai-agent-generated-prompt {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-color, #d8dbe2);
    border-radius: .65rem;
    box-sizing: border-box;
    color: inherit;
    font: inherit;
    line-height: 1.45;
    padding: .8rem;
    resize: vertical;
    width: 100%;
}

.job-ai-agent-generated-prompt {
    background: var(--background-secondary, #f7f8fa);
}

.job-ai-agent-capability {
    background: var(--background-secondary, #f7f8fa);
    border-radius: .55rem;
    padding: .7rem .8rem;
}

.job-ai-agent-capability.is-allowed {
    border-left: .25rem solid #1f9d62;
}

.job-ai-agent-capability.is-limited {
    border-left: .25rem solid #d98d00;
}

.job-ai-agent-generate {
    align-items: center;
    display: inline-flex;
    gap: .45rem;
}

.job-ai-agent-generate.is-loading {
    opacity: .72;
}

.job-ai-agent-result {
    border-top: 1px solid var(--border-color, #e4e6eb);
    margin-top: .25rem;
    padding-top: 1rem;
}

.job-ai-agent-result:empty {
    display: none;
}

.business-ai-chat-history {
    display: flex;
    flex-direction: column;
    gap: .6rem;
    margin-bottom: .8rem;
}

.business-ai-chat-bubble {
    align-self: flex-start;
    background: var(--background-secondary, #f7f8fa);
    border: 1px solid var(--border-color, #e4e6eb);
    border-radius: .8rem .8rem .8rem .2rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    max-width: 88%;
    padding: .65rem .75rem;
    white-space: pre-wrap;
}

.business-ai-chat-bubble.is-user {
    align-self: flex-end;
    background: color-mix(in srgb, #1685e8 12%, var(--background-primary, #fff));
    border-radius: .8rem .8rem .2rem .8rem;
}

.business-ai-chat-speaker {
    color: var(--text-secondary, #667085);
    font-size: .7rem;
    font-weight: 600;
}

.business-ai-chat-composer {
    border-top: 1px solid var(--border-color, #e4e6eb);
    margin-top: .85rem;
    padding-top: .85rem;
}

.business-ai-chat-options {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.business-ai-chat-option {
    font-size: .82rem;
}

.business-ai-chat-reply {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-color, #d8dbe2);
    border-radius: .65rem;
    box-sizing: border-box;
    color: inherit;
    font: inherit;
    line-height: 1.4;
    padding: .65rem;
    resize: vertical;
    width: 100%;
}

.job-ai-agent-result-card {
    background: var(--background-secondary, #f7f8fa);
    border: 1px solid var(--border-color, #e4e6eb);
    border-radius: .8rem;
    padding: 1rem;
}

.job-ai-agent-result-card.is-blocked {
    border-color: #d97979;
}

.job-ai-agent-status {
    color: var(--text-secondary, #667085);
    font-size: .8rem;
}

.job-ai-agent-status.is-complete,
.business-ai-live-kicker {
    color: #16784a;
}

.job-ai-agent-spec-grid {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.job-ai-agent-spec-grid>div {
    background: var(--background-primary, #fff);
    border-radius: .55rem;
    display: flex;
    flex-direction: column;
    gap: .2rem;
    min-width: 0;
    padding: .65rem;
}

.job-ai-agent-spec-grid span {
    color: var(--text-secondary, #667085);
    font-size: .72rem;
}

.job-ai-agent-spec-grid strong {
    font-size: .82rem;
    overflow-wrap: anywhere;
}

.job-ai-email-preview {
    display: flex;
    flex-direction: column;
    gap: .5rem;
}

.job-ai-email-subject,
.job-ai-email-body {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-color, #e4e6eb);
    border-radius: .55rem;
    padding: .75rem;
}

.job-ai-email-body {
    display: flex;
    flex-direction: column;
    gap: .55rem;
}

.job-ai-preview-strong {
    font-weight: 700;
}

.job-ai-preview-large_strong {
    font-size: 1.25rem;
    font-weight: 700;
}

.job-ai-agent-warnings {
    background: #fff8e6;
    border-radius: .55rem;
    color: #5d4300;
    padding: .7rem .8rem;
}

.job-ai-agent-warnings ul {
    margin: .35rem 0 0 1rem;
    padding: 0;
}

.job-ai-agent-message {
    background: var(--background-secondary, #f7f8fa);
    border-radius: .55rem;
    padding: .75rem;
}

.job-ai-agent-message-error {
    background: #fff0f0;
    color: #9b1c1c;
}

.business-ai-runtime-checks {
    display: flex;
    flex-direction: column;
    gap: .45rem;
}

.business-ai-runtime-checks>div {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

.business-ai-check-pill {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-color, #d8dbe2);
    border-radius: 999px;
    font-size: .72rem;
    padding: .3rem .55rem;
}

.business-ai-live-result {
    border-color: color-mix(in srgb, #1f9d62 45%, var(--border-color, #e4e6eb));
}

.business-ai-period {
    align-items: center;
    background: var(--background-primary, #fff);
    border-radius: .55rem;
    display: flex;
    justify-content: space-between;
    padding: .65rem .75rem;
}

.business-ai-period span,
.business-ai-result-metrics span {
    color: var(--text-secondary, #667085);
    font-size: .75rem;
}

.business-ai-period strong {
    font-size: .82rem;
}

.business-ai-result-metrics {
    display: grid;
    gap: .65rem;
    grid-template-columns: repeat(auto-fit, minmax(8.5rem, 1fr));
}

.business-ai-result-metrics>div {
    background: var(--background-primary, #fff);
    border-radius: .6rem;
    display: flex;
    flex-direction: column;
    gap: .3rem;
    min-width: 0;
    padding: .75rem;
}

.business-ai-result-metrics strong {
    font-size: 1.1rem;
    overflow-wrap: anywhere;
}

.business-ai-table-wrap {
    background: var(--background-primary, #fff);
    border: 1px solid var(--border-color, #e4e6eb);
    border-radius: .65rem;
    overflow-x: auto;
}

.business-ai-result-table {
    border-collapse: collapse;
    min-width: 34rem;
    width: 100%;
}

.business-ai-result-table th,
.business-ai-result-table td {
    border-bottom: 1px solid var(--border-color, #e4e6eb);
    font-size: .8rem;
    padding: .65rem .7rem;
    text-align: left;
    white-space: nowrap;
}

.business-ai-result-table td:not(.is-number) {
    max-width: 20rem;
    white-space: normal;
}

.business-ai-result-status {
    color: #8a5600;
    font-weight: 600;
}

.business-ai-option-list {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.business-ai-result-table .is-number {
    font-variant-numeric: tabular-nums;
    text-align: right;
}

.business-ai-result-table thead th {
    color: var(--text-secondary, #667085);
    font-size: .72rem;
    font-weight: 600;
}

.business-ai-result-table tfoot th,
.business-ai-result-table tfoot td {
    border-bottom: 0;
    font-weight: 700;
}

.business-ai-plan-details {
    border-top: 1px solid var(--border-color, #e4e6eb);
    padding-top: .65rem;
}

.business-ai-plan-details>summary {
    color: var(--text-secondary, #667085);
    cursor: pointer;
    font-size: .78rem;
}

.business-ai-plan-details-body {
    display: flex;
    flex-direction: column;
    gap: .75rem;
    padding-top: .75rem;
}

@media (max-width: 720px) {
    .job-ai-agent-panel {
        max-width: none;
        width: 100vw;
    }

    .job-ai-agent-spec-grid,
    .business-ai-result-metrics {
        grid-template-columns: 1fr;
    }

    .job-ai-agent-actions {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .job-ai-agent-actions button {
        justify-content: center;
        width: 100%;
    }
}
