/* create-post.css — styles for the Create New Post page */

    /* Create Post — AI Workspace */
    .create-post-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 20px;
    }
    .create-post-header .page-title {
        margin-bottom: 2px;
    }
    .create-post-header .page-subtitle {
        margin: 0;
    }
    .create-post-header .page-subtitle a {
        color: var(--pc-sidebar-active-color, #4338ca);
        text-decoration: none;
        font-weight: 500;
    }
    .create-post-header .page-subtitle a:hover {
        text-decoration: underline;
    }

    /* Workspace — full width, centered, no container feel */
    .workspace-root {
        max-width: 100%;
        margin: 0 auto;
    }

    .workspace-card {
        background: transparent;
        border: none;
        border-radius: 0;
        box-shadow: none;
    }

    .workspace-card:hover {
        transform: none;
        box-shadow: none;
    }

    .workspace-body {
        padding: 0;
    }

    /* Alerts — quiet inline guidance */
    .workspace-body .alert {
        border-radius: 10px;
        font-size: 13px;
        padding: 12px 16px;
        border: none;
        border-left: 3px solid;
        box-shadow: none;
        line-height: 1.5;
    }

    .workspace-body .alert-info {
        background: rgba(99, 102, 241, 0.04);
        border-left-color: #a5b4fc;
        color: #4a5568;
    }

    .workspace-body .alert-warning {
        background: rgba(217, 119, 6, 0.04);
        border-left-color: #fbbf24;
        color: #4a5568;
    }

    .workspace-body .alert-danger {
        background: rgba(220, 38, 38, 0.04);
        border-left-color: #f87171;
        color: #4a5568;
    }

    .workspace-body .alert h5,
    .workspace-body .alert h6 {
        font-size: 13.5px;
        color: var(--pc-text-primary, #111827);
        margin-bottom: 4px;
    }

    .workspace-body .alert p {
        margin-bottom: 6px;
    }

    .workspace-body .alert .alert-heading i {
        opacity: 0.6;
    }

    .workspace-body .alert .btn {
        font-size: 12px;
        padding: 4px 12px;
    }

    /* Form labels — cleaner */
    .workspace-body .form-label {
        font-size: 14px;
        font-weight: 600;
        color: var(--pc-text-primary, #111827);
        margin-bottom: 6px;
    }

    .workspace-body .form-text {
        font-size: 12.5px;
        color: var(--pc-text-muted, #7c8898);
    }

    .workspace-body .form-control,
    .workspace-body .form-select {
        border-radius: 10px;
        border: 1.5px solid #e2e7ef;
        padding: 10px 14px;
        font-size: 14.5px;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .workspace-body .form-control:focus,
    .workspace-body .form-select:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
    }

    /* Workspace sections — visual grouping */
    .ws-section {
        padding: 20px 0;
        border-bottom: 1px solid #f0f2f6;
    }

    .ws-section:first-child {
        padding-top: 0;
    }

    .ws-section:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .ws-section-label {
        font-size: 11px;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: var(--pc-text-muted, #7c8898);
        margin-bottom: 12px;
        display: flex;
        align-items: center;
        gap: 6px;
    }

    .ws-section-label i {
        font-size: 13px;
        opacity: 0.7;
    }

    /* Collapse alerts into slim inline banners */
    .ws-alert {
        font-size: 13px;
        padding: 10px 14px;
        border-radius: 10px;
        margin-bottom: 10px;
        display: flex;
        align-items: flex-start;
        gap: 10px;
        line-height: 1.45;
    }

    .ws-alert i {
        margin-top: 2px;
        font-size: 14px;
        flex-shrink: 0;
    }

    .ws-alert-info {
        background: #f0f4ff;
        border: 1px solid #dbeafe;
        color: #1e40af;
    }

    .ws-alert-warning {
        background: #fffbeb;
        border: 1px solid #fde68a;
        color: #92400e;
    }

    /* Topic input — hero-sized */
    .ws-topic-input {
        font-size: 17px;
        padding: 14px 18px;
        border-radius: 12px;
        border: 2px solid #e2e7ef;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    .ws-topic-input:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
    }

    /* AI Config panel — grouped, lighter */
    .ws-config-row {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 16px;
    }

    .ws-config-item label {
        font-size: 12px;
        font-weight: 600;
        color: var(--pc-text-muted, #7c8898);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-bottom: 6px;
        display: block;
    }

    /* Submit area — sticky and prominent */
    .ws-submit-area {
        position: sticky;
        bottom: 0;
        background: linear-gradient(180deg, rgba(252, 252, 254, 0) 0%, #fcfcfe 20%);
        padding: 20px 0 4px;
        margin-top: 16px;
        z-index: 10;
    }

    .ws-submit-area .btn-primary {
        padding: 12px 28px;
        font-size: 15px;
        font-weight: 600;
        border-radius: 12px;
    }

    /* Existing content browser */
    #existing-content-section .alert {
        font-size: 12.5px;
        padding: 8px 12px;
        margin-bottom: 10px;
    }

    /* Special instructions — emphasis */
    #special-instructions-section textarea {
        border-radius: 10px;
        border: 2px solid #e2e7ef;
        transition: border-color 0.2s, box-shadow 0.2s;
    }

    #special-instructions-section textarea:focus {
        border-color: #6366f1;
        box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.08);
    }

    @media (max-width: 768px) {
        .create-post-header {
            flex-direction: column;
            align-items: flex-start;
            gap: 12px;
        }
        .ws-config-row {
            grid-template-columns: 1fr;
        }
        .workspace-root {
            max-width: 100%;
        }
    }

/* === Tweak Modal & AI Suggestion styles === */

/* ===== Tweak Image Modal Styles ===== */
.alma-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
}

.alma-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 24px 32px;
    max-width: 700px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.alma-modal-content h2 {
    margin: 0 0 20px 0;
    color: #1a1a2e;
    font-size: 1.5rem;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 12px;
}

.alma-modal-content h3 {
    margin: 16px 0 12px 0;
    color: #495057;
    font-size: 1rem;
    font-weight: 600;
}

.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

.left-column, .right-column {
    display: flex;
    flex-direction: column;
}

.tweak-option, .style-option {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.9rem;
    text-align: left;
    color: #495057;
}

.tweak-option:hover, .style-option:hover {
    background: #e9ecef;
    border-color: #0d6efd;
    color: #0d6efd;
}

.tweak-option.active, .style-option.active {
    background: #0d6efd;
    border-color: #0d6efd;
    color: #fff;
}

.tweak-option i, .style-option i {
    width: 18px;
    text-align: center;
}

.style-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.style-option {
    flex: 0 0 auto;
    margin-bottom: 0;
}

#alma-tweak-custom {
    width: 100%;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 12px;
    font-size: 0.9rem;
    resize: vertical;
    transition: border-color 0.2s;
}

#alma-tweak-custom:focus {
    outline: none;
    border-color: #0d6efd;
}

