/**
 * Repivot — Editor Styles
 */

/* ========================================
   Annotation Highlights  (WP Annotations API — <mark> elements)
   ======================================== */

mark.annotation-text[class*="annotation-text-repivot-"] {
    background-color: rgba(107, 114, 128, 0.12); /* fallback for unknown sources */
    cursor: pointer;
    border-radius: 4px;
    padding: 2px 3px;
    margin: 0 -1px;
    transition: background-color 0.2s ease;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}

/* Source-specific highlight colors */
mark.annotation-text-repivot-brand {
    background-color: rgba(139, 92, 246, 0.15);
}
mark.annotation-text-repivot-geo {
    background-color: rgba(59, 130, 246, 0.15); /* legacy: geo merged into content */
}
mark.annotation-text-repivot-internal-links {
    background-color: rgba(245, 158, 11, 0.18);
}
mark.annotation-text-repivot-accessibility {
    background-color: rgba(16, 185, 129, 0.15);
}
mark.annotation-text-repivot-competitive {
    background-color: rgba(239, 68, 68, 0.15);
}
mark.annotation-text-repivot-content {
    background-color: rgba(59, 130, 246, 0.15);
}

/* Hidden state — toggle via JS class on .editor-styles-wrapper */
.repivot-annotations-hidden mark.annotation-text[class*="annotation-text-repivot-"] {
    background-color: transparent !important;
    cursor: default;
}

/* ========================================
   ALT Text Overlay (on images)
   ======================================== */

.repivot-alt-overlay-portal {
    position: absolute;
    bottom: 8px;
    left: 8px;
    right: 8px;
    z-index: 20;
    pointer-events: none;
}

.repivot-alt-overlay {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(55, 65, 81, 0.92);
    color: #F9FAFB;
    padding: 6px 12px;
    border-radius: 6px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 13px;
    line-height: 1.4;
    max-width: 100%;
    pointer-events: auto;
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.repivot-alt-overlay-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    background: rgba(75, 85, 99, 1);
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    color: #D1D5DB;
}

