/* ========================================
   AD CREATIVES STYLES
   ======================================== */

/* Sidebar icon gradient */
.ad-creatives-icon {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header */
.ac-header {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    border-radius: 16px;
    padding: 28px 32px;
    margin-bottom: 24px;
    color: white;
}

.ac-header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ac-header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ac-header-icon {
    font-size: 28px;
    opacity: 0.9;
}

.ac-header-title {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.ac-header-subtitle {
    font-size: 14px;
    opacity: 0.85;
    margin: 4px 0 0;
}

.ac-header-credits {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(8px);
    border-radius: 10px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Tabs */
.ac-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-radius: 12px;
    overflow: hidden;
    border: 1.5px solid #e2e8f0;
    background: #f8fafc;
}

.ac-tab {
    flex: 1;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: transparent;
    color: #64748b;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.ac-tab:hover {
    background: #f1f5f9;
    color: #334155;
}

.ac-tab.active {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    color: white;
}

.ac-panel {
    animation: acFadeIn 0.2s ease;
}

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

/* Two-column layout */
.ac-two-col {
    display: grid;
    grid-template-columns: 400px 1fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .ac-two-col {
        grid-template-columns: 1fr;
    }
}

/* Controls column */
.ac-controls {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Cards */
.ac-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
}

.ac-card-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    background: #f8fafc;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ac-card-header i {
    color: #129ed9;
    font-size: 14px;
}

.ac-card-body {
    padding: 16px 18px;
}

/* Input mode toggle */
.ac-input-mode-toggle {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.ac-mode-btn {
    flex: 1;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.ac-mode-btn.active {
    background: #129ed9;
    color: white;
}

/* Select */
.ac-select {
    width: 100%;
    padding: 9px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    background: #fff;
    cursor: pointer;
    outline: none;
    transition: border-color 0.2s;
}

.ac-select:focus {
    border-color: #129ed9;
    box-shadow: 0 0 0 3px rgba(18, 158, 217, 0.1);
}

/* Product image grid */
.ac-product-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(64px, 1fr));
    gap: 8px;
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.ac-product-img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.15s;
}

.ac-product-img:hover {
    border-color: #129ed9;
    transform: scale(1.05);
}

.ac-product-img.selected {
    border-color: #129ed9;
    box-shadow: 0 0 0 3px rgba(18, 158, 217, 0.25);
}

/* Upload zone */
.ac-upload-zone {
    border: 2px dashed #e2e8f0;
    border-radius: 10px;
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #94a3b8;
}

.ac-upload-zone:hover,
.ac-upload-zone.drag-over {
    border-color: #129ed9;
    background: rgba(18, 158, 217, 0.04);
    color: #129ed9;
}

.ac-upload-zone i {
    font-size: 24px;
    margin-bottom: 8px;
    display: block;
}

.ac-upload-zone p {
    font-size: 13px;
    margin: 0;
}

.ac-upload-zone-sm {
    padding: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.ac-upload-zone-sm i {
    font-size: 14px;
    margin: 0;
}

.ac-upload-zone-sm span {
    font-size: 13px;
    cursor: pointer;
}

.ac-upload-link {
    color: #129ed9;
    cursor: pointer;
    font-weight: 500;
}

.ac-upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.ac-upload-thumb {
    position: relative;
    width: 64px;
    height: 64px;
}

.ac-upload-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.ac-upload-thumb .ac-remove-btn {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ef4444;
    color: white;
    border: none;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* Reference preview */
.ac-ref-preview {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

/* Badge */
.ac-badge {
    font-size: 10px;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 6px;
    background: rgba(18, 158, 217, 0.1);
    color: #129ed9;
    margin-left: 4px;
}

/* Hint text */
.ac-hint {
    font-size: 12px;
    color: #94a3b8;
    margin: 0 0 10px;
}

.ac-hint-inline {
    font-size: 11px;
    color: #94a3b8;
    font-weight: 400;
}

/* Labels */
.ac-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 6px;
}

/* Chip grid (hooks & angles) */
.ac-chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.ac-chip {
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-chip:hover {
    border-color: #129ed9;
    color: #129ed9;
    background: rgba(18, 158, 217, 0.04);
}

.ac-chip.selected {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    color: white;
    border-color: transparent;
}

/* Textarea */
.ac-textarea {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    resize: vertical;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.ac-textarea:focus {
    border-color: #129ed9;
    box-shadow: 0 0 0 3px rgba(18, 158, 217, 0.1);
}

/* Settings grid */
.ac-settings-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.ac-settings-grid.cols-4 {
    grid-template-columns: 1fr 1fr 1fr 1fr;
}

/* Toggle row */
.ac-toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* Cost bar */
.ac-cost-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    background: linear-gradient(135deg, #f0f9ff 0%, #ede9fe 100%);
    border: 1px solid #ddd6fe;
    border-radius: 12px;
}

.ac-cost-label {
    font-size: 13px;
    color: #6d28d9;
    font-weight: 500;
}

.ac-cost-label strong {
    font-size: 16px;
}

/* Generate button */
.ac-generate-btn {
    padding: 10px 24px;
    font-size: 14px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.ac-generate-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(18, 158, 217, 0.3);
}

.ac-generate-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Output area */
.ac-output {
    position: sticky;
    top: 24px;
}

.ac-output-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    background: linear-gradient(135deg, #f9fafb 0%, #f3f4f6 100%);
    border: 2px dashed rgba(229, 231, 235, 0.8);
    border-radius: 16px;
    color: #cbd5e1;
    text-align: center;
    padding: 40px;
}

.ac-output-placeholder i {
    font-size: 48px;
    margin-bottom: 12px;
}

.ac-output-placeholder p {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* Generated result */
.ac-result {
    animation: acSlideUp 0.3s ease;
}

@keyframes acSlideUp {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

.ac-result img,
.ac-result video {
    width: 100%;
    border-radius: 12px;
    display: block;
}

.ac-result-actions {
    display: flex;
    gap: 10px;
    margin-top: 16px;
    flex-wrap: wrap;
}

.ac-action-btn {
    padding: 9px 18px;
    font-size: 13px;
    font-weight: 500;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: white;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-action-btn:hover {
    border-color: #129ed9;
    color: #129ed9;
    background: rgba(18, 158, 217, 0.04);
}

.ac-action-btn.primary {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    color: white;
    border-color: transparent;
}

.ac-action-btn.primary:hover {
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.3);
}

.ac-action-btn.saved {
    background: linear-gradient(135deg, #ec4899, #f43f5e);
    color: white;
    border-color: transparent;
}

.ac-action-btn.meta {
    background: linear-gradient(135deg, #0081FB, #0064E0);
    color: white;
    border-color: transparent;
}

.ac-action-btn.meta:hover {
    box-shadow: 0 4px 12px rgba(0, 129, 251, 0.3);
}

.ac-creative-actions .meta {
    background: linear-gradient(135deg, #0081FB, #0064E0);
    color: white;
    border-color: transparent;
}

.ac-creative-actions .meta:hover {
    box-shadow: 0 4px 12px rgba(0, 129, 251, 0.3);
}

/* Skeleton loading */
.ac-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 16px;
    min-height: 400px;
    position: relative;
    overflow: hidden;
}

.ac-skeleton::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    animation: acShimmer 2s infinite;
}

@keyframes acShimmer {
    0% { left: -100%; }
    100% { left: 100%; }
}

.ac-skeleton-pulse {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(18, 158, 217, 0.1), rgba(164, 116, 235, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    animation: acPulse 2s ease-in-out infinite;
    margin-bottom: 16px;
}

@keyframes acPulse {
    0%, 100% { opacity: 0.6; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.05); }
}

.ac-skeleton-text {
    font-size: 14px;
    color: #64748b;
    font-weight: 500;
}

.ac-skeleton-detail {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 4px;
}

/* Video loading overlay */
.ac-video-loading {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc, #f1f5f9);
    border-radius: 12px;
    z-index: 2;
}

/* ===== AI VIDEO SCRIPT ===== */

.ac-script-layout {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.ac-scene-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.ac-scene-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    padding: 16px;
    background: #fafbfc;
    transition: border-color 0.2s;
}

.ac-scene-card.generating {
    border-color: #129ed9;
    background: rgba(18, 158, 217, 0.03);
}

.ac-scene-card.done {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.03);
}

.ac-scene-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    color: white;
    font-size: 12px;
    font-weight: 700;
    margin-right: 10px;
}

.ac-scene-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.ac-scene-header-left {
    display: flex;
    align-items: center;
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ac-scene-duration {
    font-size: 12px;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.ac-scene-status {
    font-size: 12px;
    font-weight: 500;
    padding: 3px 10px;
    border-radius: 6px;
}

.ac-scene-status.pending {
    background: #f1f5f9;
    color: #94a3b8;
}

.ac-scene-status.generating {
    background: rgba(18, 158, 217, 0.1);
    color: #129ed9;
    animation: acPulse 1.5s ease-in-out infinite;
}

.ac-scene-status.done {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
}

.ac-scene-status.error {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.ac-scene-prompt {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    min-height: 48px;
    color: #334155;
    box-sizing: border-box;
}

.ac-scene-prompt:focus {
    outline: none;
    border-color: #129ed9;
}

.ac-script-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #f1f5f9;
}

.ac-script-output-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

.ac-script-video-card {
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    overflow: hidden;
    background: white;
}

.ac-script-video-card video {
    width: 100%;
    display: block;
}

.ac-script-video-label {
    padding: 10px 14px;
    font-size: 12px;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* ===== MY CREATIVES LIBRARY ===== */

.ac-library-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.ac-library-filters {
    display: flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e2e8f0;
}

.ac-filter-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    background: #f8fafc;
    color: #64748b;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.ac-filter-btn.active {
    background: linear-gradient(135deg, #129ed9 0%, #a474eb 100%);
    color: white;
}

.ac-library-count {
    font-size: 13px;
    color: #94a3b8;
    font-weight: 500;
}

.ac-library-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.ac-library-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #94a3b8;
}

.ac-library-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    display: block;
    color: #cbd5e1;
}

.ac-library-empty p {
    font-size: 16px;
    font-weight: 600;
    color: #64748b;
    margin: 0 0 4px;
}

.ac-library-empty span {
    font-size: 13px;
}

.ac-creative-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    overflow: hidden;
    transition: all 0.2s;
}

.ac-creative-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08);
}

.ac-creative-thumb {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
    display: block;
    background: #f1f5f9;
}

.ac-creative-info {
    padding: 14px 16px;
}

.ac-creative-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 6px;
}

.ac-creative-type {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 5px;
}

.ac-creative-type.image {
    background: rgba(18, 158, 217, 0.1);
    color: #129ed9;
}

.ac-creative-type.video {
    background: rgba(164, 116, 235, 0.1);
    color: #a474eb;
}

.ac-creative-date {
    font-size: 11px;
    color: #94a3b8;
}

.ac-creative-prompt {
    font-size: 12px;
    color: #64748b;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 10px;
}

.ac-creative-tags {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ac-creative-tag {
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #64748b;
}

.ac-creative-actions {
    display: flex;
    gap: 6px;
}

.ac-creative-actions button {
    flex: 1;
    padding: 7px 0;
    font-size: 11px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    color: #64748b;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-creative-actions button:hover {
    border-color: #129ed9;
    color: #129ed9;
}

.ac-creative-actions button.danger:hover {
    border-color: #ef4444;
    color: #ef4444;
}

/* Remix modal */
.ac-remix-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.ac-remix-modal-content {
    background: white;
    border-radius: 16px;
    padding: 28px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.15);
}

.ac-remix-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.ac-remix-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #1e293b;
}

.ac-remix-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: #f1f5f9;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Spinner for loading states */
.ac-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: acSpin 0.6s linear infinite;
}

@keyframes acSpin {
    to { transform: rotate(360deg); }
}

/* ========================================
   AI AGENT
   ======================================== */

.ac-agent-info {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    padding: 20px;
    background: linear-gradient(135deg, #eff6ff 0%, #f0f0ff 100%);
    border: 1px solid #c7d2fe;
    border-radius: 12px;
    margin-top: 16px;
}

.ac-agent-info-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.ac-agent-info strong {
    font-size: 15px;
    color: #1e293b;
    display: block;
    margin-bottom: 4px;
}

.ac-agent-info p {
    font-size: 13px;
    color: #64748b;
    margin: 0;
    line-height: 1.5;
}

.ac-agent-create-btn {
    width: 100%;
    margin-top: 20px;
    padding: 14px 24px;
    font-size: 15px;
    font-weight: 700;
    font-family: 'Inter', sans-serif;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s;
    position: relative;
}

.ac-agent-create-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(18, 158, 217, 0.35);
}

.ac-agent-create-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.ac-agent-create-cost {
    font-size: 11px;
    font-weight: 500;
    opacity: 0.8;
    margin-left: 4px;
}

/* Strategy Card */
.ac-agent-strategy {
    margin-top: 20px;
    padding: 18px 20px;
    background: linear-gradient(135deg, #faf5ff 0%, #f0f9ff 100%);
    border: 1px solid #e0e7ff;
    border-radius: 12px;
}

.ac-agent-strategy-title {
    font-size: 13px;
    font-weight: 700;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.ac-agent-strategy-summary {
    font-size: 13px;
    color: #475569;
    margin-bottom: 8px;
    font-weight: 600;
}

.ac-agent-strategy-text {
    font-size: 13px;
    color: #64748b;
    line-height: 1.6;
}

/* Plan Grid */
.ac-agent-plan-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    margin-top: 16px;
}

.ac-agent-plan-card {
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s;
}

.ac-agent-plan-card.generating {
    border-color: #818cf8;
    animation: acAgentPulse 2s ease-in-out infinite;
}

.ac-agent-plan-card.done {
    border-color: #10b981;
}

.ac-agent-plan-card.error {
    border-color: #ef4444;
}

@keyframes acAgentPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(129, 140, 248, 0.3); }
    50% { box-shadow: 0 0 0 6px rgba(129, 140, 248, 0); }
}

