/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — MAIN SECTION
   Distinctive purple/violet theme to differentiate from
   the blue rule-based checks
   ═══════════════════════════════════════════════════════════ */

.dp-section {
    width: 100%;
    margin: 8px 0 4px 0;
    border-radius: 10px;
    background: linear-gradient(135deg, #f5f0ff 0%, #ede7ff 50%, #f0edff 100%);
    border: 1px solid #d4c8f0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.dp-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
}

.dp-brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.dp-logo {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 50%, #4c1d95 100%);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.3);
    flex-shrink: 0;
}

.dp-title-group {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.dp-name {
    font-size: 14px;
    font-weight: 700;
    color: #4c1d95;
    letter-spacing: 0.3px;
    font-family: 'Segoe UI', sans-serif;
}

.dp-subtitle {
    font-size: 10.5px;
    color: #7c3aed;
    font-weight: 500;
    letter-spacing: 0.2px;
}

/* ── Toggle Switch ── */

.dp-toggle {
    position: relative;
    cursor: pointer;
    user-select: none;
}

.dp-toggle input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.dp-toggle-track {
    display: block;
    width: 42px;
    height: 22px;
    border-radius: 11px;
    background: #c4b5d4;
    transition: background 0.3s ease;
    position: relative;
}

.dp-toggle input:checked + .dp-toggle-track {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
}

.dp-toggle-thumb {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease;
}

.dp-toggle input:checked + .dp-toggle-track .dp-toggle-thumb {
    transform: translateX(20px);
}

/* ── Status Bar ── */

.dp-status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 8px 14px;
    font-size: 11.5px;
    color: #666;
    border-top: 1px solid rgba(124, 58, 237, 0.1);
}

.dp-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #ccc;
    flex-shrink: 0;
    transition: background 0.3s ease;
}

.dp-status-dot.connected {
    background: #22c55e;
    box-shadow: 0 0 6px rgba(34, 197, 94, 0.5);
}

.dp-status-dot.disconnected {
    background: #ef4444;
}

.dp-status-dot.checking {
    background: #f59e0b;
    animation: dotPulse 1.2s ease-in-out infinite;
}

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

.dp-status-text {
    font-family: 'Segoe UI', sans-serif;
}

/* ── Action Buttons ── */

.dp-actions {
    display: flex;
    gap: 8px;
    padding: 4px 14px 12px 14px;
}

.dp-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 10px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
}

.dp-analyze-btn {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(124, 58, 237, 0.25);
}
.dp-analyze-btn:hover:not(:disabled) {
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
    transform: translateY(-1px);
}

.dp-report-btn {
    background: #fff;
    color: #5b21b6;
    border: 1.5px solid #d4c8f0;
}
.dp-report-btn:hover:not(:disabled) {
    background: #f5f0ff;
    border-color: #7c3aed;
}

.dp-action-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.dp-action-btn:active:not(:disabled) {
    transform: translateY(0);
}

/* ── Progress Bar ── */

.dp-progress {
    padding: 0 14px 12px 14px;
}

.dp-progress-bar {
    width: 100%;
    height: 4px;
    border-radius: 2px;
    background: rgba(124, 58, 237, 0.15);
    overflow: hidden;
    margin-bottom: 6px;
}

.dp-progress-fill {
    height: 100%;
    border-radius: 2px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa, #7c3aed);
    background-size: 200% 100%;
    animation: progressShimmer 2s linear infinite;
    transition: width 0.5s ease;
    width: 0%;
}