.repivot-alt-overlay-text {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ========================================
   Unified Sidebar
   ======================================== */

.repivot-sidebar {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ========================================
   Collapsible Section
   ======================================== */

.repivot-collapsible {
    border-bottom: 1px solid #e0e0e0;
}

.repivot-collapsible__header {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 12px 16px;
    background: #f9f9f9;
    border: none;
    border-bottom: 1px solid #e0e0e0;
    cursor: pointer;
    text-align: left;
    font-family: inherit;
}

.repivot-collapsible__header:hover {
    background: #f3f3f3;
}

.repivot-collapsible__icon {
    display: flex;
    align-items: center;
    color: #555;
    flex-shrink: 0;
}

.repivot-collapsible__title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.repivot-collapsible__chevron {
    flex-shrink: 0;
    color: #888;
    transition: transform 0.2s ease;
}

.repivot-collapsible__chevron--open {
    transform: rotate(180deg);
}

.repivot-collapsible__content {
    padding: 16px;
}

/* ========================================
   Connection Banner
   ======================================== */

.repivot-connection-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: linear-gradient(135deg, #fff9e6 0%, #fff5d6 100%);
    border-bottom: 1px solid #f0e6c8;
}

.repivot-connection-content {
    display: flex;
    align-items: center;
    gap: 8px;
}

.repivot-connection-icon {
    color: #b8860b;
    display: flex;
}

.repivot-connection-text {
    font-size: 12px;
    color: #8b6914;
    font-weight: 500;
}

.repivot-connection-link {
    font-size: 12px;
    font-weight: 600;
    color: #10B981;
    text-decoration: none;
    white-space: nowrap;
}

.repivot-connection-link:hover {
    text-decoration: underline;
}

/* ========================================
   Sidebar Header & Buttons
   ======================================== */

.repivot-sidebar-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 16px;
    border-bottom: 1px solid #e0e0e0;
    background: #f9f9f9;
}

.repivot-analyze-button {
    flex: 1;
    justify-content: center;
    background-color: #10B981 !important;
    color: #1a1a1a !important;
    border: none !important;
    font-weight: 600 !important;
}

.repivot-analyze-button:hover:not(:disabled) {
    background-color: #059669 !important;
}

.repivot-clear-button {
    color: #666 !important;
}

/* ========================================
   Issues Summary
   ======================================== */

.repivot-issues-summary {
    padding: 12px 16px;
    border-bottom: 1px solid #e0e0e0;
}

.repivot-issues-count {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.repivot-classic-editor-notice {
    margin: 8px 16px 12px;
    padding: 10px 12px;
    font-size: 12px;
    line-height: 1.5;
    color: #92400E;
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 6px;
}

/* ========================================
   Issues List
   ======================================== */

.repivot-issues-list {
    padding: 8px;
}

.repivot-web-link {
    padding: 8px 16px 12px;
    text-align: center;
}

.repivot-web-link a {
    font-size: 12px;
    font-weight: 600;
    color: #10B981;
    text-decoration: none;
}

.repivot-web-link a:hover {
    text-decoration: underline;
}

/* ========================================
   Content Gap Insight Cards (matches repivot-web)
   ======================================== */

.repivot-gap-card {
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
}

.repivot-gap-card:hover {
    border-color: #9CA3AF;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
    background: #F9FAFB;
}

.repivot-gap-card--selected {
    background: #F3F4F6;
    border-color: #6B7280;
    box-shadow: 0 0 0 2px #6B7280;
    transform: scale(1.01);
}

.repivot-gap-card--dismissed {
    opacity: 0.45;
    padding: 10px 12px;
}

.repivot-gap-card--dismissed .repivot-gap-card-suggestion {
    display: none;
}

.repivot-gap-card--dismissed.repivot-gap-card--expanded {
    opacity: 0.55;
}

.repivot-gap-card--dismissed.repivot-gap-card--expanded .repivot-gap-card-suggestion {
    display: block;
}

/* Layout: number on left, content on right */
.repivot-gap-card-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.repivot-gap-card-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F3F4F6;
    border: 1px solid #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 500;
    color: #374151;
    margin-top: 1px;
}

.repivot-gap-card-header {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 28px;
}

.repivot-gap-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.repivot-gap-card-suggestion {
    font-size: 13px;
    color: #111827;
    line-height: 1.5;
    margin-top: 6px;
}

/* ========================================
   Feedback Buttons (Inline Insight Cards)
   ======================================== */

.repivot-inline-insight-feedback {
    display: flex;
    align-items: center;
    gap: 4px;
}

.repivot-gap-feedback-label {
    font-size: 11px;
    color: #9CA3AF;
    margin-right: 4px;
}

.repivot-gap-feedback-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    border-radius: 6px;
    color: #D1D5DB;
    cursor: pointer;
    transition: all 0.15s ease;
    padding: 0;
}

.repivot-gap-feedback-btn:hover {
    background: rgba(0, 0, 0, 0.04);
    color: #10B981;
}

.repivot-gap-feedback-btn:last-child:hover {
    color: #EF4444;
}

.repivot-gap-feedback-btn--active {
    color: #059669;
    background: rgba(5, 150, 105, 0.08);
}

.repivot-gap-feedback-btn--active.repivot-gap-feedback-btn--down {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.08);
}

/* ========================================
   Fix Buttons
   ======================================== */

.repivot-inline-insight-fix-btn,
.repivot-gap-fix-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 600;
    color: #374151;
    background: #ffffff;
    border: 1.5px solid #CBD5E1;
    border-radius: 6px;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease, box-shadow 0.15s ease, transform 0.05s ease;
    line-height: 1.4;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 1px rgba(0, 0, 0, 0.04);
    flex-shrink: 0;
}

.repivot-inline-insight-fix-btn svg,
.repivot-gap-fix-btn svg {
    filter: grayscale(1);
    opacity: 0.75;
    transition: filter 0.2s ease, opacity 0.2s ease;
}
.repivot-inline-insight-fix-btn:hover,
.repivot-gap-fix-btn:hover {
    color: #047857;
    border-color: #10B981;
    background: rgba(16, 185, 129, 0.06);
    box-shadow: 0 1px 2px rgba(16, 129, 81, 0.12);
}
.repivot-inline-insight-fix-btn:hover svg,
.repivot-gap-fix-btn:hover svg {
    filter: none;
    opacity: 1;
}
.repivot-inline-insight-fix-btn:active,
.repivot-gap-fix-btn:active {
    transform: translateY(0.5px);
    box-shadow: none;
}