.ac-agent-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f1f5f9;
}

.ac-agent-card-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ac-agent-badge {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 3px 8px;
    border-radius: 6px;
}

.ac-agent-badge.image {
    background: #dbeafe;
    color: #2563eb;
}

.ac-agent-badge.video {
    background: #fae8ff;
    color: #a855f7;
}

.ac-agent-card-label {
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.ac-agent-card-status {
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 20px;
}

.ac-agent-card-status.pending {
    background: #f1f5f9;
    color: #94a3b8;
}

.ac-agent-card-status.generating {
    background: #ede9fe;
    color: #7c3aed;
}

.ac-agent-card-status.done {
    background: #d1fae5;
    color: #059669;
}

.ac-agent-card-status.error {
    background: #fee2e2;
    color: #dc2626;
}

.ac-agent-card-body {
    padding: 14px 16px;
}

.ac-agent-card-tags {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 10px;
}

.ac-agent-card-tag {
    font-size: 11px;
    padding: 2px 8px;
    background: #f1f5f9;
    border-radius: 4px;
    color: #64748b;
}

.ac-agent-card-prompt {
    font-size: 12px;
    color: #64748b;
    line-height: 1.5;
    max-height: 48px;
    overflow: hidden;
    transition: max-height 0.3s;
}

.ac-agent-card-prompt.expanded {
    max-height: 500px;
}

.ac-agent-card-toggle {
    font-size: 11px;
    color: #818cf8;
    cursor: pointer;
    border: none;
    background: none;
    padding: 4px 0;
    font-weight: 600;
}

.ac-agent-card-scenes {
    margin-top: 10px;
}

.ac-agent-scene-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 12px;
    color: #64748b;
    border-bottom: 1px solid #f8fafc;
}

