/* ==========================================================================
   ValidAí - Validador de Documentos e Textos (PDF, DOCX, TXT)
   Padronizado 100% com o Validador de Planilhas (style.css)
   Paleta Oficial Esverdeada (#4FD580 | #6AE099 | #86EAB1 | #A1F5CA | #BCFFE2)
   ========================================================================== */

/* Botão "Procurar arquivo" dentro da Dropzone */
.doc-browse-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 12px;
    padding: 7px 16px;
    border-radius: 9999px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    color: var(--text-main);
    font-size: 12.5px;
    font-weight: 600;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s ease;
}

.dropzone:hover .doc-browse-pill {
    background: #BCFFE2;
    border-color: #4FD580;
    color: #0f172a;
    transform: translateY(-1px);
}

.dropzone.has-file {
    border-color: var(--success);
    background: #f0fdf4;
}

/* ==========================================================================
   Grid de Colar Texto Manualmente (Com bordas visíveis no card e onde digita)
   ========================================================================== */
.paste-text-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 24px;
}

.paste-box {
    display: flex;
    flex-direction: column;
    background: #f8fafc;
    border: 2px dashed #cbd5e1;
    border-radius: var(--radius-md);
    padding: 16px;
    transition: all 0.2s ease;
}

.paste-box:hover {
    border-color: #94a3b8;
}

.paste-box:focus-within {
    border-style: solid;
    border-color: #4FD580;
    background: #f0fdf4;
    box-shadow: 0 0 0 3px rgba(79, 213, 128, 0.15);
}

.paste-box-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 10px;
    gap: 8px;
}

.paste-box-header label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    cursor: pointer;
}

.paste-counter {
    font-size: 11.5px;
    font-weight: 600;
    color: var(--text-muted);
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 3px 10px;
    border-radius: 9999px;
}

.doc-textarea {
    width: 100%;
    min-height: 210px;
    padding: 14px;
    border: 1.5px solid #cbd5e1;
    border-radius: var(--radius-sm);
    outline: none;
    resize: vertical;
    background: #ffffff;
    color: var(--text-main);
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    line-height: 1.6;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.03);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.doc-textarea:hover {
    border-color: #94a3b8;
}

.doc-textarea:focus {
    border-color: #4FD580;
    box-shadow: 0 0 0 3px rgba(79, 213, 128, 0.22);
}

.doc-textarea::placeholder {
    color: var(--text-muted);
    opacity: 0.75;
}

/* ==========================================================================
   Seletor de Modo de Exibição (Rich text | Redline | Plain text)
   Dentro de .tolerance-box padronizado com o Validador de Planilhas
   ========================================================================== */
.doc-mode-section {
    margin-bottom: 24px;
}

.doc-mode-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

.doc-mode-card {
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border-color);
    background: #ffffff;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    position: relative;
    box-shadow: var(--shadow-sm);
}

.doc-mode-card:hover {
    border-color: #6AE099;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.doc-mode-card.active {
    border-color: #4FD580;
    box-shadow: 0 0 0 3px rgba(79, 213, 128, 0.22);
}

/* Ilustração Miniatura dos Modos */
.doc-mode-preview {
    height: 110px;
    background: #f1f5f9;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    gap: 10px;
    padding: 14px 16px 0 16px;
    overflow: hidden;
}

.doc-mode-card.active .doc-mode-preview {
    background: #ecfdf5;
    border-bottom-color: #a7f3d0;
}