.modal-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e9ecef;
}

.modal-actions .btn {
    min-width: 100px;
}

/* AI Image Preview Section Styling */
#ai-image-preview-section {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 16px;
    border: 1px solid #e9ecef;
}

#ai-image-preview-container {
    background: #fff;
    padding: 12px;
    border-radius: 8px;
    text-align: center;
}

/* ===== End Tweak Image Modal Styles ===== */

.keyword-help {
    background: #f8f9fa;
    border-radius: 4px;
    padding: 0.5em 0.75em;
    margin-bottom: 0.25em;
}

/* Enhanced tab styling for content type tabs */
#contentTypeTabs {
    border-bottom: 1px solid #dee2e6;
    margin-bottom: 0.5rem;
}
#contentTypeTabs .nav-link {
    color: #495057;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-bottom: none;
    margin-right: 2px;
    padding: 0.5rem 1.25rem;
    font-weight: 500;
    border-radius: 0.25rem 0.25rem 0 0;
    transition: background 0.2s, color 0.2s;
}
#contentTypeTabs .nav-link.active {
    color: #212529;
    background: #fff;
    border-bottom: 2px solid #0d6efd;
    font-weight: bold;
    z-index: 2;
}
#contentTypeTabs .nav-link:not(.active):hover {
    background: #e9ecef;
    color: #0d6efd;
}
#contentTypeTabs .nav-item {
    margin-bottom: -1px;
}

.nav-tabs {
  border-bottom: 1px solid #dee2e6 !important;
  margin-bottom: 15px !important;
}

.nav-tabs .nav-link {
  color: #007bff !important;
  border: 1px solid transparent !important;
  background-color: #f8f9fa !important;
  margin-right: 2px !important;
  padding: 0.5rem 1.25rem !important;
  font-weight: 500 !important;
  border-radius: 0.25rem 0.25rem 0 0 !important;
}

.nav-tabs .nav-link.active {
  background-color: #fff !important;
  color: #495057 !important;
  border-bottom: 2px solid #ffffff !important;
  z-index: 2 !important;
  font-weight: bold !important;
}

.nav-tabs .nav-link:hover {
  background-color: #e9ecef !important;
  color: #0056b3 !important;
}

.nav-tabs .nav-item {
  margin-bottom: -1px !important;
}

/* AI Image Sub-options Container */
.ai-image-suboptions {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
    margin-top: 0.5rem;
    margin-bottom: 0.75rem;
}

/* AI Engine Card Selector */
.engine-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.engine-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 180px;
    flex: 1;
    max-width: 220px;
}

.engine-option:hover:not(.disabled) {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.engine-option.selected {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    box-shadow: 0 0 0 1px #0d6efd;
}

.engine-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #f1f3f4;
}

.engine-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1rem;
    flex-shrink: 0;
}