.ac-agent-scene-item:last-child { border-bottom: none; }

.ac-agent-scene-num {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: #64748b;
    flex-shrink: 0;
}

.ac-agent-scene-item.done .ac-agent-scene-num {
    background: #d1fae5;
    color: #059669;
}

.ac-agent-scene-item.generating .ac-agent-scene-num {
    background: #ede9fe;
    color: #7c3aed;
    animation: acAgentPulse 1.5s ease-in-out infinite;
}

/* Card Result Area */
.ac-agent-card-result {
    padding: 12px 16px;
    border-top: 1px solid #f1f5f9;
}

.ac-agent-card-result img {
    width: 100%;
    border-radius: 8px;
    max-height: 300px;
    object-fit: cover;
}

.ac-agent-card-result video {
    width: 100%;
    border-radius: 8px;
    max-height: 300px;
}

.ac-agent-card-result-actions {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-top: 10px;
}

/* Execute Bar */
.ac-agent-execute-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 20px;
    padding: 16px 20px;
    background: white;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
}

.ac-agent-execute-left {
    font-size: 14px;
    color: #475569;
}

.ac-agent-execute-right {
    display: flex;
    align-items: center;
}

/* Results */
.ac-agent-results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 24px;
    margin-bottom: 16px;
}

.ac-agent-results-header h3 {
    font-size: 16px;
    color: #1e293b;
    margin: 0;
}

