/**
 * Admin CSS for FreshRank AI
 * Complete version with priority details functionality
 * FIXED: Added backward compatibility for old wsau- class names
 */

/* Dashboard Layout - Support both freshrank- and wsau- prefixes */
.freshrank-dashboard-layout,
.wsau-dashboard-layout {
    display: flex;
    gap: 20px;
    margin: 20px 0;
}

.freshrank-main-content,
.wsau-main-content {
    flex: 1;
    min-width: 0;
}

.freshrank-sidebar,
.wsau-sidebar {
    width: 280px;
    flex-shrink: 0;
}

/* Sidebar Statistics */
.freshrank-stats-sidebar,
.wsau-stats-sidebar {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
    position: sticky;
    top: 32px;
}

.freshrank-sidebar-title,
.wsau-sidebar-title {
    margin: 0;
    padding: 20px 20px 15px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    border-bottom: 1px solid #f0f0f1;
}

.freshrank-stat-item,
.wsau-stat-item {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f1;
    transition: background-color 0.2s ease;
}

.freshrank-stat-item:last-child,
.wsau-stat-item:last-child {
    border-bottom: none;
}

.freshrank-stat-item:hover,
.wsau-stat-item:hover {
    background-color: #f6f7f7;
}

.freshrank-stat-clickable,
.wsau-stat-clickable {
    cursor: pointer;
}

.freshrank-stat-clickable:hover,
.wsau-stat-clickable:hover {
    background-color: #eef2ff;
}

.freshrank-stat-value,
.wsau-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--fr-blue);
    line-height: 1;
}

.freshrank-stat-label,
.wsau-stat-label {
    font-size: 13px;
    color: #64748b;
    font-weight: 500;
}

/* OLD Statistics Container (deprecated) */
.freshrank-stats-container,
.wsau-stats-container {
    display: flex;
    gap: 20px;
    margin: 20px 0;
    flex-wrap: wrap;
}

.freshrank-stat-box,
.wsau-stat-box {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    min-width: 150px;
    flex: 1;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.freshrank-stat-box h3,
.wsau-stat-box h3 {
    font-size: 2.5em;
    margin: 0 0 10px 0;
    color: var(--fr-blue);
    font-weight: 600;
}

.freshrank-stat-box p,
.wsau-stat-box p {
    margin: 0;
    color: #64748b;
    font-weight: 500;
}

/* Responsive Layout */
@media (max-width: 1200px) {
    .freshrank-dashboard-layout,
.wsau-dashboard-layout {
        flex-direction: column;
    }

    .freshrank-sidebar,
.wsau-sidebar {
        width: 100%;
        position: static;
    }

    .freshrank-stats-sidebar,
.wsau-stats-sidebar {
        position: static;
    }
}

/* Workflow Progress Tracker */
.freshrank-workflow-tracker,
.wsau-workflow-tracker {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin: 25px 0;
    padding: 25px;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.freshrank-workflow-step,
.wsau-workflow-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    transition: all 0.3s ease;
    min-width: 200px;
}

.freshrank-workflow-step.freshrank-step-active,
.wsau-workflow-step.freshrank-step-active,
.wsau-step-active {
    background: #eef2ff;
    border: 2px solid var(--fr-blue);
}

.freshrank-workflow-step.freshrank-step-complete,
.wsau-workflow-step.freshrank-step-complete,
.wsau-step-complete {
    background: #e7f5e9;
    border: 2px solid #46b450;
}

.freshrank-workflow-step.freshrank-step-disabled,
.wsau-workflow-step.freshrank-step-disabled,
.wsau-step-disabled {
    opacity: 0.5;
    background: #f6f7f7;
}

.freshrank-step-icon,
.wsau-step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #e0e0e0;
    border-radius: 50%;
    flex-shrink: 0;
    font-weight: 700;
    transition: all 0.3s ease;
}

.freshrank-step-active .freshrank-step-icon,
.wsau-step-active .freshrank-step-icon,
.wsau-step-active .wsau-step-icon {
    background: var(--fr-blue);
    color: white;
}

.freshrank-step-complete .freshrank-step-icon,
.wsau-step-complete .freshrank-step-icon,
.wsau-step-complete .wsau-step-icon {
    background: #46b450;
    color: white;
}

.freshrank-step-disabled .freshrank-step-icon,
.wsau-step-disabled .freshrank-step-icon,
.wsau-step-disabled .wsau-step-icon {
    background: #e0e0e0;
    color: #999;
}

.freshrank-step-icon .dashicons,
.wsau-step-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.freshrank-step-num,
.wsau-step-num {
    font-size: 18px;
    font-weight: 700;
    color: #666;
}

.freshrank-step-active .freshrank-step-num,
.wsau-step-active .freshrank-step-num,
.wsau-step-active .wsau-step-num {
    color: white;
}

.freshrank-step-content,
.wsau-step-content {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.freshrank-step-title,
.wsau-step-title {
    font-size: 15px;
    font-weight: 600;
    color: #1e293b;
}

.freshrank-step-status,
.wsau-step-status {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-size: 13px;
}

.freshrank-step-count,
.wsau-step-count {
    font-weight: 700;
    color: var(--fr-blue);
    font-size: 14px;
}

.freshrank-step-complete .freshrank-step-count,
.wsau-step-complete .freshrank-step-count,
.wsau-step-complete .wsau-step-count {
    color: #46b450;
}

.freshrank-step-label,
.wsau-step-label {
    color: #64748b;
    font-size: 12px;
}

.freshrank-workflow-connector,
.wsau-workflow-connector {
    width: 60px;
    height: 3px;
    background: #dcdcde;
    position: relative;
    transition: all 0.3s ease;
}

.freshrank-workflow-connector.freshrank-connector-complete,
.wsau-workflow-connector.freshrank-connector-complete,
.wsau-connector-complete {
    background: #46b450;
}

.freshrank-workflow-connector::after,
.wsau-workflow-connector::after {
    content: '→';
    position: absolute;
    right: -8px;
    top: -11px;
    color: #dcdcde;
    font-size: 20px;
    font-weight: bold;
}

.freshrank-workflow-connector.freshrank-connector-complete::after,
.wsau-workflow-connector.freshrank-connector-complete::after,
.wsau-connector-complete::after {
    color: #46b450;
}

/* State Container */
.freshrank-state-container,
.wsau-state-container {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    margin: 20px 0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}

.freshrank-state-container h2,
.wsau-state-container h2 {
    margin: 0;
    padding: 15px 20px;
    border-bottom: 1px solid #e2e8f0;
    background: #f6f7f7;
    border-radius: 4px 4px 0 0;
}

.toplevel_page_freshrank-ai .wsau-state-container .button .dashicons,
.freshrank-ai_page_freshrank-settings .freshrank-settings-grid .button .dashicons {
    line-height: 1;
}

.freshrank-state-info,
.wsau-state-info {
    font-size: 14px;
    font-weight: normal;
    color: #64748b;
    margin-left: 10px;
}

/* Actions Bar - Updated for grouped workflow */
.freshrank-actions-bar,
.wsau-actions-bar {
    padding: 20px;
    border-bottom: 1px solid #e2e8f0;
    background: linear-gradient(to bottom, #ffffff, #f6f7f7);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.freshrank-workflow-hint,
.wsau-workflow-hint {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 15px;
    background: #e7f3ff;
    border-left: 4px solid var(--fr-blue);
    border-radius: 4px;
    color: #1e293b;
    font-weight: 500;
    font-size: 14px;
}

.freshrank-workflow-hint .dashicons,
.wsau-workflow-hint .dashicons {
    color: var(--fr-blue);
    flex-shrink: 0;
}

.freshrank-action-group,
.wsau-action-group {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 12px 15px;
    background: white;
    border: 1px solid #dcdcde;
    border-radius: 6px;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}

.freshrank-action-group-label,
.wsau-action-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    min-width: 140px;
    padding-top: 6px;
}

.freshrank-step-number,
.wsau-step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: var(--fr-blue);
    color: white;
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.freshrank-action-group-buttons,
.wsau-action-group-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    flex: 1;
}

.freshrank-action-group-buttons .button,
.wsau-action-group-buttons .button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    padding: 6px 14px;
    height: auto;
    line-height: 1.4;
}

.freshrank-action-group-buttons .button .dashicons,
.wsau-action-group-buttons .button .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

.freshrank-action-separator,
.wsau-action-separator {
    color: #64748b;
    margin: 0 5px;
}

/* List Controls */
.freshrank-list-controls,
.wsau-list-controls {
    padding: 10px 20px;
    background: #f6f7f7;
    border-bottom: 1px solid #e2e8f0;
}

.freshrank-list-controls .description,
.wsau-list-controls .description {
    margin: 0;
    font-style: italic;
}

/* Table Container */
.freshrank-table-container,
.wsau-table-container {
    margin: 0;
}

.freshrank-table-container table,
.wsau-table-container table {
    margin: 0;
}

/* Article Table Styles */
#freshrank-articles-table {
    border-collapse: collapse;
    min-width: 1100px;
    table-layout: fixed;
}

#freshrank-articles-table th,
#freshrank-articles-table td {
    padding: 8px 8px;
    vertical-align: top;
}

.freshrank-article-row:hover,
.wsau-article-row:hover {
    background-color: #f6f7f7;
}

.freshrank-sortable-placeholder,
.wsau-sortable-placeholder {
    height: 60px;
    background: #e1f5fe;
    border: 2px dashed #039be5;
}

/* Priority Scores */
.freshrank-priority-score,
.wsau-priority-score {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 3px;
    font-weight: 600;
    font-size: 12px;
    text-align: center;
    min-width: 40px;
}

.freshrank-priority-high,
.wsau-priority-high {
    background: #d32f2f;
    color: white;
}

.freshrank-priority-medium,
.wsau-priority-medium {
    background: #f57c00;
    color: white;
}

.freshrank-priority-low,
.wsau-priority-low {
    background: #fbc02d;
    color: #333;
}

.freshrank-priority-very-low,
.wsau-priority-very-low {
    background: #ffc107;
    color: #333;
}

/* Ensure text contrast is good on blue background (low severity) */
.freshrank-issue.freshrank-severity-low strong,
.wsau-issue.freshrank-severity-low strong,
.wsau-severity-low strong {
    color: #1e293b; /* Dark text for readability on blue background */
}

.freshrank-issue.freshrank-severity-low .freshrank-issue-recommendation,
.wsau-issue.freshrank-severity-low .freshrank-issue-recommendation,
.wsau-severity-low .freshrank-issue-recommendation,
.wsau-issue.freshrank-severity-low .wsau-issue-recommendation,
.wsau-severity-low .wsau-issue-recommendation {
    color: #3c434a; /* Slightly darker gray for recommendations on blue background */
}

/* Priority Score Details Styles */
.freshrank-priority-toggle-container,
.wsau-priority-toggle-container {
    margin-top: 4px;
}

.freshrank-toggle-priority-details,
.wsau-toggle-priority-details {
    font-size: 11px;
    color: var(--fr-blue);
    text-decoration: none;
    display: block;
}

.freshrank-toggle-priority-details:hover,
.wsau-toggle-priority-details:hover {
    text-decoration: underline;
}

/* Priority Details Expandable Row */
.freshrank-priority-details-row,
.wsau-priority-details-row {
    background: #f6f7f7;
}

.freshrank-priority-details-content,
.wsau-priority-details-content {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.freshrank-detailed-priority-info h4,
.wsau-detailed-priority-info h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
}

.freshrank-priority-section,
.wsau-priority-section {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.freshrank-priority-summary-section,
.wsau-priority-summary-section,
.freshrank-priority-data-section,
.wsau-priority-data-section {
    flex: 1;
    min-width: 350px;
}

.freshrank-priority-summary-section h5,
.wsau-priority-summary-section h5,
.freshrank-priority-data-section h5,
.wsau-priority-data-section h5 {
    margin: 0 0 15px 0;
    color: #1e293b;
    font-size: 14px;
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 5px;
}

.freshrank-priority-summary-content,
.wsau-priority-summary-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.freshrank-priority-component,
.wsau-priority-component {
    margin-bottom: 20px;
    padding: 12px;
    background: #f9f9f9;
    border-radius: 4px;
    border-left: 4px solid #72aee6;
}

.freshrank-priority-total,
.wsau-priority-total {
    background: #eef2ff;
    padding: 12px;
    border-radius: 4px;
    border-left: 4px solid #72aee6;
}

.freshrank-component-label,
.wsau-component-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.freshrank-component-label strong,
.wsau-component-label strong {
    color: #1e293b;
    font-size: 14px;
}

.freshrank-component-weight,
.wsau-component-weight {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.freshrank-component-value,
.wsau-component-value {
    display: flex;
    align-items: center;
    gap: 12px;
}

.freshrank-score-value,
.wsau-score-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--fr-blue);
    min-width: 40px;
}

.freshrank-score-total,
.wsau-score-total {
    font-size: 24px;
    color: #16a34a;
}

.freshrank-score-explanation,
.wsau-score-explanation {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
    flex: 1;
}

/* GSC Data Styles */
.freshrank-gsc-data-content,
.wsau-gsc-data-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.freshrank-gsc-period,
.wsau-gsc-period {
    margin-bottom: 20px;
}

.freshrank-gsc-period:last-child,
.wsau-gsc-period:last-child {
    margin-bottom: 0;
}

.freshrank-gsc-period h6,
.wsau-gsc-period h6 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 13px;
    font-weight: 600;
    padding: 8px 12px;
    background: #f6f7f7;
    border-radius: 3px;
}

.freshrank-gsc-metrics,
.wsau-gsc-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 10px;
    padding: 0 5px;
}

.freshrank-gsc-metric,
.wsau-gsc-metric {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #f9f9f9;
    border-radius: 3px;
    font-size: 13px;
}

.freshrank-metric-label,
.wsau-metric-label {
    color: #64748b;
    font-weight: 500;
}

.freshrank-metric-value,
.wsau-metric-value {
    color: #1e293b;
    font-weight: 600;
}

/* Status Badges - IMPROVED with gradients and animations */
.freshrank-status,
.wsau-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 20px;
    border: none;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    min-width: 70px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.freshrank-status:hover,
.wsau-status:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0,0,0,0.12);
}