.mini-page {
    width: 46%;
    height: 92px;
    background: #ffffff;
    border: 1px solid #cbd5e1;
    border-bottom: none;
    border-radius: 6px 6px 0 0;
    padding: 8px 8px 0 8px;
    display: flex;
    flex-direction: column;
    gap: 5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.mini-page-single {
    width: 68%;
}

.mini-line {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    color: var(--text-muted);
    display: block;
    line-height: 1.2;
}

.mini-tag {
    display: inline-block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 9.5px;
    font-weight: 600;
    padding: 1px 5px;
    border-radius: 3px;
    width: fit-content;
    line-height: 1.25;
}

.mini-tag.tag-removed {
    background: #fee2e2;
    color: #dc2626;
}

.mini-tag.tag-removed.strike {
    text-decoration: line-through;
}

.mini-tag.tag-added {
    background: #dcfce7;
    color: #15803d;
}

.mini-block-accent {
    margin-top: auto;
    height: 20px;
    border-radius: 3px 3px 0 0;
    width: 100%;
}

.mini-block-accent.removed {
    background: linear-gradient(180deg, rgba(239, 68, 68, 0.22) 0%, rgba(239, 68, 68, 0.06) 100%);
    border-top: 2px solid rgba(239, 68, 68, 0.45);
}

.mini-block-accent.added {
    background: linear-gradient(180deg, rgba(79, 213, 128, 0.32) 0%, rgba(79, 213, 128, 0.08) 100%);
    border-top: 2px solid #4FD580;
}

.doc-mode-info {
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.doc-mode-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.doc-mode-info h4,
.doc-mode-info h5 {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-main);
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0;
}

.mode-pill-tag {
    font-size: 9.5px;
    font-weight: 800;
    padding: 2px 7px;
    border-radius: 9999px;
    background: #BCFFE2;
    color: #065f46;
    letter-spacing: 0.03em;
}

.doc-mode-check {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 800;
    border: 1.5px solid #cbd5e1;
    color: transparent;
    transition: all 0.2s ease;
}

.doc-mode-card.active .doc-mode-check {
    background: linear-gradient(135deg, #4FD580, #6AE099);
    border-color: #4FD580;
    color: #052e16;
}

.doc-mode-info p {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.45;
    margin: 0;
}

/* ==========================================================================
   Barra de Ferramentas e Legenda do Visualizador de Diferenças
   ========================================================================== */
.text-viewer-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 14px;
    padding: 12px 16px;
    background: #f8fafc;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 12px;
}

.viewer-mode-pills {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.toolbar-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text-main);
}

.viewer-pill-group {
    background: #ffffff;
    border: 1px solid var(--border-color);
    padding: 3px;
    border-radius: 9999px;
    display: inline-flex;
    gap: 4px;
}