.ac-agent-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* Skeleton for agent loading */
.ac-agent-skeleton {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    margin-top: 16px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-radius: 12px;
    border: 1.5px dashed #cbd5e1;
}

.ac-agent-skeleton-icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 22px;
    animation: acAgentPulse 2s ease-in-out infinite;
    margin-bottom: 16px;
}

.ac-agent-skeleton-text {
    font-size: 14px;
    font-weight: 600;
    color: #475569;
    margin-bottom: 4px;
}

.ac-agent-skeleton-sub {
    font-size: 12px;
    color: #94a3b8;
}

/* Progress bar for video generation */
.ac-agent-progress {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 10px;
    overflow: hidden;
}

.ac-agent-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #129ed9, #a474eb);
    border-radius: 2px;
    transition: width 0.5s ease;
}

/* ========================================
   PRODUCT PICKER
   ======================================== */

.ac-product-picker {
    position: relative;
    width: 100%;
}

.ac-picker-trigger {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    color: #334155;
    transition: all 0.2s;
    min-height: 42px;
    box-sizing: border-box;
}

.ac-picker-trigger:hover {
    border-color: #cbd5e1;
    background: #fafbfc;
}

.ac-picker-trigger.open {
    border-color: #129ed9;
    box-shadow: 0 0 0 3px rgba(18, 158, 217, 0.1);
}