.engine-option.selected .engine-icon {
    background: linear-gradient(135deg, #0d6efd 0%, #0056b3 100%);
}

.engine-option.disabled .engine-icon {
    background: #adb5bd;
}

.engine-option[data-engine="nano_banana"] .engine-icon {
    background: linear-gradient(135deg, #f6d365 0%, #fda085 100%);
}

.engine-option[data-engine="nano_banana"].selected .engine-icon {
    background: linear-gradient(135deg, #ffc107 0%, #ff8c00 100%);
}

.engine-info {
    flex: 1;
    min-width: 0;
}

.engine-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: #212529;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.engine-name .badge {
    font-size: 0.65rem;
    font-weight: 500;
    padding: 2px 6px;
}

.engine-desc {
    font-size: 0.75rem;
    color: #6c757d;
    margin-top: 2px;
}

.engine-option.disabled .engine-name {
    color: #6c757d;
}

.engine-status {
    flex-shrink: 0;
    font-size: 1rem;
}

.engine-option.selected .engine-status i {
    color: #0d6efd !important;
}

/* New styles for aspect ratio selector */
.aspect-ratio-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 8px;
}

.aspect-ratio-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    padding: 8px;
    border: 2px solid #dee2e6;
    border-radius: 6px;
    background-color: #f8f9fa;
    transition: all 0.2s ease;
    min-width: 60px;
}

.aspect-ratio-option:hover {
    border-color: #adb5bd;
    background-color: #e9ecef;
}

.aspect-ratio-option.selected {
    border-color: #0d6efd;
    background-color: #e7f3ff;
    box-shadow: 0 0 0 1px #0d6efd;
}

.aspect-ratio-option .ratio-visual {
    width: 40px;
    height: 40px;
    margin-bottom: 5px;
    border: 2px solid #dee2e6;
    border-radius: 4px;
    background-color: #6c757d;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.aspect-ratio-option.selected .ratio-visual {
    border-color: #0d6efd;
    background-color: #0d6efd;
}

/* Aspect ratio visual representations */
.aspect-ratio-option .ratio-visual.square {
    width: 36px;
    height: 36px;
}

.aspect-ratio-option .ratio-visual.landscape {
    width: 44px;
    height: 25px;
}

.aspect-ratio-option .ratio-visual.landscape-wide {
    width: 42px;
    height: 28px;
}

.aspect-ratio-option .ratio-visual.portrait-tall {
    width: 26px;
    height: 39px;
}

.aspect-ratio-option .ratio-visual.portrait-wide {
    width: 28px;
    height: 37px;
}

.aspect-ratio-option .ratio-visual.landscape-square {
    width: 38px;
    height: 28px;
}

.aspect-ratio-option .ratio-visual.portrait-narrow {
    width: 22px;
    height: 40px;
}

.aspect-ratio-option .ratio-label {
    font-size: 0.75em;
    font-weight: 500;
    color: #495057;
}

.aspect-ratio-option.selected .ratio-label {
    color: #0d6efd;
    font-weight: 600;
}

/* Unsplash Search Styles */
.unsplash-image-item {
    position: relative;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.unsplash-image-item:hover {
    border-color: #0d6efd;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.unsplash-image-item.selected {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.2);
}

.unsplash-image-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.unsplash-image-item .image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7), transparent);
    color: white;
    padding: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.unsplash-image-item:hover .image-overlay {
    opacity: 1;
}

.unsplash-image-item .photographer-credit {
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 5px;
}

#unsplash-loading {
    text-align: center;
    padding: 30px;
    color: #6c757d;
}

#unsplash-results {
    max-height: 400px;
    overflow-y: auto;
    padding: 10px 0;
}

#unsplash-selected-preview {
    margin-top: 15px;
}