/* Inline insight actions row — feedback+why left, fix pinned right */
.repivot-inline-insight-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.repivot-inline-insight-actions-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Sidebar card actions row — feedback left, fix right */
.repivot-gap-card-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.repivot-gap-card-feedback {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ========================================
   Guided Fix Message
   ======================================== */

.repivot-guided-fix-message {
    margin-top: 8px;
    padding: 8px 10px;
    font-size: 11px;
    line-height: 1.5;
    color: #6B7280;
    background: #F9FAFB;
    border: 1px solid #E5E7EB;
    border-radius: 6px;
    font-style: italic;
}

/* ========================================
   Error Banner
   ======================================== */

.repivot-error-banner {
    padding: 10px 16px;
    background: #FEF2F2;
    border-bottom: 1px solid #FECACA;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.repivot-error-text {
    font-size: 12px;
    color: #991B1B;
    line-height: 1.4;
}

.repivot-error-dismiss {
    background: none;
    border: none;
    color: #991B1B;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    padding: 2px 6px;
    border-radius: 3px;
}

.repivot-error-dismiss:hover {
    background: rgba(153, 27, 27, 0.1);
}

/* ========================================
   Progress Animation
   ======================================== */

.repivot-progress {
    padding: 16px;
}

.repivot-progress-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.repivot-progress-title {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.repivot-progress-elapsed {
    font-size: 12px;
    color: #6B7280;
    font-variant-numeric: tabular-nums;
}

.repivot-progress-note {
    margin-top: 12px;
    font-size: 11px;
    color: #9CA3AF;
    text-align: center;
}

.repivot-progress-bar-container {
    height: 4px;
    background: #E5E7EB;
    border-radius: 2px;
    margin-bottom: 16px;
    overflow: hidden;
}

.repivot-progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #3B82F6);
    border-radius: 2px;
    transition: width 0.5s ease;
}

.repivot-progress-steps {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.repivot-progress-step {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 6px 0;
}

.repivot-progress-step-indicator {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 2px;
}

.repivot-progress-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #D1D5DB;
}

.repivot-progress-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid #E5E7EB;
    border-top-color: #3B82F6;
    border-radius: 50%;
    animation: repivot-spin 0.8s linear infinite;
}

@keyframes repivot-spin {
    to { transform: rotate(360deg); }
}

.repivot-progress-step-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.repivot-progress-step-label {
    font-size: 13px;
    font-weight: 500;
    color: #1a1a1a;
}

.repivot-progress-step--pending .repivot-progress-step-label {
    color: #9CA3AF;
}

.repivot-progress-step--done .repivot-progress-step-label {
    color: #6B7280;
}

.repivot-progress-step--active .repivot-progress-step-label {
    color: #1a1a1a;
    font-weight: 600;
}

.repivot-progress-step-desc {
    font-size: 11px;
    color: #6B7280;
    margin-top: 2px;
}

/* ========================================
   Inline Insight Box (editor portal)
   ======================================== */

/*
 * The wrapper sits AFTER the block as a sibling.  A negative margin-top
 * pulls it upward so the border visually wraps the block text above.
 * pointer-events:none lets the user interact with the block text
 * underneath; interactive children opt back in with pointer-events:auto.
 *
 * marginTop and paddingTop are set dynamically via inline style.
 */

/* Hide Gutenberg's block inserter (+) when insight cards are visible.
   Users can still add blocks via the sidebar or slash commands. */
.repivot-insights-visible .block-editor-block-list__insertion-point {
    display: none !important;
}

/* Portal container — sits above Gutenberg's block inserter (+) button */
.repivot-inline-insight-portal {
    position: relative;
    z-index: 22;
}