.ac-picker-trigger-thumb {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
}

.ac-picker-trigger-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-picker-trigger-name {
    font-weight: 500;
    color: #1e293b;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-picker-trigger-detail {
    font-size: 11px;
    color: #94a3b8;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-picker-placeholder {
    color: #94a3b8;
    font-weight: 400;
}

.ac-picker-chevron {
    flex-shrink: 0;
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.2s;
}

.ac-picker-trigger.open .ac-picker-chevron {
    transform: rotate(180deg);
}

.ac-picker-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
    z-index: 200;
    overflow: hidden;
    animation: acPickerSlideIn 0.15s ease;
}

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

.ac-picker-search-wrap {
    padding: 10px 12px;
    border-bottom: 1px solid #f1f5f9;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 1;
}

.ac-picker-search {
    width: 100%;
    padding: 9px 12px 9px 34px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 13px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    outline: none;
    transition: border-color 0.2s;
    background: #f8fafc url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='%2394a3b8'%3E%3Cpath fill-rule='evenodd' d='M9 3.5a5.5 5.5 0 100 11 5.5 5.5 0 000-11zM2 9a7 7 0 1112.452 4.391l3.328 3.329a.75.75 0 11-1.06 1.06l-3.329-3.328A7 7 0 012 9z' clip-rule='evenodd'/%3E%3C/svg%3E") 10px center / 16px no-repeat;
    box-sizing: border-box;
}

.ac-picker-search:focus {
    border-color: #129ed9;
    background-color: #fff;
}

.ac-picker-list {
    max-height: 320px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ac-picker-list::-webkit-scrollbar {
    width: 6px;
}

.ac-picker-list::-webkit-scrollbar-track {
    background: transparent;
}

.ac-picker-list::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.ac-picker-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    cursor: pointer;
    transition: background 0.1s;
    border-bottom: 1px solid #f8fafc;
}

.ac-picker-item:last-child {
    border-bottom: none;
}

.ac-picker-item:hover {
    background: #f8fafc;
}

.ac-picker-item.selected {
    background: rgba(18, 158, 217, 0.06);
}

.ac-picker-item.selected::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #129ed9;
    border-radius: 0 2px 2px 0;
}

.ac-picker-item {
    position: relative;
}

.ac-picker-item-thumb {
    width: 44px;
    height: 44px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
}

.ac-picker-item-info {
    flex: 1;
    min-width: 0;
}

.ac-picker-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #1e293b;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.ac-picker-item-meta {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ac-picker-empty {
    padding: 24px 16px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.ac-picker-empty i {
    display: block;
    font-size: 24px;
    margin-bottom: 8px;
    color: #cbd5e1;
}

/* Product picker mobile bottom sheet (applied via JS class) */
.ac-picker-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.4);
    z-index: 10001;
    animation: acPickerFadeIn 0.15s ease;
}

@keyframes acPickerFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ac-picker-dropdown--mobile {
    position: fixed !important;
    top: auto !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    border-radius: 16px 16px 0 0 !important;
    max-height: 70vh;
    z-index: 10002 !important;
    animation: acPickerSlideUp 0.2s ease;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.15);
}

@keyframes acPickerSlideUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ac-picker-dropdown--mobile .ac-picker-list {
    max-height: 55vh;
}

.ac-picker-dropdown--mobile .ac-picker-item {
    padding: 12px 16px;
}

.ac-picker-dropdown--mobile .ac-picker-item-thumb {
    width: 48px;
    height: 48px;
}

/* ========================================
   CREATIVE EDITOR
   ======================================== */

