/**
 * EE Activity Modal Styles
 *
 * Zentrales Modal fuer Aktivitaeten-Eingabe (Anruf, Termin, E-Mail, Sonstiges).
 * Konzept v3.2 / Stufen 3-6.
 *
 * @since 2.11.0
 */

/* ===========================
 * Root + Backdrop + Container
 * =========================== */
.ee-activity-modal-root {
    position: fixed;
    inset: 0;
    z-index: 100200;
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 40px 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.ee-activity-modal-root.ee-am-open {
    display: flex;
}

.ee-activity-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    cursor: pointer;
    z-index: 1;
}

.ee-activity-modal-container {
    position: relative;
    z-index: 2;
    background: #fff;
    border-radius: 12px;
    width: 100%;
    max-width: 720px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 80px);
    overflow: hidden;
}

/* ===========================
 * Header / Body / Footer
 * =========================== */
.ee-activity-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 22px 14px;
    border-bottom: 1px solid #e5e7eb;
}

.ee-activity-modal-title {
    margin: 0;
    font-size: 17px;
    font-weight: 600;
    color: #111827;
    line-height: 1.35;
}

.ee-activity-modal-close {
    border: none;
    background: transparent;
    font-size: 26px;
    line-height: 1;
    color: #6b7280;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: background 0.12s ease, color 0.12s ease;
}
.ee-activity-modal-close:hover {
    background: #f3f4f6;
    color: #111827;
}

.ee-activity-modal-body {
    padding: 20px 22px;
    overflow-y: auto;
    flex: 1 1 auto;
}

.ee-activity-modal-footer {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 22px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
}

.ee-am-spacer {
    flex: 1 1 auto;
}

/* ===========================
 * Type-Selector (Phase 1)
 * =========================== */
.ee-am-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
}

.ee-am-type-card {
    --ee-am-color: #6b7280;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 18px 18px 16px;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: left;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.ee-am-type-card:hover {
    border-color: var(--ee-am-color);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.06);
    transform: translateY(-1px);
}
.ee-am-type-card:focus-visible {
    outline: 2px solid var(--ee-am-color);
    outline-offset: 2px;
}

