/* ============================================================
   PREVIEW.CSS — Right preview pane
   ============================================================ */

.preview-pane {
    background: #fff;
    border-radius: 10px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(15,23,42,0.04);
}

/* --- Header --- */
.preview-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 12px 18px;
    border-bottom: 1px solid #f1f5f9;
    flex-shrink: 0;
    gap: 12px;
}
.preview-header-left {
    flex: 1;
    min-width: 0;
}
.preview-title {
    font-weight: 600;
    font-size: 13px;
    color: #475569;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
    margin-bottom: 4px;
}
.preview-header-meta {
    display: flex;
    align-items: center;
    gap: 8px;
}
.preview-header-meta .doc-id { font-size: 11px; }
.preview-header-meta .status-pill { font-size: 10px; padding: 1px 6px; }
.preview-header-meta .trust-badge { font-size: 10px; padding: 1px 6px; }
.preview-header-meta .doc-date { font-size: 11px; }

/* Action button */
.preview-action-btn {
    padding: 5px 14px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.1s;
}
.preview-action-btn:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* Legacy action (old template) */
.preview-actions {
    display: flex;
    gap: 8px;
}
.preview-action {
    padding: 5px 14px;
    font-size: 12px;
    color: #64748b;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.1s;
}
.preview-action:hover {
    background: #f1f5f9;
    color: #2563eb;
    border-color: #bfdbfe;
}

/* --- Scrollable content --- */
.preview-scroll {
    flex: 1;
    overflow-y: auto;
    padding: 28px 32px;
    min-height: 0;
    position: relative;
}
.preview-scroll {
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}
.preview-scroll:hover {
    scrollbar-color: #cbd5e1 transparent;
}
.preview-scroll::-webkit-scrollbar { width: 6px; background: transparent; }
.preview-scroll::-webkit-scrollbar-track { background: transparent; }
.preview-scroll::-webkit-scrollbar-thumb {
    background: transparent;
    border-radius: 3px;
}
.preview-scroll:hover::-webkit-scrollbar-thumb { background: #cbd5e1; }
.preview-scroll::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* --- Content sections --- */
.preview-section {
    margin-bottom: 4px;
    padding: 14px 20px;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s;
}
.preview-section-label {
    font-size: 13px;
    font-weight: 700;
    color: #1e3a5f;
    margin-bottom: 6px;
    letter-spacing: -0.2px;
}
.preview-section-content {
    font-size: 15px;
    line-height: 1.85;
    color: #334155;
}

/* Matched/highlighted section */
.preview-section.highlight {
    background: #fffbeb;
    border-left-color: #f59e0b;
}

/* Punctuation-only sections (stray quotes/semicolons) */
.preview-section-punct {
    margin-bottom: 0;
    padding: 0 20px;
}
.preview-section-punct .preview-section-content {
    line-height: 1.2;
    color: #94a3b8;
    font-size: 0.8rem;
}

/* --- Placeholder (no selection) --- */
.preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 1;
    color: #94a3b8;
    font-size: 14px;
    text-align: center;
    padding: 40px;
}

/* --- Preview content area --- */
#preview-content {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Loading state */
.preview-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
}

/* Legal references inside preview */
.preview-section-content .legal-ref {
    color: #64748b;
    font-size: 0.9em;
}
.preview-section-content .attachment-header {
    color: #1e3a5f;
}