/* Similar Articles (simrel) */
.simrel.card { border: 1px solid #e2e8f0; background: #f8fafc; }
.simrel-body { padding: 10px 12px; }
.simrel-header { margin-bottom: 6px; }
.simrel-icon { margin-right: 6px; }
.simrel-badge {
  background: #0ea5e9; color: #fff; border-radius: 999px; padding: 2px 8px;
  font-size: 12px; line-height: 18px;
}
.simrel-loading, .simrel-empty { display: flex; align-items: center; gap: 8px; padding: 6px 0; color: #475569; }
.simrel-spinner {
  width: 14px; height: 14px; border: 2px solid #cbd5e1; border-top-color: #0ea5e9;
  border-radius: 50%; display: inline-block; animation: simrel-spin 0.9s linear infinite;
}
@keyframes simrel-spin { to { transform: rotate(360deg); } }
.simrel-list { margin: 6px 0 0; padding-left: 18px; }
.simrel-list li { margin: 4px 0; color: #0f172a; }
.simrel-list a { text-decoration: none; border-bottom: 1px dotted transparent; }
.simrel-list a:hover { border-color: #94a3b8; }
.simrel-score { color: #64748b; font-size: 12px; margin-left: 6px; }

/* Fallback indicator */
.simrel-fallback {
  font-size: 12px;
  color: #64748b;
  margin-bottom: 6px;
  padding: 0 18px;
}

/* Confidence chips */
.simrel-confidence {
  display: inline-block;
  font-size: 11px;
  padding: 2px 6px;
  margin-left: 6px;
  border-radius: 999px;
  font-weight: 500;
}
.simrel-confidence-high {
  background: #dcfce7;
  color: #166534;
}
.simrel-confidence-medium {
  background: #fef9c3;
  color: #854d0e;
}
.simrel-confidence-low {
  background: #fee2e2;
  color: #991b1b;
}

.d-none { display: none !important; }

/* Traffic Light Similarity Badges for AI Suggestions */
.auto-sim-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    cursor: help;
}

.auto-sim-high {
    background-color: #fee2e2 !important;
    color: #991b1b !important;
}

.auto-sim-medium {
    background-color: #fef9c3 !important;
    color: #854d0e !important;
}

.auto-sim-low {
    background-color: #dcfce7 !important;
    color: #166534 !important;
}

/* Topic Type Badges (Evergreen vs Trending) */
.topic-type-badge {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.2rem 0.45rem;
    border-radius: 0.25rem;
    cursor: help;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.topic-type-evergreen {
    background-color: #dbeafe !important;
    color: #1e40af !important;
    border: 1px solid #93c5fd;
}

.topic-type-trending {
    background-color: #fce7f3 !important;
    color: #be185d !important;
    border: 1px solid #f9a8d4;
}

.topic-type-trending i {
    animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

/* Topic Type Legend */
.topic-type-legend {
    display: flex;
    gap: 1rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border-radius: 0.375rem;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.topic-type-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Tooltip styles (reuse from automation) */
.auto-tooltip[data-tooltip]:hover::after,
.auto-tooltip[data-tooltip]:focus::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: #2d3748;
    background: rgba(45, 55, 72, 0.98);
    color: white;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    white-space: normal;
    width: max-content;
    max-width: 250px;
    min-width: 150px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    pointer-events: none;
    line-height: 1.4;
}

.auto-tooltip[data-tooltip]:hover::before,
.auto-tooltip[data-tooltip]:focus::before {
    content: "";
    position: absolute;
    bottom: 115%;
    left: 50%;
    transform: translateX(-50%);
    border-width: 5px;
    border-style: solid;
    border-color: #2d3748 transparent transparent transparent;
    z-index: 9999;
    pointer-events: none;
}

.auto-tooltip {
    position: relative;
    cursor: help;
}

/* Dimmed suggestions for high-risk */
.list-group-item.opacity-50 {
    opacity: 0.6;
}

.list-group-item.opacity-50:hover {
    opacity: 0.7;
}

/* Gap utility class */
.gap-2 {
    gap: 0.5rem !important;
}

/* ═══════════════════════════════════════════════════════════════
   AI CONTENT RECOMMENDATIONS — PREMIUM ENHANCEMENT
   ═══════════════════════════════════════════════════════════════ */

/* ── Toggle Button (Glassmorphism Pill) ── */
.ai-rec-toggle {
    position: relative;
    display: flex;
    width: 100%;
    padding: 3px;
    border-radius: 14px;
    border: none;
    background: linear-gradient(135deg, #667eea, #764ba2, #4facfe, #667eea);
    background-size: 300% 300%;
    animation: aiRecShimmer 6s ease infinite;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.ai-rec-toggle:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.35);
}
.ai-rec-toggle:active {
    transform: translateY(0);
}
.ai-rec-toggle-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 16px 28px;
    font-size: 1.15rem;
    font-weight: 600;
    color: #1a1a2e;
    transition: background 0.2s ease;
}
.ai-rec-toggle:hover .ai-rec-toggle-inner {
    background: rgba(255, 255, 255, 0.85);
}
.ai-rec-toggle-inner i:first-child {
    color: #764ba2;
}
.ai-rec-chevron {
    font-size: 0.7em;
    transition: transform 0.3s ease;
}
.ai-rec-toggle[aria-expanded="true"] .ai-rec-chevron {
    transform: rotate(180deg);
}
@keyframes aiRecShimmer {
    0%   { background-position: 0% 50%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* ── Refresh Button ── */
.ai-rec-refresh {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: #fff;
    border: none;
    border-radius: 16px;
    padding: 10px 20px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s ease;
}
.ai-rec-refresh:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 12px rgba(102, 126, 234, 0.4);
    color: #fff;
}

/* ── Results Panel (Frosted Glass) ── */
.ai-rec-panel {
    position: relative;
    margin-top: 14px;
    padding: 36px;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    border: 1px solid rgba(102, 126, 234, 0.15);
    box-shadow:
        0 4px 24px rgba(102, 126, 234, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04),
        inset 0 1px 0 rgba(255, 255, 255, 0.6);
    animation: aiPanelSlideIn 0.4s ease-out;
}
.ai-rec-panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    border-radius: 2px;
    background: linear-gradient(90deg, #667eea, #764ba2, #4facfe);
    opacity: 0.6;
}
@keyframes aiPanelSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Loading State ── */
.ai-loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
}
.ai-loading-brain-wrap {
    position: relative;
    width: 160px;
    height: 160px;
    margin-bottom: 32px;
}
.ai-loading-brain-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #667eea;
    border-right-color: #764ba2;
    animation: aiRingSpin 1.5s linear infinite;
}
.ai-loading-brain-ring::after {
    content: '';
    position: absolute;
    inset: 5px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-bottom-color: #4facfe;
    border-left-color: #f093fb;
    animation: aiRingSpin 2s linear infinite reverse;
}
.ai-loading-brain-icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.2rem;
    color: #764ba2;
    animation: aiBrainPulse 2s ease-in-out infinite;
}
.ai-loading-dotty-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    object-position: center 15%;
}
@keyframes aiRingSpin {
    to { transform: rotate(360deg); }
}
@keyframes aiBrainPulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.08); opacity: 0.8; }
}
.ai-loading-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: #1a1a2e;
    margin-bottom: 32px;
}