.repivot-inline-insight-wrapper {
    position: relative;
    z-index: 30;
    pointer-events: none;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 12px;
    margin-left: -8px;
    margin-right: -8px;
    padding-left: 8px;
    padding-right: 8px;
    padding-bottom: 8px;
    margin-bottom: 24px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

/* Anchor-only variant — no negative-margin wrapping, sits near the anchor block */
.repivot-inline-insight-wrapper--anchor-only {
    margin-top: 0;
    margin-bottom: 16px;
    padding-top: 8px;
}

/* Close button — circular, top-right of wrapper */
.repivot-inline-insight-close {
    pointer-events: auto;
    position: absolute;
    right: -10px;
    background: white;
    border: 1px solid #E5E7EB;
    color: #9CA3AF;
    cursor: pointer;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    padding: 0;
    z-index: 2;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.15s ease;
}

.repivot-inline-insight-close:hover {
    background: #F9FAFB;
    border-color: #D1D5DB;
    color: #374151;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transform: scale(1.08);
}

/* Nested insight card */
.repivot-inline-insight {
    pointer-events: auto;
    border: 1px solid;
    border-radius: 8px;
    padding: 16px 14px 16px 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    text-align: left;
    transition: opacity 0.3s ease, padding 0.3s ease;
    position: relative;
}

/* Dismissed state — collapsed and faded */
.repivot-inline-insight--dismissed {
    opacity: 0.45;
    padding: 10px 20px;
}

/* Hide done button when dismissed */
.repivot-inline-insight--dismissed > .repivot-inline-insight-done-btn {
    display: none;
}

.repivot-inline-insight--dismissed .repivot-inline-insight-header {
    margin-bottom: 0;
    padding-right: 0;
}

.repivot-inline-insight--dismissed.repivot-inline-insight--expanded {
    opacity: 0.55;
}

/* Spacing between grouped cards */
.repivot-inline-insight + .repivot-inline-insight {
    margin-top: 12px;
}

.repivot-inline-insight-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding-right: 30px;
}

.repivot-inline-insight-badge {
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 9999px;
    border: 1px solid;
    white-space: nowrap;
}

.repivot-inline-insight-number {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: #F3F4F6;
    border: 1px solid;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    color: #6B7280;
    white-space: nowrap;
}

.repivot-inline-insight-suggestion {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.6;
    margin-bottom: 10px;
}

.repivot-inline-insight-justification {
    font-size: 13px;
    color: #6B7280;
    font-style: italic;
    line-height: 1.6;
}

/* Structured card styles (new format) */
.repivot-inline-insight-action-line {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    margin-bottom: 6px;
}

.repivot-inline-insight-action-line--done {
    color: #9CA3AF !important;
    text-decoration: line-through;
    text-decoration-color: #D1D5DB;
    font-weight: 400 !important;
}

.repivot-inline-insight-details {
    font-size: 13px;
    color: #374151;
    line-height: 1.6;
    margin-bottom: 8px;
}