.freshrank-status-pending,
.wsau-status-pending {
    background: linear-gradient(135deg, #f6f7f7 0%, #e8e9ea 100%);
    color: #64748b;
}

.freshrank-status-analyzing,
.wsau-status-analyzing {
    background: linear-gradient(135deg, #e3f2fd 0%, #90caf9 100%);
    color: #0d47a1;
    animation: pulse-analyzing 2s ease-in-out infinite;
}

.freshrank-status-analyzing::before,
.wsau-status-analyzing::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
}

@keyframes pulse-analyzing {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.freshrank-status-creating,
.wsau-status-creating {
    background: linear-gradient(135deg, #fff3e0 0%, #ffcc80 100%);
    color: #e65100;
    animation: pulse-creating 2s ease-in-out infinite;
}

.freshrank-status-creating::before,
.wsau-status-creating::before {
    content: '';
    display: inline-block;
    width: 8px;
    height: 8px;
    background: currentColor;
    border-radius: 50%;
    animation: blink 1.4s ease-in-out infinite;
}

@keyframes pulse-creating {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.85; }
}

.freshrank-status-completed,
.wsau-status-completed {
    background: linear-gradient(135deg, #d4edda 0%, #a5d6a7 100%);
    color: #1b5e20;
}

.freshrank-status-completed::before,
.wsau-status-completed::before {
    content: '\2713';
    font-weight: bold;
}

.freshrank-status-error,
.wsau-status-error {
    background: linear-gradient(135deg, #ffebee 0%, #ef9a9a 100%);
    color: #b71c1c;
}

.freshrank-status-error::before,
.wsau-status-error::before {
    content: '\26A0';
}

.freshrank-status-draft,
.wsau-status-draft {
    background: linear-gradient(135deg, #e7f3ff 0%, #90caf9 100%);
    color: #01579b;
}

.freshrank-status-draft::before,
.wsau-status-draft::before {
    content: '\270E';
}

/* Issues Count */
.freshrank-issues-count,
.wsau-issues-count {
    font-weight: 600;
    color: #d32f2f;
}

.freshrank-no-issues,
.wsau-no-issues {
    color: #2e7d32;
    font-style: italic;
}

.freshrank-view-issues,
.wsau-view-issues {
    margin-left: 8px;
    color: var(--fr-blue);
    text-decoration: none;
    font-size: 12px;
}

.freshrank-view-issues:hover,
.wsau-view-issues:hover {
    text-decoration: underline;
}

/* Actions Column */
.freshrank-actions,
.wsau-actions {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    align-items: center;
    min-height: 60px;
}

.freshrank-actions .button,
.wsau-actions .button {
    font-size: 12px;
    padding: 4px 8px;
    height: auto;
    line-height: 1.2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.freshrank-actions .button .dashicons,
.wsau-actions .button .dashicons {
    margin: 0;
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.wsau-actions .freshrank-approve-draft,
.wsau-actions .freshrank-reject-draft {
    min-height: 30px;
}

/* Approve/Reject button styling */
.freshrank-approve-revision,
.freshrank-approve-draft {
    background: #16a34a;
    border-color: #16a34a;
    color: #fff;
}

.freshrank-approve-revision:hover,
.freshrank-approve-draft:hover {
    background: #008a20;
    border-color: #008a20;
}

.freshrank-reject-revision,
.freshrank-reject-draft {
    color: #dc2626;
    border-color: #dc2626;
}

.freshrank-reject-revision:hover,
.freshrank-reject-draft:hover {
    color: #b32d2e;
    border-color: #b32d2e;
}

.freshrank-analyzing,
.wsau-analyzing,
.freshrank-no-actions,
.wsau-no-actions {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}

.freshrank-error-indicator,
.wsau-error-indicator {
    color: #c62828;
    font-size: 12px;
    cursor: help;
}

/* Changes Count */
.freshrank-changes-count,
.wsau-changes-count {
    font-weight: 600;
    color: var(--fr-blue);
}

.freshrank-update-summary,
.wsau-update-summary {
    font-size: 11px;
    color: #64748b;
    margin-top: 3px;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
}

/* No Data Indicators */
.freshrank-no-data,
.wsau-no-data {
    color: #64748b;
    font-style: italic;
    font-size: 12px;
}

/* Progress Dialog */
#freshrank-progress-dialog {
    text-align: center;
}

#freshrank-progress-container {
    padding: 20px;
}

.freshrank-progress-bar-container {
    background: #f0f0f1;
    border-radius: 10px;
    height: 20px;
    margin-bottom: 15px;
    overflow: hidden;
}

#freshrank-progress-bar {
    width: 0%;
    height: 100%;
    background: var(--fr-blue);
    transition: width 0.3s ease;
}

#freshrank-progress-text {
    font-weight: 500;
    color: #64748b;
}

/* Settings Page */
.freshrank-setup-instructions,
.wsau-setup-instructions {
    background: #f6f7f7;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 20px;
    margin-top: 15px;
}

.freshrank-setup-instructions ol,
.wsau-setup-instructions ol {
    margin-left: 20px;
}

.freshrank-setup-instructions li,
.wsau-setup-instructions li {
    margin-bottom: 8px;
    line-height: 1.5;
}

.freshrank-api-guidelines,
.wsau-api-guidelines {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    padding: 15px;
    margin-top: 15px;
}

.freshrank-api-guidelines ul,
.wsau-api-guidelines ul {
    margin-left: 20px;
}

.freshrank-api-guidelines li,
.wsau-api-guidelines li {
    margin-bottom: 5px;
}

.freshrank-system-info table,
.wsau-system-info table {
    margin-top: 15px;
}

.freshrank-system-info td:first-child,
.wsau-system-info td:first-child {
    font-weight: 600;
    width: 200px;
}

/* Connection Status */
.freshrank-status-connected,
.wsau-status-connected {
    color: #2e7d32;
    font-weight: 600;
}

.freshrank-status-disconnected,
.wsau-status-disconnected {
    color: #c62828;
    font-weight: 600;
}

/* Analysis Results Styles */
.freshrank-issues-column,
.wsau-issues-column {
    max-width: 300px;
}

.freshrank-issues-summary,
.wsau-issues-summary {
    font-size: 12px;
    line-height: 1.3;
}

.freshrank-issues-count,
.wsau-issues-count {
    display: block;
    margin-bottom: 3px;
    color: #dc2626;
}

.freshrank-issues-breakdown,
.wsau-issues-breakdown {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 3px;
    line-height: 1.3;
}

.freshrank-overall-score,
.wsau-overall-score {
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 3px;
    display: inline-block;
}

.freshrank-issues-details,
.wsau-issues-details {
    font-size: 11px;
    color: #64748b;
    margin-bottom: 3px;
    line-height: 1.3;
}

.freshrank-score-good,
.wsau-score-good {
    background: #16a34a;
    color: white;
}

.freshrank-score-average,
.wsau-score-average {
    background: #f56e28;
    color: white;
}

.freshrank-score-poor,
.wsau-score-poor {
    background: #dc2626;
    color: white;
}

.freshrank-no-issues-found,
.wsau-no-issues-found {
    color: #16a34a;
    font-weight: 500;
    font-size: 11px;
    line-height: 1.3;
}

.freshrank-analysis-error,
.wsau-analysis-error {
    color: #dc2626;
    font-weight: 500;
    font-size: 11px;
    line-height: 1.3;
}

.freshrank-not-analyzed,
.wsau-not-analyzed {
    color: #64748b;
    font-style: italic;
    font-size: 11px;
}

.freshrank-analyzing-feedback,
.wsau-analyzing-feedback {
    font-size: 11px;
    line-height: 1.4;
}

.freshrank-analyzing-feedback,
.wsau-analyzing-feedback small {
    font-size: 10px;
    line-height: 1.3;
}

.freshrank-toggle-issues,
.wsau-toggle-issues {
    font-size: 11px;
    color: var(--fr-blue);
    text-decoration: none;
    display: block;
    margin-top: 4px;
}

.freshrank-toggle-issues:hover,
.wsau-toggle-issues:hover {
    text-decoration: underline;
}

/* Detailed Analysis Styles */
.freshrank-analysis-details-row,
.wsau-analysis-details-row {
    background: #f6f7f7;
}

.freshrank-analysis-details-content,
.wsau-analysis-details-content {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.freshrank-detailed-analysis h4,
.wsau-detailed-analysis h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
}

.freshrank-analysis-section,
.wsau-analysis-section {
    margin-bottom: 20px;
}

.freshrank-analysis-section h5,
.wsau-analysis-section h5 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 14px;
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 5px;
}

.freshrank-issues-list,
.wsau-issues-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.freshrank-issue,
.wsau-issue {
    margin-bottom: 15px;
    padding: 10px;
    background: white;
    border-left: 4px solid #72aee6;
    border-radius: 0 4px 4px 0;
}

.freshrank-issue.freshrank-severity-high,
.wsau-issue.freshrank-severity-high,
.wsau-severity-high {
    border-left-color: #dc2626; /* Red - matches high priority (60+) */
}

.freshrank-issue.freshrank-severity-medium,
.wsau-issue.freshrank-severity-medium,
.wsau-severity-medium {
    border-left-color: #f57c00; /* Orange - matches medium priority (40-59) */
}

.freshrank-issue.freshrank-severity-low,
.wsau-issue.freshrank-severity-low,
.wsau-severity-low {
    border-left-color: var(--fr-blue); /* Blue - matches low priority (20-39) */
    background: #eef2ff; /* Light blue background for consistency */
}

/* Ensure WCAG AA compliance for text on blue backgrounds */
.freshrank-issue.freshrank-severity-low,
.wsau-issue.freshrank-severity-low,
.wsau-severity-low {
    color: #1e293b; /* Dark text for readability */
}

.freshrank-issue.freshrank-severity-low .freshrank-issue-recommendation,
.wsau-issue.freshrank-severity-low .freshrank-issue-recommendation,
.wsau-severity-low .freshrank-issue-recommendation,
.wsau-issue.freshrank-severity-low .wsau-issue-recommendation,
.wsau-severity-low .wsau-issue-recommendation {
    color: #2c3338; /* Darker gray for recommendations */
}

.freshrank-issue strong,
.wsau-issue strong {
    display: block;
    margin-bottom: 5px;
    color: #1e293b;
}

.freshrank-issue-recommendation,
.wsau-issue-recommendation {
    font-size: 13px;
    color: #64748b;
    line-height: 1.4;
}

/* Draft Information Styles - Updated for expandable interface */
.freshrank-has-draft,
.wsau-has-draft {
    background-color: #eef2ff;
}

.freshrank-draft-toggle-container,
.wsau-draft-toggle-container {
    margin-top: 4px;
}

.freshrank-toggle-draft-details,
.wsau-toggle-draft-details {
    font-size: 11px;
    color: var(--fr-blue);
    text-decoration: none;
    display: block;
    margin-top: 4px;
}

.freshrank-toggle-draft-details:hover,
.wsau-toggle-draft-details:hover {
    text-decoration: underline;
}

/* Draft Details Expandable Row */
.freshrank-draft-details-row,
.wsau-draft-details-row {
    background: #f6f7f7;
}

.freshrank-draft-details-content,
.wsau-draft-details-content {
    padding: 20px;
    border-top: 1px solid #e2e8f0;
}

.freshrank-detailed-draft-info h4,
.wsau-detailed-draft-info h4 {
    margin: 0 0 15px 0;
    color: #1e293b;
}

.freshrank-draft-section,
.wsau-draft-section {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.freshrank-draft-summary-section,
.wsau-draft-summary-section,
.freshrank-draft-actions-section,
.wsau-draft-actions-section {
    flex: 1;
    min-width: 250px;
}

.freshrank-draft-summary-section h5,
.wsau-draft-summary-section h5,
.freshrank-draft-actions-section h5,
.wsau-draft-actions-section h5 {
    margin: 0 0 10px 0;
    color: #1e293b;
    font-size: 14px;
    border-bottom: 1px solid #dcdcde;
    padding-bottom: 5px;
}

.freshrank-draft-summary-content,
.wsau-draft-summary-content {
    background: white;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #dcdcde;
}

.freshrank-draft-stat,
.wsau-draft-stat {
    margin-bottom: 8px;
    font-size: 14px;
    color: #64748b;
}

.freshrank-draft-stat strong,
.wsau-draft-stat strong {
    color: var(--fr-blue);
}

.freshrank-draft-description,
.wsau-draft-description {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #f0f0f1;
    font-size: 13px;
    line-height: 1.4;
}

.freshrank-draft-description strong,
.wsau-draft-description strong {
    display: block;
    margin-bottom: 5px;
    color: #1e293b;
}

.freshrank-draft-action-buttons,
.wsau-draft-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.freshrank-draft-action-buttons .button,
.wsau-draft-action-buttons .button {
    text-align: center;
    justify-content: center;
}

/* Remove old draft info styles that are no longer used */
.freshrank-draft-info,
.wsau-draft-info {
    display: none; /* Hide the old blue box completely */
}

.freshrank-draft-indicator,
.wsau-draft-indicator,
.freshrank-draft-summary,
.wsau-draft-summary,
.freshrank-draft-update-summary,
.wsau-draft-update-summary,
.freshrank-draft-links,
.wsau-draft-links,
.freshrank-draft-link,
.wsau-draft-link {
    display: none; /* Hide all old draft styling */
}

/* Analyzing State */
.freshrank-analyzing-row,
.wsau-analyzing-row {
    background-color: #fff3cd;
    opacity: 0.8;
}

.freshrank-analyzing-row td,
.wsau-analyzing-row td {
    position: relative;
}

/* Responsive Design */
@media (max-width: 782px) {
    .freshrank-stats-container,
.wsau-stats-container {
        flex-direction: column;
    }
    
    .freshrank-stat-box,
.wsau-stat-box {
        min-width: auto;
    }
    
    .freshrank-actions-bar,
.wsau-actions-bar {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .freshrank-actions,
    .wsau-actions {
        flex-direction: column;
        width: 100%;
    }

    .freshrank-actions .button,
    .wsau-actions .button {
        width: 100%;
        text-align: center;
        margin: 2px 0;
    }
    
    .freshrank-table-container,
.wsau-table-container {
        overflow-x: auto;
    }
    
    .freshrank-update-summary,
.wsau-update-summary {
        max-width: 150px;
    }
    
    /* Priority details responsive */
    .freshrank-priority-section,
.wsau-priority-section {
        flex-direction: column;
        gap: 20px;
    }
    
    .freshrank-priority-summary-section,
.wsau-priority-summary-section,
    .freshrank-priority-data-section,
.wsau-priority-data-section {
        min-width: auto;
    }
    
    .freshrank-gsc-metrics,
.wsau-gsc-metrics {
        grid-template-columns: 1fr;
    }
    
    .freshrank-component-value,
.wsau-component-value {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .freshrank-score-value,
.wsau-score-value {
        font-size: 16px;
    }
    
    .freshrank-score-total,
.wsau-score-total {
        font-size: 20px;
    }
}

@media (max-width: 600px) {
    .freshrank-stat-box h3,
    .wsau-stat-box h3 {
        font-size: 2em;
    }

    #freshrank-articles-table th,
    #freshrank-articles-table td {
        padding: 8px 4px;
        font-size: 12px;
    }

    .freshrank-priority-score,
    .wsau-priority-score,
    .freshrank-status,
    .wsau-status {
        font-size: 10px;
        padding: 3px 6px;
    }

    .freshrank-actions .button,
    .wsau-actions .button {
        font-size: 11px;
        padding: 3px 6px;
    }
}

/* Loading States */
.freshrank-loading,
.wsau-loading {
    opacity: 0.6;
    pointer-events: none;
}

.freshrank-loading::after,
.wsau-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--fr-blue);
    border-radius: 50%;
    animation: freshrank-spin 1s linear infinite;
}

@keyframes freshrank-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.freshrank-sr-only,
.wsau-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Focus States */
.freshrank-article-row:focus,
.wsau-article-row:focus,
.freshrank-actions .button:focus,
.wsau-actions .button:focus,
.freshrank-priority-score:focus,
.wsau-priority-score:focus {
    outline: 2px solid var(--fr-blue);
    outline-offset: 2px;
}

/* High Contrast Support */
@media (prefers-contrast: high) {
    .freshrank-priority-high,
.wsau-priority-high,
    .freshrank-priority-medium,
.wsau-priority-medium,
    .freshrank-priority-low,
.wsau-priority-low,
    .freshrank-priority-very-low,
.wsau-priority-very-low {
        border: 2px solid currentColor;
    }
    
    .freshrank-status,
.wsau-status {
        border: 2px solid currentColor;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .freshrank-sortable-placeholder,
.wsau-sortable-placeholder,
    #freshrank-progress-bar {
        transition: none;
    }
    
    @keyframes freshrank-spin {
        0% { transform: rotate(0deg); }
        100% { transform: rotate(0deg); }
    }
}

/* Print Styles */
@media print {
    .freshrank-actions-bar,
    .wsau-actions-bar,
    .freshrank-actions,
    .wsau-actions,
    .button {
        display: none;
    }

    .freshrank-stats-container,
    .wsau-stats-container {
        flex-direction: row;
        page-break-inside: avoid;
    }

    .freshrank-table-container,
    .wsau-table-container {
        overflow: visible;
    }

    .freshrank-article-row,
    .wsau-article-row {
        cursor: default;
    }

    /* Show priority details when printing */
    .freshrank-priority-details-row,
    .wsau-priority-details-row,
    .freshrank-analysis-details-row,
    .wsau-analysis-details-row {
        display: table-row !important;
    }

    .freshrank-priority-section,
    .wsau-priority-section {
        flex-direction: column;
        page-break-inside: avoid;
    }
}
/* ========================================
   ACCESSIBILITY & MOBILE IMPROVEMENTS
   ======================================== */

/* Loading State for Buttons */
.freshrank-button-loading,
.wsau-button-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.6;
}

.freshrank-button-loading::after,
.wsau-button-loading::after {
    content: '';
    position: absolute;
    right: 8px;
    top: 50%;
    width: 12px;
    height: 12px;
    margin-top: -6px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid var(--fr-blue);
    border-radius: 50%;
    animation: freshrank-spin 1s linear infinite;
}

@keyframes freshrank-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Improved Button Focus States */
.button-link:focus,
button:focus,
.button:focus {
    outline: 2px solid var(--fr-blue);
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--fr-blue);
}