/* Step indicators */
.ai-loading-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    width: 100%;
    max-width: 100%;
    margin-bottom: 32px;
    padding: 0 10%;
}
.ai-loading-step {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 1.1rem;
    color: #9ca3af;
    transition: color 0.4s ease;
}
.ai-loading-step.active {
    color: #667eea;
    font-weight: 600;
}
.ai-loading-step.completed {
    color: #16a34a;
}
.ai-step-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #d1d5db;
    flex-shrink: 0;
    transition: all 0.4s ease;
}
.ai-loading-step.active .ai-step-dot {
    background: #667eea;
    box-shadow: 0 0 8px rgba(102, 126, 234, 0.5);
    animation: aiDotPulse 1.5s ease-in-out infinite;
}
.ai-loading-step.completed .ai-step-dot {
    background: #16a34a;
    box-shadow: 0 0 6px rgba(22, 163, 106, 0.4);
}
@keyframes aiDotPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.4); }
}

/* Meta info */
.ai-loading-meta {
    display: flex;
    gap: 24px;
    font-size: 1.05rem;
    color: #6b7280;
    margin-bottom: 32px;
}
.ai-loading-elapsed {
    font-weight: 600;
    color: #667eea;
}
.ai-loading-estimate {
    font-style: italic;
}

/* Fact card */
.ai-loading-fact-card {
    width: 100%;
    max-width: 100%;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.06), rgba(118, 75, 162, 0.06));
    border: 1px solid rgba(102, 126, 234, 0.12);
    border-radius: 12px;
}
.ai-loading-fact-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: #764ba2;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 10px;
}
.ai-loading-fact-text {
    font-size: 1.1rem;
    color: #4b5563;
    font-style: italic;
    line-height: 1.6;
}

/* ── Suggestion Cards ── */
.ai-suggestions-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.ai-suggestion-card {
    display: flex;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e5e7eb;
    overflow: hidden;
    transition: all 0.25s ease;
    animation: aiCardAppear 0.35s ease-out both;
}
.ai-suggestion-card:nth-child(1)  { animation-delay: 0.05s; }
.ai-suggestion-card:nth-child(2)  { animation-delay: 0.10s; }
.ai-suggestion-card:nth-child(3)  { animation-delay: 0.15s; }
.ai-suggestion-card:nth-child(4)  { animation-delay: 0.20s; }
.ai-suggestion-card:nth-child(5)  { animation-delay: 0.25s; }
.ai-suggestion-card:nth-child(6)  { animation-delay: 0.30s; }
.ai-suggestion-card:nth-child(7)  { animation-delay: 0.35s; }
.ai-suggestion-card:nth-child(8)  { animation-delay: 0.40s; }
.ai-suggestion-card:nth-child(9)  { animation-delay: 0.45s; }
.ai-suggestion-card:nth-child(10) { animation-delay: 0.50s; }
@keyframes aiCardAppear {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}
.ai-suggestion-card:hover {
    border-color: rgba(102, 126, 234, 0.3);
    box-shadow: 0 4px 16px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

/* Left accent bar */
.ai-suggestion-accent {
    width: 5px;
    flex-shrink: 0;
    background: linear-gradient(180deg, #667eea, #764ba2);
    border-radius: 4px 0 0 4px;
}
.ai-suggestion-card[data-risk="high"] .ai-suggestion-accent {
    background: linear-gradient(180deg, #ef4444, #dc2626);
}
.ai-suggestion-card[data-risk="medium"] .ai-suggestion-accent {
    background: linear-gradient(180deg, #f59e0b, #d97706);
}
.ai-suggestion-card[data-risk="low"] .ai-suggestion-accent {
    background: linear-gradient(180deg, #16a34a, #15803d);
}

/* Card body */
.ai-suggestion-body {
    flex: 1;
    padding: 20px 26px;
    min-width: 0;
}
.ai-suggestion-title-text {
    font-size: 1.15rem;
    color: #1a1a2e;
    line-height: 1.4;
    margin-bottom: 6px;
    transition: color 0.2s ease;
}
.ai-suggestion-card:not(.opacity-50) .ai-suggestion-title-text:hover {
    color: #667eea;
}
.ai-suggestion-explain {
    font-size: 1rem;
    color: #6b7280;
    line-height: 1.5;
    margin-bottom: 12px;
}
.ai-suggestion-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
}

/* Dimmed (excluded) cards */
.ai-suggestion-card.opacity-50 {
    opacity: 0.55;
}
.ai-suggestion-card.opacity-50:hover {
    opacity: 0.65;
    transform: none;
    box-shadow: none;
}

/* Footer */
.ai-suggestions-footer {
    text-align: center;
    font-size: 1rem;
    color: #9ca3af;
    padding: 20px 0 6px;
    border-top: 1px solid #f3f4f6;
    margin-top: 12px;
}

/* ── Content Hierarchy Panel ── */
.ai-hierarchy-panel {
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.04), rgba(79, 172, 254, 0.04));
    border: 1px solid rgba(102, 126, 234, 0.15);
    border-radius: 12px;
    padding: 26px 30px;
    margin-bottom: 24px;
}
.ai-hierarchy-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 12px;
}
.ai-hierarchy-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.ai-hierarchy-title {
    font-weight: 700;
    font-size: 1.2rem;
    color: #1a1a2e;
}
.ai-hierarchy-subtitle {
    font-size: 1rem;
    color: #6b7280;
}
.ai-hierarchy-disclaimer {
    font-size: 0.92rem;
    color: #9ca3af;
    margin-bottom: 16px;
    padding-left: 64px;
}
.ai-hierarchy-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.ai-hierarchy-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 20px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    transition: all 0.2s ease;
    flex-wrap: wrap;
}
.ai-hierarchy-item:hover {
    background: rgba(255, 255, 255, 0.95);
    border-color: rgba(102, 126, 234, 0.25);
}
.ai-hierarchy-item-content {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.ai-hierarchy-badge {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: #fff !important;
    font-size: 0.88rem;
    padding: 5px 12px;
    border-radius: 6px;
    flex-shrink: 0;
}
.ai-hierarchy-item-title {
    font-size: 1.1rem;
    color: #374151;
    font-weight: 500;
}
.ai-hierarchy-action {
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #6b7280;
    font-size: 0.95rem;
    padding: 8px 16px;
    border-radius: 6px;
    transition: all 0.2s ease;
}
.ai-hierarchy-write:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}
.ai-hierarchy-save:hover {
    background: #f59e0b;
    color: #fff;
    border-color: #f59e0b;
}
.ai-hierarchy-dismiss:hover {
    background: #ef4444;
    color: #fff;
    border-color: #ef4444;
}