.ee-am-type-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    background: color-mix(in srgb, var(--ee-am-color) 14%, #fff);
    color: var(--ee-am-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}
.ee-am-type-icon svg {
    width: 22px;
    height: 22px;
    stroke: var(--ee-am-color);
}

.ee-am-type-label {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
}

.ee-am-type-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* ===========================
 * Form (Phase 2)
 * =========================== */
.ee-am-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ee-am-row {
    display: flex;
    gap: 12px;
}
.ee-am-row > .ee-am-field--half {
    flex: 1 1 0;
    min-width: 0;
}

.ee-am-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.ee-am-label {
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ee-am-required {
    color: #ef4444;
    font-weight: 700;
}

.ee-am-input,
.ee-am-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #111827;
    background: #fff;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ee-am-input:focus,
.ee-am-textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ee-am-textarea {
    min-height: 90px;
    resize: vertical;
    line-height: 1.5;
}

/* Content Header + HTML Toggle */
.ee-am-content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.ee-am-html-toggle {
    background: #f0f0f0;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
    cursor: pointer;
    font-family: monospace;
    color: #555;
    line-height: 1.5;
    transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.ee-am-html-toggle:hover {
    background: #e8e8e8;
    border-color: #bbb;
}
.ee-am-html-toggle.is-active {
    background: #e3f2fd;
    border-color: #2196f3;
    color: #1565c0;
}

/* Formatted content preview (contenteditable div) */
.ee-am-content-preview {
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    min-height: 120px;
    max-height: 300px;
    overflow-y: auto;
    font-size: 14px;
    line-height: 1.5;
    background: #fff;
    color: #111827;
    font-family: inherit;
    box-sizing: border-box;
    width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: border-color 0.12s ease, box-shadow 0.12s ease;
}
.ee-am-content-preview:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}
.ee-am-content-preview:empty::before {
    content: attr(data-placeholder);
    color: #9ca3af;
    pointer-events: none;
}
.ee-am-content-preview.is-hidden,
.ee-am-textarea.is-hidden {
    display: none;
}

/* Ensure rendered HTML inside preview looks reasonable */
.ee-am-content-preview p {
    margin: 0 0 8px 0;
}
.ee-am-content-preview p:last-child {
    margin-bottom: 0;
}
.ee-am-content-preview a {
    color: #2563eb;
    text-decoration: underline;
}
.ee-am-content-preview ul,
.ee-am-content-preview ol {
    margin: 4px 0 8px 20px;
    padding: 0;
}
.ee-am-content-preview table {
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
}
.ee-am-content-preview table td,
.ee-am-content-preview table th {
    border: 1px solid #e5e7eb;
    padding: 4px 8px;
}

.ee-am-input-row {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.ee-am-input-row .ee-am-input {
    flex: 1 1 auto;
}

/* Segmented (Email-Direction) */
.ee-am-segmented {
    display: inline-flex;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}
.ee-am-segmented label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #374151;
    border-right: 1px solid #d1d5db;
    transition: background 0.12s ease, color 0.12s ease;
}
.ee-am-segmented label:last-child {
    border-right: none;
}
.ee-am-segmented input[type="radio"] {
    margin: 0;
    accent-color: #2563eb;
}
.ee-am-segmented label:hover {
    background: #f3f4f6;
}

/* ===========================
 * Contact Picker
 * =========================== */
.ee-am-contact-wrap {
    display: flex;
    gap: 6px;
    align-items: stretch;
}
.ee-am-contact-wrap .ee-am-input {
    flex: 1 1 auto;
}

.ee-am-inline-form {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 12px;
    background: #f9fafb;
    margin-top: 6px;
}

.ee-am-inline-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 10px;
}

.ee-am-inline-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

/* ===========================
 * Buttons
 * =========================== */
.ee-am-btn {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    background: #fff;
    color: #374151;
    transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
    line-height: 1.4;
    font-family: inherit;
}
.ee-am-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.ee-am-btn--primary {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}
.ee-am-btn--primary:hover:not(:disabled) {
    background: #1d4ed8;
    border-color: #1d4ed8;
}

.ee-am-btn--ghost {
    background: #fff;
    color: #374151;
    border-color: #d1d5db;
}
.ee-am-btn--ghost:hover:not(:disabled) {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.ee-am-btn--danger {
    background: #fff;
    color: #dc2626;
    border-color: #fecaca;
}
.ee-am-btn--danger:hover:not(:disabled) {
    background: #fee2e2;
    border-color: #fca5a5;
}

.ee-am-btn--ai {
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: #fff;
    border-color: transparent;
    padding: 8px 12px;
}
.ee-am-btn--ai:hover:not(:disabled) {
    filter: brightness(1.08);
}

.ee-am-link {
    background: none;
    border: none;
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
    font: inherit;
}
.ee-am-link:hover {
    color: #1d4ed8;
}

/* ===========================
 * Dropzone / File-List
 * =========================== */
.ee-am-dropzone {
    border: 2px dashed #d1d5db;
    border-radius: 10px;
    padding: 18px;
    background: #f9fafb;
    transition: border-color 0.15s ease, background 0.15s ease;
    text-align: center;
}
.ee-am-dropzone.is-dragover {
    border-color: #2563eb;
    background: #eff6ff;
}

.ee-am-dropzone-placeholder {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 6px;
}

.ee-am-file-list {
    list-style: none;
    margin: 10px 0 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
    text-align: left;
}
.ee-am-file-list:empty {
    display: none;
}

.ee-am-file-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    font-size: 13px;
}
.ee-am-file-name {
    flex: 1 1 auto;
    color: #111827;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    min-width: 0;
}
.ee-am-file-meta {
    color: #6b7280;
    font-size: 11px;
    flex: 0 0 auto;
}
.ee-am-file-remove {
    border: none;
    background: transparent;
    color: #9ca3af;
    cursor: pointer;
    font-size: 18px;
    line-height: 1;
    padding: 0 6px;
    border-radius: 4px;
    transition: color 0.12s ease, background 0.12s ease;
}
.ee-am-file-remove:hover {
    color: #ef4444;
    background: #fee2e2;
}

/* ===========================
 * Responsive
 * =========================== */
@media (max-width: 600px) {
    .ee-activity-modal-root {
        padding: 0;
    }
    .ee-activity-modal-container {
        max-width: 100%;
        border-radius: 0;
        max-height: 100vh;
    }
    .ee-am-type-grid {
        grid-template-columns: 1fr;
    }
    .ee-am-row {
        flex-direction: column;
    }
    .ee-am-inline-grid {
        grid-template-columns: 1fr;
    }
}

/* ===========================
 * Dark-Mode (optional via prefers-color-scheme)
 * =========================== */
@media (prefers-color-scheme: dark) {
    .ee-activity-modal-container {
        background: #1f2937;
        color: #e5e7eb;
    }
    .ee-activity-modal-header,
    .ee-activity-modal-footer {
        border-color: #374151;
    }
    .ee-activity-modal-footer {
        background: #111827;
    }
    .ee-activity-modal-title {
        color: #f9fafb;
    }
    .ee-am-type-card {
        background: #111827;
        border-color: #374151;
    }
    .ee-am-type-label {
        color: #f9fafb;
    }
    .ee-am-input,
    .ee-am-textarea,
    select.ee-am-input,
    input.ee-am-input,
    .ee-am-form input[type="text"],
    .ee-am-form input[type="number"],
    .ee-am-form input[type="datetime-local"],
    .ee-am-form input[type="date"],
    .ee-am-form select,
    .ee-am-form textarea {
        background: #111827 !important;
        border-color: #374151 !important;
        color: #f9fafb !important;
        color-scheme: dark;
    }
    .ee-am-form select option {
        background: #111827;
        color: #f9fafb;
    }
    .ee-am-segmented {
        background: #111827;
        border-color: #374151;
    }
    .ee-am-segmented label {
        color: #d1d5db;
        border-color: #374151;
    }
    .ee-am-dropzone {
        background: #111827;
        border-color: #374151;
    }
    .ee-am-file-item {
        background: #111827;
        border-color: #374151;
    }
    .ee-am-inline-form {
        background: #111827;
        border-color: #374151;
    }
    .ee-am-btn--ghost {
        background: #111827;
        color: #d1d5db;
        border-color: #374151;
    }
    .ee-am-btn--ghost:hover:not(:disabled) {
        background: #1f2937;
    }
    .ee-am-html-toggle {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }
    .ee-am-html-toggle.is-active {
        background: #1e3a5f;
        border-color: #2196f3;
        color: #90caf9;
    }
    .ee-am-content-preview {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }
    .ee-am-content-preview a {
        color: #60a5fa;
    }
    .ee-am-content-preview table td,
    .ee-am-content-preview table th {
        border-color: #374151;
    }

    /* Labels (TITEL, RICHTUNG, KONTAKT etc.) — #374151 on #1f2937 = ~1.6:1 FAIL */
    .ee-am-label {
        color: #94a3b8;
    }

    /* Type-Desc in type-selector */
    .ee-am-type-desc {
        color: #9ca3af;
    }

    /* Close button */
    .ee-activity-modal-close {
        color: #9ca3af;
    }
    .ee-activity-modal-close:hover {
        background: #374151;
        color: #f1f5f9;
    }

    /* Placeholder text in inputs/textareas */
    .ee-am-input::placeholder,
    .ee-am-textarea::placeholder {
        color: #6b7280;
    }
    .ee-am-content-preview:empty::before {
        color: #6b7280;
    }

    /* Dropzone placeholder */
    .ee-am-dropzone-placeholder {
        color: #9ca3af;
    }

    /* File list items */
    .ee-am-file-name {
        color: #e2e8f0;
    }
    .ee-am-file-meta {
        color: #9ca3af;
    }
    .ee-am-file-remove {
        color: #6b7280;
    }
    .ee-am-file-remove:hover {
        color: #f87171;
        background: rgba(239, 68, 68, 0.15);
    }

    /* Danger button */
    .ee-am-btn--danger {
        background: transparent;
        color: #f87171;
        border-color: #7f1d1d;
    }
    .ee-am-btn--danger:hover:not(:disabled) {
        background: rgba(239, 68, 68, 0.12);
        border-color: #991b1b;
    }

    /* Link button */
    .ee-am-link {
        color: #60a5fa;
    }
    .ee-am-link:hover {
        color: #93bbfd;
    }

    /* Segmented hover */
    .ee-am-segmented label:hover {
        background: #1f2937;
    }

    /* Follow-up hint */
    .ee-am-followup-hint {
        background: #1e293b;
        color: #94a3b8;
    }
    .ee-am-followup-hint.is-overdue {
        background: rgba(239, 68, 68, 0.12);
        color: #f87171;
        border-left-color: #ef4444;
    }
    .ee-am-followup-hint.is-empty {
        background: rgba(245, 158, 11, 0.1);
        color: #fbbf24;
    }

    /* KI AI badge / spinner */
    .ee-am-ai-badge {
        color: #a78bfa;
    }
    .ee-am-ai-spinner {
        color: #9ca3af;
    }
    .ee-am-ai-spinner::before {
        border-color: #4b5563;
        border-top-color: #a78bfa;
    }

    /* Task-loading text */
    .ee-am-task-loading {
        color: #9ca3af;
    }

    /* Primary button stays fine (blue on blue) */
    /* Ghost button hover override already exists above */

    /* Fallback: erzwinge helle Textfarbe im Preview-Div,
       falls doch mal HTML mit Inline-Styles eingefuegt wird
       (z.B. durch Drag&Drop oder Browser-Autofill). */
    .ee-am-content-preview,
    .ee-am-content-preview * {
        color: #e5e7eb !important;
    }
}

/* =========================================================
 * Follow-up Hint in Modal (Schritt 4)
 * ========================================================= */
.ee-am-followup-hint {
    font-size: 12px;
    color: #64748b;
    padding: 6px 10px;
    background: #f1f5f9;
    border-radius: 6px;
    margin-bottom: 6px;
    line-height: 1.5;
}
.ee-am-followup-hint:empty {
    display: none;
}
.ee-am-followup-hint.is-overdue {
    background: #fef2f2;
    color: #c62828;
    border-left: 3px solid #c62828;
}
.ee-am-followup-hint.is-empty {
    background: #fffbeb;
    color: #92400e;
    font-style: italic;
}
.ee-am-followup-hint-cd {
    opacity: 0.85;
}

/* ===========================
 * KI-Aufgaben-Banner
 * =========================== */
/* ── Header Actions (Bubble + Close) ── */
.ee-am-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Manueller "+ Aufgabe" Button im Header ── */
.ee-am-add-task-btn {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 10px;
    border-radius: 10px;
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(16, 185, 129, 0.25);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
.ee-am-add-task-btn:hover {
    background: rgba(16, 185, 129, 0.2);
    border-color: rgba(16, 185, 129, 0.4);
}

/* ── Task Bubble (klein und dezent im Header, links neben X) ── */
.ee-am-task-bubble {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    padding: 2px 8px;
    border-radius: 10px;
    background: rgba(99, 102, 241, 0.1);
    color: #818CF8;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid rgba(99, 102, 241, 0.2);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    line-height: 1.4;
}
.ee-am-task-bubble:hover {
    background: rgba(99, 102, 241, 0.2);
}
.ee-am-task-bubble.has-suggestions {
    background: rgba(99, 102, 241, 0.15);
    color: #6366F1;
}
.ee-am-task-bubble.is-loading {
    opacity: 0.7;
    pointer-events: none;
}

/* ── Task Dropdown (Body-Portal, UEBER dem Modal) ── */
.ee-am-task-dropdown {
    position: fixed;
    z-index: 100400;
    width: 380px;
    min-width: 300px;
    max-height: 300px;
    overflow-y: auto;
    background: #fff;
    border: 1px solid #E0E7FF;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2);
    padding: 6px;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.ee-am-task-dropdown-empty {
    font-size: 12px;
    color: #6B7280;
    text-align: center;
    padding: 12px 0;
}

.ee-am-task-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 8px;
    background: #fff;
    border-radius: 5px;
    transition: background 0.12s ease;
    cursor: default;
}
.ee-am-task-suggestion:hover {
    background: #F5F3FF;
}
.ee-am-task-suggestion.is-created {
    background: #F0FDF4;
}
.ee-am-task-suggestion-info {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1 1 auto;
    min-width: 0;
}
.ee-am-task-suggestion-title {
    font-size: 13px;
    font-weight: 600;
    color: #111827;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ee-am-task-suggestion-meta {
    font-size: 11px;
    color: #9CA3AF;
    padding-left: 18px;
}
.ee-am-task-suggestion-right {
    flex: 0 0 auto;
}
.ee-am-task-created-badge {
    font-size: 11px;
    font-weight: 600;
    color: #16A34A;
    padding: 2px 8px;
    background: #DCFCE7;
    border-radius: 4px;
}
.ee-am-btn--small {
    padding: 3px 10px;
    font-size: 11px;
}
.ee-am-task-loading {
    padding: 8px 0;
    text-align: center;
}

/* Dark mode support for task bubble/dropdown */
@media (prefers-color-scheme: dark) {
    .ee-am-task-bubble {
        background: rgba(129, 140, 248, 0.15);
        color: #A5B4FC;
        border-color: rgba(129, 140, 248, 0.25);
    }
    .ee-am-task-bubble:hover {
        background: rgba(129, 140, 248, 0.25);
    }
    .ee-am-task-bubble.has-suggestions {
        background: rgba(129, 140, 248, 0.2);
        color: #C7D2FE;
    }
    .ee-am-task-dropdown {
        background: #1F2937;
        border-color: #312E81;
        box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
    }
    .ee-am-task-dropdown-empty {
        color: #9CA3AF;
    }
    .ee-am-task-suggestion {
        background: #1F2937;
    }
    .ee-am-task-suggestion:hover {
        background: #283548;
    }
    .ee-am-task-suggestion.is-created {
        background: #052E16;
    }
    .ee-am-task-suggestion-title {
        color: #F9FAFB;
    }
    .ee-am-task-suggestion-meta {
        color: #9CA3AF;
    }
    .ee-am-task-created-badge {
        background: #052E16;
        color: #4ADE80;
    }
}

/* ── KI-Auto-Fill (Paste) ── */
.ee-am-ai-badge {
    font-size: 10px;
    color: #7c3aed;
    margin-left: 4px;
    font-weight: 500;
    letter-spacing: 0.02em;
    user-select: none;
}
.ee-am-ai-flash {
    animation: eeAmAiFlash 1.5s ease-out;
}
@keyframes eeAmAiFlash {
    0% { background-color: #fef3c7; }
    100% { background-color: transparent; }
}
.ee-am-ai-spinner {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: #6b7280;
    padding: 4px 8px;
    margin-top: 4px;
}
.ee-am-ai-spinner::before {
    content: '';
    width: 12px;
    height: 12px;
    border: 2px solid #d1d5db;
    border-top-color: #7c3aed;
    border-radius: 50%;
    animation: eeAmAiSpin 0.8s linear infinite;
}
@keyframes eeAmAiSpin {
    to { transform: rotate(360deg); }
}
.ee-am-ai-toast {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #7c3aed;
    color: #fff;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 6px;
    z-index: 10;
    animation: eeAmAiFadeIn 0.3s ease-out, eeAmAiFadeOut 0.4s 2.6s ease-in forwards;
    pointer-events: none;
}
@keyframes eeAmAiFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes eeAmAiFadeOut {
    from { opacity: 1; }
    to   { opacity: 0; }
}

/* ===========================
 * Duration Quick-Select Chips
 * =========================== */
.ee-duration-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 4px;
}

.ee-duration-chip {
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(0,0,0,0.04);
    color: var(--ee-text-secondary, #666);
    cursor: pointer;
    border: 1px solid transparent;
    transition: all 0.15s;
    font-family: inherit;
    line-height: 1.4;
}

.ee-duration-chip:hover {
    background: rgba(0,0,0,0.08);
}

.ee-duration-chip--active {
    background: var(--ee-green-light, #E8F5E9);
    color: var(--ee-green, #3FA14D);
    border-color: var(--ee-green, #3FA14D);
}

.ee-duration-chip--custom {
    color: var(--ee-text-muted, #999);
    font-style: italic;
}

.ee-am-duration-custom-input {
    margin-top: 4px;
}

/* Dark mode for duration chips */
@media (prefers-color-scheme: dark) {
    .ee-duration-chip {
        background: rgba(255,255,255,0.06);
        color: #94a3b8;
    }
    .ee-duration-chip:hover {
        background: rgba(255,255,255,0.1);
    }
    .ee-duration-chip--active {
        background: rgba(74, 222, 128, 0.15);
        color: #4ade80;
        border-color: #4ade80;
    }
    .ee-duration-chip--custom {
        color: #64748b;
    }
}