.viewer-mode-btn {
    padding: 6px 14px;
    border-radius: 9999px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 12.5px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.viewer-mode-btn:hover {
    color: var(--text-main);
    background: #f1f5f9;
}

.viewer-mode-btn.active {
    background: linear-gradient(120deg, #4FD580, #6AE099);
    color: #052e16;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(79, 213, 128, 0.3);
}

.viewer-right-controls {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

/* Botão "Exibir apenas diferenças" com checkbox padronizado */
.viewer-only-diff-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-main);
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 7px 12px;
    cursor: pointer;
    user-select: none;
    transition: border-color 0.15s ease;
}

.viewer-only-diff-toggle:hover {
    border-color: #cbd5e1;
}

.viewer-only-diff-toggle input[type="checkbox"] {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border: 1.5px solid #cbd5e1;
    border-radius: 4px;
    background-color: #ffffff;
    cursor: pointer;
    display: inline-grid;
    place-content: center;
    transition: all 0.15s ease;
    margin: 0;
    flex-shrink: 0;
}

.viewer-only-diff-toggle input[type="checkbox"]:checked {
    background: linear-gradient(135deg, #4FD580, #6AE099);
    border-color: #4FD580;
}

.viewer-only-diff-toggle input[type="checkbox"]:checked::before {
    content: "";
    width: 9px;
    height: 5px;
    border-left: 2px solid #ffffff;
    border-bottom: 2px solid #ffffff;
    transform: rotate(-45deg) translate(1px, -1px);
}

/* Legenda de Cores */
.diff-legend-bar {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding: 8px 14px;
    margin-bottom: 12px;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-muted);
}

.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.legend-dot {
    width: 12px;
    height: 12px;
    border-radius: 3px;
    display: inline-block;
}

.legend-dot.removed {
    background: #fee2e2;
    border: 1.5px solid #dc2626;
}

.legend-dot.added {
    background: #dcfce7;
    border: 1.5px solid #16a34a;
}

.legend-dot.modified {
    background: #fef3c7;
    border: 1.5px solid #d97706;
}

/* ==========================================================================
   Container Principal de Visualização (Rich Text / Redline / Plain Text)
   Com bordas bem definidas igual às tabelas do Validador de Planilhas
   ========================================================================== */
.text-diff-viewer-container {
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

/* Destaques Inline de Palavras/Caracteres */
.diff-tok-del {
    background-color: #fecaca;
    color: #991b1b;
    text-decoration: line-through;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 600;
}

.diff-tok-ins {
    background-color: #a7f3d0;
    color: #065f46;
    text-decoration: none;
    padding: 1px 4px;
    border-radius: 3px;
    font-weight: 700;
}

/* 1. MODO RICH TEXT (2 Documentos Lado a Lado com Cabeçalho Padronizado) */
.rich-doc-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.rich-doc-pane {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.rich-doc-pane:first-child {
    border-right: 1px solid var(--border-color);
}

.rich-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 11px 16px;
    background: #4FD580;
    border-bottom: 2px solid #6AE099;
    font-size: 13px;
    font-weight: 700;
    color: #052e16;
}

.rich-doc-badge {
    font-size: 11px;
    font-weight: 700;
    padding: 2px 9px;
    border-radius: 9999px;
    background: rgba(5, 46, 22, 0.14);
    color: #052e16;
}

.rich-doc-body {
    max-height: 540px;
    overflow-y: auto;
    padding: 6px 0;
}

.rich-line-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 14px;
    font-size: 13.5px;
    line-height: 1.6;
    color: var(--text-main);
    border-left: 3.5px solid transparent;
    border-bottom: 1px solid #f1f5f9;
}

.rich-line-row.line-delete {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.rich-line-row.line-insert {
    background: #f0fdf4;
    border-left-color: #4FD580;
}

.rich-line-row.line-replace-a {
    background: #fff1f2;
    border-left-color: #f59e0b;
}

.rich-line-row.line-replace-b {
    background: #ecfdf5;
    border-left-color: #4FD580;
}

.rich-line-row.line-empty-slot {
    background: repeating-linear-gradient(
        -45deg,
        #f8fafc,
        #f8fafc 6px,
        #f1f5f9 6px,
        #f1f5f9 12px
    );
    color: var(--text-muted);
    min-height: 33px;
}

.rich-line-num {
    width: 38px;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11.5px;
    color: var(--text-muted);
    user-select: none;
    padding-right: 10px;
    text-align: right;
    font-weight: 600;
}

.rich-line-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 2. MODO REDLINE (Documento Único Compilado) */
.redline-doc-wrapper {
    background: #f8fafc;
    padding: 20px;
}

.redline-doc-sheet {
    max-width: 920px;
    margin: 0 auto;
    background: #ffffff;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.redline-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 11px 18px;
    background: #4FD580;
    border-bottom: 2px solid #6AE099;
    font-size: 13px;
    font-weight: 700;
    color: #052e16;
}

.redline-doc-body {
    max-height: 560px;
    overflow-y: auto;
    padding: 16px 20px;
}

.redline-line-row {
    display: flex;
    align-items: flex-start;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-main);
    border-left: 3.5px solid transparent;
    border-bottom: 1px solid #f1f5f9;
    margin-bottom: 2px;
}

.redline-line-row.line-delete {
    background: #fef2f2;
    border-left-color: #ef4444;
}

.redline-line-row.line-insert {
    background: #f0fdf4;
    border-left-color: #4FD580;
}

.redline-line-row.line-replace {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

.redline-line-nums {
    width: 72px;
    flex-shrink: 0;
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    user-select: none;
    padding-right: 12px;
}

.redline-line-text {
    flex: 1;
    min-width: 0;
    word-break: break-word;
    white-space: pre-wrap;
}

/* 3. MODO PLAIN TEXT (Linha a Linha Monospace com Cabeçalho Verde Padronizado) */
.plain-diff-wrapper {
    max-height: 560px;
    overflow: auto;
}

.plain-diff-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'JetBrains Mono', monospace;
    font-size: 12.5px;
    line-height: 1.55;
    table-layout: fixed;
}

.plain-diff-table th {
    position: sticky;
    top: 0;
    z-index: 5;
    background: #4FD580;
    color: #052e16;
    font-family: 'Outfit', 'Montserrat', sans-serif;
    font-size: 13px;
    font-weight: 700;
    padding: 11px 12px;
    text-align: left;
    border-bottom: 2px solid #6AE099;
}

.plain-diff-table td {
    padding: 6px 10px;
    vertical-align: top;
    border-bottom: 1px solid #f1f5f9;
    word-break: break-word;
    white-space: pre-wrap;
}

.plain-diff-table td:nth-child(3),
.plain-diff-table th:nth-child(3) {
    border-right: 1px solid var(--border-color);
}

.plain-col-num {
    width: 44px;
    text-align: right;
    color: var(--text-muted);
    background: #f8fafc;
    user-select: none;
    font-size: 11px;
    font-weight: 600;
}

.plain-col-sign {
    width: 26px;
    text-align: center;
    font-weight: 700;
    user-select: none;
}

.plain-col-text {
    width: calc(50% - 70px);
}

.plain-cell-delete {
    background: #fef2f2;
}

.plain-cell-insert {
    background: #f0fdf4;
}

.plain-cell-empty {
    background: #f8fafc;
}

/* Toast Flutuante de Erro */
.toast-error {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fef2f2;
    border: 1px solid #fca5a5;
    color: #991b1b;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    font-size: 13.5px;
    font-weight: 600;
}

.toast-close {
    background: none;
    border: none;
    color: #991b1b;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    margin-left: 6px;
}

/* ==========================================================================
   Modo Escuro Padronizado ([data-theme="dark"] e body.dark-theme)
   ========================================================================== */
[data-theme="dark"] .doc-browse-pill,
body.dark-theme .doc-browse-pill {
    background: #1c1e26;
    border-color: #2d313e;
    color: #e2e8f0;
}

[data-theme="dark"] .dropzone:hover .doc-browse-pill,
body.dark-theme .dropzone:hover .doc-browse-pill {
    background: rgba(79, 213, 128, 0.2);
    border-color: #4FD580;
    color: #86EAB1;
}

[data-theme="dark"] .dropzone.has-file,
body.dark-theme .dropzone.has-file {
    background: #17181f;
    border-color: #10b981;
}

[data-theme="dark"] .paste-box,
body.dark-theme .paste-box {
    background: #13141a;
    border-color: #2f3240;
}

[data-theme="dark"] .paste-box:hover,
body.dark-theme .paste-box:hover {
    border-color: #44485b;
}

[data-theme="dark"] .paste-box:focus-within,
body.dark-theme .paste-box:focus-within {
    border-color: #4FD580;
    background: #171a21;
}

[data-theme="dark"] .paste-counter,
body.dark-theme .paste-counter {
    background: #1c1e26;
    border-color: #2d313e;
    color: #94a3af;
}

[data-theme="dark"] .doc-textarea,
body.dark-theme .doc-textarea {
    background: #1c1e26;
    border-color: #2d313e;
    color: #f1f5f9;
}

[data-theme="dark"] .doc-textarea:hover,
body.dark-theme .doc-textarea:hover {
    border-color: #3f4357;
}

[data-theme="dark"] .doc-textarea:focus,
body.dark-theme .doc-textarea:focus {
    border-color: #4FD580;
    box-shadow: 0 0 0 3px rgba(79, 213, 128, 0.22);
}

[data-theme="dark"] .doc-mode-card,
body.dark-theme .doc-mode-card {
    background: #1c1e26;
    border-color: #282a36;
}

[data-theme="dark"] .doc-mode-card:hover,
body.dark-theme .doc-mode-card:hover {
    border-color: #4FD580;
}

[data-theme="dark"] .doc-mode-card.active,
body.dark-theme .doc-mode-card.active {
    border-color: #4FD580;
    background: #1e222b;
}

[data-theme="dark"] .doc-mode-preview,
body.dark-theme .doc-mode-preview {
    background: #13141a;
    border-bottom-color: #282a36;
}

[data-theme="dark"] .doc-mode-card.active .doc-mode-preview,
body.dark-theme .doc-mode-card.active .doc-mode-preview {
    background: rgba(79, 213, 128, 0.08);
    border-bottom-color: rgba(79, 213, 128, 0.25);
}

[data-theme="dark"] .mini-page,
body.dark-theme .mini-page {
    background: #1c1e26;
    border-color: #2f3240;
}

[data-theme="dark"] .mini-tag.tag-removed,
body.dark-theme .mini-tag.tag-removed {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

[data-theme="dark"] .mini-tag.tag-added,
body.dark-theme .mini-tag.tag-added {
    background: rgba(79, 213, 128, 0.25);
    color: #86EAB1;
}

[data-theme="dark"] .mode-pill-tag,
body.dark-theme .mode-pill-tag {
    background: rgba(79, 213, 128, 0.2);
    color: #86EAB1;
}

[data-theme="dark"] .doc-mode-check,
body.dark-theme .doc-mode-check {
    border-color: #3f4357;
}

[data-theme="dark"] .text-viewer-toolbar,
body.dark-theme .text-viewer-toolbar {
    background: #13141a;
    border-color: #272a36;
}

[data-theme="dark"] .viewer-pill-group,
body.dark-theme .viewer-pill-group {
    background: #1c1e26;
    border-color: #2d313e;
}

[data-theme="dark"] .viewer-mode-btn:hover,
body.dark-theme .viewer-mode-btn:hover {
    background: #252836;
    color: #f1f5f9;
}

[data-theme="dark"] .viewer-mode-btn.active,
body.dark-theme .viewer-mode-btn.active {
    background: linear-gradient(120deg, #4FD580, #6AE099);
    color: #052e16;
}

[data-theme="dark"] .viewer-only-diff-toggle,
body.dark-theme .viewer-only-diff-toggle {
    background: #1c1e26;
    border-color: #2d313e;
    color: #f1f5f9;
}

[data-theme="dark"] .diff-legend-bar,
body.dark-theme .diff-legend-bar {
    background: #13141a;
    border-color: #272a36;
}

[data-theme="dark"] .text-diff-viewer-container,
body.dark-theme .text-diff-viewer-container,
[data-theme="dark"] .redline-doc-sheet,
body.dark-theme .redline-doc-sheet {
    background: #17181f;
    border-color: #272935;
}

[data-theme="dark"] .redline-doc-wrapper,
body.dark-theme .redline-doc-wrapper {
    background: #13141a;
}

[data-theme="dark"] .rich-doc-pane:first-child,
body.dark-theme .rich-doc-pane:first-child,
[data-theme="dark"] .plain-diff-table td:nth-child(3),
body.dark-theme .plain-diff-table td:nth-child(3) {
    border-right-color: #272935;
}

[data-theme="dark"] .rich-line-row,
body.dark-theme .rich-line-row,
[data-theme="dark"] .redline-line-row,
body.dark-theme .redline-line-row,
[data-theme="dark"] .plain-diff-table td,
body.dark-theme .plain-diff-table td {
    border-bottom-color: #232530;
}

[data-theme="dark"] .rich-line-row.line-delete,
body.dark-theme .rich-line-row.line-delete,
[data-theme="dark"] .redline-line-row.line-delete,
body.dark-theme .redline-line-row.line-delete,
[data-theme="dark"] .plain-cell-delete,
body.dark-theme .plain-cell-delete {
    background: rgba(239, 68, 68, 0.12);
}

[data-theme="dark"] .rich-line-row.line-insert,
body.dark-theme .rich-line-row.line-insert,
[data-theme="dark"] .redline-line-row.line-insert,
body.dark-theme .redline-line-row.line-insert,
[data-theme="dark"] .plain-cell-insert,
body.dark-theme .plain-cell-insert {
    background: rgba(79, 213, 128, 0.12);
}

[data-theme="dark"] .rich-line-row.line-replace-a,
body.dark-theme .rich-line-row.line-replace-a {
    background: rgba(239, 68, 68, 0.09);
}

[data-theme="dark"] .rich-line-row.line-replace-b,
body.dark-theme .rich-line-row.line-replace-b {
    background: rgba(79, 213, 128, 0.1);
}

[data-theme="dark"] .redline-line-row.line-replace,
body.dark-theme .redline-line-row.line-replace {
    background: rgba(245, 158, 11, 0.1);
}

[data-theme="dark"] .rich-line-row.line-empty-slot,
body.dark-theme .rich-line-row.line-empty-slot,
[data-theme="dark"] .plain-cell-empty,
body.dark-theme .plain-cell-empty,
[data-theme="dark"] .plain-col-num,
body.dark-theme .plain-col-num {
    background: #13141a;
}

[data-theme="dark"] .diff-tok-del,
body.dark-theme .diff-tok-del {
    background-color: rgba(239, 68, 68, 0.32);
    color: #fecaca;
}

[data-theme="dark"] .diff-tok-ins,
body.dark-theme .diff-tok-ins {
    background-color: rgba(79, 213, 128, 0.3);
    color: #a1f5ca;
}

/* Responsividade */
@media (max-width: 900px) {
    .doc-mode-cards {
        grid-template-columns: 1fr;
    }
    .paste-text-grid,
    .rich-doc-grid {
        grid-template-columns: 1fr;
    }
    .rich-doc-pane:first-child {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
}