/* ── Custom Progress Bar ── */
.ai-progress-wrap {
    width: 100%;
    max-width: 100%;
    height: 10px;
    padding: 0 10%;
    background: #e5e7eb;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}
.ai-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2, #4facfe);
    background-size: 200% 100%;
    animation: aiProgressShimmer 2s ease-in-out infinite;
    border-radius: 3px;
    transition: width 0.5s ease;
}
@keyframes aiProgressShimmer {
    0%   { background-position: 0% 50%; }
    100% { background-position: 200% 50%; }
}
.ai-progress-label {
    font-size: 1.05rem;
    font-weight: 600;
    color: #667eea;
    margin-bottom: 20px;
}

/* ── Refined Notice Cards ── */
.ai-rec-panel .ai-notice {
    border-radius: 10px;
    border-left-width: 4px;
    font-size: 1.05rem;
    padding: 18px 22px;
}

/* ── Enhanced Topic Legend ── */
.ai-topic-legend {
    border-radius: 10px;
    border: 1px solid rgba(102, 126, 234, 0.12);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.8), rgba(248, 250, 252, 0.9));
    padding: 16px 24px;
    font-size: 1.05rem;
}

/* ── Mobile Responsive ── */
@media (max-width: 640px) {
    .ai-rec-toggle-inner {
        font-size: 0.82rem;
        padding: 7px 14px;
    }
    .ai-rec-panel {
        padding: 16px;
        border-radius: 12px;
    }
    .ai-suggestion-body {
        padding: 10px 12px;
    }
    .ai-suggestion-title-text {
        font-size: 0.88rem;
    }
    .ai-hierarchy-item {
        flex-direction: column;
        align-items: flex-start;
    }
    .hierarchy-actions {
        margin-top: 6px;
    }
    .ai-hierarchy-disclaimer {
        padding-left: 0;
    }
    .ai-loading-steps {
        max-width: 100%;
    }
}

/* ═══════════════════════════════════════════════════
   GSC HERO — Search opportunities front and center
   ═══════════════════════════════════════════════════ */
