/* navigator_deep_dive.css — Deep Dive panel styling.
 *
 * Mirrors rip-reference/rip/frontend/src/components/blocks/blocks.css
 * but uses the Navigator app's existing CSS vars (--accent, --text,
 * --border, etc.) so the visual language matches the rest of the
 * Navigator. Mindfrog-red is hard-coded only where the brand spec
 * is unambiguous (verbatim card left rule, evidence-weight badge
 * background, section-header rule). */


/* ── Container ──────────────────────────────────────────────────────── */

.nav-dd-empty,
.nav-dd-generating,
.nav-dd-document {
    padding: 28px 30px 36px;
    color: var(--text);
}


/* ── Empty state (topic form) ───────────────────────────────────────── */

.nav-dd-description {
    margin: 0 0 22px;
    color: var(--text-secondary);
    line-height: 1.55;
    max-width: 680px;
}
.nav-dd-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 680px;
    margin-bottom: 16px;
}
.nav-dd-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}
.nav-dd-topic-input {
    padding: 11px 14px;
    font-size: 0.95rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
}
.nav-dd-topic-input:focus {
    border-color: var(--accent);
    outline: 2px solid rgba(232, 53, 36, 0.18);
    outline-offset: -1px;
}
.nav-dd-generate-btn {
    align-self: flex-start;
    margin-top: 4px;
}
.nav-dd-error {
    margin-top: 14px;
    padding: 12px 16px;
    background: rgba(220, 38, 38, 0.08);
    border-left: 4px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
    font-size: 0.92rem;
    max-width: 680px;
}


/* ── Generating state ────────────────────────────────────────────────── */

.nav-dd-current-topic {
    font-size: 0.92rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}
.nav-dd-current-topic strong {
    color: var(--text);
    font-weight: 600;
    margin-right: 4px;
}
.nav-dd-progress {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 24px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 10px;
    max-width: 680px;
}
.nav-dd-spinner {
    width: 22px;
    height: 22px;
    border: 3px solid var(--bg-card);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: nav-dd-spin 0.9s linear infinite;
    flex-shrink: 0;
}
@keyframes nav-dd-spin {
    to { transform: rotate(360deg); }
}
.nav-dd-phase {
    font-size: 0.95rem;
    color: var(--text);
    line-height: 1.4;
}


/* ── Complete state — document layout ────────────────────────────────── */

.nav-dd-doc-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 22px;
}
.nav-dd-topic-label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.nav-dd-doc-title {
    margin: 0;
    font-size: 1.55rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
}
.nav-dd-new-btn {
    flex-shrink: 0;
}


/* ── Blocks (shared rhythm) ──────────────────────────────────────────── */

.nav-dd-block {
    margin-bottom: 22px;
}
.nav-dd-block:last-child {
    margin-bottom: 0;
}


/* ── Text block (markdown) ───────────────────────────────────────────── */

.nav-dd-text p {
    margin: 0 0 14px;
    line-height: 1.6;
    font-size: 0.96rem;
    color: var(--text);
}
.nav-dd-text p:last-child {
    margin-bottom: 0;
}
.nav-dd-text-h {
    margin: 18px 0 10px;
    line-height: 1.3;
    font-weight: 600;
    color: var(--text);
}
.nav-dd-text-h:first-child {
    margin-top: 0;
}
.nav-dd-text h3 { font-size: 1.15rem; }
.nav-dd-text h4 { font-size: 1.05rem; }
.nav-dd-text-list {
    margin: 0 0 14px;
    padding-left: 22px;
    line-height: 1.55;
}
.nav-dd-text-list li {
    margin-bottom: 4px;
}
.nav-dd-text-code {
    background: var(--bg-input);
    padding: 1px 5px;
    border-radius: 3px;
    font-size: 0.88em;
    font-family: var(--font-mono, "JetBrains Mono", monospace);
}
.nav-dd-text-hr {
    border: none;
    border-top: 1px solid var(--border);
    margin: 18px 0;
}


/* ── Section header (red rule under) ────────────────────────────────── */

.nav-dd-section-header {
    margin: 32px 0 16px;
}
.nav-dd-section-title {
    margin: 0 0 8px;
    font-size: 1.3rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text);
}
.nav-dd-section-rule {
    border: none;
    border-top: 3px solid #E83524;   /* Mindfrog Red */
    margin: 0;
}


/* ── Chart block ─────────────────────────────────────────────────────── */

.nav-dd-chart {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px 20px;
}
.nav-dd-chart-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--text);
}
.nav-dd-chart-canvas {
    width: 100%;
    min-height: 320px;
}
.nav-dd-chart-source {
    margin-top: 12px;
    font-size: 0.78rem;
    color: var(--text-secondary);
    border-top: 1px solid var(--border);
    padding-top: 8px;
}
.nav-dd-chart-fallback {
    padding: 24px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.88rem;
    background: var(--bg-input);
    border-radius: 6px;
}


/* ── Verbatim block ──────────────────────────────────────────────────── */

