.nd-document-preview {
    flex: 2;
    min-width: 480px;
    display: none;
    flex-direction: column;
    border-left: 1px solid rgba(255,255,255,0.06);
    background: #0d0d14;
    overflow: hidden;
}
.nd-document-active .nd-document-preview { display: flex !important; }
.nd-document-active .nd-code-explorer    { display: none !important; }
.nd-document-active .nd-code-chat-panel  { flex: 0 0 360px; min-width: 0; }
.nd-document-active .nd-code-viewer      { display: none !important; }

.nd-doc-wrap {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.nd-doc-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 12px;
    height: 42px;
    flex-shrink: 0;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    position: relative;
    z-index: 10;
}
.nd-doc-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.nd-doc-icon {
    width: 26px;
    height: 26px;
    border-radius: 6px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.6);
    flex-shrink: 0;
}
.nd-doc-title {
    font-size: 12px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    line-height: 1.2;
}
.nd-doc-info {
    font-size: 10px;
    color: rgba(255,255,255,0.3);
}
.nd-doc-actions {
    display: flex;
    align-items: center;
    gap: 6px;
}
.nd-doc-drive-btn,
.nd-doc-export-btn {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 5px;
    border: 1px solid rgba(255,255,255,0.1);
    background: rgba(255,255,255,0.04);
    color: rgba(255,255,255,0.55);
    font-size: 11px;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    white-space: nowrap;
}
.nd-doc-drive-btn:not([disabled]):hover,
.nd-doc-export-btn:not([disabled]):hover {
    background: rgba(255,255,255,0.08);
    color: rgba(255,255,255,0.9);
    border-color: rgba(255,255,255,0.18);
}
.nd-doc-drive-btn[disabled],
.nd-doc-export-btn[disabled] { opacity: 0.35; cursor: not-allowed; }

.nd-doc-viewer {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nd-doc-empty {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 40px 20px;
}
.nd-doc-empty[hidden] { display: none; }
.nd-doc-empty-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(255,255,255,0.2);
}
.nd-doc-empty-label {
    font-size: 12px;
    color: rgba(255,255,255,0.35);
    text-align: center;
    line-height: 1.6;
    margin: 0;
}
.nd-doc-empty-hint {
    font-size: 10px;
    color: rgba(255,255,255,0.15);
}

.nd-doc-preview-area {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    background: #1a1a2a;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}
.nd-doc-preview-area[hidden] { display: none; }
.nd-doc-preview-area::-webkit-scrollbar { width: 8px; }
.nd-doc-preview-area::-webkit-scrollbar-track { background: #1a1a2a; }
.nd-doc-preview-area::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 4px; }
.nd-doc-preview-area::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

.nd-doc-paper {
    background: #fff;
    width: 100%;
    max-width: 720px;
    min-height: 400px;
    padding: 48px 56px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.4);
    border-radius: 2px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
    font-size: 13px;
    line-height: 1.7;
}

.nd-doc-paper .nd-doc-h1 {
    font-size: 22px;
    font-weight: bold;
    margin: 0 0 16px;
    border-bottom: 2px solid #e0e0e0;
    padding-bottom: 8px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-h2 {
    font-size: 17px;
    font-weight: bold;
    margin: 20px 0 8px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-h3 {
    font-size: 14px;
    font-weight: bold;
    margin: 16px 0 6px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-p {
    margin: 0 0 10px;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-ul,
.nd-doc-paper .nd-doc-ol {
    margin: 0 0 10px;
    padding-left: 24px;
}
.nd-doc-paper .nd-doc-ul li,
.nd-doc-paper .nd-doc-ol li {
    margin: 3px 0;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}
.nd-doc-paper .nd-doc-table th {
    background: #f0f0f0;
    padding: 6px 10px;
    border: 1px solid #ccc;
    font-weight: 600;
    text-align: left;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-table td {
    padding: 5px 10px;
    border: 1px solid #ddd;
    background: #fff;
    font-family: 'Georgia', 'Times New Roman', serif;
    color: #1a1a1a;
}
.nd-doc-paper .nd-doc-table tr:nth-child(even) td {
    background: #f9f9f9;
}
.nd-doc-paper .nd-doc-hr {
    border: none;
    border-top: 1px solid #ddd;
    margin: 16px 0;
}
.nd-doc-paper .nd-doc-quote {
    border-left: 3px solid #1a73e8;
    padding: 8px 16px;
    margin: 12px 0;
    background: #f0f4ff;
    color: #444;
    font-style: italic;
    border-radius: 0 4px 4px 0;
    font-family: 'Georgia', 'Times New Roman', serif;
}
.nd-doc-paper strong { font-weight: 700; }
.nd-doc-paper em { font-style: italic; }
.nd-doc-paper u { text-decoration: underline; }

.nd-doc-paper .nd-doc-pagebreak {
    border-top: 2px dashed #ccc;
    margin: 24px 0;
    text-align: center;
    color: #999;
    font-size: 10px;
    font-family: sans-serif;
}
.nd-doc-paper .nd-doc-pagebreak::after {
    content: '— Saut de page —';
}