.ac-editor-overlay {
    position: fixed;
    inset: 0;
    z-index: 10001;
    background: rgba(15, 23, 42, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: acEditorFadeIn 0.2s ease;
}

@keyframes acEditorFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.ac-editor-container {
    width: 95vw;
    max-width: 1280px;
    height: 90vh;
    max-height: 800px;
    background: #fff;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.25);
    animation: acEditorSlideUp 0.25s ease;
}

@keyframes acEditorSlideUp {
    from { opacity: 0; transform: translateY(16px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ac-editor-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
}

.ac-editor-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.ac-editor-header-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
}

.ac-editor-header h3 {
    font-size: 16px;
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.ac-editor-close {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ac-editor-close:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #334155;
}

.ac-editor-body {
    display: flex;
    flex: 1;
    min-height: 0;
}

.ac-editor-canvas-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8fafc;
    position: relative;
    overflow: hidden;
    min-width: 0;
}

.ac-editor-canvas-wrap canvas {
    max-width: 100%;
    max-height: 100%;
}

/* Video editor preview */
.ac-editor-video-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0f172a;
}

.ac-editor-video-wrap video {
    max-width: 100%;
    max-height: 100%;
    display: block;
}

.ac-editor-text-overlay {
    position: absolute;
    cursor: move;
    padding: 8px 16px;
    font-family: 'Inter', sans-serif;
    user-select: none;
    z-index: 2;
    border: 2px dashed transparent;
    border-radius: 4px;
    transition: border-color 0.15s;
}

.ac-editor-text-overlay:hover,
.ac-editor-text-overlay.active {
    border-color: #129ed9;
}

.ac-editor-sidebar {
    width: 300px;
    flex-shrink: 0;
    border-left: 1px solid #f1f5f9;
    overflow-y: auto;
    background: #fff;
}

.ac-editor-sidebar::-webkit-scrollbar {
    width: 5px;
}

.ac-editor-sidebar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 3px;
}

.ac-editor-section {
    border-bottom: 1px solid #f1f5f9;
}

.ac-editor-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: background 0.1s;
    user-select: none;
}

.ac-editor-section-header:hover {
    background: #fafbfc;
}

.ac-editor-section-header i {
    color: #94a3b8;
    font-size: 10px;
    transition: transform 0.2s;
}

.ac-editor-section-header.collapsed i {
    transform: rotate(-90deg);
}

.ac-editor-section-body {
    padding: 0 18px 16px;
}

.ac-editor-section-body.collapsed {
    display: none;
}

.ac-editor-text-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ac-editor-text-preset {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-editor-text-preset:hover {
    border-color: #129ed9;
    background: rgba(18, 158, 217, 0.03);
}

.ac-editor-text-preset i {
    color: #129ed9;
    font-size: 14px;
    width: 20px;
    text-align: center;
}

.ac-editor-text-preset-info {
    flex: 1;
}

.ac-editor-text-preset-name {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.ac-editor-text-preset-desc {
    font-size: 11px;
    color: #94a3b8;
    margin-top: 1px;
}

/* Slider controls */
.ac-editor-control {
    margin-bottom: 14px;
}

.ac-editor-control:last-child {
    margin-bottom: 0;
}

.ac-editor-control-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    color: #64748b;
    margin-bottom: 6px;
}

.ac-editor-control-value {
    font-weight: 600;
    color: #334155;
    font-size: 11px;
    min-width: 28px;
    text-align: right;
}

.ac-editor-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e2e8f0;
    outline: none;
    cursor: pointer;
}

.ac-editor-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #129ed9;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    transition: box-shadow 0.15s;
}

.ac-editor-slider::-webkit-slider-thumb:hover {
    box-shadow: 0 0 0 4px rgba(18, 158, 217, 0.15);
}

/* Crop presets */
.ac-editor-crop-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
}