.repivot-inline-insight-example {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 8px;
    padding: 9px 12px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid #D1D5DB;
    border-radius: 0 4px 4px 0;
}
.repivot-inline-insight-example-label {
    font-size: 9.5px;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.repivot-inline-insight-example-text {
    font-size: 12.5px;
    color: #4B5563;
    font-style: italic;
    line-height: 1.55;
}

.repivot-inline-insight-fix-preview {
    font-size: 12px;
    color: #9CA3AF;
    line-height: 1.5;
    margin-bottom: 6px;
}

/* Why? toggle — inline in the actions row */
.repivot-inline-insight-why-btn {
    font-size: 12px;
    color: #9CA3AF;
    background: none;
    border: none;
    padding: 2px 6px;
    cursor: pointer;
    border-radius: 3px;
}

.repivot-inline-insight-why-btn:hover {
    color: #6B7280;
    background: rgba(0, 0, 0, 0.04);
}

.repivot-inline-insight-why-btn--active {
    color: #6B7280;
    background: rgba(0, 0, 0, 0.04);
}

/* Why expansion — styled to match the Example box for visual consistency. */
.repivot-inline-insight-why-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0;
    padding: 9px 12px 10px;
    background: rgba(0, 0, 0, 0.02);
    border-left: 2px solid #D1D5DB;
    border-radius: 0 4px 4px 0;
}
.repivot-inline-insight-why-label {
    font-size: 9.5px;
    font-weight: 700;
    color: #9CA3AF;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}
.repivot-inline-insight-why-body {
    font-size: 12.5px;
    color: #4B5563;
    font-style: italic;
    line-height: 1.55;
}

/* Sidebar structured card styles */
.repivot-gap-card-action-line {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    margin-bottom: 4px;
}

.repivot-gap-card-action-line--done {
    color: #9CA3AF !important;
    text-decoration: line-through;
    text-decoration-color: #D1D5DB;
    font-weight: 400 !important;
}

.repivot-gap-card-details {
    font-size: 12px;
    color: #6B7280;
    line-height: 1.5;
    margin-bottom: 4px;
}

/* Expand/collapse chevron button for dismissed insights */
.repivot-insight-expand-btn {
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #9CA3AF;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.repivot-insight-expand-btn:hover {
    background: rgba(0, 0, 0, 0.06);
    color: #6B7280;
}

/* ========================================
   Post Document Panel (Post tab CTA)
   ======================================== */

.repivot-post-panel__text {
    margin: 0;
    font-size: 13px;
    color: #666;
    line-height: 1.5;
}

.repivot-post-panel__link {
    padding: 0 !important;
    height: auto !important;
    font-size: 13px;
}

.repivot-post-panel__cta {
    width: 100%;
    justify-content: center;
}

/* ========================================
   Empty State
   ======================================== */

.repivot-empty-state {
    padding: 24px 16px;
    color: #666;
}

.repivot-empty-state p {
    margin: 0 0 12px 0;
    font-size: 13px;
    line-height: 1.5;
}

/* ========================================
   Done Button & Done States
   ======================================== */

/* Done button (circle checkbox) — absolute top-right */
.repivot-gap-done-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid var(--rp-gray-300, #D1D5DB);
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s ease;
    padding: 0;
    color: white;
    z-index: 1;
}

.repivot-gap-done-btn:hover {
    border-color: var(--rp-gray-400, #9CA3AF);
}

.repivot-gap-done-btn--checked {
    background: var(--rp-emerald-500, #10B981);
    border-color: var(--rp-emerald-500, #10B981);
    animation: repivot-check-pop 0.3s ease;
}

/* Rejected state — red X for downvoted insights (sidebar) */
.repivot-gap-done-btn--rejected {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #EF4444;
    cursor: default;
}

/* Rejected state — red X for downvoted insights (inline) */
.repivot-inline-insight-done-btn--rejected {
    background: #FEE2E2;
    border-color: #FECACA;
    color: #EF4444;
    cursor: default;
}

/* Expand chevron — pushed to far right of header for dismissed inline insights */
.repivot-insight-expand-chevron {
    margin-left: auto;
    display: flex;
    align-items: center;
    color: #9CA3AF;
    transition: transform 0.2s ease;
}

.repivot-insight-expand-chevron--open {
    transform: rotate(180deg);
}

@keyframes repivot-check-pop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

/* Done card state — light green bg, matching sidebar */
.repivot-gap-card--done {
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.2);
}

.repivot-gap-card--done .repivot-gap-card-suggestion {
    color: var(--rp-gray-400, #9CA3AF);
    text-decoration: line-through;
    text-decoration-color: var(--rp-gray-300, #D1D5DB);
}

/* Done inline insight — shows full suggestion with strikethrough */
.repivot-inline-insight--done {
    background-color: rgba(16, 185, 129, 0.05) !important;
    border-color: rgba(16, 185, 129, 0.15) !important;
}

/* Done circle button — empty state (open), positioned top-right */
.repivot-inline-insight-done-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #D1D5DB;
    background: transparent;
    color: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 1;
}

.repivot-inline-insight-done-btn:hover {
    border-color: #9CA3AF;
    color: #D1D5DB;
}

/* Done circle button — checked state (done), positioned top-right */
.repivot-inline-insight-done-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: none;
    background: var(--rp-emerald-500, #10B981);
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.2s ease;
    z-index: 1;
}

.repivot-inline-insight-done-check:hover {
    background: var(--rp-emerald-600, #059669);
}

.repivot-inline-insight-suggestion--done {
    color: #9CA3AF !important;
    text-decoration: line-through;
    text-decoration-color: #D1D5DB;
    font-weight: 400 !important;
}

/* Done annotation in editor */
mark.annotation-text.repivot-annotation--done {
    background-color: rgba(16, 185, 129, 0.08) !important;
    border-bottom: 1px dashed var(--rp-emerald-400, #34D399) !important;
    opacity: 0.5;
    transition: background-color 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}

/* ========================================
   Link Tooltip (shown after insert_link fix)
   ======================================== */

.repivot-link-tooltip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    z-index: 100000;
    animation: repivot-tooltip-fade-in 0.15s ease;
    max-width: 380px;
}

@keyframes repivot-tooltip-fade-in {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.repivot-link-tooltip-icon {
    flex-shrink: 0;
    color: #10B981;
}

.repivot-link-tooltip-url {
    color: #374151;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.repivot-link-tooltip-close {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    border-radius: 4px;
    font-size: 14px;
    padding: 0;
    line-height: 1;
}

.repivot-link-tooltip-close:hover {
    background: #F3F4F6;
    color: #374151;
}

/* ========================================
   Inline Insert Text Area  (guided insert inside insight box)
   ======================================== */

.repivot-inline-insert-label {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5;
    margin: 0 0 6px;
}
.repivot-inline-insert-area {
    margin-bottom: 12px;
    padding: 10px 12px;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 8px;
}
.repivot-inline-insert-textarea {
    display: block;
    width: 100%;
    min-height: 60px;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.5;
    font-family: inherit;
    resize: vertical;
    background: #fff;
    color: #1f2937;
    box-sizing: border-box;
}
.repivot-inline-insert-textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}
.repivot-inline-insert-textarea::placeholder {
    color: #9ca3af;
    font-style: italic;
}
.repivot-inline-insert-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
}
.repivot-inline-insert-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 5px;
    cursor: pointer;
    border: none;
    line-height: 1.6;
}
.repivot-inline-insert-btn--add {
    background: #008236;
    color: #fff;
}
.repivot-inline-insert-btn--add:hover:not(:disabled) {
    background: #006b2d;
}
.repivot-inline-insert-btn--add:disabled {
    opacity: 0.4;
    cursor: default;
}
.repivot-inline-insert-btn--cancel {
    background: transparent;
    color: #6b7280;
}
.repivot-inline-insert-btn--cancel:hover {
    color: #374151;
    background: rgba(0,0,0,0.04);
}
.repivot-inline-insert-hint {
    margin-left: auto;
    font-size: 11px;
    color: #9ca3af;
}

/* ========================================
   Cross-Post Modal
   ======================================== */


/* ========================================
   Labels Section
   ======================================== */

.repivot-labels-content {
    /* Sits inside CollapsibleSection which provides padding */
}

.repivot-labels-pills {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    position: relative;
}

.repivot-label-pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 6px 2px 10px;
    border-radius: 9999px;
    font-size: 11px;
    font-weight: 600;
    border: 1px solid;
}

.repivot-label-pill-remove {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 14px;
    height: 14px;
    border: none;
    background: transparent;
    border-radius: 50%;
    cursor: pointer;
    padding: 0;
    color: inherit;
    opacity: 0;
    transition: opacity 0.15s ease, background 0.15s ease;
}

.repivot-label-pill:hover .repivot-label-pill-remove {
    opacity: 0.7;
}

.repivot-label-pill-remove:hover {
    opacity: 1 !important;
    background: rgba(0, 0, 0, 0.1);
}

.repivot-label-add-btn {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 1px dashed #D1D5DB;
    background: transparent;
    color: #9CA3AF;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: all 0.15s ease;
}

.repivot-label-add-btn:hover {
    border-color: #9CA3AF;
    color: #6B7280;
}

/* Label Picker Dropdown */
.repivot-label-picker {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    z-index: 100;
    background: white;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    overflow: hidden;
}

.repivot-label-picker-search {
    width: 100%;
    padding: 8px 12px;
    border: none;
    border-bottom: 1px solid #F3F4F6;
    font-size: 13px;
    outline: none;
    box-sizing: border-box;
}

.repivot-label-picker-search:focus {
    box-shadow: none;
}

.repivot-label-picker-list {
    max-height: 200px;
    overflow-y: auto;
}

.repivot-label-picker-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 6px 12px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    text-align: left;
    transition: background 0.1s ease;
}

.repivot-label-picker-row:hover {
    background: #F9FAFB;
}

.repivot-label-checkbox {
    width: 16px;
    height: 16px;
    border-radius: 3px;
    border: 2px solid #D1D5DB;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.15s ease;
    color: white;
}

.repivot-label-checkbox--checked {
    background: #10B981;
    border-color: #10B981;
}

.repivot-label-picker-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.repivot-label-picker-name {
    color: #374151;
    font-weight: 500;
}

.repivot-label-picker-create {
    border-top: 1px solid #F3F4F6;
}

.repivot-label-picker-create-text {
    color: #10B981;
    font-weight: 600;
    font-size: 13px;
}

.repivot-label-picker-empty {
    padding: 12px;
    font-size: 12px;
    color: #9CA3AF;
    font-style: italic;
    text-align: center;
}

.repivot-label-picker-done {
    width: 100%;
    padding: 8px;
    border: none;
    border-top: 1px solid #F3F4F6;
    background: transparent;
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: background 0.1s ease;
}

.repivot-label-picker-done:hover {
    background: #F9FAFB;
}

/* ========================================
   Notes Section
   ======================================== */

.repivot-notes-content {
    /* Sits inside CollapsibleSection which provides padding */
}

.repivot-note-add-trigger {
    width: 100%;
    padding: 8px 12px;
    border: 1px dashed #E5E7EB;
    border-radius: 8px;
    background: transparent;
    color: #9CA3AF;
    font-size: 13px;
    cursor: pointer;
    text-align: left;
    transition: all 0.15s ease;
    margin-bottom: 8px;
}

.repivot-note-add-trigger:hover {
    border-color: #D1D5DB;
    color: #6B7280;
}

/* Note form */
.repivot-note-form {
    margin-bottom: 8px;
}

.repivot-note-textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    resize: vertical;
    min-height: 48px;
    max-height: 120px;
    outline: none;
    box-sizing: border-box;
}

