.ai-tag-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: none;
    border-radius: 7px;
    background: #7c3aed;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s, box-shadow 0.2s, transform 0.15s;
}

.ai-tag-btn:hover {
    background: #6d28d9;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.22);
}

.ai-tag-btn:active {
    transform: translateY(1px);
}

.ai-tag-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(15, 23, 42, 0.48);
    z-index: 1200;
    padding: 20px;
}

.ai-tag-modal.is-open {
    display: flex;
}

.ai-tag-modal-dialog {
    width: min(980px, 100%);
    max-height: 88vh;
    overflow: auto;
    border-radius: 18px;
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
}

.ai-tag-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 22px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
}

.ai-tag-modal-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #1e293b;
}

.ai-tag-close {
    border: 0;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    background: #eef2ff;
    color: #4f46e5;
    font-size: 1.2rem;
    cursor: pointer;
}

.ai-tag-body {
    padding: 22px;
}

.ai-provider-list {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.ai-provider-check {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #334155;
    font-weight: 600;
}

.ai-provider-check input {
    accent-color: #7c3aed;
}

.ai-analysis-results {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
}

.ai-provider-card {
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: #fff;
    overflow: hidden;
}

.ai-provider-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px 14px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    font-weight: 700;
}

.ai-provider-status {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.ai-provider-status.completed {
    background: #dcfce7;
    color: #166534;
}

.ai-provider-status.error {
    background: #fee2e2;
    color: #b91c1c;
}

.ai-provider-card-body {
    padding: 14px;
    color: #334155;
}

.ai-provider-card-body p {
    margin: 0 0 10px;
    line-height: 1.55;
}

.ai-tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
}

.ai-tag-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border: 1px solid #e9d5ff;
    border-radius: 10px;
    background: #faf5ff;
    font-size: 12px;
    color: #4c1d95;
}

.ai-tag-item input {
    accent-color: #7c3aed;
}

.ai-provider-card-body h4 {
    margin: 14px 0 8px;
    color: #475569;
    font-size: 13px;
}

.ai-new-tag-list {
    display: grid;
    gap: 8px;
}

.ai-new-tag-item {
    align-items: flex-start;
    max-width: 100%;
}

.ai-new-tag-item input {
    margin-top: 3px;
}

.ai-new-tag-copy {
    display: grid;
    gap: 3px;
}

.ai-new-tag-copy small {
    color: #64748b;
    white-space: normal;
}

.ai-warning-list {
    margin: 10px 0 0;
    padding-left: 18px;
    color: #b91c1c;
}

.ai-empty-state {
    padding: 18px;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
    background: #f8fafc;
    color: #64748b;
    text-align: center;
}

.ai-tag-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
    padding-top: 16px;
    border-top: 1px solid #e2e8f0;
}

.ai-tag-actions button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 700;
}

.ai-tag-actions .primary {
    background: #7c3aed;
    color: #fff;
}

.ai-tag-actions .secondary {
    background: #e2e8f0;
    color: #0f172a;
}

.ai-tag-summary {
    margin-top: 12px;
    color: #475569;
    font-size: 13px;
}