.ac-editor-crop-btn {
    padding: 10px 8px;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-editor-crop-btn:hover {
    border-color: #129ed9;
    background: rgba(18, 158, 217, 0.03);
}

.ac-editor-crop-btn.active {
    border-color: #129ed9;
    background: rgba(18, 158, 217, 0.08);
    color: #129ed9;
}

.ac-editor-crop-btn-ratio {
    font-size: 14px;
    font-weight: 700;
    color: #334155;
}

.ac-editor-crop-btn.active .ac-editor-crop-btn-ratio {
    color: #129ed9;
}

.ac-editor-crop-btn-label {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 2px;
}

/* Text style controls */
.ac-editor-font-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.ac-editor-font-select {
    flex: 1;
    padding: 7px 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 12px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    outline: none;
    background: #fff;
    cursor: pointer;
}

.ac-editor-font-select:focus {
    border-color: #129ed9;
}

.ac-editor-color-input {
    width: 36px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    padding: 2px;
    background: #fff;
}

.ac-editor-style-btns {
    display: flex;
    gap: 4px;
    margin-bottom: 10px;
}

.ac-editor-style-btn {
    width: 34px;
    height: 34px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #64748b;
    font-size: 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.ac-editor-style-btn:hover {
    border-color: #129ed9;
    color: #129ed9;
}

.ac-editor-style-btn.active {
    background: #129ed9;
    color: #fff;
    border-color: #129ed9;
}

/* Toolbar */
.ac-editor-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    border-top: 1px solid #f1f5f9;
    flex-shrink: 0;
    background: #fff;
}

.ac-editor-toolbar-left {
    display: flex;
    gap: 8px;
}

.ac-editor-toolbar-right {
    display: flex;
    gap: 8px;
}

.ac-editor-tool-btn {
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.15s;
    font-family: 'Inter', sans-serif;
}

.ac-editor-tool-btn:hover {
    border-color: #129ed9;
    color: #129ed9;
}

.ac-editor-tool-btn.primary {
    background: linear-gradient(135deg, #129ed9, #a474eb);
    color: #fff;
    border: none;
}

.ac-editor-tool-btn.primary:hover {
    box-shadow: 0 4px 14px rgba(18, 158, 217, 0.35);
    transform: translateY(-1px);
}

.ac-editor-tool-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Video trim controls */
.ac-editor-trim-section {
    padding: 0 18px 16px;
}

.ac-editor-trim-track {
    position: relative;
    height: 40px;
    background: #f1f5f9;
    border-radius: 8px;
    margin: 12px 0;
    overflow: hidden;
    cursor: pointer;
}

.ac-editor-trim-range {
    position: absolute;
    top: 0;
    height: 100%;
    background: rgba(18, 158, 217, 0.15);
    border-left: 3px solid #129ed9;
    border-right: 3px solid #129ed9;
}

.ac-editor-trim-handle {
    position: absolute;
    top: 0;
    width: 14px;
    height: 100%;
    background: #129ed9;
    cursor: ew-resize;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    border-radius: 4px;
}

.ac-editor-trim-handle::after {
    content: '';
    width: 2px;
    height: 16px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 1px;
}

.ac-editor-trim-handle.start {
    left: 0;
    border-radius: 8px 4px 4px 8px;
}

.ac-editor-trim-handle.end {
    right: 0;
    border-radius: 4px 8px 8px 4px;
}

.ac-editor-trim-time {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    color: #64748b;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}

.ac-editor-playback-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
}

.ac-editor-play-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #129ed9, #a474eb);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    flex-shrink: 0;
}

.ac-editor-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(18, 158, 217, 0.3);
}

.ac-editor-time-display {
    font-size: 12px;
    color: #64748b;
    font-variant-numeric: tabular-nums;
    font-weight: 500;
}

.ac-editor-speed-select {
    padding: 5px 8px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 11px;
    font-family: 'Inter', sans-serif;
    color: #334155;
    outline: none;
    cursor: pointer;
    margin-left: auto;
}

/* ========================================
   RESPONSIVE — TABLET (≤900px)
   ======================================== */

