/* ===================================================
   Module Intégrité Textuelle — Styles
   Design inspiré de "Mes Projets" (two-panel grid)
   =================================================== */

/* ===== CONTAINER PRINCIPAL (grid 2 colonnes) ===== */
#integrite-textuelle-content {
    flex: 1;
    min-height: 0;
    overflow: hidden;
}

.integrity-container {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 0;
    height: 100%;
    min-height: 0;
    background: var(--card-bg, white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

/* ===== PANNEAU GAUCHE (historique) ===== */
.integrity-left-panel {
    background: var(--bg-tertiary, #f9fafb);
    border-right: 1px solid var(--border-color, #e5e7eb);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.integrity-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--card-bg, white);
    gap: 0.5rem;
    min-height: 0;
}

.integrity-panel-header-left {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
    overflow: hidden;
}

.integrity-panel-header-left svg {
    color: #EF4444;
    flex-shrink: 0;
}

.integrity-panel-header h2 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    margin: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.integrity-panel-count {
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.15rem 0.5rem;
    border-radius: 10px;
    flex-shrink: 0;
}

.integrity-new-btn {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.4rem 0.7rem;
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: white;
    border: none;
    border-radius: 7px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.integrity-new-btn-label {
    display: none;
}

.integrity-new-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(239, 68, 68, 0.3);
}

.integrity-new-btn svg {
    color: white;
}

/* Search bar */
.integrity-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.85rem 1.5rem;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
    background: var(--card-bg, white);
}

.integrity-search svg {
    color: var(--text-tertiary, #9ca3af);
    flex-shrink: 0;
}

.integrity-search input {
    flex: 1;
    border: none;
    background: none;
    font-size: 0.9rem;
    color: var(--text-primary, #111827);
    outline: none;
}

.integrity-search input::placeholder {
    color: var(--text-tertiary, #9ca3af);
}

/* Scrollable list */
.integrity-list-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 0.75rem;
    min-height: 0;
}

/* Empty state (left panel) */
.integrity-list-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-tertiary, #9ca3af);
}

.integrity-list-empty svg {
    margin-bottom: 0.75rem;
    opacity: 0.35;
}

.integrity-list-empty p {
    font-weight: 500;
    margin: 0 0 0.35rem;
    color: var(--text-secondary, #6b7280);
    font-size: 0.9rem;
}

.integrity-list-empty span {
    font-size: 0.8rem;
}

/* History card */
.integrity-history-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.integrity-history-card:hover {
    border-color: #EF4444;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.1);
}

.integrity-history-card.active {
    border-color: #EF4444;
    background: var(--bg-tertiary, #f9fafb);
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.15);
}

.integrity-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.4rem;
}

.integrity-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary, #111827);
    line-height: 1.3;
    flex: 1;
    margin-right: 0.5rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.integrity-card-badges {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.integrity-card-rate {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    color: white;
}

.integrity-card-type {
    font-size: 0.7rem;
    font-weight: 500;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    background: rgba(239, 68, 68, 0.1);
    color: #EF4444;
}

.integrity-card-date {
    font-size: 0.75rem;
    color: var(--text-tertiary, #9ca3af);
    margin-bottom: 0.4rem;
}

.integrity-card-stats {
    display: flex;
    gap: 1rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-card-stats span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.integrity-card-stats svg {
    opacity: 0.5;
    flex-shrink: 0;
}

.integrity-card-delete {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: var(--text-tertiary, #9ca3af);
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
}

.integrity-history-card:hover .integrity-card-delete {
    opacity: 1;
}

.integrity-card-delete:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #DC2626;
}

/* ===== PANNEAU DROIT (contenu) ===== */
.integrity-right-panel {
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    padding: 1.5rem 2rem;
    background: var(--bg-primary, #f3f4f6);
}

/* ===== EMPTY STATE (right panel) ===== */
.integrity-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-align: center;
    color: var(--text-tertiary, #9ca3af);
    padding: 3rem;
}

.integrity-empty-state svg {
    margin-bottom: 1rem;
    opacity: 0.25;
}

.integrity-empty-state h3 {
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-secondary, #6b7280);
    margin: 0 0 0.5rem;
}

.integrity-empty-state p {
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
    max-width: 320px;
    line-height: 1.5;
}

.integrity-empty-state .integrity-new-btn {
    font-size: 0.9rem;
    padding: 0.6rem 1.25rem;
}

/* ===== SECTION HEADER (titre page) ===== */
.integrity-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.integrity-page-header-left {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.integrity-page-icon {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, #EF4444, #F97316);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.integrity-page-icon svg {
    color: white;
    stroke: white;
}

.integrity-page-title h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text-primary, #111827);
    margin: 0;
}

.integrity-page-title p {
    font-size: 0.85rem;
    color: var(--text-secondary, #6b7280);
    margin: 0.15rem 0 0;
}

.integrity-page-actions {
    display: flex;
    gap: 0.5rem;
}

/* ===== TABS ===== */
.integrity-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 4px;
    width: fit-content;
}

.integrity-tab-btn {
    padding: 0.55rem 1.25rem;
    border: none;
    background: transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    color: var(--text-secondary, #6b7280);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.integrity-tab-btn:hover {
    color: var(--text-primary, #111827);
    background: rgba(239, 68, 68, 0.06);
}

.integrity-tab-btn.active {
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: white;
    font-weight: 600;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.25);
}

.integrity-tab-btn svg {
    flex-shrink: 0;
}

/* ===== INPUT AREA (Card) ===== */
.integrity-input-card {
    background: var(--card-bg, white);
    border-radius: 12px;
    border: 1px solid var(--border-color, #e5e7eb);
    overflow: hidden;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 200px;
}

.integrity-textarea {
    width: 100%;
    flex: 1;
    min-height: 180px;
    border: none;
    padding: 1.25rem;
    font-size: 0.95rem;
    font-family: 'Inter', sans-serif;
    line-height: 1.7;
    resize: none;
    background: transparent;
    color: var(--text-primary, #111827);
    outline: none;
    box-sizing: border-box;
}

.integrity-textarea::placeholder {
    color: var(--text-tertiary, #9ca3af);
}

.integrity-input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.65rem 1.25rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
    background: var(--bg-tertiary, #f9fafb);
}

.integrity-word-count {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-char-count {
    font-size: 0.82rem;
    color: var(--text-tertiary, #9ca3af);
}

/* ===== FILE DROP ZONE ===== */
.integrity-file-drop {
    border: 2px dashed var(--border-color, #d1d5db);
    border-radius: 12px;
    padding: 2.5rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 1.25rem;
    background: var(--card-bg, white);
}

.integrity-file-drop:hover,
.integrity-file-drop.dragover {
    border-color: #EF4444;
    background: rgba(239, 68, 68, 0.03);
}

.integrity-file-drop-icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 0.75rem;
    opacity: 0.4;
}

.integrity-file-drop-icon svg {
    width: 56px;
    height: 56px;
    stroke: var(--text-tertiary, #9ca3af);
}

.integrity-file-drop:hover .integrity-file-drop-icon svg,
.integrity-file-drop.dragover .integrity-file-drop-icon svg {
    stroke: #EF4444;
}

.integrity-file-drop-btn {
    display: inline-block;
    padding: 0.6rem 1.5rem;
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 0.5rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.integrity-file-drop-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.integrity-file-drop-hint {
    font-size: 0.82rem;
    color: var(--text-tertiary, #9ca3af);
}

.integrity-file-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.65rem 1rem;
    background: rgba(239, 68, 68, 0.05);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    margin-bottom: 1rem;
    font-size: 0.88rem;
    color: var(--text-primary, #111827);
}

.integrity-file-info svg {
    width: 18px;
    height: 18px;
    stroke: #EF4444;
    flex-shrink: 0;
}

/* ===== ANALYZE BUTTON ===== */
.integrity-analyze-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    width: 100%;
    padding: 0.85rem;
    background: linear-gradient(135deg, #EF4444, #F97316);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.integrity-analyze-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.3);
}

.integrity-analyze-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    background: var(--text-tertiary, #9ca3af);
    box-shadow: none;
    transform: none;
}

.integrity-analyze-btn .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: integrity-spin 0.8s linear infinite;
}

@keyframes integrity-spin {
    to { transform: rotate(360deg); }
}

/* ===== RESULTS VIEW ===== */
.integrity-results {
    animation: integrity-fadeIn 0.4s ease;
}

@keyframes integrity-fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== GAUGE SECTION ===== */
.integrity-gauge-section {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
    flex-wrap: wrap;
}

.integrity-gauge-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 170px;
}

.integrity-gauge-wrapper {
    position: relative;
    width: 150px;
    height: 150px;
}

.integrity-gauge-svg {
    width: 150px;
    height: 150px;
    transform: rotate(-90deg);
    display: block;
}

.integrity-gauge-bg {
    fill: none;
    stroke: var(--bg-secondary, #e5e7eb);
    stroke-width: 10;
}

.integrity-gauge-fill {
    fill: none;
    stroke-width: 10;
    stroke-linecap: round;
    transition: stroke-dashoffset 1.5s ease, stroke 0.5s ease;
}

.integrity-gauge-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.integrity-gauge-percent {
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
}

.integrity-gauge-sublabel {
    font-size: 0.72rem;
    color: var(--text-secondary, #6b7280);
    margin-top: 0.2rem;
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    background: var(--bg-secondary, #f3f4f6);
    display: inline-block;
}

.integrity-gauge-label {
    font-size: 0.88rem;
    font-weight: 600;
    margin-top: 0.5rem;
    text-align: center;
    white-space: nowrap;
}

.integrity-gauge-confidence {
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    margin-top: 0.2rem;
    text-align: center;
}

/* Gauge info panel */
.integrity-gauge-info {
    flex: 1;
    min-width: 240px;
}

.integrity-gauge-info h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary, #111827);
}

/* ===== INDICATORS ===== */
.integrity-indicator-item {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 0.55rem;
}

.integrity-indicator-label {
    flex: 0 0 150px;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-indicator-bar {
    flex: 1;
    height: 7px;
    background: var(--bg-secondary, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}

.integrity-indicator-fill {
    height: 100%;
    border-radius: 4px;
    transition: width 1s ease;
}

.integrity-indicator-value {
    flex: 0 0 38px;
    text-align: right;
    font-size: 0.78rem;
    font-weight: 600;
}

/* ===== SECTION CARDS ===== */
.integrity-section-card {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.integrity-section-card h4 {
    margin: 0 0 0.75rem;
    font-size: 0.95rem;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.integrity-section-card h4 svg {
    color: #EF4444;
    flex-shrink: 0;
}

/* ===== SENTENCE HIGHLIGHTING ===== */
.integrity-sentence-panel {
    background: var(--bg-tertiary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 1.1rem;
    max-height: 380px;
    overflow-y: auto;
    line-height: 1.8;
}

.integrity-sentence {
    display: inline;
    padding: 2px 4px;
    border-radius: 4px;
    transition: background 0.3s ease;
    cursor: default;
}

.integrity-sentence:hover {
    outline: 2px solid rgba(0,0,0,0.08);
}

.integrity-sentence-human { background-color: #DCFCE7; color: #166534; }
.integrity-sentence-mixed { background-color: #FEF9C3; color: #854D0E; }
.integrity-sentence-likely-ai { background-color: #FFEDD5; color: #9A3412; }
.integrity-sentence-highly-ai { background-color: #FEE2E2; color: #991B1B; }

/* ===== DISTRIBUTION BAR ===== */
.integrity-distribution-bar {
    display: flex;
    height: 28px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

.integrity-dist-segment {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.72rem;
    font-weight: 600;
    color: white;
    min-width: 2px;
    transition: flex 0.5s ease;
}

.integrity-dist-human { background: #22C55E; }
.integrity-dist-mixed { background: #EAB308; }
.integrity-dist-likely-ai { background: #F97316; }
.integrity-dist-highly-ai { background: #EF4444; }

.integrity-distribution-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.integrity-legend-item {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-legend-dot {
    width: 9px;
    height: 9px;
    border-radius: 3px;
    flex-shrink: 0;
}

/* ===== TOP SENTENCES ===== */
.integrity-top-sentence-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.65rem 0.85rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: var(--bg-tertiary, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
}

.integrity-top-sentence-score {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: white;
}

.integrity-top-sentence-text {
    flex: 1;
    font-size: 0.88rem;
    color: var(--text-primary, #111827);
    line-height: 1.5;
}

/* ===== PLAGIARISM SECTION ===== */
.integrity-plagiarism-section {
    background: var(--card-bg, white);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.integrity-plagiarism-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.integrity-plagiarism-header h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--text-primary, #111827);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.integrity-plagiarism-btn {
    padding: 0.45rem 1.1rem;
    background: linear-gradient(135deg, #8B5CF6, #6366F1);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.integrity-plagiarism-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(139, 92, 246, 0.3);
}

.integrity-plagiarism-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.integrity-plagiarism-gauge {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 0.85rem;
    padding: 0.85rem 1rem;
    background: var(--bg-tertiary, #f9fafb);
    border-radius: 10px;
}

.integrity-plagiarism-percent {
    font-size: 1.8rem;
    font-weight: 800;
}

.integrity-plagiarism-label {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-plagiarism-summary {
    font-size: 0.88rem;
    color: var(--text-secondary, #6b7280);
    padding: 0.65rem 0.85rem;
    background: var(--bg-tertiary, #f9fafb);
    border-radius: 8px;
    margin-bottom: 0.85rem;
    line-height: 1.5;
    font-style: italic;
}

.integrity-source-item {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    padding: 0.65rem;
    border-radius: 8px;
    margin-bottom: 0.4rem;
    background: var(--bg-tertiary, #f9fafb);
    border-left: 3px solid #8B5CF6;
}

.integrity-source-title {
    font-weight: 600;
    font-size: 0.88rem;
    color: var(--text-primary, #111827);
}

.integrity-source-author {
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

.integrity-source-url {
    font-size: 0.78rem;
    color: #6366F1;
    text-decoration: none;
    word-break: break-all;
}

.integrity-source-url:hover { text-decoration: underline; }

.integrity-source-similarity {
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-flagged-passage {
    padding: 0.6rem 0.8rem;
    margin-top: 0.45rem;
    background: rgba(239, 68, 68, 0.05);
    border-radius: 8px;
    font-size: 0.82rem;
    color: var(--text-primary, #111827);
    border-left: 3px solid #EF4444;
}

.integrity-flagged-text {
    font-weight: 600;
    line-height: 1.45;
}

.integrity-flagged-reason {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-flagged-excerpt {
    margin-top: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
    padding: 0.35rem 0.6rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
    border-left: 2px solid #6366F1;
}

.integrity-flagged-excerpt-label {
    font-weight: 600;
    font-style: normal;
    color: #6366F1;
}

.integrity-flagged-source {
    margin-top: 0.1rem;
    font-size: 0.78rem;
    color: #6366F1;
}

[data-theme="dark"] .integrity-flagged-passage {
    background: rgba(239, 68, 68, 0.1);
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .integrity-flagged-source {
    color: #818CF8;
}

[data-theme="dark"] .integrity-flagged-reason {
    color: #9ca3af;
}

[data-theme="dark"] .integrity-flagged-excerpt {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-left-color: #818CF8;
}

[data-theme="dark"] .integrity-flagged-excerpt-label {
    color: #818CF8;
}

[data-theme="dark"] .integrity-source-author {
    color: #9ca3af;
}

[data-theme="dark"] .integrity-source-url {
    color: #818CF8;
}

/* ===== ACTION BUTTONS ===== */
.integrity-actions-row {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.integrity-btn-secondary {
    padding: 0.45rem 0.9rem;
    border: 1px solid var(--border-color, #d1d5db);
    background: var(--card-bg, white);
    border-radius: 8px;
    font-size: 0.82rem;
    cursor: pointer;
    color: var(--text-primary, #111827);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.integrity-btn-secondary:hover {
    background: var(--bg-secondary, #f3f4f6);
    border-color: var(--text-secondary, #9ca3af);
}

.integrity-improve-btn {
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #22C55E, #16A34A);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.integrity-improve-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(34, 197, 94, 0.3);
}

.integrity-improve-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.integrity-save-btn {
    padding: 0.55rem 1.1rem;
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: all 0.2s ease;
}

.integrity-save-btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(59, 130, 246, 0.3);
}

/* ===== LOADING ===== */
.integrity-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.85rem;
    padding: 2.5rem;
    color: var(--text-secondary, #6b7280);
}

.integrity-loading .spinner-large {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color, #e5e7eb);
    border-top-color: #EF4444;
    border-radius: 50%;
    animation: integrity-spin 0.8s linear infinite;
}

/* ===== DARK MODE ===== */
[data-theme="dark"] .integrity-container {
    background: var(--bg-secondary, #1f2937);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

[data-theme="dark"] .integrity-left-panel {
    background: var(--bg-tertiary, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-panel-header {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-search {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-search input {
    color: var(--text-primary, #f3f4f6);
}

[data-theme="dark"] .integrity-history-card {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-history-card:hover {
    border-color: #F87171;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.15);
}

[data-theme="dark"] .integrity-history-card.active {
    border-color: #F87171;
    background: var(--bg-tertiary, #111827);
}

[data-theme="dark"] .integrity-card-delete:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #FCA5A5;
}

[data-theme="dark"] .integrity-right-panel {
    background: var(--bg-primary, #111827);
}

[data-theme="dark"] .integrity-tabs {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-tab-btn {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .integrity-tab-btn:hover {
    color: var(--text-primary, #f3f4f6);
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .integrity-input-card {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-textarea {
    color: var(--text-primary, #f3f4f6);
}

[data-theme="dark"] .integrity-input-footer {
    background: var(--bg-tertiary, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-file-drop {
    border-color: var(--border-color, #374151);
    background: var(--bg-secondary, #1f2937);
}

[data-theme="dark"] .integrity-file-drop:hover,
[data-theme="dark"] .integrity-file-drop.dragover {
    border-color: #F87171;
    background: rgba(239, 68, 68, 0.06);
}

[data-theme="dark"] .integrity-file-info {
    background: rgba(239, 68, 68, 0.08);
    border-color: rgba(239, 68, 68, 0.2);
}

[data-theme="dark"] .integrity-gauge-section {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-gauge-sublabel {
    background: var(--bg-tertiary, #111827);
}

[data-theme="dark"] .integrity-section-card {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-sentence-panel {
    background: var(--bg-tertiary, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-sentence-human {
    background-color: rgba(34, 197, 94, 0.2);
    color: #86EFAC;
}

[data-theme="dark"] .integrity-sentence-mixed {
    background-color: rgba(234, 179, 8, 0.2);
    color: #FDE68A;
}

[data-theme="dark"] .integrity-sentence-likely-ai {
    background-color: rgba(249, 115, 22, 0.2);
    color: #FDBA74;
}

[data-theme="dark"] .integrity-sentence-highly-ai {
    background-color: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

[data-theme="dark"] .integrity-top-sentence-item {
    background: var(--bg-tertiary, #111827);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-plagiarism-section {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-plagiarism-gauge,
[data-theme="dark"] .integrity-plagiarism-summary {
    background: var(--bg-tertiary, #111827);
}

[data-theme="dark"] .integrity-source-item {
    background: var(--bg-tertiary, #111827);
}

[data-theme="dark"] .integrity-btn-secondary {
    background: var(--bg-secondary, #1f2937);
    border-color: var(--border-color, #374151);
    color: var(--text-primary, #f3f4f6);
}

[data-theme="dark"] .integrity-list-empty {
    color: var(--text-secondary, #6b7280);
}

[data-theme="dark"] .integrity-empty-state {
    color: var(--text-secondary, #6b7280);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .integrity-container {
        grid-template-columns: 1fr;
        height: auto;
    }

    .integrity-left-panel {
        border-right: none;
        border-bottom: 1px solid var(--border-color, #e5e7eb);
        max-height: 320px;
    }
}

@media (max-width: 768px) {
    .integrity-right-panel {
        padding: 1rem;
    }

    .integrity-gauge-section {
        flex-direction: column;
        align-items: center;
    }

    .integrity-gauge-info {
        min-width: 100%;
    }

    .integrity-actions-row {
        flex-direction: column;
    }

    .integrity-actions-row button {
        width: 100%;
        justify-content: center;
    }

    .integrity-top-sentence-item {
        flex-direction: column;
    }

    .integrity-top-sentence-score {
        width: auto;
        height: auto;
        padding: 0.2rem 0.5rem;
    }

    .integrity-distribution-legend {
        flex-direction: column;
        gap: 0.4rem;
    }

    .integrity-left-panel {
        max-height: 260px;
    }

    .integrity-panel-header {
        padding: 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .integrity-agent-cards {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================================
   PLAGIARISM OVERLAY (card style like init-overlay)
   Shared by basic + deep plagiarism checks
   ============================================================ */
.iplag-overlay {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    animation: iplag-fadeIn 0.4s ease;
}

[data-theme="dark"] .iplag-overlay {
    background: rgba(15, 23, 42, 0.94);
}

@keyframes iplag-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.iplag-modal {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 24px;
    padding: 42px 40px;
    text-align: center;
    max-width: 460px;
    width: 90%;
    box-shadow: 0 25px 60px rgba(0,0,0,0.12);
    animation: iplag-modalIn 0.5s ease-out;
}

[data-theme="dark"] .iplag-modal {
    box-shadow: 0 25px 60px rgba(0,0,0,0.4);
}

@keyframes iplag-modalIn {
    from { opacity: 0; transform: scale(0.92) translateY(16px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.iplag-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: rgba(99, 102, 241, 0.1);
    margin-bottom: 16px;
    animation: iplag-logoPulse 2s ease-in-out infinite;
}

.iplag-logo svg {
    stroke: var(--info, #3B82F6);
}

.iplag-logo.deep {
    background: rgba(245, 158, 11, 0.1);
}

.iplag-logo.deep svg {
    stroke: #F59E0B;
}

[data-theme="dark"] .iplag-logo {
    background: rgba(99, 102, 241, 0.2);
}

[data-theme="dark"] .iplag-logo.deep {
    background: rgba(245, 158, 11, 0.2);
}

@keyframes iplag-logoPulse {
    0%, 100% { transform: scale(1); filter: drop-shadow(0 0 8px rgba(59,130,246,0.3)); }
    50% { transform: scale(1.06); filter: drop-shadow(0 0 20px rgba(59,130,246,0.4)); }
}

.iplag-title {
    color: var(--text-primary, #111827);
    font-size: 1.6rem;
    font-weight: 700;
    margin: 0 0 6px 0;
    letter-spacing: 0.5px;
}

.iplag-subtitle {
    color: var(--text-secondary, #6b7280);
    font-size: 0.95rem;
    margin: 0 0 28px 0;
}

/* Progress bar */
.iplag-progress-container {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.iplag-progress-bar {
    flex: 1;
    height: 8px;
    background: var(--border-color, #e5e7eb);
    border-radius: 4px;
    overflow: hidden;
}

.iplag-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--info, #3B82F6) 0%, #6366F1 50%, var(--success, #10B981) 100%);
    background-size: 200% 100%;
    border-radius: 4px;
    transition: width 0.4s ease;
    animation: iplag-progressGradient 3s linear infinite;
}

@keyframes iplag-progressGradient {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.iplag-progress-text {
    color: var(--info, #3B82F6);
    font-size: 0.85rem;
    font-weight: 600;
    min-width: 70px;
    white-space: nowrap;
}

/* Steps */
.iplag-steps {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 20px;
}

.iplag-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 16px;
    background: var(--bg-tertiary, #f9fafb);
    border-radius: 12px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}

.iplag-step.pending {
    opacity: 0.45;
}

.iplag-step.active {
    background: rgba(59, 130, 246, 0.08);
    border-color: var(--info, #3B82F6);
}

.iplag-step.completed {
    background: rgba(16, 185, 129, 0.08);
    border-color: var(--success, #10B981);
}

[data-theme="dark"] .iplag-step {
    background: var(--bg-secondary, #131C31);
}

[data-theme="dark"] .iplag-step.active {
    background: rgba(59, 130, 246, 0.15);
}

[data-theme="dark"] .iplag-step.completed {
    background: rgba(16, 185, 129, 0.15);
}

.iplag-step-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: var(--border-color, #e5e7eb);
    transition: all 0.3s;
}

.iplag-step.active .iplag-step-icon {
    background: var(--info, #3B82F6);
    animation: iplag-stepPulse 1.2s ease-in-out infinite;
}

.iplag-step.completed .iplag-step-icon {
    background: var(--success, #10B981);
}

@keyframes iplag-stepPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.4); }
    50% { box-shadow: 0 0 0 8px rgba(59, 130, 246, 0); }
}

.iplag-step-label {
    color: var(--text-primary, #111827);
    font-size: 0.9rem;
    text-align: left;
    flex: 1;
}

.iplag-step.pending .iplag-step-label {
    color: var(--text-muted, #9ca3af);
}

.iplag-step-status {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.iplag-step.active .iplag-step-status {
    border: 2.5px solid var(--border-color, #d1d5db);
    border-top-color: var(--info, #3B82F6);
    border-radius: 50%;
    animation: integrity-spin 0.8s linear infinite;
}

.iplag-step.completed .iplag-step-status::after {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--success, #10B981);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
    background-size: 14px;
    background-repeat: no-repeat;
    background-position: center;
}

/* Current task label */
.iplag-current-task {
    color: var(--text-secondary, #6b7280);
    font-size: 0.85rem;
    font-style: italic;
    min-height: 20px;
}

/* ============================================================
   DEEP HEMISYNC+ PLAGIARISM STYLES
   ============================================================ */

/* Deep section separator */
.integrity-deep-section {
    border-top: 2px solid transparent;
    border-image: linear-gradient(90deg, #F59E0B, #D97706, #8B5CF6) 1;
    padding-top: 0.75rem;
    margin-top: 0.5rem;
}

/* Agent analysis cards */
.integrity-agent-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.integrity-agent-card {
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 10px;
    padding: 0.9rem 1rem;
    border-left: 4px solid;
    transition: box-shadow 0.2s;
}

.integrity-agent-card:hover {
    box-shadow: 0 2px 10px rgba(0,0,0,0.06);
}

.integrity-agent-card.semantic { border-left-color: #3B82F6; }
.integrity-agent-card.citation { border-left-color: #22C55E; }
.integrity-agent-card.structural { border-left-color: #8B5CF6; }

.integrity-agent-card-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}

.integrity-agent-card-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    flex-shrink: 0;
}

.integrity-agent-card-icon.semantic { background: #3B82F6; }
.integrity-agent-card-icon.citation { background: #22C55E; }
.integrity-agent-card-icon.structural { background: #8B5CF6; }

.integrity-agent-card-title {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary, #1f2937);
}

.integrity-agent-card-text {
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    line-height: 1.55;
}

/* Deep plagiarism button */
.integrity-deep-plagiarism-btn {
    background: linear-gradient(135deg, #F59E0B, #D97706);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    transition: all 0.2s;
}

.integrity-deep-plagiarism-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 3px 10px rgba(245,158,11,0.35);
}

.integrity-deep-plagiarism-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Per-sentence plagiarism view */
.integrity-plag-sentences {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.integrity-plag-sentence {
    display: flex;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    cursor: pointer;
}

.integrity-plag-sentence:hover {
    box-shadow: 0 1px 6px rgba(0,0,0,0.06);
}

.integrity-plag-sentence-header {
    display: flex;
    align-items: stretch;
    gap: 0;
    cursor: pointer;
    user-select: none;
}

.integrity-plag-sentence-bar {
    width: 5px;
    flex-shrink: 0;
    border-radius: 0;
}

.integrity-plag-sentence-body,
.integrity-plag-sentence-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.6rem 0.85rem;
    min-width: 0;
}

.integrity-plag-sentence-text {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.82rem;
    line-height: 1.5;
    color: var(--text-primary, #1f2937);
}

.integrity-plag-sentence-text > span:first-child {
    flex: 1;
    min-width: 0;
}

.integrity-plag-score-pill {
    padding: 0.15rem 0.55rem;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    flex-shrink: 0;
    white-space: nowrap;
}

.integrity-plag-expand-icon {
    font-size: 0.7rem;
    color: var(--text-secondary, #9ca3af);
    transition: transform 0.3s;
    flex-shrink: 0;
}

.integrity-plag-sentence.expanded .integrity-plag-expand-icon {
    transform: rotate(180deg);
}

.integrity-plag-sources {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0 0.85rem 0 0.85rem;
    margin-left: 5px;
    border-top: 0 solid transparent;
}

.integrity-plag-sources.expanded {
    max-height: 600px;
    padding: 0.6rem 0.85rem 0.75rem 0.85rem;
    border-top: 1px solid var(--border-color, #e5e7eb);
}

.integrity-plag-analysis {
    font-size: 0.78rem;
    color: var(--text-secondary, #6b7280);
    margin-bottom: 0.5rem;
    font-style: italic;
    line-height: 1.45;
}

.integrity-plag-source-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.integrity-plag-source-item {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.4rem 0.65rem;
    background: var(--bg-secondary, #f9fafb);
    border-radius: 6px;
    font-size: 0.78rem;
    flex-wrap: wrap;
}

.integrity-plag-source-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.integrity-plag-source-meta {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.integrity-plag-source-title {
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    flex: 1;
    min-width: 100px;
}

.integrity-plag-source-author {
    font-size: 0.74rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
}

.integrity-plag-source-url {
    color: #6366F1;
    text-decoration: none;
    font-size: 0.72rem;
    max-width: 280px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.integrity-plag-source-excerpt {
    font-size: 0.74rem;
    color: var(--text-secondary, #6b7280);
    font-style: italic;
    margin-top: 0.2rem;
    padding: 0.25rem 0.5rem;
    background: rgba(99, 102, 241, 0.05);
    border-radius: 4px;
    border-left: 2px solid #6366F1;
    line-height: 1.4;
}

.integrity-plag-source-url:hover {
    text-decoration: underline;
}

.integrity-plag-sim-badge {
    padding: 0.1rem 0.4rem;
    border-radius: 4px;
    font-size: 0.68rem;
    font-weight: 700;
    background: #FEE2E2;
    color: #991B1B;
    flex-shrink: 0;
}

.integrity-plag-type-badge {
    padding: 0.1rem 0.45rem;
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 600;
    flex-shrink: 0;
}

.integrity-plag-type-badge.direct { background: #FEE2E2; color: #991B1B; }
.integrity-plag-type-badge.paraphrase { background: #FEF9C3; color: #854D0E; }
.integrity-plag-type-badge.structure { background: #E0E7FF; color: #3730A3; }

/* Global sources in deep mode */
.integrity-global-source-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.55rem 0.85rem;
    background: var(--card-bg, #fff);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    margin-bottom: 0.4rem;
}

.integrity-global-source-title {
    flex: 1;
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text-primary, #1f2937);
}

.integrity-global-source-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-secondary, #6b7280);
    flex-shrink: 0;
}

/* Deep plagiarism circular gauges — reuses .integrity-gauge-svg/.bg/.fill/.text/.percent from main gauge */
.integrity-deep-gauges {
    display: flex;
    justify-content: center;
    gap: 3rem;
    margin-bottom: 1.5rem;
    padding: 1.25rem 0;
}

.integrity-deep-gauge {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.integrity-deep-gauge-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.integrity-deep-gauge-label {
    font-size: 0.82rem;
    color: var(--text-secondary, #6b7280);
    font-weight: 600;
    text-align: center;
}

/* Deep results container */
.integrity-deep-results {
    padding: 0.5rem 0;
}

.integrity-plag-sentences-list {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.integrity-global-sources-list {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

/* Dark mode overrides — Deep Hemisync+ */
[data-theme="dark"] .integrity-agent-card {
    background: var(--card-bg, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-agent-card-body {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .integrity-plag-sentence {
    border-color: var(--border-color, #374151);
    background: var(--card-bg, #1f2937);
}

[data-theme="dark"] .integrity-plag-sentence-text {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .integrity-plag-source-item {
    background: var(--bg-tertiary, #111827);
}

[data-theme="dark"] .integrity-plag-source-title {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .integrity-plag-source-url {
    color: #818CF8;
}

[data-theme="dark"] .integrity-plag-analysis {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .integrity-plag-sim-badge {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

[data-theme="dark"] .integrity-plag-type-badge.direct {
    background: rgba(239, 68, 68, 0.2);
    color: #FCA5A5;
}

[data-theme="dark"] .integrity-plag-type-badge.paraphrase {
    background: rgba(234, 179, 8, 0.2);
    color: #FDE68A;
}

[data-theme="dark"] .integrity-plag-type-badge.structure {
    background: rgba(99, 102, 241, 0.2);
    color: #A5B4FC;
}

[data-theme="dark"] .integrity-global-source-item {
    background: var(--card-bg, #1f2937);
    border-color: var(--border-color, #374151);
}

[data-theme="dark"] .integrity-deep-gauge-label {
    color: var(--text-secondary, #9ca3af);
}

[data-theme="dark"] .integrity-deep-results {
    color: var(--text-primary, #e5e7eb);
}

[data-theme="dark"] .integrity-deep-section {
    border-image: linear-gradient(90deg, #D97706, #F59E0B, #8B5CF6) 1;
}

[data-theme="dark"] .integrity-plag-source-author {
    color: #9ca3af;
}

[data-theme="dark"] .integrity-plag-source-excerpt {
    background: rgba(99, 102, 241, 0.12);
    color: #a5b4fc;
    border-left-color: #818CF8;
}

[data-theme="dark"] .integrity-plag-sources {
    border-top-color: var(--border-color, #374151);
}