.button-link {
    color: var(--fr-blue);
    text-decoration: none;
    background: none;
    border: none;
    padding: 4px 8px;
    cursor: pointer;
    font-size: 13px;
    transition: color 0.2s ease;
    position: relative;
    z-index: 1;
}

.button-link:hover {
    color: var(--fr-blue-dark, #1d4ed8);
    text-decoration: underline;
}

.button-link:active {
    color: #0a4b78;
}

/* Empty State Styling */
.freshrank-empty-state,
.wsau-empty-state {
    background: #f6f7f7;
}

.freshrank-empty-state-content,
.wsau-empty-state-content {
    padding: 40px 20px;
    text-align: center;
}

.freshrank-empty-state-content > .dashicons,
.wsau-empty-state-content > .dashicons {
    font-size: 64px;
    color: #e2e8f0;
    width: 64px;
    height: 64px;
}

.freshrank-empty-state-content h3,
.wsau-empty-state-content h3 {
    margin: 20px 0 10px;
    color: #1e293b;
    font-size: 18px;
}

.freshrank-empty-state-content p,
.wsau-empty-state-content p {
    color: #64748b;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Empty Analysis State - Enhanced */
.freshrank-empty-analysis-state,
.wsau-empty-analysis-state {
    background: linear-gradient(135deg, #eef2ff 0%, #e7f3ff 100%);
    border: 2px solid var(--fr-blue);
    border-radius: 12px;
    margin: 20px 0;
    box-shadow: 0 4px 12px rgba(34, 113, 177, 0.1);
}

.freshrank-empty-analysis-content,
.wsau-empty-analysis-content {
    padding: 50px 40px;
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
}

.freshrank-empty-analysis-icon,
.wsau-empty-analysis-icon {
    margin-bottom: 20px;
}

.freshrank-empty-analysis-icon .dashicons,
.wsau-empty-analysis-icon .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: var(--fr-blue);
    background: white;
    border-radius: 50%;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.freshrank-empty-analysis-content h3,
.wsau-empty-analysis-content h3 {
    margin: 0 0 15px;
    color: #1e293b;
    font-size: 26px;
    font-weight: 600;
}

.freshrank-empty-subtitle,
.wsau-empty-subtitle {
    color: #3c434a;
    margin: 0 0 30px;
    font-size: 15px;
    line-height: 1.6;
}

.freshrank-empty-features,
.wsau-empty-features {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin: 30px 0;
    flex-wrap: wrap;
}

.freshrank-empty-feature,
.wsau-empty-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 20px;
    background: white;
    border-radius: 8px;
    min-width: 140px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.freshrank-empty-feature .dashicons,
.wsau-empty-feature .dashicons {
    font-size: 32px;
    width: 32px;
    height: 32px;
    color: var(--fr-blue);
}

.freshrank-empty-feature span:last-child,
.wsau-empty-feature span:last-child {
    font-weight: 600;
    color: #1e293b;
    font-size: 13px;
}

.freshrank-empty-analysis-content .button-hero,
.wsau-empty-analysis-content .button-hero {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    padding: 12px 32px;
    height: auto;
    margin: 20px 0;
}

.freshrank-empty-analysis-content .button-hero .dashicons,
.wsau-empty-analysis-content .button-hero .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.freshrank-empty-details,
.wsau-empty-details {
    margin-top: 30px;
    text-align: left;
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 0;
    cursor: pointer;
}

.freshrank-empty-details summary,
.wsau-empty-details summary {
    padding: 15px 20px;
    font-weight: 600;
    color: var(--fr-blue);
    cursor: pointer;
    user-select: none;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.freshrank-empty-details summary::-webkit-details-marker,
.wsau-empty-details summary::-webkit-details-marker {
    display: none;
}

.freshrank-empty-details summary::after,
.wsau-empty-details summary::after {
    content: '\f140';
    font-family: dashicons;
    font-size: 20px;
    transition: transform 0.3s ease;
}

.freshrank-empty-details[open] summary::after,
.wsau-empty-details[open] summary::after {
    transform: rotate(180deg);
}

.freshrank-empty-details-content,
.wsau-empty-details-content {
    padding: 0 20px 20px;
    border-top: 1px solid #f0f0f1;
}

.freshrank-empty-details-content ul,
.wsau-empty-details-content ul {
    margin: 15px 0;
    padding-left: 20px;
}

.freshrank-empty-details-content li,
.wsau-empty-details-content li {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #3c434a;
}

.freshrank-empty-details-content strong,
.wsau-empty-details-content strong {
    color: #1e293b;
}

/* Info Box Styling */
.freshrank-info-box,
.wsau-info-box {
    background: #e7f3ff;
    border-left: 4px solid var(--fr-blue);
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.freshrank-info-box .dashicons,
.wsau-info-box .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
    color: var(--fr-blue);
    flex-shrink: 0;
    margin-top: 2px;
}

.freshrank-info-box strong,
.wsau-info-box strong {
    color: #1e293b;
    display: block;
    margin-bottom: 5px;
}

.freshrank-info-box p,
.wsau-info-box p {
    color: #1e293b;
    margin: 0;
    font-size: 14px;
}

/* Mobile Responsiveness */
@media (max-width: 782px) {
    /* Settings grid - stack cards */
    .freshrank-settings-grid,
.wsau-settings-grid {
        grid-template-columns: 1fr !important;
    }

    .freshrank-card,
.wsau-card {
        padding: 15px;
    }

    .freshrank-card,
.wsau-card h3 {
        font-size: 16px;
    }

    /* Workflow Tracker - Stack on mobile */
    .freshrank-workflow-tracker,
.wsau-workflow-tracker {
        flex-direction: column;
        padding: 20px;
    }

    .freshrank-workflow-step,
.wsau-workflow-step {
        width: 100%;
        min-width: auto;
    }

    .freshrank-workflow-connector,
.wsau-workflow-connector {
        width: 3px;
        height: 40px;
        transform: rotate(0);
    }

    .freshrank-workflow-connector,
.wsau-workflow-connector::after {
        content: '↓';
        right: auto;
        top: auto;
        left: -8px;
        bottom: -20px;
    }

    /* Action Groups - Stack on mobile */
    .freshrank-action-group,
.wsau-action-group {
        flex-direction: column;
        align-items: stretch;
        padding: 15px;
    }

    .freshrank-action-group-label,
.wsau-action-group-label {
        min-width: auto;
        padding-top: 0;
    }

    .freshrank-action-group-buttons,
.wsau-action-group-buttons {
        flex-direction: column;
    }

    .freshrank-action-group-buttons .button,
    .wsau-action-group-buttons .button {
        width: 100%;
        justify-content: center;
    }

    /* Actions bar - stack buttons */
    .freshrank-actions-bar,
.wsau-actions-bar {
        padding: 15px;
    }

    .freshrank-workflow-hint,
.wsau-workflow-hint {
        font-size: 13px;
        padding: 8px 12px;
    }

    /* Empty Analysis State */
    .freshrank-empty-analysis-content,
.wsau-empty-analysis-content {
        padding: 30px 20px;
    }

    .freshrank-empty-analysis-icon .dashicons,
    .wsau-empty-analysis-icon .dashicons {
        font-size: 60px;
        width: 60px;
        height: 60px;
    }

    .freshrank-empty-features,
.wsau-empty-features {
        flex-direction: column;
        gap: 10px;
    }

    .freshrank-empty-feature,
.wsau-empty-feature {
        min-width: auto;
    }

    /* Card-based layout for articles table on mobile */
    #freshrank-articles-table thead {
        display: none;
    }

    #freshrank-articles-table,
    #freshrank-articles-table tbody,
    #freshrank-articles-table tr,
    #freshrank-articles-table td {
        display: block;
        width: 100%;
    }

    #freshrank-articles-table tr {
        margin-bottom: 20px;
        border: 1px solid #e2e8f0;
        border-radius: 4px;
        padding: 15px;
        background: white;
        position: relative;
    }

    #freshrank-articles-table td {
        text-align: left;
        padding: 8px 0;
        border: none;
    }

    #freshrank-articles-table td:before {
        content: attr(data-label);
        font-weight: 600;
        display: block;
        margin-bottom: 4px;
        color: #1e293b;
    }

    #freshrank-articles-table td.check-column {
        position: absolute;
        top: 15px;
        right: 15px;
        padding: 0;
    }

    #freshrank-articles-table td.check-column:before {
        display: none;
    }

    /* Stack action buttons in table */
    .freshrank-actions,
    .wsau-actions {
        flex-direction: column;
        width: 100%;
    }

    .freshrank-actions .button,
    .wsau-actions .button {
        width: 100%;
        text-align: center;
        margin-bottom: 4px;
    }

    /* Stat boxes - full width on mobile */
    .freshrank-stat-box,
.wsau-stat-box {
        min-width: 100%;
        flex: 1 1 100%;
    }

    /* GSC metrics - single column */
    .freshrank-gsc-metrics,
.wsau-gsc-metrics {
        grid-template-columns: 1fr !important;
    }

    /* Severity options - more padding */
    .freshrank-severity-option,
.wsau-severity-option {
        padding: 15px 12px;
    }

    /* Expandable rows - adjust for mobile */
    .freshrank-priority-details-row,
.wsau-priority-details-row td,
    .freshrank-analysis-details-row,
.wsau-analysis-details-row td,
    .freshrank-draft-details-row,
.wsau-draft-details-row td {
        padding: 15px !important;
    }
}

@media (max-width: 480px) {
    /* Very small screens - further optimizations */
    .freshrank-card,
    .wsau-card {
        padding: 12px;
    }

    .freshrank-stat-box h3,
    .wsau-stat-box h3 {
        font-size: 2em;
    }

    /* Shorter button labels */
    #freshrank-analyze-all-articles {
        font-size: 0;
    }

    #freshrank-analyze-all-articles::before {
        content: 'Analyze All';
        font-size: 14px;
    }
}

/* Skip Link for Accessibility */
.freshrank-skip-link,
.wsau-skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--fr-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    z-index: 100;
}

.freshrank-skip-link:focus,
.wsau-skip-link:focus {
    top: 0;
}

/* Screen Reader Only */
.freshrank-sr-only,
.wsau-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

/* Tooltip System */
.freshrank-tooltip,
.wsau-tooltip {
    position: absolute;
    background: #1e293b;
    color: #fff;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 12px;
    max-width: 250px;
    z-index: 10000;
    pointer-events: none;
}

.freshrank-tooltip::after,
.wsau-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #1e293b transparent transparent transparent;
}

/* Quick Preset Active State */
.freshrank-quick-presets .button.active,
.wsau-quick-presets .button.active {
    background: var(--fr-blue);
    color: white;
    border-color: var(--fr-blue-dark, #1d4ed8);
}

.freshrank-quick-presets .button.active::before,
.wsau-quick-presets .button.active::before {
    content: '✓ ';
    margin-right: 4px;
}

/* Table Column Widths - Optimized for consolidated layout */
#freshrank-articles-table .check-column {
    width: 3%;
}

#freshrank-articles-table .column-title-enhanced {
    width: 30%;
}

#freshrank-articles-table .column-priority {
    width: 10%;
    vertical-align: middle;
}

#freshrank-articles-table .column-priority .button-link {
    pointer-events: auto;
    position: relative;
    z-index: 10;
}

#freshrank-articles-table .column-analysis-status {
    width: 30%;
    vertical-align: middle;
}

#freshrank-articles-table .column-status {
    width: 12%;
    vertical-align: middle;
}

.column-status .wsau-status-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.column-status .freshrank-badge-draft {
    margin: 0;
}

.column-status .button-link {
    margin: 0;
    padding: 2px 4px;
    font-size: 11px;
    line-height: 1.3;
}