@media (max-width: 900px) {
    /* Tabs: horizontal scroll on tablet/mobile */
    .ac-tabs {
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
    }
    .ac-tabs::-webkit-scrollbar { display: none; }
    .ac-tab {
        flex: 0 0 auto;
        padding: 10px 16px;
        white-space: nowrap;
        font-size: 12px;
    }

    /* Settings grids */
    .ac-settings-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
    }

    /* Library toolbar: stack */
    .ac-library-toolbar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
    }
    .ac-library-filters {
        width: 100%;
    }
    .ac-filter-btn {
        flex: 1;
        text-align: center;
    }
    .ac-library-count {
        text-align: center;
    }

    /* Agent execute bar: stack */
    .ac-agent-execute-bar {
        flex-direction: column;
        gap: 12px;
        align-items: stretch;
        text-align: center;
    }
    .ac-agent-execute-right {
        justify-content: center;
    }

    /* Agent plan grid */
    .ac-agent-plan-grid {
        grid-template-columns: 1fr;
    }

    /* Creative editor */
    .ac-editor-container {
        width: 100vw;
        height: 100vh;
        max-width: none;
        max-height: none;
        border-radius: 0;
    }
    .ac-editor-body {
        flex-direction: column;
    }
    .ac-editor-sidebar {
        width: 100%;
        border-left: none;
        border-top: 1px solid #f1f5f9;
        max-height: 40vh;
    }
    .ac-editor-canvas-wrap {
        min-height: 280px;
    }
    .ac-editor-header {
        padding: 12px 16px;
    }
    .ac-editor-toolbar {
        padding: 10px 16px;
        flex-wrap: wrap;
        gap: 8px;
    }
    .ac-editor-toolbar-left,
    .ac-editor-toolbar-right {
        gap: 6px;
    }
    .ac-editor-tool-btn {
        padding: 7px 12px;
        font-size: 12px;
    }

    /* Cost bar: stack if needed */
    .ac-cost-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }

    /* Script output grid */
    .ac-script-output-grid {
        grid-template-columns: 1fr;
    }

    /* Agent results grid */
    .ac-agent-results-grid {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   RESPONSIVE — MOBILE (≤640px)
   ======================================== */

@media (max-width: 640px) {
    /* Tabs: smaller, icons only on very small */
    .ac-tab {
        padding: 9px 12px;
        font-size: 11px;
        gap: 5px;
    }

    /* Section header within Ad Creatives */
    .section-header--adcreatives {
        padding: 18px 16px;
    }
    .section-header--adcreatives .ac-header-title {
        font-size: 22px;
    }
    .section-header--adcreatives p {
        font-size: 13px;
    }

    /* Two-column: already 1fr at 1100px, but tighten gap */
    .ac-two-col {
        gap: 16px;
    }

    /* Cards: less padding */
    .ac-card-header {
        padding: 12px 14px;
    }
    .ac-card-body {
        padding: 14px;
    }

    /* Generate button: full width */
    .ac-generate-btn {
        width: 100%;
        justify-content: center;
    }

    /* Action buttons: smaller */
    .ac-action-btn {
        padding: 8px 12px;
        font-size: 12px;
        gap: 5px;
    }

    /* Result actions: full width buttons */
    .ac-result-actions {
        flex-direction: column;
    }
    .ac-result-actions .ac-action-btn {
        width: 100%;
        justify-content: center;
    }

    /* Settings grid: single column on small */
    .ac-settings-grid {
        grid-template-columns: 1fr;
    }
    .ac-settings-grid.cols-4 {
        grid-template-columns: 1fr 1fr;
    }

    /* Upload zone: smaller */
    .ac-upload-zone {
        padding: 16px;
    }

    /* Library grid: single column */
    .ac-library-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    /* Creative card actions: wrap */
    .ac-creative-actions {
        flex-wrap: wrap;
    }
    .ac-creative-actions button {
        flex: 1 1 auto;
        min-width: 0;
        padding: 8px 6px;
        font-size: 10px;
    }

    /* Agent info box */
    .ac-agent-info {
        flex-direction: column;
        gap: 12px;
        padding: 16px;
    }

    /* Output placeholder: smaller */
    .ac-output-placeholder {
        min-height: 250px;
        padding: 24px;
    }
    .ac-output-placeholder i {
        font-size: 36px;
    }

    /* Product picker: mobile bottom sheet handled via JS class */
    .ac-picker-list {
        max-height: 50vh;
    }
    .ac-picker-search-wrap {
        padding: 12px 14px;
    }

    /* Editor: full-screen with better touch targets */
    .ac-editor-header h3 {
        font-size: 14px;
    }
    .ac-editor-header-icon {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }
    .ac-editor-close {
        width: 32px;
        height: 32px;
    }
    .ac-editor-sidebar {
        max-height: 45vh;
    }
    .ac-editor-canvas-wrap {
        min-height: 220px;
    }
    .ac-editor-section-header {
        padding: 12px 14px;
    }
    .ac-editor-section-body {
        padding: 0 14px 14px;
    }
    .ac-editor-text-preset {
        padding: 8px 12px;
    }
    .ac-editor-crop-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 6px;
    }
    .ac-editor-crop-btn {
        padding: 8px 6px;
    }
    .ac-editor-toolbar {
        padding: 10px 12px;
    }
    .ac-editor-tool-btn {
        padding: 6px 10px;
        font-size: 11px;
        gap: 4px;
    }

    /* Remix modal: wider */
    .ac-remix-modal-content {
        width: 95%;
        padding: 20px;
    }

    /* Skeleton: smaller */
    .ac-skeleton {
        min-height: 280px;
        padding: 40px 20px;
    }

    /* Agent skeleton */
    .ac-agent-skeleton {
        padding: 32px 16px;
    }

    /* Script actions: stack */
    .ac-script-actions {
        flex-direction: column;
        gap: 12px;
    }

    /* Scene card: tighter */
    .ac-scene-card {
        padding: 12px;
    }
}

/* ========================================
   RESPONSIVE — SMALL MOBILE (≤400px)
   ======================================== */

@media (max-width: 400px) {
    .ac-tab {
        padding: 8px 10px;
        font-size: 10px;
        gap: 4px;
    }
    .ac-tab i {
        font-size: 11px;
    }

    .ac-chip {
        padding: 5px 10px;
        font-size: 11px;
    }

    .section-header--adcreatives .ac-header-title {
        font-size: 20px;
    }

    .ac-editor-toolbar-left,
    .ac-editor-toolbar-right {
        flex-wrap: wrap;
    }
}
