/* ==========================================
   AI Processing Phase
   ========================================== */

.ai-progress-bar {
    padding: var(--space-4) var(--space-5);
    border-bottom: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

.ai-progress-text {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-2);
}

.ai-streak {
    color: var(--color-amber-text);
    font-weight: 500;
    animation: ai-streak-bounce 0.5s var(--ease-in-out);
}

@keyframes ai-streak-bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.ai-progress-track {
    height: 4px;
    background: var(--border-light);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.ai-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-blue) 0%, var(--accent-blue-gradient-end) 100%);
    border-radius: var(--radius-full);
    transition: width var(--transition-smooth);
}

/* Current Task Display */
.ai-current-task {
    margin: var(--space-4) var(--space-5);
    padding: var(--space-5);
    background: var(--bg-tertiary);
    border-radius: var(--radius-lg);
}

.ai-task-quote {
    position: relative;
}

.ai-task-title {
    font-size: var(--font-size-md);
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-2);
}

.ai-task-title::before {
    content: '"';
}

.ai-task-title::after {
    content: '"';
}

/* v1.1.58 — Per-task "Why?" affordance. Opens the shared
   AIExplanation modal with the reasoning_traces row for the current
   triage suggestion. Quiet text button; sits on the right edge of
   the quote block so the title stays the visual focus. */
.ai-task-why-btn {
    position: absolute;
    top: 0;
    right: 0;
    background: transparent;
    border: 0;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    color: var(--text-tertiary);
    font-size: var(--font-size-xs);
    font-weight: 500;
    cursor: pointer;
    transition: background var(--duration-fast) var(--ease-in-out), color var(--duration-fast) var(--ease-in-out);
}
.ai-task-why-btn:hover {
    background: var(--bg-secondary);
    color: var(--accent-blue);
}
.ai-task-why-btn:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

.ai-task-notes {
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    line-height: var(--line-height-relaxed);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.ai-task-notes:empty {
    display: none;
}

/* Batch Banner - inline Apply All shortcut */
.ai-batch-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
}

.ai-batch-banner-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-1) var(--space-2);
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    transition: background var(--transition-fast);
}

.ai-batch-banner-btn:hover {
    background: var(--accent-blue-opacity-10);
}

/* Phase 3C — cluster-bundle nudge (clone of the batch banner, Jarvis-
   voiced). Blue accents only; #10B981 stays reserved for true inbox-zero. */
.ai-cluster-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    flex-wrap: wrap;
    padding: var(--space-3) var(--space-5);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    animation: aiClusterBannerIn var(--duration-slow) var(--ease-in-out);
}

.ai-cluster-banner .ai-zap {
    color: var(--accent-blue);
    flex-shrink: 0;
}

.ai-cluster-banner-text {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

.ai-cluster-banner-actions {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
}

/* ≥44px touch targets on every control (design-system floor). */
.ai-cluster-btn {
    background: none;
    border: none;
    color: var(--accent-blue);
    font-size: var(--font-size-sm);
    font-weight: 500;
    cursor: pointer;
    padding: var(--space-2) var(--space-3);
    min-height: 44px;
    border-radius: var(--radius-sm);
    font-family: var(--font-family);
    transition: background var(--duration-fast) var(--ease-in-out);
}

.ai-cluster-btn:hover {
    background: var(--accent-blue-opacity-10);
}

.ai-cluster-btn:disabled {
    opacity: 0.5;
    cursor: default;
}

.ai-cluster-btn-primary {
    font-weight: 600;
}

.ai-cluster-btn-text,
.ai-cluster-btn-dismiss {
    color: var(--text-secondary);
}

.ai-cluster-name-input {
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--text-primary);
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
    min-height: 44px;
    min-width: 180px;
}

@keyframes aiClusterBannerIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-cluster-banner { animation: none; }
    .ai-cluster-btn { transition: none; }
}

/* Phase 3C — batch per-row include checkboxes. The wrapping label is the
   ≥44px hit target; the native input keeps keyboard + AT semantics. */
.ai-batch-check-header {
    width: 44px;
}

.ai-batch-check-cell {
    width: 44px;
    text-align: center;
    padding: 0;
}

.ai-batch-check-hit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    min-height: 44px;
    cursor: pointer;
}

.ai-batch-row-check {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

/* Excluded rows read as excluded at a glance (100ms mute; the checkbox
   cell itself stays full-strength so re-including is obvious). */
.ai-batch-table tr td {
    transition: opacity var(--duration-fast) var(--ease-in-out);
}

.ai-batch-table tr.ai-batch-row-excluded td:not(.ai-batch-check-cell) {
    opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
    .ai-batch-table tr td { transition: none; }
}

/* Phase-1 fast inbox clarify — the proposal sentence. This is what
   will happen if the user does nothing but hit Enter (binding
   invariant: appliedFields in ai-inbox-processor.js's
   buildProposalSentence names exactly what's bolded here). */
.ai-proposal-sentence {
    display: flex;
    align-items: flex-start;
    gap: var(--space-2);
    margin: 0 var(--space-5) var(--space-3);
    padding: var(--space-3) var(--space-4);
    background: var(--accent-blue-opacity-10);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    line-height: var(--line-height-relaxed);
    color: var(--text-secondary);
}

.ai-proposal-sentence .ai-zap {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--accent-blue);
}

.ai-proposal-text strong {
    color: var(--accent-blue);
    font-weight: 600;
}

/* One-shot glow when a background AI enhancement swaps the sentence
   out from under the user — never a silent change. Class is added by
   enhanceWithAI's completion path and removed on animationend. */
.ai-proposal-sentence.ai-proposal-updated {
    animation: aiProposalGlow var(--duration-normal) var(--ease-in-out);
}

@keyframes aiProposalGlow {
    0% { background: var(--accent-blue-opacity-10); }
    40% { background: var(--accent-blue-opacity-20); }
    100% { background: var(--accent-blue-opacity-10); }
}

@media (prefers-reduced-motion: reduce) {
    .ai-proposal-sentence.ai-proposal-updated {
        animation: none;
    }
}