@keyframes progressShimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.dp-progress-text {
    font-size: 11px;
    color: #7c3aed;
    font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — RESULTS PANEL
   ═══════════════════════════════════════════════════════════ */

.dp-results-header {
    background: linear-gradient(135deg, #7c3aed 0%, #4c1d95 100%) !important;
}

.dp-report-header {
    background: linear-gradient(135deg, #5b21b6 0%, #3b0764 100%) !important;
}

/* ── Filter Bar ── */

.dp-filter-bar {
    position: sticky;
    top: 52px;
    z-index: 10001;
    display: flex;
    gap: 6px;
    padding: 10px 14px;
    background: #fff;
    border-bottom: 1px solid #e8e8e8;
}

.dp-filter-btn {
    padding: 5px 12px;
    border: 1px solid #ddd;
    border-radius: 16px;
    background: #fff;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
    color: #666;
}

.dp-filter-btn:hover { border-color: #7c3aed; color: #7c3aed; }

.dp-filter-btn.active {
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    border-color: #7c3aed;
}

/* ── Issue Summary Bar ── */

.dp-summary-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 14px;
}

.dp-summary-stat {
    flex: 1;
    text-align: center;
    padding: 10px 4px;
    border-radius: 8px;
    background: #fff;
    border: 1px solid #eee;
}

.dp-summary-stat-num {
    display: block;
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 2px;
}

.dp-stat-critical  { color: #dc2626; }
.dp-stat-warning   { color: #f59e0b; }
.dp-stat-info      { color: #7c3aed; }
.dp-stat-auto      { color: #22c55e; }

.dp-summary-stat-label {
    font-size: 9.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #999;
}

/* ── Issue Cards ── */

.dp-issue-card {
    background: #fff;
    border-radius: 8px;
    border-left: 4px solid #ddd;
    margin-bottom: 6px;
    overflow: hidden;
    transition: box-shadow 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.dp-issue-card:hover {
    box-shadow: 0 3px 12px rgba(0,0,0,0.1);
}

.dp-issue-card.critical { border-left-color: #dc2626; }
.dp-issue-card.warning  { border-left-color: #f59e0b; }
.dp-issue-card.info     { border-left-color: #7c3aed; }

.dp-issue-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    cursor: pointer;
    user-select: none;
}

.dp-issue-header:hover { background: #faf8ff; }

.dp-issue-severity {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 2px 8px;
    border-radius: 10px;
    flex-shrink: 0;
}

.dp-issue-severity.critical { background: #fef2f2; color: #dc2626; }
.dp-issue-severity.warning  { background: #fffbeb; color: #b45309; }
.dp-issue-severity.info     { background: #f5f0ff; color: #7c3aed; }

.dp-issue-title {
    flex: 1;
    font-size: 12.5px;
    font-weight: 500;
    color: #333;
    line-height: 1.35;
}

.dp-issue-confidence {
    font-size: 11px;
    font-weight: 600;
    color: #999;
    flex-shrink: 0;
}

.dp-issue-arrow {
    flex-shrink: 0;
    font-size: 10px;
    color: #ccc;
    transition: transform 0.2s ease;
}
.dp-issue-arrow.open { transform: rotate(180deg); }

/* Issue Detail (collapsed) */
.dp-issue-detail {
    max-height: 0;
    overflow: hidden;
    padding: 0 12px;
    transition: max-height 0.3s ease, padding 0.3s ease;
}
.dp-issue-detail.open {
    max-height: 500px;
    padding: 0 12px 12px 12px;
}

.dp-issue-text {
    font-size: 11.5px;
    color: #666;
    background: #f8f7fc;
    padding: 8px 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    font-family: 'Consolas', 'Courier New', monospace;
    word-break: break-word;
    border-left: 2px solid #d4c8f0;
}

.dp-issue-reasoning {
    font-size: 12px;
    line-height: 1.5;
    color: #555;
    margin-bottom: 8px;
}

.dp-issue-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 8px;
}

.dp-meta-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 10.5px;
    font-weight: 600;
    border-radius: 10px;
    background: #f0edff;
    color: #5b21b6;
}

.dp-autofix-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #fff;
    font-size: 11.5px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
    box-shadow: 0 1px 4px rgba(34, 197, 94, 0.25);
}

.dp-autofix-btn:hover {
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

/* ── Consistency Warnings ── */

.dp-consistency-card {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
}

.dp-consistency-title {
    font-size: 12px;
    font-weight: 600;
    color: #92400e;
    margin-bottom: 4px;
}

.dp-consistency-msg {
    font-size: 11.5px;
    color: #78350f;
    line-height: 1.45;
}

/* ── Suggestions ── */

.dp-suggestion-card {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    padding: 10px 12px;
    margin-bottom: 6px;
}

.dp-suggestion-title {
    font-size: 12px;
    font-weight: 600;
    color: #14532d;
    margin-bottom: 4px;
}

.dp-suggestion-msg {
    font-size: 11.5px;
    color: #166534;
    line-height: 1.45;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — REPORT PANEL CONTENT
   ═══════════════════════════════════════════════════════════ */

.dp-report-status {
    text-align: center;
    padding: 16px;
    border-radius: 10px;
    margin-bottom: 16px;
    font-size: 14px;
    font-weight: 600;
}

.dp-report-status.pass {
    background: linear-gradient(135deg, #f0fdf4, #dcfce7);
    color: #166534;
    border: 1px solid #bbf7d0;
}

.dp-report-status.pass_with_warnings {
    background: linear-gradient(135deg, #fffbeb, #fef3c7);
    color: #92400e;
    border: 1px solid #fde68a;
}

.dp-report-status.needs_review {
    background: linear-gradient(135deg, #fff7ed, #fed7aa);
    color: #9a3412;
    border: 1px solid #fdba74;
}

.dp-report-status.fail {
    background: linear-gradient(135deg, #fef2f2, #fecaca);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.dp-report-executive {
    font-size: 13px;
    line-height: 1.6;
    color: #444;
    margin-bottom: 16px;
    padding: 12px;
    background: #faf8ff;
    border-radius: 8px;
    border-left: 3px solid #7c3aed;
}

.dp-report-section {
    margin-bottom: 14px;
}

.dp-report-section-title {
    font-size: 13px;
    font-weight: 700;
    color: #4c1d95;
    margin-bottom: 6px;
    padding-bottom: 4px;
    border-bottom: 1px solid #ede7ff;
}

.dp-report-check-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 12px;
    margin-bottom: 2px;
}

.dp-report-check-row:hover { background: #faf8ff; }

.dp-report-run-num {
    width: 24px;
    font-weight: 700;
    color: #7c3aed;
    font-size: 11px;
    text-align: right;
}

.dp-report-check-name {
    width: 140px;
    font-weight: 500;
    color: #333;
    flex-shrink: 0;
}

.dp-report-check-summary {
    flex: 1;
    color: #666;
    font-size: 11.5px;
}

.dp-report-recommendations {
    margin-top: 16px;
    padding: 12px;
    background: #f5f0ff;
    border-radius: 8px;
}

.dp-report-recommendations h4 {
    font-size: 13px;
    font-weight: 700;
    color: #4c1d95;
    margin: 0 0 8px 0;
}

.dp-report-rec-item {
    font-size: 12px;
    line-height: 1.5;
    color: #5b21b6;
    padding: 4px 0 4px 16px;
    position: relative;
}

.dp-report-rec-item::before {
    content: "→";
    position: absolute;
    left: 0;
    color: #7c3aed;
    font-weight: 700;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — EMPTY / LOADING STATES
   ═══════════════════════════════════════════════════════════ */

.dp-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.dp-empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: 0.5;
}

.dp-empty-title {
    font-size: 14px;
    font-weight: 600;
    color: #666;
    margin-bottom: 6px;
}

.dp-empty-desc {
    font-size: 12px;
    line-height: 1.5;
    color: #999;
}

.dp-analyzing-state {
    text-align: center;
    padding: 40px 20px;
}

.dp-analyzing-icon {
    width: 48px;
    height: 48px;
    border: 3px solid #ede7ff;
    border-top-color: #7c3aed;
    border-radius: 50%;
    margin: 0 auto 16px auto;
    animation: dpSpin 0.8s linear infinite;
}

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

.dp-analyzing-text {
    font-size: 13px;
    font-weight: 500;
    color: #5b21b6;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — SECTION LABELS IN RESULTS
   ═══════════════════════════════════════════════════════════ */

.dp-section-divider {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #7c3aed;
    padding: 12px 0 6px 0;
    border-bottom: 1px solid #ede7ff;
    margin-bottom: 8px;
    margin-top: 8px;
}

.dp-section-divider:first-child {
    margin-top: 0;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — ANALYSIS META INFO
   ═══════════════════════════════════════════════════════════ */

.dp-meta-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: #f8f7fc;
    border-radius: 6px;
    margin-bottom: 12px;
    font-size: 11px;
    color: #666;
}

.dp-meta-bar strong { color: #4c1d95; }


/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — ISSUE GROUP STYLES (new in v2)
   ═══════════════════════════════════════════════════════════ */

.dp-issue-group {
    margin-bottom: 10px;
    border: 1px solid #e8e4f0;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.dp-group-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #f8f6fd;
    cursor: pointer;
    user-select: none;
    border-bottom: 1px solid #e8e4f0;
}
.dp-group-header:hover { background: #f0edfa; }

.dp-group-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    background: linear-gradient(135deg, #7c3aed, #5b21b6);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.dp-group-title {
    flex: 1;
    font-size: 13px;
    font-weight: 600;
    color: #4c1d95;
}

.dp-group-count {
    padding: 2px 8px;
    border-radius: 10px;
    background: #ede7ff;
    color: #5b21b6;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.dp-group-arrow {
    font-size: 10px;
    color: #999;
    transition: transform 0.25s ease;
}
.dp-group-arrow.open { transform: rotate(180deg); }

.dp-group-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.dp-group-body.open {
    max-height: 5000px;
    padding: 6px;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — JSON VIEWER STYLES
   ═══════════════════════════════════════════════════════════ */

.dp-json-btn {
    background: #fff;
    color: #5b21b6;
    border: 1.5px solid #d4c8f0;
    min-width: 60px;
}
.dp-json-btn:hover:not(:disabled) {
    background: #f5f0ff;
    border-color: #7c3aed;
}

.dp-json-pre {
    background: #1e1e2e;
    color: #a6e3a1;
    padding: 14px;
    border-radius: 8px;
    font-size: 11px;
    font-family: 'Consolas', 'Courier New', monospace;
    line-height: 1.5;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 70vh;
    overflow-y: auto;
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI — RE-ANALYZE BUTTON
   ═══════════════════════════════════════════════════════════ */

.dp-reanalyze-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px 12px;
    border: 1.5px dashed #d4c8f0;
    border-radius: 8px;
    background: #faf8ff;
    color: #7c3aed;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    font-family: 'Segoe UI', sans-serif;
    transition: all 0.2s ease;
}
.dp-reanalyze-btn:hover {
    background: #7c3aed;
    color: #fff;
    border-style: solid;
}


/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI v3 — APPEND TO BOTTOM OF docpilot.css
   ═══════════════════════════════════════════════════════════ */

/* ── Issue Groups ── */
.dp-issue-group { margin-bottom:10px;border:1px solid #e8e4f0;border-radius:8px;overflow:hidden;background:#fff }
.dp-group-header { display:flex;align-items:center;gap:8px;padding:10px 12px;background:#f8f6fd;cursor:pointer;user-select:none;border-bottom:1px solid #e8e4f0 }
.dp-group-header:hover { background:#f0edfa }
.dp-group-icon { width:24px;height:24px;border-radius:6px;background:linear-gradient(135deg,#7c3aed,#5b21b6);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0 }
.dp-group-title { flex:1;font-size:13px;font-weight:600;color:#4c1d95 }
.dp-group-count { padding:2px 8px;border-radius:10px;background:#ede7ff;color:#5b21b6;font-size:11px;font-weight:700;flex-shrink:0 }
.dp-group-arrow { font-size:10px;color:#999;transition:transform 0.25s ease }
.dp-group-arrow.open { transform:rotate(180deg) }
.dp-group-body { max-height:0;overflow:hidden;transition:max-height 0.35s ease }
.dp-group-body.open { max-height:5000px;padding:6px }

/* ── Navigate Button ── */
.dp-navigate-btn {
    padding:5px 10px;border:1.5px solid #0078d4;border-radius:6px;background:#fff;
    color:#0078d4;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;
    font-family:'Segoe UI',sans-serif;transition:all 0.2s ease;flex-shrink:0
}
.dp-navigate-btn:hover { background:#0078d4;color:#fff }

/* ── Issue text + navigate row ── */
.dp-issue-text-row { display:flex;align-items:flex-start;gap:8px;margin-bottom:8px }

/* ── Single-Issue Fix Button ── */
.dp-autofix-single-btn {
    display:inline-flex;align-items:center;gap:4px;padding:7px 14px;border:none;border-radius:6px;
    background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;font-size:11.5px;font-weight:600;
    cursor:pointer;font-family:'Segoe UI',sans-serif;transition:all 0.2s ease;
    box-shadow:0 1px 4px rgba(34,197,94,0.25);margin-top:4px
}
.dp-autofix-single-btn:hover { box-shadow:0 3px 10px rgba(34,197,94,0.35);transform:translateY(-1px) }
.dp-autofix-single-btn:disabled { opacity:0.6;cursor:not-allowed;transform:none }

/* ── Re-analyze Button ── */
.dp-reanalyze-btn {
    width:100%;margin-top:16px;padding:10px 12px;border:1.5px dashed #d4c8f0;border-radius:8px;
    background:#faf8ff;color:#7c3aed;font-size:13px;font-weight:600;cursor:pointer;
    font-family:'Segoe UI',sans-serif;transition:all 0.2s ease
}
.dp-reanalyze-btn:hover { background:#7c3aed;color:#fff;border-style:solid }

/* ── JSON Viewer ── */
.dp-json-btn { background:#fff;color:#5b21b6;border:1.5px solid #d4c8f0;min-width:60px }
.dp-json-btn:hover:not(:disabled) { background:#f5f0ff;border-color:#7c3aed }
.dp-json-pre {
    background:#1e1e2e;color:#a6e3a1;padding:14px;border-radius:8px;font-size:11px;
    font-family:'Consolas','Courier New',monospace;line-height:1.5;overflow-x:auto;
    white-space:pre-wrap;word-break:break-word;max-height:70vh;overflow-y:auto
}

/* ═══════════════════════════════════════════════════════════
   DOCPILOT AI v3 — APPEND TO BOTTOM OF docpilot.css
   ═══════════════════════════════════════════════════════════ */

/* ── Issue Groups ── */
.dp-issue-group { margin-bottom:10px;border:1px solid #e8e4f0;border-radius:8px;overflow:hidden;background:#fff }
.dp-group-header { display:flex;align-items:center;gap:8px;padding:10px 12px;background:#f8f6fd;cursor:pointer;user-select:none;border-bottom:1px solid #e8e4f0 }
.dp-group-header:hover { background:#f0edfa }
.dp-group-icon { width:24px;height:24px;border-radius:6px;background:linear-gradient(135deg,#7c3aed,#5b21b6);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0 }
.dp-group-title { flex:1;font-size:13px;font-weight:600;color:#4c1d95 }
.dp-group-count { padding:2px 8px;border-radius:10px;background:#ede7ff;color:#5b21b6;font-size:11px;font-weight:700;flex-shrink:0 }
.dp-group-arrow { font-size:10px;color:#999;transition:transform 0.25s ease }
.dp-group-arrow.open { transform:rotate(180deg) }
.dp-group-body { max-height:0;overflow:hidden;transition:max-height 0.35s ease }
.dp-group-body.open { max-height:5000px;padding:6px }

/* ── Navigate Button ── */
.dp-navigate-btn {
    padding:5px 10px;border:1.5px solid #0078d4;border-radius:6px;background:#fff;
    color:#0078d4;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;
    font-family:'Segoe UI',sans-serif;transition:all 0.2s ease;flex-shrink:0
}
.dp-navigate-btn:hover { background:#0078d4;color:#fff }

/* ── Issue text + navigate row ── */
.dp-issue-text-row { display:flex;align-items:flex-start;gap:8px;margin-bottom:8px }

/* ── Single-Issue Fix Button ── */
.dp-autofix-single-btn {
    display:inline-flex;align-items:center;gap:4px;padding:7px 14px;border:none;border-radius:6px;
    background:linear-gradient(135deg,#22c55e,#16a34a);color:#fff;font-size:11.5px;font-weight:600;
    cursor:pointer;font-family:'Segoe UI',sans-serif;transition:all 0.2s ease;
    box-shadow:0 1px 4px rgba(34,197,94,0.25);margin-top:4px
}
.dp-autofix-single-btn:hover { box-shadow:0 3px 10px rgba(34,197,94,0.35);transform:translateY(-1px) }
.dp-autofix-single-btn:disabled { opacity:0.6;cursor:not-allowed;transform:none }

/* ── Re-analyze Button ── */
.dp-reanalyze-btn {
    width:100%;margin-top:16px;padding:10px 12px;border:1.5px dashed #d4c8f0;border-radius:8px;
    background:#faf8ff;color:#7c3aed;font-size:13px;font-weight:600;cursor:pointer;
    font-family:'Segoe UI',sans-serif;transition:all 0.2s ease
}
.dp-reanalyze-btn:hover { background:#7c3aed;color:#fff;border-style:solid }

/* ── JSON Viewer ── */
.dp-json-btn { background:#fff;color:#5b21b6;border:1.5px solid #d4c8f0;min-width:60px }
.dp-json-btn:hover:not(:disabled) { background:#f5f0ff;border-color:#7c3aed }
.dp-json-pre {
    background:#1e1e2e;color:#a6e3a1;padding:14px;border-radius:8px;font-size:11px;
    font-family:'Consolas','Courier New',monospace;line-height:1.5;overflow-x:auto;
    white-space:pre-wrap;word-break:break-word;max-height:70vh;overflow-y:auto
}

/* ── Stale Analysis Warning Banner ── */
.dp-stale-banner {
    display:flex;align-items:center;gap:8px;padding:10px 12px;margin-bottom:10px;
    background:#fffbeb;border:1px solid #fde68a;border-radius:8px;
    font-size:11.5px;color:#92400e;line-height:1.4
}
.dp-stale-banner span { flex:1 }
.dp-stale-btn {
    padding:5px 12px;border:1.5px solid #f59e0b;border-radius:6px;background:#fff;
    color:#b45309;font-size:11px;font-weight:600;cursor:pointer;white-space:nowrap;
    font-family:'Segoe UI',sans-serif;transition:all 0.2s ease;flex-shrink:0
}
.dp-stale-btn:hover { background:#f59e0b;color:#fff }

/* ═══════════════════════════════════════════════════════════
   QC SUMMARY: ACCORDION CARDS + GO TO NAVIGATION
   Append this entire block to the END of your taskpane.css
   ═══════════════════════════════════════════════════════════ */

.sr-card {
    background: #fff;
    border-radius: 8px;
    border-left: 3px solid #0078d4;
    margin-bottom: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    overflow: hidden;
}
.sr-card.done    { border-left-color: #107c10; }
.sr-card.error   { border-left-color: #d13438; }
.sr-card.pending { border-left-color: #ccc; opacity: 0.7; }

/* Header row (clickable when has details) */
.sr-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    font-size: 12.5px;
}
.sr-clickable { cursor: pointer; }
.sr-clickable:hover { background: #f5f8fc; }

.sr-num {
    flex-shrink: 0;
    width: 22px;
    font-weight: 700;
    font-size: 12px;
    color: #0078d4;
    text-align: center;
}
.sr-name { flex: 1; font-weight: 500; color: #1a1a1a; }
.sr-right { display: flex; align-items: center; gap: 6px; }
.sr-icon { font-size: 13px; }
.sr-time { font-size: 10.5px; color: #999; }
.sr-chev {
    font-size: 10px;
    color: #999;
    transition: transform 0.2s ease;
}
.sr-chev.up { transform: rotate(180deg); }

/* Expandable detail body */
.sr-body {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.sr-body.open {
    max-height: 2000px;
    overflow-y: auto;
}

.sr-body-title {
    padding: 8px 12px;
    font-size: 11.5px;
    font-weight: 600;
    color: #333;
    background: #f8f9fb;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

/* Stat rows (count + note, no navigation) */
.sr-body-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 12px;
    font-size: 12px;
    border-bottom: 1px solid #f0f0f0;
}
.sr-body-row:last-child { border-bottom: none; }

.sr-body-label { color: #555; flex: 1; }
.sr-body-vals { display: flex; align-items: center; gap: 6px; }

.sr-body-count {
    display: inline-block;
    background: #0078d4;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 10px;
    min-width: 20px;
    text-align: center;
}

.sr-body-note {
    font-size: 11px;
    color: #888;
    font-style: italic;
}

/* Navigation rows (clickable Go To) */
.sr-nav-row {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f0f6ff;
    border-bottom: 1px solid #dde8f8;
    cursor: pointer;
    transition: background 0.15s ease;
}
.sr-nav-row:last-child { border-bottom: none; }
.sr-nav-row:hover      { background: #d8eaff; }
.sr-nav-row.sr-nav-active { background: #b3d4ff; }

.sr-nav-arrow {
    flex-shrink: 0;
    color: #0078d4;
    font-size: 12px;
    font-weight: 700;
}

.sr-nav-text {
    flex: 1;
    font-size: 11.5px;
    color: #1a1a1a;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sr-nav-note {
    flex-shrink: 0;
    font-size: 10.5px;
    color: #0078d4;
    font-weight: 600;
    background: #deeafc;
    border-radius: 8px;
    padding: 1px 7px;
}

.sr-nav-btn {
    flex-shrink: 0;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #0078d4;
    border-radius: 6px;
    padding: 2px 7px;
    transition: background 0.15s ease;
}
.sr-nav-row:hover .sr-nav-btn { background: #005a9e; }

/* ═══════════════════════════════════════════════════════════
   QUEUED STATE — visual feedback when a check is waiting
   ═══════════════════════════════════════════════════════════ */

.ck-card.queued {
    background: #f0f7ff !important;
    border-left-color: #5da8ff;
    box-shadow: 0 2px 8px rgba(93, 168, 255, 0.25);
    animation: queuePulse 2s ease-in-out infinite;
}

.ck-card.queued .ck-label {
    color: #0066cc;
    font-weight: 600;
}

.ck-card.queued .check-status {
    color: #5da8ff;
    font-size: 12px;
    font-weight: 600;
}

@keyframes queuePulse {
    0%, 100% { background: #f0f7ff; }
    50%      { background: #e6f0ff; }
}

.check-status.queued {
    color: #5da8ff;
}

/* ═══════════════════════════════════════════════════════════════
   DocPilot v4 — additions for source badges and occurrence buttons
   APPEND THIS TO YOUR EXISTING docpilot.css
   ═══════════════════════════════════════════════════════════════ */

/* Source badge — small colored tag next to severity */
.dp-source-badge {
  display: inline-block;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  text-transform: uppercase;
  font-family: 'Segoe UI', sans-serif;
  vertical-align: middle;
}

.dp-source-structure {
  background: #e0e7ff;
  color: #3730a3;
  border: 1px solid #c7d2fe;
}

.dp-source-terminology {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.dp-source-crossref {
  background: #fce7f3;
  color: #9d174d;
  border: 1px solid #fbcfe8;
}

.dp-source-analyze {
  background: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

/* Occurrence buttons — clickable paragraph numbers in terminology issues */
.dp-occurrence-btn {
  display: inline-block;
  background: #f3f4f6;
  border: 1px solid #d1d5db;
  border-radius: 4px;
  padding: 2px 8px;
  margin: 2px;
  font-size: 11px;
  font-family: 'Segoe UI', sans-serif;
  cursor: pointer;
  color: #374151;
  transition: background 0.15s, border-color 0.15s;
}

.dp-occurrence-btn:hover {
  background: #e5e7eb;
  border-color: #9ca3af;
}

.dp-occurrence-btn:active {
  background: #d1d5db;
}