.ai-gsc-hero {
    background: linear-gradient(135deg, #f8faff 0%, #eef2ff 60%, #f0f4ff 100%);
    border: 1px solid rgba(66, 133, 244, 0.18);
    border-radius: 14px;
    padding: 18px 20px 14px;
    margin-bottom: 16px;
    animation: aiCardAppear 0.3s ease-out both;
}
.ai-gsc-hero-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.ai-gsc-logo {
    width: 34px;
    height: 34px;
    background: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(66, 133, 244, 0.15);
    flex-shrink: 0;
}
.ai-gsc-hero-title-area { flex: 1; min-width: 0; }
.ai-gsc-hero-title {
    font-weight: 800;
    font-size: 1rem;
    color: #1a1a2e;
    letter-spacing: -0.01em;
}
.ai-gsc-hero-subtitle {
    font-size: 0.78rem;
    color: #6b7280;
    margin-top: 1px;
}
.ai-scan-cache-badge {
    font-size: 0.7rem;
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}
.ai-branded-toggle {
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    padding: 4px 10px;
    border-radius: 6px;
    border: 1px solid #e5e7eb;
    background: #fff;
    transition: all 0.15s ease;
}
.ai-branded-toggle:hover {
    border-color: #4285F4;
    color: #374151;
}
.ai-branded-toggle input { margin: 0; }
.ai-branded-toggle input:checked + span { color: #4285F4; font-weight: 600; }

/* Query rows */
.ai-gsc-queries {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.ai-gsc-query-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    border: 1px solid rgba(0, 0, 0, 0.05);
    animation: aiCardAppear 0.3s ease-out both;
    transition: border-color 0.15s ease;
}
.ai-gsc-query-row:hover {
    border-color: rgba(66, 133, 244, 0.25);
}
.ai-gsc-query-hot {
    border-left: 3px solid #4285F4;
}
.ai-gsc-query-rank {
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.72rem;
    color: #6b7280;
    flex-shrink: 0;
}
.ai-gsc-query-hot .ai-gsc-query-rank {
    background: #4285F4;
    color: #fff;
}
.ai-gsc-query-body {
    flex: 1;
    min-width: 0;
}
.ai-gsc-query-text {
    font-weight: 700;
    font-size: 0.88rem;
    color: #1a1a2e;
    margin-bottom: 2px;
}
.ai-gsc-query-meta {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}
.ai-gsc-stat {
    font-size: 0.72rem;
    color: #6b7280;
}
.ai-gsc-stat i { margin-right: 3px; }
.ai-gsc-stat-zero {
    color: #dc2626;
    font-weight: 600;
}
.ai-gsc-query-signal {
    flex-shrink: 0;
}
.ai-gsc-lost-badge {
    font-size: 0.68rem;
    font-weight: 600;
    color: #dc2626;
    background: #fee2e2;
    padding: 3px 8px;
    border-radius: 6px;
    white-space: nowrap;
}

/* Position pill */
.ai-gsc-pos-pill {
    width: 36px;
    height: 28px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 0.72rem;
    flex-shrink: 0;
    background: #f3f4f6;
    color: #374151;
}
.ai-gsc-cat-quick_win .ai-gsc-pos-pill { background: #dcfce7; color: #166534; }
.ai-gsc-cat-page_two .ai-gsc-pos-pill  { background: #dbeafe; color: #1e40af; }
.ai-gsc-cat-content_gap .ai-gsc-pos-pill { background: #fef3c7; color: #92400e; }
.ai-gsc-cat-long_shot .ai-gsc-pos-pill { background: #f3f4f6; color: #6b7280; }

/* Advice text under query */
.ai-gsc-advice {
    font-size: 0.72rem;
    color: #9ca3af;
    font-style: italic;
    margin-top: 2px;
}

/* Write button in query row */
.ai-gsc-write-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #fff;
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: all 0.15s ease;
    font-size: 0.75rem;
}
.ai-gsc-write-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* Category sections */
.ai-gsc-category {
    margin-top: 14px;
}
.ai-gsc-category:first-of-type {
    margin-top: 0;
}
.ai-gsc-cat-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    margin-bottom: 6px;
    font-size: 0.82rem;
    width: 100%;
    border: none;
    cursor: default;
    text-align: left;
}
button.ai-gsc-cat-header {
    cursor: pointer;
}
.ai-gsc-cat-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    flex-shrink: 0;
}
.ai-gsc-cat-title {
    font-weight: 700;
    color: #1a1a2e;
}
.ai-gsc-cat-count {
    font-weight: 700;
    font-size: 0.72rem;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.08);
    color: #374151;
}
.ai-gsc-cat-desc {
    font-size: 0.75rem;
    color: #6b7280;
    flex: 1;
}

/* Category color variants */
.ai-gsc-cat-quickwin {
    background: #f0fdf4;
}
.ai-gsc-cat-quickwin .ai-gsc-cat-icon { background: #dcfce7; color: #16a34a; }
.ai-gsc-cat-quickwin .ai-gsc-cat-count { background: #dcfce7; color: #166534; }

.ai-gsc-cat-pagetwo {
    background: #eff6ff;
}
.ai-gsc-cat-pagetwo .ai-gsc-cat-icon { background: #dbeafe; color: #2563eb; }
.ai-gsc-cat-pagetwo .ai-gsc-cat-count { background: #dbeafe; color: #1e40af; }

.ai-gsc-cat-gap {
    background: #fffbeb;
}
.ai-gsc-cat-gap .ai-gsc-cat-icon { background: #fef3c7; color: #d97706; }
.ai-gsc-cat-gap .ai-gsc-cat-count { background: #fef3c7; color: #92400e; }

.ai-gsc-cat-keyword {
    background: linear-gradient(135deg, #faf5ff, #f5f3ff);
}
.ai-gsc-cat-keyword .ai-gsc-cat-icon { background: #ede9fe; color: #7c3aed; }
.ai-gsc-cat-keyword .ai-gsc-cat-count { background: #ede9fe; color: #7c3aed; }

.ai-gsc-cat-longshot {
    background: #f9fafb;
}
.ai-gsc-cat-longshot .ai-gsc-cat-icon { background: #f3f4f6; color: #6b7280; }
.ai-gsc-cat-longshot .ai-gsc-cat-count { background: #f3f4f6; color: #6b7280; }

/* Keyword chips */
.ai-gsc-keyword-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 0;
}
.ai-keyword-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 20px;
    border: 1px solid #e5e7eb;
    background: #fff;
    cursor: pointer;
    transition: all 0.15s ease;
    font-size: 0.82rem;
}
.ai-keyword-chip:hover {
    border-color: #7c3aed;
    background: #faf5ff;
}
.ai-keyword-chip-active {
    border-color: #7c3aed;
    background: #ede9fe;
    color: #5b21b6;
}
.ai-keyword-chip-active .ai-keyword-chip-stat {
    color: #7c3aed;
}
.ai-keyword-chip-text {
    font-weight: 600;
    color: #374151;
}
.ai-keyword-chip-active .ai-keyword-chip-text {
    color: #5b21b6;
}
.ai-keyword-chip-stat {
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
}

/* Add all keywords button */
.ai-add-keywords-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 10px 16px;
    margin-top: 8px;
    border-radius: 10px;
    border: 2px dashed #7c3aed;
    background: transparent;
    color: #7c3aed;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.ai-add-keywords-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-style: solid;
}
.ai-add-keywords-done {
    background: #dcfce7;
    color: #166534;
    border-color: #16a34a;
    border-style: solid;
    cursor: default;
}
.ai-add-keywords-done:hover {
    background: #dcfce7;
    color: #166534;
}

/* Toast notification for keyword addition */
.ai-keyword-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #1a1a2e;
    color: #fff;
    padding: 12px 24px;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}
.ai-keyword-toast-show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* GSC connect nudge */
.ai-gsc-connect-nudge {
    display: flex;
    align-items: center;
    background: #fffbeb;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    color: #92400e;
}

/* ═══════════════════════════════════════════════════
   TECHNICAL ISSUES STRIP — Compact collapsible bar
   ═══════════════════════════════════════════════════ */
.ai-issues-strip {
    margin-bottom: 12px;
}
.ai-issues-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    padding: 8px 12px;
    color: #9a3412;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.ai-issues-toggle:hover { background: #ffedd5; }
.ai-insights-chevron {
    transition: transform 0.25s ease;
    font-size: 0.7rem;
}
.ai-issues-toggle[aria-expanded="true"] .ai-insights-chevron,
.ai-insights-toggle[aria-expanded="true"] .ai-insights-chevron {
    transform: rotate(180deg);
}
.ai-issues-body {
    padding: 10px 12px 6px;
    font-size: 0.78rem;
    color: #6b7280;
}
.ai-issue-group {
    margin-bottom: 6px;
}
.ai-issue-group code {
    font-size: 0.72rem;
    background: #f3f4f6;
    padding: 1px 5px;
    border-radius: 3px;
    margin-right: 4px;
}

/* ═══════════════════════════════════════════════════
   SOURCE BADGES — Tags on topic cards
   ═══════════════════════════════════════════════════ */
.ai-source-badge {
    font-size: 0.68rem;
    font-weight: 600;
    padding: 3px 8px;
    border-radius: 6px;
}
.ai-source-gsc {
    background: linear-gradient(135deg, #dbeafe, #ede9fe);
    color: #4338ca;
    border: 1px solid rgba(67, 56, 202, 0.15);
}
.ai-source-search {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid rgba(22, 101, 52, 0.15);
}
.ai-source-competitor {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid rgba(153, 27, 27, 0.15);
}

/* ═══════════════════════════════════════════════════
   SCAN FOOTER — Proof of work at bottom
   ═══════════════════════════════════════════════════ */
.ai-scan-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0 4px;
    border-top: 1px solid #f3f4f6;
    margin-top: 12px;
    font-size: 0.78rem;
    color: #9ca3af;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-scan-proof {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #6b7280;
}

/* ═══════════════════════════════════════════════════
   TOPICS HEADER — Section title + controls row
   ═══════════════════════════════════════════════════ */
.ai-topics-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 6px;
}
.ai-topics-title {
    font-weight: 700;
    font-size: 0.9rem;
    color: #1a1a2e;
}
.ai-topics-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}
.ai-strip-toggle {
    font-size: 0.75rem;
    color: #6b7280;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}
.ai-strip-toggle input { margin: 0; }

/* ═══════════════════════════════════════════════════
   RESPONSIVE — Mobile adjustments
   ═══════════════════════════════════════════════════ */
@media (max-width: 768px) {
    .ai-gsc-hero { padding: 14px 14px 10px; }
    .ai-gsc-query-row { padding: 8px 10px; gap: 8px; }
    .ai-gsc-query-meta { gap: 8px; }
    .ai-gsc-query-signal { display: none; }
    .ai-topics-header { flex-direction: column; align-items: flex-start; }
    .ai-scan-footer { flex-direction: column; text-align: center; }
}