.repivot-note-textarea:focus {
    border-color: #10B981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.15);
}

.repivot-note-form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 6px;
}

.repivot-note-date-input {
    font-size: 12px;
    padding: 3px 6px;
    border: 1px solid #E5E7EB;
    border-radius: 4px;
    color: #6B7280;
}

.repivot-note-form-actions {
    display: flex;
    gap: 8px;
}

.repivot-note-cancel-btn {
    font-size: 13px;
    color: #9CA3AF;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
}

.repivot-note-cancel-btn:hover {
    color: #6B7280;
}

.repivot-note-save-btn {
    font-size: 13px;
    font-weight: 600;
    color: #10B981;
    background: none;
    border: none;
    cursor: pointer;
    padding: 2px 4px;
}

.repivot-note-save-btn:hover {
    color: #059669;
}

.repivot-note-save-btn:disabled {
    color: #D1D5DB;
    cursor: default;
}

/* Note list */
.repivot-notes-list {
    /* Container */
}

.repivot-note-item {
    padding: 8px 0;
    border-bottom: 1px solid #F3F4F6;
    position: relative;
}

.repivot-note-item:last-child {
    border-bottom: none;
}

.repivot-note-meta {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
}

.repivot-note-date {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
}

.repivot-note-author {
    font-size: 12px;
    color: #9CA3AF;
}

.repivot-note-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 4px;
    visibility: hidden;
}

.repivot-note-item:hover .repivot-note-actions {
    visibility: visible;
}

.repivot-note-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border: none;
    background: transparent;
    border-radius: 4px;
    color: #D1D5DB;
    cursor: pointer;
    padding: 0;
    transition: all 0.15s ease;
}

.repivot-note-action-btn:hover {
    background: #F3F4F6;
    color: #6B7280;
}

.repivot-note-action-btn--delete:hover {
    color: #EF4444;
}

.repivot-note-confirm {
    display: flex;
    gap: 6px;
    font-size: 11px;
}

.repivot-note-confirm-delete {
    background: none;
    border: none;
    color: #EF4444;
    font-weight: 600;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.repivot-note-confirm-cancel {
    background: none;
    border: none;
    color: #9CA3AF;
    cursor: pointer;
    font-size: 11px;
    padding: 0;
}

.repivot-note-body {
    font-size: 13px;
    color: #374151;
    line-height: 1.5;
}

.repivot-notes-empty {
    font-size: 12px;
    color: #9CA3AF;
    text-align: center;
    padding: 12px 0;
}