/* Draft and Analysis modal dialogs */
.freshrank-draft-modal .ui-dialog-titlebar {
    background: #fff;
    color: #1e293b;
    border-bottom: 1px solid #dcdcde;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.freshrank-draft-modal .ui-dialog-title {
    font-size: 16px;
    font-weight: 600;
    padding-right: 50px;
    color: #1e293b;
}

.freshrank-draft-modal .ui-dialog-titlebar-close {
    background: var(--fr-blue) !important;
    border: none !important;
    color: #fff !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 4px !important;
    opacity: 1 !important;
    position: absolute !important;
    right: 12px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close {
    background: transparent !important;
    border: none !important;
    color: #64748b !important;
    width: 32px !important;
    height: 32px !important;
}

.freshrank-draft-modal .ui-dialog-titlebar-close:hover {
    background: var(--fr-blue-dark, #1d4ed8) !important;
    color: #fff !important;
    transform: translateY(-50%) scale(1.05) !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close:hover {
    background: #f0f0f1 !important;
    color: #000 !important;
}

.freshrank-draft-modal .ui-dialog-titlebar-close .ui-icon,
.freshrank-analysis-modal .ui-dialog-titlebar-close .ui-icon {
    display: none;
}

.freshrank-draft-modal .ui-dialog-titlebar-close:before {
    content: '×';
    font-size: 28px;
    display: block;
    text-align: center;
    color: #fff;
    font-weight: 700;
    line-height: 36px;
    width: 36px;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close:before {
    content: '×';
    font-size: 24px;
    display: block;
    text-align: center;
    color: #fff;
    font-weight: 700;
    line-height: 1;
    width: 32px;
}

#freshrank-articles-table .column-actions {
    width: 15%;
}

/* Enhanced Article Header */
.freshrank-article-header,
.wsau-article-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 5px;
}

.freshrank-article-title,
.wsau-article-title {
    flex: 1;
}

.freshrank-article-title a,
.wsau-article-title a {
    font-size: 14px;
    font-weight: 600;
    color: var(--fr-blue);
    text-decoration: none;
}

.freshrank-article-title a:hover,
.wsau-article-title a:hover {
    color: var(--fr-blue-dark, #1d4ed8);
}

/* Priority Badge */
.freshrank-priority-badge,
.wsau-priority-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    height: 24px;
    padding: 0 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
    border: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.freshrank-priority-badge:hover,
.wsau-priority-badge:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.2) !important;
}

.freshrank-priority-badge.freshrank-priority-high,
.wsau-priority-badge.freshrank-priority-high,
.wsau-priority-high {
    background: linear-gradient(135deg, #d32f2f 0%, #b71c1c 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(211, 47, 47, 0.3);
}

.freshrank-priority-badge.freshrank-priority-medium,
.wsau-priority-badge.freshrank-priority-medium,
.wsau-priority-medium {
    background: linear-gradient(135deg, #f57c00 0%, #e65100 100%);
    color: white;
    box-shadow: 0 2px 4px rgba(245, 124, 0, 0.3);
}

.freshrank-priority-badge.freshrank-priority-low,
.wsau-priority-badge.freshrank-priority-low,
.wsau-priority-low {
    background: linear-gradient(135deg, #fbc02d 0%, #f9a825 100%);
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(251, 192, 45, 0.3);
}

.freshrank-priority-badge.freshrank-priority-very-low,
.wsau-priority-badge.freshrank-priority-very-low,
.wsau-priority-very-low {
    background: linear-gradient(135deg, #ffc107 0%, #ffb300 100%);
    color: #1e293b;
    box-shadow: 0 2px 4px rgba(255, 193, 7, 0.3);
}

/* Article Metadata */
.freshrank-article-meta,
.wsau-article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    color: #64748b;
    margin-bottom: 4px;
    line-height: 1.3;
}

.freshrank-meta-item,
.wsau-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

.freshrank-meta-item .dashicons,
.wsau-meta-item .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
    color: #999;
}

.freshrank-meta-label,
.wsau-meta-label {
    font-weight: 500;
}

.freshrank-meta-separator,
.wsau-meta-separator {
    color: #dcdcde;
}

/* Status Container in Analysis Column */
.freshrank-status-container,
.wsau-status-container {
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f1;
}

/* Validation Feedback */
.validation-feedback {
    color: #dc2626;
    margin-top: 4px;
    font-size: 13px;
}

input.error,
select.error,
textarea.error {
    border-color: #dc2626;
}

input.success,
select.success,
textarea.success {
    border-color: #16a34a;
}

/* GEO Score Indicators */
.geo-score-indicator {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.geo-score-excellent {
    background: #16a34a;
    color: white;
}

.geo-score-good {
    background: #72aee6;
    color: white;
}

.geo-score-fair {
    background: #f0c33c;
    color: #1e293b;
}

.geo-score-poor {
    background: #dc2626;
    color: white;
}

/* Platform-Specific Icons */
.geo-platform-icon {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-right: 4px;
    vertical-align: middle;
}

/* GEO Analysis Section */
.geo-analysis-section {
    background: #eef2ff;
    border-left: 4px solid var(--fr-blue);
    padding: 15px;
    margin: 15px 0;
}

.geo-analysis-section h4 {
    margin-top: 0;
    color: var(--fr-blue);
}

.geo-metric {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #e0e0e0;
}

.geo-metric:last-child {
    border-bottom: none;
}

.geo-metric-label {
    font-weight: 600;
    color: #1e293b;
}

.geo-metric-value {
    color: #64748b;
}

/* Spinning icon animation for analyzing status */
.dashicons.spin {
    animation: dashicon-spin 1s linear infinite;
}

@keyframes dashicon-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Highlight row when creating draft in background */
.freshrank-creating-draft-row,
.wsau-creating-draft-row {
    background-color: #fff8e5 !important;
    border-left: 4px solid #f0b849 !important;
}

.freshrank-creating-draft-row:hover,
.wsau-creating-draft-row:hover {
    background-color: #fff3cc !important;
}

/* Hover effect for usage stat box */
.freshrank-stat-box-usage:hover,
.wsau-stat-box-usage:hover {
    border-color: var(--fr-blue);
    box-shadow: 0 2px 4px rgba(0,115,170,0.1);
    transform: translateY(-1px);
    transition: all 0.2s ease;
}

/* Pagination Styles */
.freshrank-pagination,
.wsau-pagination {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding: 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.pagination-info {
    color: #666;
    font-size: 13px;
}

.pagination-controls {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-pages {
    display: flex;
    gap: 5px;
    align-items: center;
}

.pagination-pages a,
.pagination-pages .current-page {
    display: inline-block;
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: white;
    text-decoration: none;
    color: var(--fr-blue);
    border-radius: 3px;
    min-width: 32px;
    text-align: center;
}

.pagination-pages .current-page {
    background: var(--fr-blue);
    color: white;
    border-color: var(--fr-blue);
    font-weight: bold;
}

.pagination-pages a:hover {
    background: #f0f0f0;
}

.pagination-ellipsis {
    padding: 5px;
    color: #666;
}

.pagination-controls .button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
}

.pagination-per-page {
    display: flex;
    align-items: center;
    gap: 8px;
}

.pagination-per-page label {
    font-size: 13px;
    color: #666;
    margin: 0;
}

.pagination-per-page select {
    padding: 4px 24px 4px 8px;
    border: 1px solid #ddd;
    border-radius: 3px;
    background-position: right 4px center;
}

/* Modal Dialog Styling */
.freshrank-analysis-modal .ui-dialog-titlebar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border: none;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.freshrank-analysis-modal .ui-dialog-title {
    font-size: 16px;
    font-weight: 600;
    padding-right: 40px;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close {
    background: rgba(255,255,255,0.15) !important;
    border: none !important;
    border-radius: 6px !important;
    width: 32px !important;
    height: 32px !important;
    right: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    cursor: pointer !important;
    line-height: 32px !important;
    text-align: center !important;
    transition: all 0.2s ease !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close:hover {
    background: rgba(255,255,255,0.3) !important;
    transform: translateY(-50%) scale(1.08) !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close:focus {
    outline: 2px solid rgba(255,255,255,0.6) !important;
    outline-offset: 2px !important;
    background: rgba(255,255,255,0.25) !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close span {
    display: inline-block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    background: none !important;
    position: relative !important;
    line-height: 32px !important;
    vertical-align: middle !important;
}

.freshrank-analysis-modal .ui-dialog-titlebar-close span:before {
    content: '\f335' !important;
    font-family: dashicons !important;
    font-size: 18px !important;
    color: #fff !important;
    display: inline-block !important;
    line-height: 32px !important;
    vertical-align: middle !important;
    text-indent: 0 !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center !important;
}

.freshrank-analysis-modal .ui-dialog-content {
    padding: 24px !important;
    max-height: calc(80vh - 100px) !important;
    overflow-y: auto;
}

/* Common modal button styling */
.freshrank-analysis-modal .ui-dialog-buttonpane,
.freshrank-diff-modal .ui-dialog-buttonpane,
.freshrank-draft-modal .ui-dialog-buttonpane {
    background: #f6f7f7;
    border-top: 1px solid #dcdcde;
    padding: 16px 24px;
    text-align: right;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.freshrank-analysis-modal .ui-dialog-buttonset,
.freshrank-diff-modal .ui-dialog-buttonset,
.freshrank-draft-modal .ui-dialog-buttonset {
    display: flex;
    align-items: center;
    gap: 8px;
}

.freshrank-analysis-modal .ui-dialog-buttonset button,
.freshrank-diff-modal .ui-dialog-buttonset button,
.freshrank-draft-modal .ui-dialog-buttonset button {
    background: var(--fr-blue);
    color: #fff;
    border: none;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 1.4;
}

.freshrank-analysis-modal .ui-dialog-buttonset button:hover,
.freshrank-diff-modal .ui-dialog-buttonset button:hover,
.freshrank-draft-modal .ui-dialog-buttonset button:hover {
    background: var(--fr-blue-dark, #1d4ed8);
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
    transform: translateY(-1px);
}

.freshrank-analysis-modal .ui-dialog-buttonset button:active,
.freshrank-diff-modal .ui-dialog-buttonset button:active,
.freshrank-draft-modal .ui-dialog-buttonset button:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.freshrank-draft-modal {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

#freshrank-draft-dialog {
    padding: 20px !important;
    font-size: 14px;
    line-height: 1.6;
}

#freshrank-draft-dialog .wsau-detailed-draft-info {
    margin: 0;
}

#freshrank-draft-dialog .wsau-detailed-draft-info h4 {
    margin-top: 0;
}

.freshrank-analysis-modal {
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

/* Make the modal content look better */
#freshrank-analysis-dialog .wsau-detailed-analysis {
    margin: 0;
}

#freshrank-analysis-dialog .wsau-severity-section {
    margin-bottom: 24px;
}

#freshrank-analysis-dialog .wsau-section-header {
    padding: 12px 16px;
    margin: 0 0 12px 0;
}

#freshrank-analysis-dialog .wsau-issue-item {
    padding: 12px;
    margin-bottom: 8px;
}

/* Diff Modal Styling */
.freshrank-diff-modal .ui-dialog-titlebar {
    background: linear-gradient(135deg, var(--fr-blue) 0%, var(--fr-blue-dark, #1d4ed8) 100%);
    color: #fff;
    border: none;
    padding: 16px 20px;
    border-radius: 8px 8px 0 0;
    position: relative;
}

.freshrank-diff-modal .ui-dialog-title {
    font-size: 16px;
    font-weight: 600;
    padding-right: 40px;
}

.freshrank-diff-modal .ui-dialog-titlebar-close {
    background: rgba(255,255,255,0.2) !important;
    border: none !important;
    border-radius: 4px !important;
    width: 28px !important;
    height: 28px !important;
    right: 16px !important;
    top: 16px !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    cursor: pointer !important;
    line-height: 28px !important;
    text-align: center !important;
}

.freshrank-diff-modal .ui-dialog-titlebar-close:hover {
    background: rgba(255,255,255,0.35) !important;
}

.freshrank-diff-modal .ui-dialog-titlebar-close span {
    display: inline-block !important;
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    text-indent: 0 !important;
    background: none !important;
    position: relative !important;
    line-height: 28px !important;
    vertical-align: middle !important;
}

.freshrank-diff-modal .ui-dialog-titlebar-close span:before {
    content: '\f335' !important;
    font-family: dashicons !important;
    font-size: 16px !important;
    color: #fff !important;
    display: inline-block !important;
    line-height: 28px !important;
    vertical-align: middle !important;
    text-indent: 0 !important;
    width: 100% !important;
    height: 100% !important;
    text-align: center !important;
}

.freshrank-diff-modal .ui-dialog-content {
    padding: 0 !important;
    overflow: hidden !important;
}

.freshrank-diff-container {
    display: flex;
    height: 100%;
    gap: 1px;
    background: #ddd;
}

.freshrank-diff-pane {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #fff;
    overflow: hidden;
}

.freshrank-diff-pane h3 {
    margin: 0;
    padding: 16px 20px;
    background: #f6f7f7;
    border-bottom: 2px solid #ddd;
    font-size: 14px;
    font-weight: 600;
    color: #1e293b;
}

.freshrank-diff-original h3 {
    border-bottom-color: #b32d2e;
}

.freshrank-diff-draft h3 {
    border-bottom-color: #16a34a;
}

.freshrank-diff-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    font-size: 14px;
    line-height: 1.8;
}

.freshrank-diff-formatted {
    max-width: 100%;
}

.freshrank-diff-formatted p {
    margin-bottom: 1em;
}

.freshrank-diff-formatted h1,
.freshrank-diff-formatted h2,
.freshrank-diff-formatted h3,
.freshrank-diff-formatted h4,
.freshrank-diff-formatted h5,
.freshrank-diff-formatted h6 {
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    font-weight: 600;
}

.freshrank-diff-formatted ul,
.freshrank-diff-formatted ol {
    margin-left: 2em;
    margin-bottom: 1em;
}

.freshrank-diff-formatted img {
    max-width: 100%;
    height: auto;
}

.freshrank-diff-formatted blockquote {
    border-left: 4px solid #ddd;
    padding-left: 16px;
    margin: 1em 0;
    color: #666;
}

/* Sortable column headers */
#freshrank-articles-table th.sortable a {
    cursor: pointer;
    text-decoration: none;
    color: inherit;
    font-weight: 600;
    display: inline-block;
    transition: color 0.2s ease;
}

#freshrank-articles-table th.sortable a:hover {
    color: var(--fr-blue);
}

#freshrank-articles-table th.sortable a:active {
    color: var(--fr-blue-dark, #1d4ed8);
}



/* Dashboard Filters */
.freshrank-filters {
    background: #fff;
    padding: 15px;
    border: 1px solid #ccd0d4;
    border-radius: 4px;
    margin-bottom: 15px;
}

.freshrank-filters form {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
}

.freshrank-filters .filter-left {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.freshrank-filters .filter-right {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
    margin-left: auto;
}

.freshrank-filters label {
    font-weight: 600;
    margin-right: 5px;
}

.freshrank-filters select,
.freshrank-filters input[type="search"] {
    min-width: 150px;
    padding: 5px 8px;
    border: 1px solid #8c8f94;
    border-radius: 3px;
}

.freshrank-filters input[type="search"] {
    min-width: 200px;
}

/* Active filters */
.freshrank-active-filters {
    background: #eef2ff;
    border-left: 4px solid var(--fr-blue);
    padding: 10px 15px;
    margin-bottom: 15px;
}

.freshrank-active-filters strong {
    margin-right: 10px;
}

.freshrank-active-filters a {
    margin-left: 15px;
    text-decoration: underline;
}

/* Results count */
.freshrank-results-count {
    margin-bottom: 10px;
    font-size: 14px;
    color: #64748b;
}

/* Responsive filters */
@media (max-width: 782px) {
    .freshrank-filters form {
        flex-direction: column;
        align-items: stretch;
    }

    .freshrank-filters .filter-left,
    .freshrank-filters .filter-right {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        margin-left: 0;
    }

    .freshrank-filters select,
    .freshrank-filters input[type="search"] {
        width: 100%;
    }
}

/* ==================================================================
   Analysis Item Management - Visual Indicators & Dismiss System
   ================================================================== */

/* Analysis Header with Controls */
.freshrank-analysis-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e5e5;
}

.freshrank-analysis-header h4 {
    margin: 0;
    font-size: 16px;
}

.freshrank-analysis-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* View Toggle Dropdown */
.freshrank-view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.freshrank-view-toggle label {
    font-weight: 600;
    margin: 0;
}

.freshrank-view-selector {
    min-width: 180px;
    padding: 4px 8px;
    border: 1px solid #8c8f94;
    border-radius: 4px;
    background: #fff;
}

/* Actionable Badges */
.freshrank-actionable-badge {
    display: flex;
    gap: 8px;
    align-items: center;
}

.freshrank-actionable-badge .badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.badge-actionable {
    background: #d7f4dd;
    color: #1e4620;
    border: 1px solid #a7e1b4;
}

.badge-secondary {
    background: #f0f0f1;
    color: #50575e;
    border: 1px solid #e2e8f0;
}

.badge-info {
    background: #e5f5fa;
    color: var(--fr-blue-dark, #1d4ed8);
    border: 1px solid #b8dae4;
}

/* Filter Info Text */
.freshrank-filter-info {
    margin: -10px 0 15px 0;
    padding: 8px 12px;
    background: #eef2ff;
    border-left: 3px solid var(--fr-blue);
    border-radius: 3px;
}

.freshrank-filter-info small {
    color: #64748b;
    font-size: 13px;
}

.freshrank-filter-info a {
    color: var(--fr-blue);
    text-decoration: none;
    font-weight: 500;
}

.freshrank-filter-info a:hover {
    text-decoration: underline;
}

/* Category Count in Headers */
.category-count {
    font-weight: normal;
    font-size: 13px;
    color: #64748b;
    margin-left: 6px;
}

/* Issue Header with Indicator and Buttons */
.freshrank-issue-header {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 8px;
}

.freshrank-issue-indicator {
    flex-shrink: 0;
    margin-top: 2px;
}

.freshrank-issue-indicator .dashicons {
    font-size: 20px;
    width: 20px;
    height: 20px;
}

.freshrank-issue-content {
    flex: 1;
}

/* Dismiss/Restore Buttons */
.freshrank-dismiss-item,
.freshrank-restore-item {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    color: #64748b;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    border-radius: 3px;
    transition: all 0.2s;
    width: 24px;
    height: 24px;
}

.freshrank-dismiss-item {
    font-family: Arial, sans-serif;
}

.freshrank-dismiss-item:hover {
    color: #dc2626;
    background: #fcf0f1;
}

.freshrank-restore-item {
    color: var(--fr-blue);
}

.freshrank-restore-item:hover {
    color: var(--fr-blue-dark, #1d4ed8);
    background: #eef2ff;
}

.freshrank-restore-item .dashicons {
    font-size: 18px;
    width: 18px;
    height: 18px;
}

/* Issue Status Classes */
.freshrank-issue-status-dismissed {
    opacity: 0.6;
    background: #f6f7f7;
    border-left: 3px solid #dc2626 !important;
}

.freshrank-issue-status-actionable {
    /* Don't override border color - let severity classes (high/medium/low) control the color */
}

.freshrank-issue-status-category_disabled,
.freshrank-issue-status-severity_filtered {
    opacity: 0.5;
    background: #f9f9f9;
    border-left: 3px solid #8c8f94 !important;
}

/* Disable buttons for non-actionable items */
.freshrank-issue-status-category_disabled button,
.freshrank-issue-status-severity_filtered button {
    cursor: not-allowed !important;
} 

/* Hide non-actionable issues by default when in "actionable" view */
.wsau-detailed-analysis[data-view="actionable"] .freshrank-issue-status-dismissed,
.wsau-detailed-analysis[data-view="actionable"] .freshrank-issue-status-category_disabled,
.wsau-detailed-analysis[data-view="actionable"] .freshrank-issue-status-severity_filtered {
    display: none;
}

/* Show only dismissed items when in "dismissed" view */
.wsau-detailed-analysis[data-view="dismissed"] .freshrank-issue-status-actionable,
.wsau-detailed-analysis[data-view="dismissed"] .freshrank-issue-status-category_disabled,
.wsau-detailed-analysis[data-view="dismissed"] .freshrank-issue-status-severity_filtered {
    display: none;
}

/* Show all items when in "all" view - no hiding */

/* Fade Animation for Dismiss/Restore */
@keyframes fadeOut {
    from { opacity: 1; max-height: 1000px; }
    to { opacity: 0; max-height: 0; padding: 0; margin: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; max-height: 0; }
    to { opacity: 1; max-height: 1000px; }
}

.freshrank-issue-fading-out {
    animation: fadeOut 0.3s ease-out forwards;
    overflow: hidden;
}

.freshrank-issue-fading-in {
    animation: fadeIn 0.3s ease-in forwards;
}

/* Loading State */
.freshrank-dismiss-item.loading,
.freshrank-restore-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* Responsive Design */
@media (max-width: 782px) {
    .freshrank-analysis-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .freshrank-analysis-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .freshrank-view-selector {
        width: 100%;
    }

    .freshrank-actionable-badge {
        flex-wrap: wrap;
        width: 100%;
    }

    .freshrank-issue-header {
        flex-direction: column;
        gap: 8px;
    }

.freshrank-dismiss-item,
.freshrank-restore-item {
    align-self: flex-start;
}
}

/* OpenRouter model selector */
.freshrank-model-selector {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    max-width: 640px;
    flex-wrap: wrap;
}

.freshrank-model-selector .freshrank-model-search,
.freshrank-model-selector select {
    flex: 1 1 48%;
    min-width: 220px;
    box-sizing: border-box;
}

.freshrank-model-selector .freshrank-model-search {
    padding: 4px 8px;
}

.freshrank-model-selector select.freshrank-model-open {
    border-color: var(--fr-blue);
    box-shadow: 0 0 0 1px rgba(34, 113, 177, 0.25);
    overflow-y: auto;
    padding-right: 4px;
    background-color: #fff;
}

.freshrank-model-selector select.freshrank-model-open option {
    padding: 6px 8px;
    background-color: #fff;
}

.freshrank-model-selector select.freshrank-model-open option:checked,
.freshrank-model-selector select.freshrank-model-open option:hover {
    background-color: #e6f2fb;
}

.freshrank-cost-disclaimer {
    margin-top: -6px;
    color: #64748b;
    font-style: italic;
}

@media (max-width: 782px) {
    .freshrank-model-selector {
        flex-direction: column;
        max-width: 100%;
    }

    .freshrank-model-selector .freshrank-model-search,
    .freshrank-model-selector select {
        min-width: 100%;
        width: 100%;
        flex-basis: 100%;
    }
}

.freshrank-settings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 20px;
}
@media (max-width: 1400px) {
    .freshrank-settings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 900px) {
    .freshrank-settings-grid {
        grid-template-columns: 1fr;
    }
}
.freshrank-card {
    background: #fff;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 1px rgba(0,0,0,.04);
}
.freshrank-card h3 {
    margin: 0;
    padding: 12px;
    border-bottom: 1px solid #f0f0f1;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}
.freshrank-card h3 .dashicons {
    color: var(--fr-blue);
}
.freshrank-card-body {
    padding: 15px;
}
.freshrank-field {
    margin-bottom: 20px;
}
.freshrank-field:last-child {
    margin-bottom: 0;
}
.freshrank-field label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
}
.freshrank-field .description {
    margin-top: 8px;
    color: #64748b;
    font-size: 13px;
}
.freshrank-field #freshrank-test-openai-connection {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.freshrank-status-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
}
.freshrank-status-badge.connected {
    background: #16a34a;
    color: #fff;
}
.freshrank-status-badge.disconnected {
    background: #f59e0b;
    color: #fff;
}
.freshrank-severity-option {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    margin-bottom: 8px;
    background: #f6f7f7;
    border-radius: 4px;
    transition: background 0.2s;
}
.freshrank-severity-option:hover {
    background: #f0f0f1;
}
.freshrank-severity-option input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 2px;
}
.freshrank-severity-label {
    flex: 1;
}
.freshrank-severity-title {
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}
.freshrank-severity-desc {
    font-size: 12px;
    color: #64748b;
}

/* FreshRank Agent Hover Popover */
.freshrank-agent-label {
    position: relative;
}
.freshrank-agent-label .dashicons-info-outline:hover::after {
    content: "Managed service — no API key needed. Free includes 5 requests total; paid plans add monthly or lifetime limits by tier.";
    position: absolute;
    left: 0;
    top: 100%;
    margin-top: 8px;
    background: #1e293b;
    color: #fff;
    padding: 12px 14px;
    border-radius: 4px;
    border: none;
    font-size: 13px;
    line-height: 1.5;
    white-space: normal;
    width: 300px;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    font-weight: normal;
    opacity: 1;
}
.freshrank-agent-label .dashicons-info-outline {
    transition: color 0.2s;
}
.freshrank-agent-label .dashicons-info-outline:hover {
    color: var(--fr-blue) !important;
}

/* ==========================================================================
   FreshRank brand layer (freshrank.ai landing-page palette)
   Scoped to plugin admin pages only via body classes:
   - body.toplevel_page_freshrank-ai            (Dashboard)
   - body[class*="page_freshrank"]              (Settings & subpages)
   Appended last so it wins the cascade over the defaults above.
   ========================================================================== */

body.toplevel_page_freshrank-ai,
body[class*="page_freshrank"] {
    --fr-blue: #2563eb;
    --fr-blue-light: #3b82f6;
    --fr-blue-dark: #1d4ed8;
    --fr-navy: #1e3a5f;
    --fr-ink: #1e293b;
    --fr-slate: #475569;
    --fr-muted: #64748b;
    --fr-border: #e2e8f0;
    --fr-surface: #f8fafc;
    --fr-tint: #eef2ff;
    --fr-amber: #f59e0b;
    --fr-red: #dc2626;
    --fr-green: #16a34a;
    --fr-radius: 12px;
    --fr-radius-sm: 8px;
    --fr-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
    --fr-gradient: linear-gradient(135deg, var(--fr-blue) 0%, #3b82f6 100%);
    background: var(--fr-surface);
}

/* --- Page heading: navy with a small gradient accent (logo echo) --- */
body.toplevel_page_freshrank-ai .wrap h1,
body[class*="page_freshrank"] .wrap h1 {
    color: var(--fr-navy);
    font-weight: 600;
    letter-spacing: -0.01em;
}
body.toplevel_page_freshrank-ai .wrap h1::after,
body[class*="page_freshrank"] .wrap h1::after {
    content: "";
    display: block;
    width: 48px;
    height: 3px;
    margin-top: 8px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--fr-blue) 0%, #60a5fa 100%);
}

/* --- Cards & sidebar panels --- */
body.toplevel_page_freshrank-ai .freshrank-card,
body[class*="page_freshrank"] .freshrank-card,
body.toplevel_page_freshrank-ai .wsau-card,
body[class*="page_freshrank"] .wsau-card,
body.toplevel_page_freshrank-ai .wsau-stats-sidebar,
body[class*="page_freshrank"] .wsau-stats-sidebar,
body.toplevel_page_freshrank-ai .freshrank-stats-sidebar,
body[class*="page_freshrank"] .freshrank-stats-sidebar {
    border: 1px solid var(--fr-border);
    border-radius: var(--fr-radius);
    box-shadow: var(--fr-shadow);
}
body.toplevel_page_freshrank-ai .freshrank-card h3,
body[class*="page_freshrank"] .freshrank-card h3,
body.toplevel_page_freshrank-ai .wsau-card h3,
body[class*="page_freshrank"] .wsau-card h3,
body.toplevel_page_freshrank-ai .wsau-stats-sidebar h3,
body[class*="page_freshrank"] .wsau-stats-sidebar h3 {
    color: var(--fr-navy);
}
body.toplevel_page_freshrank-ai .wsau-stat-value,
body[class*="page_freshrank"] .wsau-stat-value,
body.toplevel_page_freshrank-ai .freshrank-stat-value,
body[class*="page_freshrank"] .freshrank-stat-value {
    color: var(--fr-blue);
}
body.toplevel_page_freshrank-ai .wsau-stat-item:hover,
body[class*="page_freshrank"] .wsau-stat-item:hover {
    background: var(--fr-tint);
}

/* --- Workflow tracker --- */
body.toplevel_page_freshrank-ai .freshrank-workflow-tracker,
body.toplevel_page_freshrank-ai .wsau-workflow-tracker,
body[class*="page_freshrank"] .freshrank-workflow-tracker,
body[class*="page_freshrank"] .wsau-workflow-tracker {
    border-radius: var(--fr-radius);
    background: linear-gradient(135deg, #f8fafc 0%, #eef2ff 100%);
    border: 1px solid var(--fr-border);
}
body.toplevel_page_freshrank-ai .freshrank-workflow-step,
body.toplevel_page_freshrank-ai .wsau-workflow-step,
body[class*="page_freshrank"] .freshrank-workflow-step,
body[class*="page_freshrank"] .wsau-workflow-step {
    border-radius: var(--fr-radius-sm);
    border: 1px solid var(--fr-border);
}
body.toplevel_page_freshrank-ai .freshrank-step-active .freshrank-step-icon,
body.toplevel_page_freshrank-ai .wsau-step-active .freshrank-step-icon,
body.toplevel_page_freshrank-ai .wsau-step-active .wsau-step-icon,
body[class*="page_freshrank"] .freshrank-step-active .freshrank-step-icon,
body[class*="page_freshrank"] .wsau-step-active .freshrank-step-icon,
body[class*="page_freshrank"] .wsau-step-active .wsau-step-icon {
    background: var(--fr-gradient);
}

/* --- Primary buttons: brand gradient --- */
body.toplevel_page_freshrank-ai .button-primary,
body[class*="page_freshrank"] .button-primary {
    /* Opaque solid base UNDER the gradient: when :hover drops the gradient image,
       this color shows through immediately, so there is never a transparent frame.
       Only background-color is transitioned (background-image is not animatable;
       transitioning the `background` shorthand caused a hover flash). */
    background-color: var(--fr-blue);
    background-image: var(--fr-gradient);
    border-color: var(--fr-blue);
    color: #fff;
    border-radius: 6px;
    text-shadow: none;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}
body.toplevel_page_freshrank-ai .button-primary:hover,
body[class*="page_freshrank"] .button-primary:hover,
body.toplevel_page_freshrank-ai .button-primary:active,
body[class*="page_freshrank"] .button-primary:active {
    background-color: var(--fr-blue-dark);
    background-image: none;
    border-color: var(--fr-blue-dark);
    color: #fff;
}
body.toplevel_page_freshrank-ai .button-primary:focus,
body[class*="page_freshrank"] .button-primary:focus {
    background-color: var(--fr-blue-dark);
    background-image: none;
    border-color: var(--fr-blue-dark);
    box-shadow: 0 0 0 1px #fff, 0 0 0 3px var(--fr-blue);
}
body.toplevel_page_freshrank-ai .button-primary[disabled],
body[class*="page_freshrank"] .button-primary[disabled],
body.toplevel_page_freshrank-ai .button-primary.disabled,
body[class*="page_freshrank"] .button-primary.disabled {
    background: #93c5fd !important;
    border-color: #93c5fd !important;
    color: #fff !important;
}
body.toplevel_page_freshrank-ai .button:not(.button-primary),
body[class*="page_freshrank"] .button:not(.button-primary) {
    border-radius: 6px;
    color: var(--fr-blue);
    border-color: var(--fr-border);
}
body.toplevel_page_freshrank-ai .button:not(.button-primary):hover,
body[class*="page_freshrank"] .button:not(.button-primary):hover {
    color: var(--fr-blue-dark);
    border-color: var(--fr-blue);
    background: var(--fr-tint);
}

/* --- Tables --- */
body.toplevel_page_freshrank-ai .wp-list-table,
body[class*="page_freshrank"] .wp-list-table {
    border: 1px solid var(--fr-border);
    border-radius: var(--fr-radius-sm);
    overflow: hidden;
    box-shadow: var(--fr-shadow);
}
body.toplevel_page_freshrank-ai .wp-list-table thead th,
body[class*="page_freshrank"] .wp-list-table thead th,
body.toplevel_page_freshrank-ai .wp-list-table thead td,
body[class*="page_freshrank"] .wp-list-table thead td {
    background: var(--fr-surface);
    color: var(--fr-navy);
    font-weight: 600;
    border-bottom: 1px solid var(--fr-border);
}
body.toplevel_page_freshrank-ai .wp-list-table tbody tr:hover td,
body[class*="page_freshrank"] .wp-list-table tbody tr:hover td,
body.toplevel_page_freshrank-ai .wp-list-table tbody tr:hover th,
body[class*="page_freshrank"] .wp-list-table tbody tr:hover th {
    background: var(--fr-tint);
}

/* --- Settings nav tabs --- */
body.toplevel_page_freshrank-ai .nav-tab,
body[class*="page_freshrank"] .nav-tab {
    background: transparent;
    border-color: transparent;
    color: var(--fr-slate);
    font-weight: 500;
    border-radius: 6px 6px 0 0;
    transition: color 0.15s ease, background 0.15s ease;
}
body.toplevel_page_freshrank-ai .nav-tab:hover,
body[class*="page_freshrank"] .nav-tab:hover {
    background: var(--fr-tint);
    color: var(--fr-blue);
}
body.toplevel_page_freshrank-ai .nav-tab-active,
body[class*="page_freshrank"] .nav-tab-active,
body.toplevel_page_freshrank-ai .nav-tab-active:hover,
body[class*="page_freshrank"] .nav-tab-active:hover {
    background: #fff;
    color: var(--fr-blue);
    border: 1px solid var(--fr-border);
    border-bottom: 2px solid var(--fr-blue);
    font-weight: 600;
}
body.toplevel_page_freshrank-ai .nav-tab-wrapper,
body[class*="page_freshrank"] .nav-tab-wrapper {
    border-bottom: 1px solid var(--fr-border);
}

/* --- Status pills & severity rows --- */
body.toplevel_page_freshrank-ai .freshrank-status-badge,
body[class*="page_freshrank"] .freshrank-status-badge {
    border-radius: 999px;
}
body.toplevel_page_freshrank-ai .freshrank-severity-option,
body[class*="page_freshrank"] .freshrank-severity-option {
    background: var(--fr-surface);
    border: 1px solid var(--fr-border);
    border-radius: var(--fr-radius-sm);
}
body.toplevel_page_freshrank-ai .freshrank-severity-option:hover,
body[class*="page_freshrank"] .freshrank-severity-option:hover {
    background: var(--fr-tint);
}

/* --- Forms & focus states --- */
body.toplevel_page_freshrank-ai input[type="text"]:focus,
body[class*="page_freshrank"] input[type="text"]:focus,
body.toplevel_page_freshrank-ai input[type="password"]:focus,
body[class*="page_freshrank"] input[type="password"]:focus,
body.toplevel_page_freshrank-ai input[type="number"]:focus,
body[class*="page_freshrank"] input[type="number"]:focus,
body.toplevel_page_freshrank-ai select:focus,
body[class*="page_freshrank"] select:focus,
body.toplevel_page_freshrank-ai textarea:focus,
body[class*="page_freshrank"] textarea:focus {
    border-color: var(--fr-blue);
    box-shadow: 0 0 0 1px var(--fr-blue);
}
body.toplevel_page_freshrank-ai input[type="radio"]:checked::before,
body[class*="page_freshrank"] input[type="radio"]:checked::before {
    background-color: var(--fr-blue);
}
body.toplevel_page_freshrank-ai input[type="checkbox"]:checked::before,
body[class*="page_freshrank"] input[type="checkbox"]:checked::before {
    color: var(--fr-blue);
}

/* --- Notices --- */
body.toplevel_page_freshrank-ai .notice-info,
body[class*="page_freshrank"] .notice-info {
    border-left-color: var(--fr-blue);
}

/* --- Minimal "no matching issues" draft hint (replaces the old verbose paragraph) --- */
body.toplevel_page_freshrank-ai .freshrank-draft-hint,
body[class*="page_freshrank"] .freshrank-draft-hint {
    display: inline-block;
    color: var(--fr-muted);
    font-size: 13px;
    vertical-align: middle;
    margin-right: 4px;
}
body.toplevel_page_freshrank-ai .freshrank-btn-muted,
body[class*="page_freshrank"] .freshrank-btn-muted {
    opacity: 0.55;
}

/* --- Modal close (✕) alignment: authoritative, consistent across all three dialogs.
   The per-dialog rules above mixed top:50%+translateY with a bare top:16px, leaving the
   diff modal's X a few px high. Center all three the same way (the close button is absolute
   within the position:relative titlebar, so this tracks the real titlebar height). --- */
.freshrank-analysis-modal .ui-dialog-titlebar-close,
.freshrank-draft-modal .ui-dialog-titlebar-close,
.freshrank-diff-modal .ui-dialog-titlebar-close {
    top: 50% !important;
    transform: translateY(-50%) !important;
    margin-top: 0 !important;
}
.freshrank-analysis-modal .ui-dialog-titlebar-close:hover,
.freshrank-draft-modal .ui-dialog-titlebar-close:hover,
.freshrank-diff-modal .ui-dialog-titlebar-close:hover {
    transform: translateY(-50%) scale(1.05) !important;
}


/* =====================================================================
   ANALYSIS DETAILS MODAL — "cards" refresh (+ grafted order-robustness)
   ---------------------------------------------------------------------
   EVERY selector is scoped under .freshrank-analysis-modal so the SAME
   .wsau-issue markup that admin.js clones into the dialog (admin.js
   1907/1920) AND the inline dashboard list both share is only upgraded
   inside the modal — the inline list is untouched.
   No JS-dependent class/attribute is renamed or removed; restyle only.
   Brand --fr-* tokens are inherited from body[class*="page_freshrank"];
   hex fallbacks inlined for safety. Append AFTER all existing modal rules
   so it wins on order without !important — except where the base used
   !important on JS-toggled state classes, matched here for parity so the
   cloned/toggled states still win.

   VERIFIED render order (class-dashboard.php):
     factual_updates (2263): recommendation -> detail   [rec-first]
     structure/quality (2413/2417): recommendation -> detail [rec-first]
     opportunities (2522/2526): recommendation -> detail [rec-first]
     user_experience (2344/2349): detail -> recommendation [detail-first]
   => connector + pairing styled SYMMETRICALLY for both orders.
   ===================================================================== */

/* --- Modal chrome: on-brand header + softer shell -------------------- */
.freshrank-analysis-modal {
    border-radius: var(--fr-radius, 12px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden; /* clip titlebar gradient to rounded corners */
}
.freshrank-analysis-modal .ui-dialog-titlebar {
    background: var(--fr-gradient, linear-gradient(135deg, var(--fr-blue) 0%, #3b82f6 100%));
    border-radius: 0;
    padding: 18px 22px;
}
.freshrank-analysis-modal .ui-dialog-title {
    font-size: 16px;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.freshrank-analysis-modal .ui-dialog-content {
    padding: 22px 24px !important;          /* matches base !important specificity */
    background: var(--fr-surface, #f8fafc);
}

/* --- Header / controls bar -------------------------------------------- */
.freshrank-analysis-modal .freshrank-analysis-header {
    align-items: center;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fr-border, #e2e8f0);
}
.freshrank-analysis-modal .freshrank-analysis-header h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--fr-ink, #1e293b);
}
.freshrank-analysis-modal .freshrank-analysis-controls { gap: 14px; }
.freshrank-analysis-modal .freshrank-view-toggle label {
    color: var(--fr-slate, #475569);
    font-size: 13px;
}
.freshrank-analysis-modal .freshrank-view-selector {
    min-width: 190px;
    padding: 6px 10px;
    border: 1px solid var(--fr-border, #e2e8f0);
    border-radius: var(--fr-radius-sm, 8px);
    background: #fff;
    color: var(--fr-ink, #1e293b);
    font-size: 13px;
    box-shadow: var(--fr-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.freshrank-analysis-modal .freshrank-view-selector:hover {
    border-color: var(--fr-blue-light, #3b82f6);
}
.freshrank-analysis-modal .freshrank-view-selector:focus-visible {
    outline: none;
    border-color: var(--fr-blue, var(--fr-blue));
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}

/* --- Badges (palette already in use, tightened) ----------------------- */
.freshrank-analysis-modal .freshrank-actionable-badge .badge {
    padding: 5px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.2;
}
.freshrank-analysis-modal .badge-actionable {
    background: #d7f4dd; color: #1e4620; border: 1px solid #a7e1b4;
}
.freshrank-analysis-modal .badge-secondary {
    background: #f1f5f9; color: var(--fr-slate, #475569); border: 1px solid var(--fr-border, #e2e8f0);
}
.freshrank-analysis-modal .badge-info {
    background: #e5f5fa; color: var(--fr-blue-dark, #1d4ed8); border: 1px solid #b8dae4;
}

/* --- Filter info bar --------------------------------------------------
   GRAFT (from dense): neutralize the base -10px negative top margin
   (admin.css: .freshrank-filter-info { margin: -10px 0 15px 0 }) so it
   can never collide with / overlap the header inside the modal. */
.freshrank-analysis-modal .freshrank-filter-info {
    margin: 0 0 18px 0;
    padding: 10px 14px;
    background: var(--fr-tint, #eef2ff);
    border: 1px solid #dbe3ff;
    border-left: 3px solid var(--fr-blue, var(--fr-blue));
    border-radius: var(--fr-radius-sm, 8px);
}
.freshrank-analysis-modal .freshrank-filter-info small {
    color: var(--fr-slate, #475569);
    font-size: 13px;
    line-height: 1.5;
}
.freshrank-analysis-modal .freshrank-filter-info strong { color: var(--fr-ink, #1e293b); }
.freshrank-analysis-modal .freshrank-filter-info a {
    color: var(--fr-blue, var(--fr-blue));
    font-weight: 600;
    text-decoration: none;
}
.freshrank-analysis-modal .freshrank-filter-info a:hover { text-decoration: underline; }

/* --- Section headers (emoji + count) ---------------------------------- */
.freshrank-analysis-modal .wsau-analysis-section { margin-bottom: 22px; }
.freshrank-analysis-modal .wsau-analysis-section h5 {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--fr-ink, #1e293b);
    border-bottom: 1px solid var(--fr-border, #e2e8f0);
}
.freshrank-analysis-modal .wsau-analysis-section .category-count {
    margin-left: auto;
    font-size: 12px;
    font-weight: 500;
    color: var(--fr-muted, #64748b);
    white-space: nowrap;
}

/* --- Issue LIST -------------------------------------------------------
   GRAFT (from dense): flex column + gap replaces per-card margin-bottom,
   eliminating last-child handling and the arbitrary 15px rhythm. */
.freshrank-analysis-modal .wsau-issues-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

/* --- The issue CARD ---------------------------------------------------- */
.freshrank-analysis-modal .wsau-issue {
    position: relative;
    margin: 0;                          /* gap owns spacing now */
    padding: 16px 18px;
    background: #fff;
    border: 1px solid var(--fr-border, #e2e8f0);
    border-left-width: 4px;             /* severity rail */
    border-left-color: var(--fr-blue-light, #3b82f6); /* default fallback */
    border-radius: var(--fr-radius-sm, 8px);
    box-shadow: var(--fr-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
    transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.freshrank-analysis-modal .wsau-issue:hover {
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
}
/* Severity accent rail + faint tint (semantics preserved: high/med/low) */
.freshrank-analysis-modal .wsau-issue.wsau-severity-high {
    border-left-color: var(--fr-red, #dc2626);
    background: linear-gradient(90deg, rgba(220, 38, 38, 0.04) 0%, #fff 40%);
}
.freshrank-analysis-modal .wsau-issue.wsau-severity-medium {
    border-left-color: #f57c00;
    background: linear-gradient(90deg, rgba(245, 124, 0, 0.05) 0%, #fff 40%);
}
.freshrank-analysis-modal .wsau-issue.wsau-severity-low {
    border-left-color: var(--fr-blue, var(--fr-blue));
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.05) 0%, #fff 40%);
    color: var(--fr-ink, #1e293b);
}

/* --- Card header: type eyebrow + issue statement + dismiss ------------ */
.freshrank-analysis-modal .freshrank-issue-header {
    gap: 12px;
    margin-bottom: 12px;
}
.freshrank-analysis-modal .freshrank-issue-content {
    color: var(--fr-ink, #1e293b);
    font-size: 14px;
    line-height: 1.5;
}
/* The type label is the FIRST-CHILD <strong> of .freshrank-issue-content
   (verified 2271/2325/2395/2504). Promote it to an uppercase eyebrow.
   Use > strong so it never catches the labels nested in the data rows. */
.freshrank-analysis-modal .freshrank-issue-content > strong {
    display: block;
    margin-bottom: 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--fr-slate, #475569);
}

/* --- Dismiss / restore control ----------------------------------------
   GRAFT (from dense): fixed compact hit target >=22px, top-right aligned,
   comfortable on narrow viewports. */
.freshrank-analysis-modal .freshrank-dismiss-item,
.freshrank-analysis-modal .freshrank-restore-item {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    font-size: 18px;
    line-height: 1;
    color: var(--fr-muted, #64748b);
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.freshrank-analysis-modal .freshrank-dismiss-item:hover {
    color: var(--fr-red, #dc2626);
    background: #fcecec;
}
.freshrank-analysis-modal .freshrank-restore-item { color: var(--fr-blue, var(--fr-blue)); }
.freshrank-analysis-modal .freshrank-restore-item:hover {
    color: var(--fr-blue-dark, #1d4ed8);
    background: var(--fr-tint, #eef2ff);
}
.freshrank-analysis-modal .freshrank-dismiss-item:focus-visible,
.freshrank-analysis-modal .freshrank-restore-item:focus-visible {
    outline: 2px solid var(--fr-blue, var(--fr-blue));
    outline-offset: 2px;
}
.freshrank-analysis-modal .freshrank-dismiss-item.loading,
.freshrank-analysis-modal .freshrank-restore-item.loading {
    opacity: 0.5;
    pointer-events: none;
}

/* --- Before / After data rows -----------------------------------------
   .wsau-issue-detail had NO rule anywhere (the documented spacing /
   contrast offender); .wsau-issue-recommendation was muted #64748b.
   Give both identical rhythm: the "from" (detail: Current/Impact/
   Expected Benefit) is a muted panel; the "to" (recommendation: Update
   to/Fix/Implementation) is a green-accented panel. Standalone styles
   cover whichever row appears alone (e.g. UX with empty user_impact). */
.freshrank-analysis-modal .wsau-issue-detail,
.freshrank-analysis-modal .wsau-issue-recommendation {
    position: relative;
    margin: 8px 0 0 0;
    padding: 9px 12px;
    font-size: 13px;
    line-height: 1.5;
    border-radius: 6px;
}
/* The leading <strong> label inside each row -> small uppercase caption.
   PHP renders it as the first child (verified), so > strong is exact. */
.freshrank-analysis-modal .wsau-issue-detail > strong,
.freshrank-analysis-modal .wsau-issue-recommendation > strong {
    display: block;
    margin-bottom: 2px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

/* FROM row (detail): muted, AA-readable value text */
.freshrank-analysis-modal .wsau-issue-detail {
    background: var(--fr-surface, #f8fafc);
    border: 1px solid var(--fr-border, #e2e8f0);
    color: var(--fr-slate, #475569);   /* value text — AA on light surface */
}
.freshrank-analysis-modal .wsau-issue-detail > strong {
    color: var(--fr-muted, #64748b);
}

/* TO row (recommendation): green-accented suggestion, full-contrast value */
.freshrank-analysis-modal .wsau-issue-recommendation {
    background: rgba(22, 163, 74, 0.06);
    border: 1px solid rgba(22, 163, 74, 0.22);
    color: var(--fr-ink, #1e293b);      /* was #64748b — now full contrast */
}
.freshrank-analysis-modal .wsau-issue-recommendation > strong {
    color: var(--fr-green, #16a34a);
}

/* --- ORDER-ROBUST connector (GRAFT from Typography, single most valuable)
   PHP emits recommendation-FIRST in factual/structure/opportunities and
   detail-FIRST only in user_experience. Style BOTH adjacencies so the
   "from -> to" connector and tightened pairing read correctly in every
   section and never render visually inverted. Decorative arrow only;
   meaning is carried by the explicit Current:/Fix: labels. */
.freshrank-analysis-modal .wsau-issue-detail + .wsau-issue-recommendation,
.freshrank-analysis-modal .wsau-issue-recommendation + .wsau-issue-detail {
    margin-top: 6px;
}
/* detail -> recommendation (user_experience): arrow points down INTO the fix */
.freshrank-analysis-modal .wsau-issue-detail + .wsau-issue-recommendation::before {
    content: "\2193";                   /* down arrow */
    color: var(--fr-green, #16a34a);
    border-color: rgba(22, 163, 74, 0.3);
}
/* recommendation -> detail (factual/structure/opportunities):
   the detail (Impact/Expected Benefit) is supporting context BELOW the
   fix; a down arrow on the detail would imply it's the target, so use a
   neutral connector tick instead — keeps the visual relationship without
   falsely framing context as the action. */
.freshrank-analysis-modal .wsau-issue-recommendation + .wsau-issue-detail::before {
    content: "\2193";                   /* down arrow */
    color: var(--fr-muted, #64748b);
    border-color: var(--fr-border, #e2e8f0);
}
/* Shared connector chip geometry for both adjacency directions */
.freshrank-analysis-modal .wsau-issue-detail + .wsau-issue-recommendation::before,
.freshrank-analysis-modal .wsau-issue-recommendation + .wsau-issue-detail::before {
    position: absolute;
    top: -13px;
    left: 14px;
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 12px;
    background: #fff;
    border-style: solid;
    border-width: 1px;
    border-radius: 50%;
}

/* --- Low-severity card readability (GRAFT from Typography) -------------
   The low-severity card sits on a blue tint. cards covered the detail
   value; mirror it for the recommendation value too so BOTH value texts
   stay --fr-ink, with micro-labels kept as short 700-weight cue words. */
.freshrank-analysis-modal .wsau-issue.wsau-severity-low .wsau-issue-detail,
.freshrank-analysis-modal .wsau-issue.wsau-severity-low .wsau-issue-recommendation {
    color: var(--fr-ink, #1e293b);
}

/* --- State classes: dismissed / filtered (JS-toggled) -----------------
   GRAFT (from Typography): minimize !important churn — only re-express
   the LEFT BORDER with !important, because the base uses
   `border-left: 3px solid <color> !important` (admin.css 3370/3385) and
   our card sets a 4px border-left-width WITHOUT !important; without
   matched-!important here the JS-toggled state colour could lose in the
   clone. Everything else (opacity/bg) stays normal-weight. */
.freshrank-analysis-modal .wsau-issue.freshrank-issue-status-dismissed {
    opacity: 0.62;
    background: var(--fr-surface, #f8fafc);
    border-left: 4px solid var(--fr-red, #dc2626) !important;
}
.freshrank-analysis-modal .wsau-issue.freshrank-issue-status-dismissed .freshrank-issue-content {
    text-decoration: line-through;
    text-decoration-color: rgba(100, 116, 139, 0.5);
}
.freshrank-analysis-modal .wsau-issue.freshrank-issue-status-category_disabled,
.freshrank-analysis-modal .wsau-issue.freshrank-issue-status-severity_filtered {
    opacity: 0.55;
    background: var(--fr-surface, #f8fafc);
    border-left: 4px solid #94a3b8 !important;
}

/* --- Footer button --------------------------------------------------- */
.freshrank-analysis-modal .ui-dialog-buttonpane {
    background: #fff;
    border-top: 1px solid var(--fr-border, #e2e8f0);
    padding: 14px 24px;
}
.freshrank-analysis-modal .ui-dialog-buttonset button {
    border-radius: var(--fr-radius-sm, 8px);
    font-weight: 600;
}
.freshrank-analysis-modal .ui-dialog-buttonset button:focus-visible {
    outline: 2px solid var(--fr-blue, var(--fr-blue));
    outline-offset: 2px;
}

/* --- Responsive (<= 782px): stack controls, soften padding ------------ */
@media screen and (max-width: 782px) {
    .freshrank-analysis-modal .ui-dialog-content { padding: 16px !important; }
    .freshrank-analysis-modal .freshrank-analysis-header {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .freshrank-analysis-modal .freshrank-analysis-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    .freshrank-analysis-modal .freshrank-view-selector { width: 100%; }
    .freshrank-analysis-modal .wsau-issue { padding: 14px; }
    /* dismiss/restore stays a comfortable >=22px target on narrow screens */
    .freshrank-analysis-modal .freshrank-dismiss-item,
    .freshrank-analysis-modal .freshrank-restore-item { width: 24px; height: 24px; }
}


/* =====================================================================
   DRAFT DETAILS MODAL — alignment cleanup  (system, harmonized w/ analysis)
   ---------------------------------------------------------------------
   Appended at END OF FILE (after the analysis-modal cleanup that ends at
   line 4350) so it wins on SOURCE ORDER without an !important spree. EVERY
   selector is scoped under .freshrank-draft-modal (the dialogClass set in
   admin.js:1884; container #freshrank-draft-dialog) or .freshrank-diff-modal
   - no other view is affected.

   GOAL: fix the draft two-column TOP-MISALIGNMENT and harmonize draft/diff
   chrome with the SHIPPED analysis-modal cleanup (verified tokens:
   var(--fr-surface) body, 13px/700 section dividers on var(--fr-border)
   @admin.css:4074, white footer 14px 24px + radius-sm + 600 buttons +
   2px var(--fr-blue) focus-visible @admin.css:4322-4334, responsive
   16px !important @4338). Brand --fr-* tokens are inherited from
   body[class*="page_freshrank"] (admin.css:3670); hex fallbacks inlined
   for safety, exactly as the analysis block does.

   TITLEBARS ARE LEFT UNTOUCHED ON PURPOSE. Verified: the three modals
   currently have THREE DIFFERENT titlebar treatments - draft is WHITE
   (admin.css:2331), analysis is a PURPLE gradient #667eea->#764ba2
   (admin.css:2752), diff is a BLUE gradient var(--fr-blue)->#1d4ed8
   (admin.css:2928). The "all three already use --fr-gradient" premise is
   inaccurate for analysis, so forcing the draft bar to --fr-gradient would
   NOT match analysis - it would invent a THIRD blue. Per the design note
   ("confirm before changing a shipping titlebar"), titlebar colour is
   deliberately scoped OUT of this CSS-first fix; chrome is harmonized only
   on the parts that are verifiably consistent (body/section/footer/buttons).

   No JS-dependent class/attr is renamed (.freshrank-toggle-draft-details,
   .freshrank-draft-details-row/-content, #freshrank-draft-dialog,
   data-post-id, .freshrank-view-diff, all .wsau-draft-* preserved -
   restyle only; verified against admin.js toggleDraftDetails 1855-1896).
   ===================================================================== */

/* --- Shell: match the base radius token, slightly softer shadow ------- */
.freshrank-draft-modal {
    border-radius: var(--fr-radius, 12px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}

/* --- Body: analysis surface + padding. The base sets
   #freshrank-draft-dialog{padding:20px !important} (admin.css:2890); to
   raise it to the analysis 22/24 we MUST match that !important specificity
   (overriding a base-stylesheet !important - NOT an inline style). ------ */
.freshrank-draft-modal .ui-dialog-content,
#freshrank-draft-dialog {
    padding: 22px 24px !important;          /* matches base !important @2890 */
    background: var(--fr-surface, #f8fafc);
    font-size: 14px;
    line-height: 1.6;
}

/* --- Title row (the "Draft Details" h4): match analysis header rhythm --- */
.freshrank-draft-modal .wsau-detailed-draft-info > h4,
.freshrank-draft-modal .freshrank-detailed-draft-info > h4 {
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--fr-border, #e2e8f0);
    font-size: 15px;
    font-weight: 600;
    color: var(--fr-ink, #1e293b);
}

/* --- TWO-COLUMN ROW: top-align the columns -----------------------------
   .wsau-draft-section is a flex row (admin.css:1348, gap:30px, wrap); the
   summary + actions children are flex:1 (admin.css:1357). The base sets NO
   align-items, so it defaults to stretch; align-items:flex-start anchors
   both columns to y=0 of the row so their h5 underlines share a baseline.
   ROBUSTNESS NOTE (documented fallback): CSS Grid
   [display:grid; grid-template-columns:1fr 1fr; align-items:start] is the
   most future-proof top-alignment because grid tracks share a common start
   line and cannot drift even if column heights change. align-items:
   flex-start on the existing flex row is sufficient here and is the
   minimal, lowest-risk change, so we keep flex. */
.freshrank-draft-modal .wsau-draft-section,
.freshrank-draft-modal .freshrank-draft-section {
    align-items: flex-start;
    gap: 28px;
    margin: 0;
}

/* === THE ALIGNMENT FIX ================================================
   .wsau-draft-actions-section carries an INLINE
     style="border-top: 1px solid #ddd; padding-top: 20px; margin-top: 20px;"
   (class-dashboard.php:694 render_draft_info AND :838
   render_revision_draft_info - verified present; bare, NO inline style, at
   :919 render-3). In the flex column layout that inline stacking decoration
   pushes the ENTIRE right column down ~40px (breaking top-alignment) and
   paints a stray full-width divider above "Actions".
   Inline styles have specificity (1,0,0,0) and CANNOT be beaten from a
   stylesheet without !important - so !important here is REQUIRED and
   SCOPED, applied to exactly the three offending props and nothing else.
   The 3rd block (:919) has NO such inline style, so this is a harmless
   no-op there (nothing to remove; does not regress it). If the optional
   PHP markupEdit below is applied, these three flags become harmless
   (no inline target) and could later drop to normal weight. ============ */
.freshrank-draft-modal .wsau-draft-actions-section,
.freshrank-draft-modal .freshrank-draft-actions-section {
    border-top: 0 !important;     /* override inline border-top:1px #ddd */
    margin-top: 0 !important;     /* override inline margin-top:20px      */
    padding-top: 0 !important;    /* override inline padding-top:20px     */
}

/* --- Columns: keep equal flex, sane min-width, kill stray margins ------ */
.freshrank-draft-modal .wsau-draft-summary-section,
.freshrank-draft-modal .freshrank-draft-summary-section,
.freshrank-draft-modal .wsau-draft-actions-section,
.freshrank-draft-modal .freshrank-draft-actions-section {
    flex: 1 1 0;
    min-width: 240px;
    margin: 0;
}

/* --- Section headers: identical to the analysis modal's h5 (verified
   tokens @admin.css:4074 - 13px/700, padding-bottom:8px, margin 0 0 12px,
   border-bottom 1px var(--fr-border)) so BOTH columns' underlines match
   weight + height and line up across the two top-aligned columns. The base
   h5 (admin.css:1362) is 14px / #dcdcde / 5px pad - we upgrade it. ------- */
.freshrank-draft-modal .wsau-draft-summary-section h5,
.freshrank-draft-modal .freshrank-draft-summary-section h5,
.freshrank-draft-modal .wsau-draft-actions-section h5,
.freshrank-draft-modal .freshrank-draft-actions-section h5 {
    display: block;
    margin: 0 0 12px 0;
    padding-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.01em;
    color: var(--fr-ink, #1e293b);
    border-bottom: 1px solid var(--fr-border, #e2e8f0);
}

/* --- Summary column body: rhythm + token colours ---------------------- */
.freshrank-draft-modal .wsau-draft-description,
.freshrank-draft-modal .freshrank-draft-description {
    color: var(--fr-slate, #475569);
    font-size: 13px;
    line-height: 1.6;
}
.freshrank-draft-modal .wsau-draft-description strong,
.freshrank-draft-modal .freshrank-draft-description strong {
    color: var(--fr-ink, #1e293b);
}
/* Summary-CARD variant (3rd renderer .wsau-draft-summary-content @:879)
   -> match the analysis card chrome for a consistent modal system. */
.freshrank-draft-modal .wsau-draft-summary-content,
.freshrank-draft-modal .freshrank-draft-summary-content {
    background: #fff;
    padding: 14px 16px;
    border: 1px solid var(--fr-border, #e2e8f0);
    border-radius: var(--fr-radius-sm, 8px);
    box-shadow: var(--fr-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}
.freshrank-draft-modal .wsau-draft-stat strong,
.freshrank-draft-modal .freshrank-draft-stat strong {
    color: var(--fr-blue, var(--fr-blue));
}

/* --- ACTION BUTTONS: turn the oversized stacked blocks into a compact,
   evenly-spaced vertical stack of sensible-height rows.
   The base sets flex-direction:column (admin.css:1412); the PHP inlines
   display:flex; gap:8px; flex-wrap:wrap; margin-top:12px on
   .wsau-draft-action-buttons (class-dashboard.php:696/840) but does NOT set
   flex-direction, so the column direction survives (verified). We re-assert
   the stack and pin flex-wrap:nowrap !important - a justified !important
   because the inline flex-wrap:wrap IS present (1,0,0,0); without it the
   stack relies on wrap being a cosmetic no-op in a single-column flex. */
.freshrank-draft-modal .wsau-draft-action-buttons,
.freshrank-draft-modal .freshrank-draft-action-buttons {
    display: flex;
    flex-direction: column;
    flex-wrap: nowrap !important;   /* beats inline flex-wrap:wrap @696/840 */
    gap: 10px;
    margin-top: 14px;
}

/* Each action <a>.button -> compact, tappable row (NOT a tall block).
   Sizing/padding/radius are class-level (no inline equivalents) so they
   win on source order WITHOUT !important. */
.freshrank-draft-modal .wsau-draft-action-buttons .button,
.freshrank-draft-modal .freshrank-draft-action-buttons .button,
.freshrank-draft-modal .wsau-draft-action-buttons a.button,
.freshrank-draft-modal .freshrank-draft-action-buttons a.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    min-height: 38px;
    height: auto;
    margin: 0;
    padding: 9px 14px;
    box-sizing: border-box;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    border-radius: var(--fr-radius-sm, 8px);
    box-shadow: var(--fr-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
    transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

/* Brand colour: the buttons hard-code inline
   style="background: var(--fr-blue); color: #fff; border-color: var(--fr-blue)"
   (class-dashboard.php:698/704/709 and 848/852, and the diff <button> @925).
   Those are inline (1,0,0,0), so mapping them to brand tokens REQUIRES
   !important on the three colour props ONLY - scoped, documented. */
.freshrank-draft-modal .wsau-draft-action-buttons .button,
.freshrank-draft-modal .freshrank-draft-action-buttons .button,
.freshrank-draft-modal .wsau-draft-action-buttons a.button,
.freshrank-draft-modal .freshrank-draft-action-buttons a.button {
    background: var(--fr-blue, var(--fr-blue)) !important;       /* beats inline var(--fr-blue) */
    color: #fff !important;                               /* beats inline #fff   */
    border: 1px solid var(--fr-blue, var(--fr-blue)) !important; /* beats inline border-color */
}
.freshrank-draft-modal .wsau-draft-action-buttons .button:hover,
.freshrank-draft-modal .freshrank-draft-action-buttons .button:hover,
.freshrank-draft-modal .wsau-draft-action-buttons a.button:hover,
.freshrank-draft-modal .freshrank-draft-action-buttons a.button:hover {
    background: var(--fr-blue-dark, #1d4ed8) !important;
    border-color: var(--fr-blue-dark, #1d4ed8) !important;
    color: #fff !important;
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.22);
    transform: translateY(-1px);
}
.freshrank-draft-modal .wsau-draft-action-buttons .button:active,
.freshrank-draft-modal .freshrank-draft-action-buttons .button:active,
.freshrank-draft-modal .wsau-draft-action-buttons a.button:active,
.freshrank-draft-modal .freshrank-draft-action-buttons a.button:active {
    transform: translateY(0);
    box-shadow: var(--fr-shadow, 0 1px 2px rgba(15, 23, 42, 0.04));
}
.freshrank-draft-modal .wsau-draft-action-buttons .button:focus-visible,
.freshrank-draft-modal .freshrank-draft-action-buttons .button:focus-visible,
.freshrank-draft-modal .wsau-draft-action-buttons a.button:focus-visible,
.freshrank-draft-modal .freshrank-draft-action-buttons a.button:focus-visible {
    outline: 2px solid var(--fr-blue, var(--fr-blue));
    outline-offset: 2px;
}
/* The inline dashicon inside each button carries style="margin-top: 3px"
   (class-dashboard.php:699/705/710/849/853/860/926) which mis-nudges it now
   that the button is a centred flex row; zero it (inline -> !important,
   scoped) and let flex centre it. */
.freshrank-draft-modal .wsau-draft-action-buttons .button .dashicons,
.freshrank-draft-modal .freshrank-draft-action-buttons .button .dashicons {
    margin: 0 !important;       /* beats inline margin-top:3px on the <span> */
    font-size: 16px;
    width: 16px;
    height: 16px;
    line-height: 1;
}

/* --- 3rd-block JS-bound diff trigger (.freshrank-view-diff <button> @:922):
   keep it the same compact brand row as the anchors (it is a <button>, not
   <a>, but DOES carry the same inline background/color/border-color @:925,
   so the colour trio above already covers it; here we pin width/height/
   radius which are class-level, no !important). The JS click handler is
   untouched. ----------------------------------------------------------- */
.freshrank-draft-modal .wsau-draft-action-buttons .freshrank-view-diff,
.freshrank-draft-modal .freshrank-draft-action-buttons .freshrank-view-diff {
    width: 100%;
    min-height: 38px;
    border-radius: var(--fr-radius-sm, 8px);
    font-weight: 600;
}

/* --- Token-usage <details> + Created line: tidy muted treatment -------- */
.freshrank-draft-modal .wsau-draft-token-usage summary,
.freshrank-draft-modal .freshrank-draft-token-usage summary {
    color: var(--fr-muted, #64748b);
    font-size: 12px;
    cursor: pointer;
}
.freshrank-draft-modal .wsau-draft-token-usage summary:hover,
.freshrank-draft-modal .freshrank-draft-token-usage summary:hover {
    color: var(--fr-blue, var(--fr-blue));
}

/* --- Footer (buttonpane): identical to the analysis cleanup
   (admin.css:4322-4334) - white bar, radius + 600 buttons + focus ring. - */
.freshrank-draft-modal .ui-dialog-buttonpane {
    background: #fff;
    border-top: 1px solid var(--fr-border, #e2e8f0);
    padding: 14px 24px;
}
.freshrank-draft-modal .ui-dialog-buttonset button {
    border-radius: var(--fr-radius-sm, 8px);
    font-weight: 600;
}
.freshrank-draft-modal .ui-dialog-buttonset button:focus-visible {
    outline: 2px solid var(--fr-blue, var(--fr-blue));
    outline-offset: 2px;
}

/* --- DIFF MODAL: harmonize shell + footer ONLY (titlebar left as-is, see
   header note). Content padding stays 0 (iframe viewer) by design - do NOT
   touch .freshrank-diff-modal .ui-dialog-content. --------------------- */
.freshrank-diff-modal {
    border-radius: var(--fr-radius, 12px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
}
.freshrank-diff-modal .ui-dialog-buttonpane {
    background: #fff;
    border-top: 1px solid var(--fr-border, #e2e8f0);
    padding: 14px 24px;
}
.freshrank-diff-modal .ui-dialog-buttonset button {
    border-radius: var(--fr-radius-sm, 8px);
    font-weight: 600;
}
.freshrank-diff-modal .ui-dialog-buttonset button:focus-visible {
    outline: 2px solid var(--fr-blue, var(--fr-blue));
    outline-offset: 2px;
}

/* --- Responsive (<= 782px): single column, soften padding, keep tap
   targets - mirrors the analysis block's responsive rules @admin.css:4338. */
@media screen and (max-width: 782px) {
    .freshrank-draft-modal .ui-dialog-content,
    #freshrank-draft-dialog { padding: 16px !important; }
    .freshrank-draft-modal .wsau-draft-section,
    .freshrank-draft-modal .freshrank-draft-section {
        flex-direction: column;
        gap: 18px;
    }
    .freshrank-draft-modal .wsau-draft-summary-section,
    .freshrank-draft-modal .freshrank-draft-summary-section,
    .freshrank-draft-modal .wsau-draft-actions-section,
    .freshrank-draft-modal .freshrank-draft-actions-section {
        min-width: 0;
        width: 100%;
    }
    .freshrank-draft-modal .wsau-draft-action-buttons .button,
    .freshrank-draft-modal .freshrank-draft-action-buttons .button,
    .freshrank-draft-modal .wsau-draft-action-buttons a.button,
    .freshrank-draft-modal .freshrank-draft-action-buttons a.button {
        min-height: 44px;   /* comfortable mobile tap target */
    }
}


/* --- Draft modal close (×) --- The draft titlebar is WHITE (#fff), so the X must be a DARK,
   clearly-visible glyph in a subtle pill that tints on hover. (A frosted-white pill — as briefly
   tried — is invisible on a white titlebar.) Vertical centering comes from the shared
   top:50%/translateY rule above; this centers the × glyph within the 32px button. */
.freshrank-draft-modal .ui-dialog-titlebar-close {
    background: transparent !important;
    border: none !important;
    width: 32px !important;
    height: 32px !important;
    border-radius: 6px !important;
    right: 14px !important;
}
.freshrank-draft-modal .ui-dialog-titlebar-close:hover {
    background: #eef2ff !important;
}
.freshrank-draft-modal .ui-dialog-titlebar-close:focus {
    outline: 2px solid var(--fr-blue, var(--fr-blue)) !important;
    outline-offset: 2px !important;
    background: #eef2ff !important;
}
.freshrank-draft-modal .ui-dialog-titlebar-close:before {
    content: '×' !important;
    color: #475569 !important;
    display: block !important;
    width: 32px !important;
    line-height: 32px !important;
    font-size: 26px !important;
    font-weight: 700 !important;
    text-align: center !important;
}
.freshrank-draft-modal .ui-dialog-titlebar-close:hover:before {
    color: #1e293b !important;
}

/* ==========================================================================
   FreshRank confirm popup — self-contained, branded confirmation dialog.
   Pure-CSS replacement for jQuery UI Dialog / native confirm() (both can be
   broken by other plugins). Clean native-style look: white card, dim backdrop,
   message, thin rule, Cancel/OK. All selectors prefixed .freshrank-confirm-*
   (no bleed in/out); z-index sits above WP's jQuery-UI dialog overlay (100102).
   ========================================================================== */
.freshrank-confirm-overlay {
    position: fixed;
    inset: 0;
    top: 0; right: 0; bottom: 0; left: 0; /* explicit fallback for inset */
    z-index: 100110;                       /* above WP jQuery-UI dialog overlay (100102) + plugin modals */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(15, 23, 42, 0.45);
    -webkit-animation: freshrank-confirm-fade 0.12s ease-out;
    animation: freshrank-confirm-fade 0.12s ease-out;
}
.freshrank-confirm-card {
    box-sizing: border-box;
    width: 100%;
    max-width: 460px;
    background: #fff;
    color: var(--fr-ink, #1e293b);
    border-radius: var(--fr-radius, 12px);
    box-shadow: 0 20px 48px rgba(15, 23, 42, 0.22);
    overflow: hidden;
    text-align: left;
    -webkit-animation: freshrank-confirm-pop 0.14s ease-out;
    animation: freshrank-confirm-pop 0.14s ease-out;
}
.freshrank-confirm-body {
    padding: 22px 24px;
}
.freshrank-confirm-message {
    margin: 0;
    color: var(--fr-ink, #1e293b);
    font-size: 15px;
    line-height: 1.5;
    font-weight: 400;
}
.freshrank-confirm-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 6px;
    padding: 10px 14px;
    border-top: 1px solid #e5e7eb;
}
.freshrank-confirm-footer .freshrank-confirm-btn {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
    border: 0;
    background: transparent;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    cursor: pointer;
}
.freshrank-confirm-footer .freshrank-confirm-cancel {
    color: #64748b;
}
.freshrank-confirm-footer .freshrank-confirm-cancel:hover {
    background: #f1f5f9;
    color: #334155;
}
.freshrank-confirm-footer .freshrank-confirm-ok {
    color: var(--fr-blue, #2563eb);
}
.freshrank-confirm-footer .freshrank-confirm-ok:hover {
    background: rgba(37, 99, 235, 0.08);
    color: var(--fr-blue-dark, #1d4ed8);
}
.freshrank-confirm-footer .freshrank-confirm-btn:focus {
    outline: none;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--fr-blue, #2563eb);
}
@-webkit-keyframes freshrank-confirm-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes freshrank-confirm-fade { from { opacity: 0; } to { opacity: 1; } }
@-webkit-keyframes freshrank-confirm-pop {
    from { opacity: 0; -webkit-transform: translateY(8px) scale(0.98); transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; -webkit-transform: none; transform: none; }
}
@keyframes freshrank-confirm-pop {
    from { opacity: 0; transform: translateY(8px) scale(0.98); }
    to   { opacity: 1; transform: none; }
}
@media screen and (max-width: 600px) {
    .freshrank-confirm-card { max-width: 100%; }
}