.nav-dd-verbatim {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.nav-dd-verbatim-card {
    margin: 0;
    background: var(--bg-card);
    border-left: 4px solid #E83524;   /* Mindfrog Red */
    border-radius: 0 8px 8px 0;
    padding: 14px 18px;
}
.nav-dd-verbatim-text {
    font-style: italic;
    line-height: 1.55;
    color: var(--text);
}
.nav-dd-verbatim-text::before { content: '"'; }
.nav-dd-verbatim-text::after  { content: '"'; }
.nav-dd-verbatim-source {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}
.nav-dd-verbatim-speaker {
    font-weight: 600;
    color: var(--text);
}
.nav-dd-verbatim-sep { color: var(--text-muted); }
.nav-dd-verbatim-illustrative {
    background: transparent;
    border-left: 4px dashed var(--text-muted);
    color: var(--text-secondary);
}
.nav-dd-verbatim-illustrative .nav-dd-verbatim-text {
    color: var(--text-secondary);
}


/* ── Evidence weight badge ──────────────────────────────────────────── */

.nav-dd-evidence {
    background: #E83524;   /* Mindfrog Red */
    color: #ffffff;
    border-radius: 8px;
    padding: 12px 16px;
}
.nav-dd-evidence-claim {
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-weight: 600;
    font-size: 0.88rem;
    margin-bottom: 8px;
    color: #ffffff;
}
.nav-dd-evidence-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.88);
}
.nav-dd-evidence-contradict {
    color: #ffffff;
    font-weight: 700;
}
.nav-dd-evidence-chips {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.nav-dd-evidence-chip {
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    background: #ffffff;
    color: #B82A1C;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.7rem;
}


/* ── Convergence flag ───────────────────────────────────────────────── */

.nav-dd-convergence-wrap {
    border-left: 4px solid;
    border-radius: 6px;
    padding: 12px 16px;
}
.nav-dd-convergence {
    border-color: #16a34a;
    background: rgba(22, 163, 74, 0.06);
}
.nav-dd-divergence {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.08);
}
.nav-dd-convergence-header {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.92rem;
    margin-bottom: 4px;
}
.nav-dd-convergence-icon {
    display: inline-flex;
    width: 22px;
    height: 22px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: 700;
    background: #ffffff;
}
.nav-dd-convergence .nav-dd-convergence-icon { color: #16a34a; }
.nav-dd-divergence  .nav-dd-convergence-icon { color: #d97706; }
.nav-dd-convergence-label {
    font-weight: 600;
    color: var(--text);
}
.nav-dd-convergence-studies {
    color: var(--text-secondary);
    font-size: 0.85rem;
}
.nav-dd-convergence-message {
    margin: 0;
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--text);
}


/* ── Source attribution (footer) ────────────────────────────────────── */

.nav-dd-source-attribution {
    margin-top: 24px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    font-size: 0.82rem;
    color: var(--text-secondary);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nav-dd-source-label {
    font-weight: 600;
    color: var(--text);
}
.nav-dd-source-item {
    color: var(--accent);
}
.nav-dd-source-sep { color: var(--text-muted); }


/* ── Lifted markdown table (TableBlock) ─────────────────────────────── */

.nav-dd-table-wrap {
    overflow-x: auto;
}
.nav-dd-table {
    border-collapse: collapse;
    width: 100%;
    font-size: 0.9rem;
}
.nav-dd-table th,
.nav-dd-table td {
    border: 1px solid var(--border);
    padding: 8px 12px;
    text-align: left;
    vertical-align: top;
}
.nav-dd-table thead th {
    background: var(--bg-input);
    font-weight: 600;
}
.nav-dd-table tbody tr:nth-child(even) td {
    background: var(--bg-input);
}


/* ── Error block ─────────────────────────────────────────────────────── */

.nav-dd-block-error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    background: rgba(220, 38, 38, 0.08);
    border-left: 4px solid #dc2626;
    border-radius: 6px;
    color: #991b1b;
}
.nav-dd-error-icon { font-size: 1.05rem; line-height: 1; }
.nav-dd-error-message { line-height: 1.5; }


/* ── Chat-bubble overrides when the assistant turn is block-rendered ─
 *
 * Quick Query now routes every assistant turn through the block
 * renderer (text + chart + verbatim + evidence_weight + ...) the same
 * way RIP does. The block-mode bubble keeps the chat-bubble background
 * but inherits block typography from the .nav-dd-* classes inside.
 * Without these overrides, .nav-chat-bubble's tight font-size and
 * line-height bleed into the block styling and crowd the chart /
 * verbatim cards. */
.nav-chat-bubble-blocks {
    font-size: 0.95rem;
    line-height: 1.55;
    padding: 14px 18px;
}
.nav-chat-bubble-blocks .nav-dd-block {
    margin-bottom: 14px;
}
.nav-chat-bubble-blocks .nav-dd-block:last-child {
    margin-bottom: 0;
}
.nav-chat-bubble-blocks .nav-dd-text p:last-child {
    margin-bottom: 0;
}


/* ── Unknown / fallback block ───────────────────────────────────────── */

.nav-dd-unknown-block {
    font-size: 0.75rem;
    padding: 10px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow-x: auto;
    color: var(--text-secondary);
}

/* Suggested Deep Dives — objective-anchored prompt chips (spec B §2c) */
.nav-dd-suggestions {
    margin-bottom: 16px;
}
.nav-dd-suggestions-label {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 8px;
}
.nav-dd-suggestion-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nav-dd-suggestion-chip {
    appearance: none;
    cursor: pointer;
    text-align: left;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 6px 12px;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.3;
}
.nav-dd-suggestion-chip:hover {
    border-color: var(--accent);
    color: var(--text);
}
