/* ═══════════════════════════════════════════════════════════════
   CAM Lease Analyzer — Stylesheet
   Professional legal-tech look. Clean, trustworthy, competent.
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ── */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #1a365d;
    --primary-light: #2b4c7e;
    --primary-bg: #f0f4f8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --text: #1e293b;
    --text-muted: #64748b;
    --text-light: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #93c5fd;
    --bg: #ffffff;
    --bg-alt: #f8fafc;
    --success: #16a34a;
    --success-bg: #f0fdf4;
    --warning: #d97706;
    --warning-bg: #fffbeb;
    --danger: #dc2626;
    --danger-bg: #fef2f2;
    --info: #64748b;
    --info-bg: #f1f5f9;
    --critical-bg: #fef2f2;
    --high-bg: #fff7ed;
    --medium-bg: #fffbeb;
    --low-bg: #f1f5f9;
    --radius-sm: 0.25rem;
    --radius: 0.5rem;
    --radius-lg: 0.75rem;
    --shadow: 0 1px 3px rgba(0,0,0,0.1);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
    --transition: 0.2s ease;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --app-rail: 94vw;
    --wide-rail: 96vw;
    --app-side-pad: 2vw;
}

html {
    height: 100%;
}

body {
    font-family: var(--font);
    color: var(--text);
    background: var(--bg-alt);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Lock page scroll when results are showing — prevents sticky jitter */
body.results-active,
body:has(#state-results:not(.hidden)) {
    overflow: hidden;
    height: 100%;
}
html:has(#state-results:not(.hidden)) {
    overflow: hidden;
}

/* ── Layout ── */
.app-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    height: 100%;
}

.app-header {
    background: var(--primary);
    color: white;
    padding: 0.75rem var(--app-side-pad);
    display: flex;
    align-items: center;
    gap: 1rem;
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 100;
}

.app-header .logo {
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.app-header .tagline {
    font-size: 0.875rem;
    opacity: 0.8;
    border-left: 1px solid rgba(255,255,255,0.3);
    padding-left: 1rem;
}

.app-header .expiry-notice {
    margin-left: auto;
    margin-right: 1rem;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.7);
    white-space: nowrap;
}
.app-header .expiry-notice.warning { color: #fbbf24; }
.app-header .expiry-notice.urgent  { color: #f87171; }

.app-header .privacy-link {
    font-size: 0.75rem;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    cursor: pointer;
}
/* First privacy-link gets margin-left: auto as fallback when expiry-notice is hidden */
.app-header .privacy-link:first-of-type {
    margin-left: auto;
}
.app-header .privacy-link:hover {
    color: rgba(255,255,255,0.9);
}

.workflow-nav {
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--border);
    position: fixed;
    top: 3.75rem;
    left: 0;
    right: 0;
    z-index: 95;
    display: flex;
    align-items: center;
    padding-right: var(--app-side-pad);
    backdrop-filter: blur(8px);
}

.workflow-cancel-btn {
    margin-left: auto;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    height: 1.75rem;
    align-self: center;
    flex-shrink: 0;
}
.workflow-nav-inner {
    flex: 1;
    min-width: 0;
    padding: 0.75rem var(--app-side-pad);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    justify-content: flex-start;
}

.workflow-nav-tab {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.875rem;
    border-radius: 999px;
    padding: 0.55rem 1rem;
    line-height: 1;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, opacity 0.18s ease;
}

.workflow-nav-tab:hover:not(:disabled):not(.active) {
    color: var(--text);
    border-color: var(--primary-200);
    background: #f8fbff;
}

.workflow-nav-tab.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}

.workflow-nav-tab:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.app-main {
    flex: 1;
    padding: 2rem var(--app-side-pad);
    width: var(--app-rail);
    max-width: none;
    margin: 0 auto;
}

.app-main:has(#state-upload:not(.hidden)) {
    width: var(--wide-rail);
    padding-top: calc(2rem + 3.75rem);
}

.app-main:has(#state-processing:not(.hidden)) {
    padding-top: calc(2rem + 3.75rem);
}
/* When results are showing: no max-width, no padding, fill height as flex column */
.app-main:has(#state-results:not(.hidden)) {
    max-width: none;
    padding: 3.75rem 0 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    flex: 1;
    min-height: 0;
}

/* state-results fills its parent flex container */
.app-main:has(#state-results:not(.hidden)) > #state-results {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    min-height: 0;
}

.app-footer {
    text-align: center;
    padding: 1rem 2rem;
    font-size: 0.75rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    background: var(--bg);
}

/* ── Utility ── */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }

/* ── Buttons ── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
}

.btn-primary {
    background: var(--accent);
    color: white;
}
.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    box-shadow: var(--shadow-md);
}
.btn-primary:disabled {
    background: var(--text-light);
    cursor: not-allowed;
}

.btn-secondary {
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn-secondary:hover {
    background: var(--bg-alt);
    border-color: var(--text-light);
}

.btn-ghost {
    background: none;
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border, #e2e8f0);
}
.btn-ghost:hover {
    color: #dc2626;
    border-color: #dc2626;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-warning {
    background: var(--warning);
    color: white;
}
.btn-outline {
    background: var(--bg, #ffffff);
    color: var(--primary, #1a365d);
    border: 1.5px solid var(--primary-light, #2b4c7e);
    font-weight: 500;
}
.btn-outline:hover {
    background: var(--primary-bg, #f0f4f8);
    border-color: var(--primary, #1a365d);
}
.btn-outline.active {
    border-color: var(--accent);
    background: var(--accent);
    color: white;
}

/* ── Form Inputs ── */
.input-field {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-family: var(--font);
    transition: border-color var(--transition);
    background: var(--bg);
}
.input-field:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.375rem;
}

.input-helper {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

textarea.input-field {
    resize: vertical;
    min-height: 5rem;
}

/* ── Cards ── */
.card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 1.5rem;
}

.card-header {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
}

/* ── Error/Alert messages ── */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}
.alert-error {
    background: var(--danger-bg);
    color: var(--danger);
    border: 1px solid #fecaca;
}
.alert-success {
    background: var(--success-bg);
    color: var(--success);
    border: 1px solid #bbf7d0;
}
.alert-info {
    background: var(--info-bg);
    color: var(--info);
    border: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════════
   STATE 1: Access Gate
   ══════════════════════════════════════════════════════ */
#state-gate {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 70vh;
}

.gate-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 3rem;
    width: 100%;
    max-width: min(32vw, 26.25rem);
    text-align: center;
}

.gate-card .logo {
    font-size: 2.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.08em;
    margin-bottom: 0.25rem;
}

.gate-card .subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.gate-card .input-field {
    text-align: center;
    font-size: 1rem;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.gate-card .btn {
    width: 100%;
    justify-content: center;
    padding: 0.75rem;
    font-size: 1rem;
}

.gate-card .gate-footer {
    margin-top: 1.5rem;
    font-size: 0.8125rem;
    color: var(--text-light);
}

/* ══════════════════════════════════════════════════════
   STATE 3: Upload & Configure
   ══════════════════════════════════════════════════════ */
.upload-layout {
    display: grid;
    grid-template-columns: 48% 28% 20%;
    gap: 1.5rem;
    align-items: stretch;
    width: 100%;
    max-width: none;
    margin: 0 auto;
}
/* Phase 1: contracts + provisions hidden */
.upload-layout:has(.contracts-column.hidden) {
    grid-template-columns: 1fr 1fr;
}


/* Wrapper: upload columns 1+2 side-by-side, email at bottom */
.upload-columns-wrapper {
    display: flex;
    flex-direction: column;
}

/* Mode selector (Step 253) */
.mode-selector-wrapper {
    margin-bottom: 1rem;
}
.mode-selector-card {
    padding: 0.875rem 1rem;
}
.mode-selector-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.625rem;
}
.mode-selector-options {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}
@media (max-width: 700px) {
    .mode-selector-options {
        grid-template-columns: 1fr;
    }
}
.mode-option {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    padding: 0.625rem 0.875rem;
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    cursor: pointer;
    transition: border-color 0.15s, background-color 0.15s;
}
.mode-option:hover {
    border-color: var(--primary);
    background-color: var(--bg-subtle, #f7f7f9);
}
.mode-option input[type="radio"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
}
.mode-option:has(input[type="radio"]:checked) {
    border-color: var(--primary);
    background-color: var(--bg-subtle, #f7f7f9);
}
.mode-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}
.mode-option-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary, #1b1b22);
}
.mode-option-help {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}

/* Mode C: template dropzone hidden */
.upload-cols-grid.mode-analyze #template-dropzone-wrapper {
    display: none;
}
.upload-cols-grid.mode-analyze {
    grid-template-columns: 1fr;
}

/* Step 254: Mode C Audit Trail "this stage doesn't run in Analyze mode" message */
.audit-mode-c-message {
    background: var(--bg-subtle, #f7f7f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 1.25rem 1.5rem;
    max-width: 720px;
    margin: 1rem 0;
    color: var(--text-primary, #1b1b22);
    line-height: 1.55;
}
.audit-mode-c-heading {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary, #1b1b22);
    margin-bottom: 0.5rem;
}
.audit-mode-c-message p {
    margin: 0 0 0.75rem 0;
    font-size: 0.925rem;
}
.audit-mode-c-message p:last-child {
    margin-bottom: 0;
}
.audit-mode-c-message a {
    color: var(--primary, #2563eb);
    text-decoration: underline;
}
.audit-mode-c-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    font-size: 0.8rem;
    color: #374151;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.75rem;
}

/* Step 306d: Mode C Coverage Evaluation in audit trail */
.audit-cov-section { margin: 1rem 0; }
.audit-cov-section-heading { font-weight: 700; font-size: 0.95rem; color: var(--text, #333); padding: 0.5rem 0 0.625rem; border-bottom: 2px solid var(--border, #e1e4e8); margin-bottom: 0.5rem; }
.audit-cov-lp { border: 1px solid var(--border, #e1e4e8); border-radius: 6px; margin-bottom: 0.5rem; overflow: hidden; }
.audit-cov-lp-header { display: flex; align-items: center; gap: 0.5rem; padding: 0.625rem 0.875rem; background: var(--bg-subtle, #f8fafc); cursor: pointer; user-select: none; }
.audit-cov-lp-header:hover { background: #f1f5f9; }
.audit-cov-lp-id { font-family: monospace; font-size: 0.82rem; color: var(--text-muted, #888); }
.audit-cov-lp-name { font-weight: 600; font-size: 0.88rem; color: var(--text, #333); }
.audit-cov-method-badge { font-size: 0.68rem; color: var(--text-muted, #888); background: #f0f0f0; border-radius: 3px; padding: 0.1rem 0.35rem; margin-left: 0.25rem; font-family: monospace; }
.audit-cov-chevron { font-size: 0.75rem; margin-left: auto; color: var(--text-muted, #888); }
.audit-cov-lp-body { padding: 0.75rem 0.875rem; border-top: 1px solid var(--border, #e1e4e8); }
.audit-cov-deriv-note { font-size: 0.82rem; color: var(--text, #333); margin-bottom: 0.5rem; background: #f8fafc; border-left: 3px solid var(--primary, #0366d6); padding: 0.375rem 0.5rem; border-radius: 0 3px 3px 0; }
.audit-cov-sub-toggle { display: flex; align-items: center; gap: 0.3rem; cursor: pointer; font-size: 0.8rem; color: var(--text-muted, #888); padding: 0.3rem 0; margin-top: 0.25rem; user-select: none; }
.audit-cov-sub-toggle:hover { color: var(--primary, #0366d6); }
.audit-sub-chev { font-size: 0.7rem; }
.audit-cov-elem-list { margin: 0.25rem 0 0.5rem 1rem; padding: 0; font-size: 0.8rem; color: var(--text, #333); line-height: 1.7; }
.audit-cov-table-wrap { overflow-x: auto; margin: 0.25rem 0 0.5rem; }
.audit-cov-table { width: 100%; border-collapse: collapse; font-size: 0.78rem; }
.audit-cov-th { text-align: left; font-weight: 600; color: var(--text-muted, #888); font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--border, #eee); white-space: nowrap; }
.audit-cov-td, .audit-cov-td-label { padding: 0.25rem 0.5rem; border-bottom: 1px solid var(--border-light, #f1f5f9); vertical-align: middle; font-size: 0.78rem; }
.audit-cov-td-label { color: var(--text, #333); max-width: 14rem; }
.audit-cov-row-disag { background: #fffbeb; }
.audit-cov-cit { font-family: monospace; font-size: 0.7rem; color: var(--text-muted, #888); margin-left: 0.25rem; }
.audit-cov-reason { font-size: 0.68rem; background: #fff3cd; color: #856404; border-radius: 3px; padding: 0.1rem 0.3rem; margin-left: 0.25rem; }
.audit-cov-trace-list { margin: 0.25rem 0 0.5rem; }
.audit-cov-trace-item { font-size: 0.8rem; padding: 0.3rem 0; border-bottom: 1px solid var(--border-light, #f1f5f9); }
.audit-cov-trace-item:last-child { border-bottom: none; }
.audit-cov-trace-elem { font-weight: 500; color: var(--text, #333); }
.audit-cov-trace-arrow { color: var(--text-muted, #888); margin: 0 0.2rem; }
.audit-cov-trace-merged { color: var(--text, #333); }
.audit-cov-trace-dissents { margin-top: 0.2rem; display: flex; flex-wrap: wrap; gap: 0.35rem; }
.audit-cov-trace-dissent { font-size: 0.72rem; background: #fff3cd; color: #856404; border-radius: 3px; padding: 0.1rem 0.35rem; }

.upload-cols-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    flex: 1;
    align-items: stretch;
}
.email-section {
    margin-top: 1rem;
}

@media (max-width: 1400px) {
    .upload-layout {
        grid-template-columns: 66% 30%;
    }
    .upload-layout:has(.contracts-column.hidden) {
        grid-template-columns: 1fr 1fr;
    }

    .help-chat-column {
        grid-column: 1 / -1;
    }
}
@media (max-width: 1100px) {
    .upload-layout,
    .upload-layout:has(.contracts-column.hidden) {
        grid-template-columns: 1fr;
    }
    .upload-cols-grid {
        grid-template-columns: 1fr;
    }
}

.upload-main {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}
/* Collapse summary container when empty */
#template-summary-container:empty {
    display: none;
}
.upload-main > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.contracts-column {
    display: flex;
    flex-direction: column;
}
.contracts-column > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Make card internals stretch to fill height */
.upload-main > .card > .upload-col,
.contracts-column > .card > .upload-col {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.upload-main > .card > .upload-col > .drop-zone,
.contracts-column > .card > .upload-col > .drop-zone {
    flex: 1;
    justify-content: flex-end;
}

/* Make provisions and chat cards fill height */
.provisions-sidebar {
    display: flex;
    flex-direction: column;
}
.provisions-sidebar > .card {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.provisions-sidebar > .card > .provisions-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.help-chat-column .help-chat-card {
    height: 100%;
    display: flex;
    flex-direction: column;
}

/* Upload two-column layout */
.upload-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-top: 0.5rem;
}
@media (max-width: 700px) {
    .upload-columns {
        grid-template-columns: 1fr;
    }
}

.upload-col-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    margin-bottom: 0.5rem;
}
.upload-col-title {
    font-weight: 600;
    font-size: 0.8125rem;
    white-space: nowrap;
}
.upload-col-subtitle {
    font-size: 0.6875rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}
@media (max-width: 900px) {
    .upload-col-subtitle { display: none; }
}

.upload-clear-btn {
    font-size: 0.72rem;
    font-weight: 500;
    padding: 0.15rem 0.55rem;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: white;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.upload-clear-btn:hover {
    border-color: var(--danger, #ef4444);
    color: var(--danger, #ef4444);
    background: #fef2f2;
}

/* Drop zones */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition);
    background: var(--bg);
    min-height: 7.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(37, 99, 235, 0.03);
}
.drop-zone.has-files {
    border-style: solid;
    border-color: var(--success);
    background: var(--success-bg);
}

.drop-zone .drop-icon {
    font-size: 2rem;
    opacity: 0.5;
}
.drop-zone .drop-text {
    font-size: 0.875rem;
    color: var(--text-muted);
}
.drop-zone .drop-formats {
    font-size: 0.75rem;
    color: var(--text-light);
}

.file-list {
    list-style: none;
    margin-top: 0.75rem;
    text-align: left;
    width: 100%;
}
.file-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0.5rem;
    font-size: 0.8125rem;
    border-radius: var(--radius);
    background: var(--bg);
    margin-bottom: 0.25rem;
}
.file-list li.tenant-file-order-note {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.2rem;
    background: #f8fbff;
    border: 1px solid var(--primary-100);
    padding: 0.55rem 0.7rem;
}
.tenant-file-order-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--primary);
}
.tenant-file-order-copy {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.tenant-file-item {
    gap: 0.75rem;
    cursor: grab;
}
.tenant-file-item.dragging {
    opacity: 0.6;
}
.tenant-file-item.drag-over {
    outline: 2px dashed var(--primary-200);
    outline-offset: 1px;
    background: #f8fbff;
}
.tenant-file-main {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    min-width: 0;
    flex: 1;
}
.tenant-file-order {
    min-width: 1.5rem;
    font-weight: 800;
    color: var(--primary);
}
.tenant-file-drag,
.tenant-file-move {
    border: 1px solid var(--border);
    background: #fff;
    color: var(--text-muted);
    border-radius: 999px;
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.25rem 0.45rem;
}
.tenant-file-drag {
    cursor: grab;
}
.tenant-file-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
}
.tenant-file-move:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}
.tenant-file-move:hover:not(:disabled),
.tenant-file-drag:hover {
    border-color: var(--primary-200);
    color: var(--text);
    background: #f8fbff;
}
.file-list li .file-name {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-width: 0;
}
.file-list .remove-file {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0 0.25rem;
    line-height: 1;
}
.file-list .remove-file:hover {
    color: var(--danger);
}

/* Provisions sidebar */
.provisions-sidebar {
}

.provisions-sidebar .card {
}

.provision-list {
    list-style: none;
}
.provision-list li {
    padding: 0.25rem 0;
}
.provision-list label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.25rem 0.375rem;
    border-radius: 0.25rem;
    transition: background var(--transition);
}
.provision-list label:hover {
    background: var(--bg-alt);
}

.provision-controls {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.provision-controls button {
    background: none;
    border: none;
    font-size: 0.75rem;
    color: var(--accent);
    cursor: pointer;
    padding: 0;
}
.provision-controls button:hover {
    text-decoration: underline;
}

.custom-provision-add {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 0.375rem;
}
.custom-provision-add input {
    flex: 1;
    padding: 0.375rem 0.5rem;
    font-size: 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
}

/* Estimate & submit area */
.submit-area {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.estimate-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.provisions-sidebar .estimate-text {
    padding: 0.4rem 0.75rem;
    margin: 0.25rem 0 0.5rem;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--accent);
    background: rgba(26, 54, 93, 0.05);
    border-left: 3px solid var(--accent);
    border-radius: 0 0.25rem 0.25rem 0;
    min-height: 1.6rem;
}


/* ── Template Summary Card (Step 138) ── */
#template-summary-card {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin: 0.75rem 0;
}
.tscard-header {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.625rem;
}
.tscard-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.875rem;
}
.tscard-field {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.tscard-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.tscard-value {
    font-size: 0.88rem;
    color: var(--text);
    font-weight: 500;
}
.tscard-placeholder {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 400;
}
.tscard-identity-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}
.tscard-identity-label {
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.tscard-check {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    font-size: 0.82rem;
    color: var(--text);
    cursor: pointer;
}
.tscard-check input[type="checkbox"] {
    width: 0.875rem;
    height: 0.875rem;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════
   STATE 4: Processing
   ══════════════════════════════════════════════════════ */
.processing-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
    width: var(--app-rail);
    max-width: none;
    margin: 0 auto;
    padding: 1.5rem var(--app-side-pad) 2.5rem;
}

.processing-hero-shell,
.processing-secondary-grid,
.processing-checklist-column,
.processing-main-stack,
.processing-sidebar {
    min-width: 0;
}

.processing-sidebar {
    width: 100%;
    position: relative;
    align-self: stretch;
    display: flex;
}

.processing-layout > .processing-hero-shell:empty {
    display: none;
}
@media (max-width: 1100px) {
    .processing-layout {
        width: var(--app-rail);
        padding: 1rem var(--app-side-pad) 2rem;
    }
}
@media (max-width: 760px) {
    .processing-layout {
        gap: 1rem;
        padding: 0.75rem 1.5vw 1.5rem;
    }
    .processing-knowledge-band {
        width: 100%;
        margin-left: 0;
    }
    .processing-title {
        font-size: 1.55rem;
    }
    .processing-status-card {
        padding: 1.2rem 1.1rem 1rem;
    }
    .processing-chat-panel {
        min-height: 26.25rem;
        height: auto;
    }
}

.processing-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.45rem;
    line-height: 1.15;
    color: var(--primary, #1a365d);
}

.processing-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: var(--accent, #2563eb);
    margin-bottom: 0.65rem;
}

.processing-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted, #64748b);
    line-height: 1.65;
    margin-bottom: 1.35rem;
}

.processing-status-card {
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 1.125rem;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.06);
    padding: 1.5rem 1.75rem 1.25rem;
    min-height: 0;
}

.processing-knowledge-band {
    width: 100%;
    margin-left: 0;
    margin-right: 0;
    min-height: 31.25rem;
    height: 100%;
}

/* Overall job progress bar (shown when multiple tenants) */
.job-progress-overall {
    margin-bottom: 1.4rem;
    padding: 0.95rem 1rem 0.9rem;
    border: 1px solid #dbe4f0;
    border-radius: 0.75rem;
    background: #f7faff;
}
.job-progress-label {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    margin-bottom: 0.5rem;
}
.job-progress-bar {
    height: 0.5rem;
    background: #e6edf7;
    border-radius: 999px;
    overflow: hidden;
}
.job-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5b7cfa 0%, #3b82f6 100%);
    border-radius: 999px;
    transition: width 0.8s ease;
}

.tenant-progress {
    margin-bottom: 1rem;
    padding: 0.85rem 1rem;
    border-radius: 0.875rem;
    background: #f8fafc;
    border: 1px solid #e7edf5;
}
.tenant-progress .tenant-name {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}
.tenant-progress .tenant-status-label {
    font-size: 0.77rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
}

.progress-bar {
    height: 0.5625rem;
    background: #e5ecf5;
    border-radius: 999px;
    overflow: hidden;
}
.progress-bar .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #4f67ff 0%, #377dff 100%);
    border-radius: 999px;
    transition: width 0.5s ease;
}
.progress-bar .progress-fill.completed {
    background: var(--success);
}
.progress-bar .progress-fill.failed {
    background: var(--danger);
}
.progress-bar .progress-fill.processing {
    background: var(--accent);
    animation: pulse-bar 1.5s ease-in-out infinite;
}

.processing-overview-status {
    margin: 1rem 0 1.1rem;
    padding: 0.9rem 1rem;
    border: 1px solid #d8e2f2;
    border-radius: 0.875rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
}

.processing-overview-status.hidden {
    display: none;
}

.processing-overview-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.3rem;
}

.processing-overview-headline {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.2rem;
}

.processing-overview-detail {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.processing-hero-shell,
.processing-secondary-grid {
    min-width: 0;
}

.processing-status-card {
    min-height: 0;
}

.processing-overview-status {
    margin: 1rem 0 0;
    padding: 1.1rem 1.15rem 1rem;
    border: 1px solid #d8e2f2;
    border-radius: 1rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
}

.processing-overview-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
    margin-bottom: 0.9rem;
}

.processing-overview-meta-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.4rem 0.68rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.84);
    border: 1px solid #d8e2f2;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.processing-hero-summary {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 1rem 1.25rem;
    align-items: start;
}

.processing-hero-copy {
    min-width: 0;
}

.processing-hero-label {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.28rem;
}

.processing-hero-headline {
    font-size: 1.14rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.28rem;
}

.processing-hero-detail {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.processing-hero-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.45rem;
    min-width: 11.25rem;
}

.processing-hero-percent {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--primary);
}

.processing-hero-status {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.processing-hero-substatus {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.processing-hero-bar {
    margin-top: 1rem;
    margin-bottom: 0.75rem;
}

.processing-hero-bar-track {
    height: 0.75rem;
    background: #e6edf7;
    border-radius: 999px;
    overflow: hidden;
}

.processing-hero-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #5b7cfa 0%, #3b82f6 55%, #2563eb 100%);
    border-radius: 999px;
    transition: width 0.8s ease;
}

.processing-hero-footer {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
    align-items: center;
}

.processing-hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.45rem 0.7rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.82);
    border: 1px solid #d8e2f2;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text);
}

.processing-secondary-grid {
    display: grid;
    grid-template-columns: 22% 50% 24%;
    gap: 1.5rem;
    align-items: stretch;
}

.processing-checklist-column,
.processing-main-stack {
    display: grid;
    gap: 1rem;
    min-width: 0;
}

.processing-checklist-column {
    align-content: start;
}

#processing-carousel-slot {
    min-width: 0;
    order: 1;
}

#processing-status-slot {
    min-width: 0;
    order: 2;
}

.processing-checklist-card {
    order: 3;
}

#processing-ready-card {
    order: 4;
}

.processing-detail-card {
    order: 5;
}

#lp-progress-panel {
    order: 6;
}

.processing-return-panel {
    order: 7;
}

.processing-return-panel,
.processing-checklist-card,
.processing-ready-card,
.lp-progress-card,
.processing-detail-card {
    background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.05);
    overflow: hidden;
}

.processing-checklist-card,
.processing-ready-card,
.lp-progress-card,
.processing-detail-card {
    padding: 1.1rem 1.2rem;
}

/* LP Progress Panel */
.lp-progress-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.15rem 1.5rem;
    margin-top: 0.625rem;
}
.lp-progress-row {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    transition: color 0.3s ease;
}
.lp-progress-icon {
    font-size: 0.75rem;
    width: 1rem;
    text-align: center;
    flex-shrink: 0;
    transition: color 0.3s ease;
}
.lp-progress-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.lp-progress-row.state-covered { color: var(--text); }
.lp-progress-row.state-covered .lp-progress-icon { color: var(--success, #16a34a); }
.lp-progress-row.state-covered_unfavorable .lp-progress-icon,
.lp-progress-row.state-partial .lp-progress-icon,
.lp-progress-row.state-ambiguous .lp-progress-icon,
.lp-progress-row.state-review_needed .lp-progress-icon { color: var(--warning, #d97706); }
.lp-progress-row.state-missing .lp-progress-icon,
.lp-progress-row.state-broken_xref .lp-progress-icon { color: var(--danger, #dc2626); }
.lp-progress-row.state-not_applicable { opacity: 0.55; }
.lp-progress-row.state-processing {
    color: var(--accent, #2563eb);
    font-weight: 500;
}
.lp-progress-row.state-processing .lp-progress-icon {
    color: var(--accent, #2563eb);
    animation: lp-spin 0.9s linear infinite;
    display: inline-block;
}
.lp-progress-row.state-processing .lp-progress-name {
    animation: lp-pulse 1.4s ease-in-out infinite;
}
@keyframes lp-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}
@keyframes lp-pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

.processing-main-stack .processing-knowledge-band {
    min-height: 0;
    height: auto;
    margin: 0;
}

.processing-main-stack .processing-hero-shell {
    min-width: 0;
}

.processing-main-stack .processing-status-card {
    height: 100%;
}

.processing-hero-ready {
    margin-top: 1rem;
    padding: 0.95rem 1rem;
    border: 1px solid #d6e3fb;
    border-radius: 0.875rem;
    background: #f8fbff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.processing-hero-ready-title {
    font-size: 0.96rem;
    font-weight: 700;
    color: var(--text);
}

.processing-hero-ready-meta {
    font-size: 0.84rem;
    color: var(--text-muted);
    margin-top: 0.18rem;
}

.processing-side-kicker {
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.22rem;
}

.processing-side-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text);
}

.processing-side-subtitle {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-top: 0.25rem;
}

.processing-checklist-list {
    display: grid;
    gap: 0.95rem;
    margin-top: 1rem;
}

.processing-checklist-group {
    border: 1px solid #e4ebf5;
    border-radius: 0.875rem;
    background: #f8fbff;
    padding: 0.9rem 0.95rem;
}

.processing-checklist-group.current {
    border-color: #c9d9f6;
    background: linear-gradient(180deg, #f8fbff 0%, #f1f6ff 100%);
}

.processing-checklist-group.complete {
    background: #fbfefd;
}

.processing-checklist-group-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 0.7rem;
}

/* Step 282: title-side wrapper (the unnamed first child div containing
   title + meta) gets flex: 1 1 auto + min-width: 0 so the long
   contract filename can wrap rather than push the badge off-screen.
   `overflow-wrap: anywhere` permits breaking on filenames that have
   no natural break points (long underscored names, etc.). */
.processing-checklist-group-header > div:first-child {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
}

.processing-checklist-group-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.processing-checklist-group-meta {
    margin-top: 0.18rem;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Step 282: badge must never shrink — READY / STEP X OF Y labels were
   getting clipped when the title side took up the full row. flex: 0 0
   auto locks the badge to content size; existing `white-space: nowrap`
   keeps the label on a single line. */
.processing-checklist-group-badge {
    flex: 0 0 auto;
    font-size: 0.76rem;
    font-weight: 800;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.processing-checklist-steps {
    display: grid;
    gap: 0.5rem;
}

.processing-checklist-step {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0.65rem;
    align-items: start;
}

.processing-checklist-icon {
    width: 1.3rem;
    text-align: center;
    font-size: 0.92rem;
    line-height: 1.3rem;
    color: var(--text-muted);
}

.processing-checklist-step.is-complete .processing-checklist-icon {
    color: #1f8b4d;
}

.processing-checklist-step.is-active .processing-checklist-icon {
    color: var(--primary);
}

.processing-checklist-step.is-pending .processing-checklist-icon {
    color: #b1bfd3;
}

.processing-checklist-step-title {
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--text);
}

.processing-checklist-step-meta {
    margin-top: 0.12rem;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.45;
}

.processing-checklist-step.is-complete .processing-checklist-step-title,
.processing-checklist-step.is-complete .processing-checklist-step-meta {
    color: #617489;
}

.processing-checklist-empty {
    padding: 0.9rem 0.95rem;
    border: 1px dashed #d7e2ef;
    border-radius: 0.875rem;
    background: #fbfdff;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.processing-ready-list {
    display: grid;
    gap: 0.75rem;
    margin-top: 1rem;
}

.processing-ready-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 0.95rem;
    border: 1px solid #d8e2f2;
    border-radius: 0.875rem;
    background: #f8fbff;
}

.processing-ready-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.processing-ready-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.18rem;
}

.processing-ready-empty {
    margin-top: 1rem;
    padding: 0.9rem 0.95rem;
    border: 1px dashed #d7e2ef;
    border-radius: 0.875rem;
    background: #fbfdff;
    color: var(--text-muted);
    font-size: 0.88rem;
    line-height: 1.5;
}

.processing-detail-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
}

.processing-detail-list {
    display: grid;
    gap: 0.85rem;
    margin-top: 1rem;
}

.processing-detail-list.hidden {
    display: none;
}

.processing-tenant-card {
    padding: 1.05rem 1.1rem;
    border-radius: 0.875rem;
    background: #f8fafc;
    border: 1px solid #e7edf5;
}

.processing-tenant-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem 0.75rem;
    margin-bottom: 0.9rem;
}

.processing-tenant-top {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
    align-items: flex-start;
    margin-bottom: 0.7rem;
}

/* Step 282: status wrap must hold its full width — READY / STEP X OF Y
   labels were getting clipped when the contract filename was long.
   `flex: 0 0 auto` locks the wrap to its content size, and the
   `min-width: 35%` floor stays as a layout reservation for very narrow
   viewports. The internal status / status-meta lines already declare
   `white-space: nowrap`, so the labels render in full now that the
   wrap can't be squeezed below content size. */
.processing-tenant-status-wrap {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.35rem;
    min-width: 35%;
    flex: 0 0 auto;
}

.processing-tenant-percent {
    font-size: 2rem;
    line-height: 1;
    font-weight: 800;
    color: var(--primary);
}

/* Step 282: title takes the remaining width and is allowed to wrap.
   `flex: 1 1 auto` lets it grow into available space and shrink as
   needed; `min-width: 0` is the standard escape hatch that lets a flex
   child actually shrink below its content's intrinsic min-content size
   (the long-filename wrap pattern that already works on the contract
   filename today). `overflow-wrap: anywhere` lets pathological
   filenames like "T-10_Negotiated_Tennant_Lease.docx_with_extra_…"
   wrap rather than overflow horizontally. */
.processing-tenant-name {
    flex: 1 1 auto;
    min-width: 0;
    overflow-wrap: anywhere;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.processing-tenant-status {
    font-size: 0.88rem;
    font-weight: 800;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}

.processing-tenant-status-meta {
    font-size: 0.84rem;
    font-weight: 700;
    color: var(--text);
    text-align: right;
    white-space: nowrap;
}

.processing-tenant-detail {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.4rem;
    line-height: 1.45;
}

.processing-tenant-detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    min-height: 2.1rem;
    min-width: 0;
}

.processing-tenant-detail-row .processing-tenant-detail {
    margin-top: 0.4rem;
    min-height: 1.2rem;
}

.processing-tenant-open-btn {
    margin-top: 0.15rem;
}

.processing-tenant-action-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.55rem;
}

@media (max-width: 1100px) {
    .processing-secondary-grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 760px) {
    .processing-layout {
        padding: 0.75rem 0.75rem 1.5rem;
        gap: 1rem;
    }

    .processing-hero-summary {
        grid-template-columns: minmax(0, 1fr);
    }

    .processing-hero-meta {
        align-items: flex-start;
        min-width: 0;
    }

    .processing-ready-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .processing-hero-ready {
        flex-direction: column;
        align-items: flex-start;
    }

    .processing-checklist-group-header {
        flex-direction: column;
    }

    .processing-detail-header {
        flex-direction: column;
    }
}

@keyframes pulse-bar {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.6; }
}

.cancel-area {
    display: flex;
    align-items: center;
    gap: 1rem;
    justify-content: flex-start;
    flex-wrap: wrap;
    padding-top: 0.35rem;
}
.btn-cancel {
    background: #fff;
    color: var(--text-muted);
    border: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 999px;
}
.btn-cancel:hover:not(:disabled) {
    color: var(--danger);
    border-color: var(--danger);
}
.btn-cancel:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cancelled-badge {
    display: inline-block;
    background: var(--text-light);
    color: white;
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 0.1875rem;
    text-transform: uppercase;
}

/* Cancelling state */
.cancelling-state {
    text-align: center;
    padding: 3rem 1rem;
}
.cancelling-state .spinner {
    display: inline-block;
    width: 2rem;
    height: 2rem;
    margin-bottom: 1rem;
}
.cancelling-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.cancelling-detail {
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Cancel confirmation screen */
.cancel-confirm {
    text-align: center;
    padding: 3rem 1rem 2rem;
}
.cancel-confirm-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    background: var(--bg-alt);
    border: 2px solid var(--border);
    font-size: 1.5rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
}
.cancel-confirm-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}
.cancel-confirm-detail {
    color: var(--text-muted);
    font-size: 0.875rem;
    max-width: 30rem;
    margin: 0 auto 1.5rem;
    line-height: 1.5;
}
.cancel-confirm-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.processing-info {
    margin-top: 0;
    padding: 1.25rem 1.35rem 1.25rem;
    background: transparent;
    border: none;
    border-top: 1px solid var(--border, #e2e8f0);
    border-radius: 0;
    box-shadow: none;
    font-size: 0.9rem;
    line-height: 1.7;
}
.processing-info .email-notice {
    display: block;
    font-weight: 700;
    font-size: 1rem;
    color: var(--primary, #1a365d);
}

.processing-info-body {
    color: var(--text-muted, #64748b);
    margin-top: 0.7rem;
}

.copy-link-area {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
}
.copy-link-area input {
    flex: 1;
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: var(--font-mono);
    width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
}
.copy-link-area .btn { align-self: flex-end; }

/* ══════════════════════════════════════════════════════
   STATE 5: Results Dashboard
   ══════════════════════════════════════════════════════ */

/* Results header row */
.results-header-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Batch summary */
.batch-summary {
    margin-bottom: 2rem;
}

/* Portfolio header inside batch summary */
.batch-portfolio-header {
    margin-bottom: 1.25rem;
}
.batch-section-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}
.batch-portfolio-title {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.3;
}
.batch-portfolio-sub {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.batch-portfolio-stats {
    font-size: 0.875rem;
    color: var(--text);
    margin-top: 0.375rem;
}

/* Batch table */
.batch-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}
.batch-table th,
.batch-table td {
    padding: 0.625rem 0.875rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
}
.batch-table th {
    font-weight: 600;
    background: var(--bg-alt);
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}
.batch-table tr:hover td {
    background: var(--bg-alt);
    cursor: pointer;
}
.batch-table tr.active-row td {
    background: rgba(37, 99, 235, 0.05);
}

/* Action badges in batch table */
.batch-action {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 0.625rem;
}
.action-immediate {
    background: var(--danger-bg);
    color: var(--danger);
}
.action-review {
    background: var(--high-bg);
    color: #c2410c;
}
.action-monitor {
    background: var(--medium-bg);
    color: var(--warning);
}
.action-clear {
    background: var(--success-bg);
    color: var(--success);
}

/* Tech details collapsible */
.tech-details-section {
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
}

/* Severity badges */
.severity-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    border-radius: 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    white-space: nowrap;
}
.severity-CRITICAL {
    background: var(--critical-bg);
}
.severity-HIGH {
    background: var(--high-bg);
}
.severity-MEDIUM {
    background: var(--medium-bg);
}
.severity-LOW {
    background: var(--low-bg);
}
.severity-CONFORMS {
    background: var(--success-bg);
}

/* Severity colors scoped to badge only — prevents cascade into card body text */
.severity-badge.severity-CRITICAL { color: var(--danger); }
.severity-badge.severity-HIGH     { color: #c2410c; }
.severity-badge.severity-MEDIUM   { color: var(--warning); }
.severity-badge.severity-LOW      { color: var(--info); }
.severity-badge.severity-CONFORMS { color: var(--success); }

/* Ensure finding card body text is always standard dark — not inherited from severity */
.finding-card { color: var(--text); }

/* Risk rating badge (for batch table) */
.risk-high { color: var(--danger); font-weight: 600; }
.risk-medium { color: var(--warning); font-weight: 600; }
.risk-low { color: var(--success); font-weight: 600; }

/* Tenant selector */
.tenant-selector {
    margin-bottom: 1.5rem;
}
.tenant-selector select {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    font-family: var(--font);
    min-width: 15.625rem;
}

/* Contract summary container */
.contract-summary {
    margin-bottom: 1.5rem;
}

.contract-summary-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0 0 0.9rem;
    border: none;
    background: transparent;
    color: var(--text-muted, #64748b);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    text-align: left;
}

.contract-summary-toggle:hover {
    color: var(--text, #1e293b);
}

.contract-summary-toggle-icon,
.nav-toggle-chevron,
.audit-chevron,
.demo-toggle-arrow,
.conforming-chevron,
.dissent-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1;
    flex-shrink: 0;
}

.contract-summary-toggle:hover .contract-summary-toggle-icon,
.nav-section-toggle:hover .nav-toggle-chevron,
.audit-provision-header:hover .audit-chevron,
.demo-toggle-btn:hover .demo-toggle-arrow,
.conforming-main:hover .conforming-chevron,
.dissent-toggle:hover .dissent-chevron {
    border-color: #94a3b8;
    color: #334155;
    background: #f8fafc;
}

.contract-summary-body.hidden {
    display: none;
}

.contract-summary-compact {
    padding: 0.1rem 0 0.2rem;
    color: var(--text, #1e293b);
    font-size: 0.9rem;
    font-weight: 500;
}

.contract-clause-filter-bar {
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    flex: 1 1 0;
    min-width: 0;
    overflow: visible;
}
.contract-clause-filter-layout {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: stretch;
}
.contract-clause-filter-toprow {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
    padding: 0.125rem 0 0.375rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.contract-clause-filter-controls {
    display: flex;
    align-items: center;
    gap: 2%;
    width: 100%;
    overflow: visible;
    position: relative;
    z-index: 10;
}
.contract-clause-filter-controls > select {
    flex: 1 1 15%;
    min-width: 0;
}
.contract-clause-filter-controls > button {
    flex: 0 0 auto;
}
.contract-clause-filter-actions {
    display: flex;
    flex-wrap: nowrap;
    justify-content: flex-end;
    align-items: center;
    gap: 0.625rem;
}
.contract-clause-filter-select {
    min-width: 0;
    padding: 0.45rem 0.7rem;
    border: 1px solid var(--border, #d1d5db);
    border-radius: 0.5rem;
    background: #fff;
    font-size: 0.8rem;
    color: var(--text, #1e293b);
}
.contract-clause-filter-reset {
    padding: 0.45rem 0.8rem;
    border: 1px solid #cbd5e1;
    border-radius: 0.5rem;
    background: #fff;
    color: var(--primary, #1a365d);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.contract-clause-filter-reset:hover {
    background: var(--bg-alt, #f8fafc);
    border-color: #94a3b8;
}

.contract-final-draft-btn {
    margin-left: 0;
}

.contract-annotated-btn {
    margin-left: auto;
}

/* ── Contract Summary Hero Card (039b) ── */
.contract-hero {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
}

.contract-headline {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
}

.contract-subline {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 1rem;
}

.contract-chips-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.5rem;
}

.deviation-count-chip {
    display: inline-block;
    padding: 0.25rem 0.625rem;
    background: var(--warning-bg);
    border: 1px solid var(--warning);
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--warning);
    white-space: nowrap;
    cursor: default;
    pointer-events: none;
    user-select: none;
}
.deviation-count-chip.conforming-chip {
    background: var(--success-bg);
    border-color: var(--success);
    color: var(--success);
}

.risk-headline-chip {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: normal;
    cursor: pointer;
    transition: opacity 0.15s ease;
    text-decoration: none;
}
.risk-headline-chip:hover {
    opacity: 0.85;
    text-decoration: underline;
    text-underline-offset: 2px;
}
.risk-headline-CRITICAL {
    background: var(--danger-bg);
    color: var(--danger);
}
.risk-headline-HIGH {
    background: var(--warning-bg);
    color: #c2410c;
}
.risk-headline-MEDIUM {
    background: #fefce8;
    color: #a16207;
}
.risk-headline-LOW {
    background: var(--info-bg);
    color: var(--info);
}

.contract-docview-link {
    margin-bottom: 0.5rem;
}

.contract-footer {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Section headers */
.section-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary, #1a365d);
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

/* Deviation card header + detail sections (used in finding-card accordion) */
/* Two-line deviation header (Step 186) */
.deviation-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
}

.deviation-header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-width: 0;
    flex: 1 1 auto;
}

.deviation-header-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    min-width: 0;
    flex: 1 1 auto;
    flex-wrap: wrap;
}

.deviation-header-main .provision-title {
    font-weight: 600;
    font-size: 0.9375rem;
    white-space: nowrap;
}

.deviation-header-right {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.deviation-header-main .section-ref {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}

.deviation-header-actions {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    flex: 0 0 auto;
}

.detail-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0.75rem;
}
.detail-two-col > .detail-section {
    margin-bottom: 0;
}
.detail-section {
    margin-bottom: 0.75rem;
}
.detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}
.detail-text {
    font-size: 0.875rem;
    line-height: 1.6;
}
.detail-text p {
    margin: 0 0 0.5rem;
}
.detail-text p:last-child {
    margin-bottom: 0;
}

.evaluator-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

/* Expandable sections */
.expandable {
    margin-top: 0.75rem;
}
.expandable-toggle {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0.25rem 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.expandable-toggle:hover {
    text-decoration: underline;
}
.expandable-content {
    display: none;
    margin-top: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    line-height: 1.6;
    white-space: pre-wrap;
    max-height: 18.75rem;
    overflow-y: auto;
}
.expandable-content.open {
    display: block;
}

/* Feedback buttons */
.feedback-area {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.feedback-area .feedback-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-right: 0.5rem;
}
.feedback-saved {
    font-size: 0.75rem;
    color: var(--success);
    margin-left: 0.5rem;
}

.feedback-notes {
    width: 100%;
    margin-top: 0.5rem;
}
.feedback-notes textarea {
    width: 100%;
    padding: 0.375rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.8125rem;
    font-family: var(--font);
    resize: vertical;
    min-height: 3rem;
}

/* ══════════════════════════════════════════════════════
   QUICK FEEDBACK BAR (052) — always visible on DEVIATES cards
   ══════════════════════════════════════════════════════ */

.card-quick-feedback {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1rem;
    background: var(--bg-alt, #f8fafc);
    border-top: 1px solid var(--border, #e2e8f0);
    flex-wrap: wrap;
}

.quick-feedback-question {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-right: 0.25rem;
    white-space: nowrap;
}

.quick-feedback-btns {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}

/* Quick feedback buttons — compact pill style */
.qfb {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.1875rem 0.625rem;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    background: var(--bg, #ffffff);
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.qfb:hover {
    border-color: var(--primary, #1a365d);
    color: var(--primary, #1a365d);
}

/* Selected states */
.qfb-yes.qfb-selected {
    background: #dcfce7;
    border-color: #16a34a;
    color: #15803d;
}
.qfb-no.qfb-selected {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
}
.qfb-unsure.qfb-selected {
    background: #fef9c3;
    border-color: #ca8a04;
    color: #854d0e;
}

/* Saved confirmation text */
.quick-feedback-saved {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    margin-left: 0.25rem;
}

/* ── Quick feedback "No" follow-up prompt ── */
.qfb-followup {
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.qfb-followup-msg {
    font-size: 0.78rem;
    color: #78350f;
    flex: 1;
    min-width: 12.5rem;
}
.qfb-followup-btns {
    display: flex;
    gap: 0.5rem;
    flex-shrink: 0;
}
.qfb-followup-yes {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    border: 1.5px solid #d97706;
    background: #fef3c7;
    color: #92400e;
    cursor: pointer;
    transition: all 0.15s ease;
}
.qfb-followup-yes:hover {
    background: #fde68a;
    border-color: #b45309;
}
.qfb-followup-cancel {
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.qfb-followup-cancel:hover {
    background: var(--bg-alt);
}

/* Conforming list */
.conforming-list {
    list-style: none;
}
.conforming-list li {
    padding: 0.375rem 0;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    border-bottom: 1px solid var(--border);
}
.conforming-list li:last-child {
    border-bottom: none;
}

/* Downloads section */
.downloads-section {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

/* ── Privacy Modal ── */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    align-items: center;
    justify-content: center;
}
.modal-overlay.open {
    display: flex;
}

.modal-content {
    background: var(--bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    padding: 2rem;
    max-width: 40rem;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}
.modal-content h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}
.modal-content p {
    font-size: 0.875rem;
    margin-bottom: 0.75rem;
    line-height: 1.6;
}
.modal-content ul {
    font-size: 0.875rem;
    padding-left: 1.5rem;
    margin-bottom: 0.75rem;
}
.modal-content li {
    margin-bottom: 0.375rem;
}
.modal-close {
    margin-top: 1rem;
}

/* ── Loading spinner ── */
.spinner {
    display: inline-block;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ══════════════════════════════════════════════════════
   FINDING CARD ACCORDION (039b)
   ══════════════════════════════════════════════════════ */

.finding-card {
    background: var(--bg, #ffffff);
    border-radius: var(--radius, 0.5rem);
    border: 1px solid var(--border, #e2e8f0);
    border-left: 4px solid var(--border, #e2e8f0);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
    transition: box-shadow 0.15s ease;
}
.finding-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.08));
}
.finding-card.severity-critical, .finding-card.severity-CRITICAL {
    border-left-color: var(--danger, #dc2626);
    background: #fffafa;
}
.finding-card.severity-high, .finding-card.severity-HIGH {
    border-left-color: #ea580c;
    background: #fffcfa;
}
.finding-card.severity-medium, .finding-card.severity-MEDIUM {
    border-left-color: var(--warning, #d97706);
    background: var(--medium-bg, #fffbeb);
}
.finding-card.severity-low, .finding-card.severity-LOW {
    border-left-color: var(--info, #64748b);
    background: var(--low-bg, #f1f5f9);
}

.finding-card .deviation-header {
    cursor: pointer;
    user-select: none;
}
.finding-card .deviation-header:hover {
    background: rgba(37, 99, 235, 0.03);
}

.finding-collapse-indicator {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    flex-shrink: 0;
}

.finding-collapse-indicator::before {
    content: "▾";
}

.finding-card:not(.card-expanded) .finding-collapse-indicator::before {
    content: "▸";
}

.finding-card .deviation-header:hover .finding-collapse-indicator {
    border-color: #94a3b8;
    color: #334155;
    background: #f8fafc;
}

.card-actions-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
}
.card-docview-link {
    color: var(--accent) !important;
    font-size: 0.8125rem;
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}
.card-docview-link:hover {
    text-decoration: underline;
}
.card-docview-link--btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13.125rem;
    min-height: 1.875rem;
    margin-top: 0;
    padding: 0.3rem 0.85rem;
    border: 1.5px solid var(--accent, #4f46e5);
    border-radius: 0.5rem;
    background: var(--accent, #4f46e5);
    font-size: 0.76rem;
    font-weight: 600;
    color: #ffffff !important;
    line-height: 1;
    text-decoration: none !important;
}
.card-docview-link--btn:hover {
    background: #4338ca;
    border-color: #4338ca;
    text-decoration: none;
}
.card-expand-bar-inline {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    cursor: pointer;
    user-select: none;
    color: var(--text-muted);
    font-size: 0.8125rem;
    transition: color 0.15s ease;
}
.card-expand-bar-inline:hover {
    color: var(--accent);
}
.card-expand-bar-inline .expand-icon {
    font-size: 0.75rem;
}
.finding-card.card-expanded .card-actions-row {
    border-bottom: 1px solid var(--border);
}

.card-expand-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--accent);
    background: var(--surface);
    border-top: 1px solid var(--border);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.card-expand-bar:hover {
    background: rgba(37, 99, 235, 0.04);
}
.card-expand-bar .expand-icon {
    font-size: 0.75rem;
}
.finding-card.card-expanded .card-expand-bar {
    border-bottom: 1px solid var(--border);
}

.card-summary {
    padding: 1rem;
}

.finding-card:not(.card-expanded) .card-summary,
.finding-card:not(.card-expanded) .resolution-bar,
.finding-card:not(.card-expanded) .card-quick-feedback,
.finding-card:not(.card-expanded) .fd-modify-panel,
.finding-card:not(.card-expanded) .notable-clauses-section,
.finding-card:not(.card-expanded) .cascade-source-callout {
    display: none;
}

.risk-headline {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 0.75rem;
    line-height: 1.4;
}

.card-details {
    display: none;
}
.finding-card.card-expanded .card-details {
    display: block;
    padding: 0 1rem 1rem;
}

/* ══════════════════════════════════════════════════════
   COUNT BADGE (040)
   ══════════════════════════════════════════════════════ */

.count-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.375rem;
    height: 1.375rem;
    padding: 0 0.375rem;
    background: var(--primary, #1a365d);
    color: white;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    vertical-align: middle;
}

.review-recommended-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.1875rem 0.625rem;
    background: #fff7ed;
    color: #c2410c;
    border: 1.5px solid #fed7aa;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    vertical-align: middle;
}

/* ══════════════════════════════════════════════════════
   DISSENT TRANSPARENCY (042)
   ══════════════════════════════════════════════════════ */

.conforming-item {
    list-style: none;
    display: block !important;
    margin: 0 0 0.875rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg);
    background: var(--bg, #fff);
    overflow: hidden;
}
.conforming-audit-row {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 0 0;
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}
.conforming-close-row {
    list-style: none;
    padding: 0.5rem 1rem;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: flex-end;
}
.conforming-close-all-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.375rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.conforming-close-all-btn:hover {
    background: var(--bg-alt);
    color: var(--primary);
    border-color: var(--primary);
}
.conforming-item:last-child {
    border-bottom: none;
}
.conforming-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    cursor: pointer;
    user-select: none;
    padding: 0.75rem 1rem;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.conforming-chevron {
    flex-shrink: 0;
}
/* Expanded clause detail within conforming item */
.conforming-detail {
    padding: 0.875rem 1rem 0.875rem;
}
.conforming-clause-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 0.75rem;
}
.conforming-clause-col {}
.conforming-clause-label {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.25rem;
}
.conforming-clause-text {
    font-size: 0.8rem;
    line-height: 1.6;
    padding: 0.5rem 0.75rem;
    background: var(--bg, #fff);
    border-left: 2px solid #86efac; /* green — matches CONFORMS */
    border-radius: 0 0.25rem 0.25rem 0;
    color: var(--text, #1e293b);
}
/* Concern bar — compact version of resolution bar for CONFORMS */
.conforming-concern-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.5rem;
    background: #f8fafc;
    border-top: 1px solid var(--border, #e2e8f0);
    flex-wrap: wrap;
}
.conforming-concern-bar .workflow-open-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.conforming-main-left {
    min-width: 0;
    flex: 1;
}
.conforming-main-right {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}
.conforming-summary-title-row {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
}
.conforming-summary-title {
    font-weight: 700;
    color: var(--text);
    font-size: 1rem;
}
.conforming-summary-meta {
    margin-top: 0.2rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}
.conforming-concern-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}
.conforming-concern-btn {
    padding: 0.2rem 0.6rem;
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 0.25rem;
    background: var(--surface, #fff);
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s;
    color: var(--text, #1e293b);
}
.conforming-concern-btn:hover {
    border-color: var(--accent, #1a365d);
    color: var(--accent, #1a365d);
}
.conforming-concern-btn.concern-active {
    background: #fef3c7;
    border-color: #d97706;
    color: #92400e;
    font-weight: 600;
}
.conforming-concern-btn.flag-active {
    background: #fee2e2;
    border-color: #dc2626;
    color: #991b1b;
    font-weight: 600;
}

.dissent-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    margin-top: 0.25rem;
    margin-left: 1.5rem;
    font-size: 0.75rem;
    color: var(--warning, #d97706);
    cursor: pointer;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    background: #fffbeb;
    border: 1px solid #fde68a;
    font-weight: 500;
    transition: background 0.15s;
}
.dissent-toggle:hover {
    background: #fef3c7;
}
.dissent-chevron {
    margin-left: 0.35rem;
}

.dissent-panel {
    margin: 0.5rem 0 0.25rem 1.5rem;
    padding: 0.75rem 1rem;
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-left: 3px solid var(--warning, #d97706);
    border-radius: var(--radius, 0.5rem);
    font-size: 0.8125rem;
}
.dissent-panel-header {
    font-weight: 600;
    color: #92400e;
    margin-bottom: 0.375rem;
    font-size: 0.8125rem;
}
.dissent-panel-intro {
    color: var(--text-muted, #64748b);
    font-size: 0.8125rem;
    margin-bottom: 0.625rem;
    line-height: 1.5;
}
.dissent-evaluator {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #fde68a;
}
.dissent-evaluator-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
.dissent-evaluator-name {
    font-weight: 600;
    color: var(--text, #1e293b);
    font-size: 0.8125rem;
}
.dissent-evaluator-reasoning {
    color: var(--text, #1e293b);
    font-size: 0.8125rem;
    line-height: 1.6;
}


/* ══════════════════════════════════════════════════════
   CHAT SCOPE SELECTOR (044)
   ══════════════════════════════════════════════════════ */

.chat-scope-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg-alt, #f8fafc);
    border-top: 1px solid var(--border, #e2e8f0);
    flex-wrap: wrap;
}

.chat-scope-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    flex-shrink: 0;
}

.chat-scope-select {
    font-size: 0.75rem;
    padding: 0.1875rem 0.375rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-sm, 0.25rem);
    background: var(--bg, #ffffff);
    color: var(--text, #1e293b);
    cursor: pointer;
    max-width: 8.125rem;
}
.chat-scope-select:focus {
    outline: none;
    border-color: var(--border-focus, #93c5fd);
}

.chat-scope-reset {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
    border: 1px solid var(--border, #e2e8f0);
    background: transparent;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.chat-scope-reset:hover {
    border-color: var(--danger, #dc2626);
    color: var(--danger, #dc2626);
}

.chat-scope-indicator {
    padding: 0.1875rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--primary, #1a365d);
    background: var(--primary-bg, #f0f4f8);
    border-left: 3px solid var(--primary, #1a365d);
    border-top: 1px solid var(--border, #e2e8f0);
}

/* ══════════════════════════════════════════════════════
   MODEL VERSION & FALLBACK (040)
   ══════════════════════════════════════════════════════ */

.model-version {
    font-size: 0.6875rem;
    font-weight: 400;
    color: var(--text-muted, #94a3b8);
}

.fallback-note {
    font-size: 0.6875rem;
    font-weight: 500;
    color: var(--warning, #d97706);
}

/* ══════════════════════════════════════════════════════
   CREDIBILITY LINE (1F)
   ══════════════════════════════════════════════════════ */

/* Credibility link — clickable, severity-colored (Step 186) */
.credibility-link {
    font-size: 0.8125rem;
    font-weight: 500;
    text-decoration: none;
    padding: 0.0625rem 0;
    border-bottom: 1px dotted currentColor;
    transition: opacity 0.15s;
}
.credibility-link:hover {
    opacity: 0.75;
    border-bottom-style: solid;
}

/* Severity-colored credibility links */
.credibility-critical { color: var(--danger, #dc2626); }
.credibility-high     { color: #c2410c; }
.credibility-medium   { color: var(--warning, #d97706); }
.credibility-low      { color: var(--info, #64748b); }

/* ══════════════════════════════════════════════════════
   CHAT SYNTH HINT (039z)
   ══════════════════════════════════════════════════════ */

.chat-synth-hint {
    font-size: 0.6875rem;
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    align-self: center;
}

/* ══════════════════════════════════════════════════════
   AGREEMENT SPLIT BADGE (039z)
   ══════════════════════════════════════════════════════ */

.badge-split {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    background: var(--bg-alt, #f1f5f9);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border, #e2e8f0);
    gap: 0.25rem;
}

.badge-split::before {
    content: "\26A1";
    font-size: 0.625rem;
}

/* ══════════════════════════════════════════════════════
   SEVERITY REVIEW / UNCLEAR (039z)
   ══════════════════════════════════════════════════════ */

.finding-card.severity-review, .finding-card.severity-REVIEW {
    border-left-color: var(--text-muted, #94a3b8);
    background: var(--bg-alt, #f8fafc);
}

.badge-review {
    background: var(--bg-alt, #f1f5f9);
    color: var(--text-muted, #64748b);
    border: 1px solid var(--border, #e2e8f0);
}

/* ══════════════════════════════════════════════════════
   EVALUATOR PANELS (1B)
   ══════════════════════════════════════════════════════ */

.evaluator-analysis-section {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.evaluator-analysis-header {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 0.375rem;
}

.evaluator-analysis-intro {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-bottom: 0.875rem;
    line-height: 1.5;
}

.evaluator-panels {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
}

.evaluator-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: var(--bg);
    overflow: hidden;
}

.evaluator-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-bottom: 1px solid var(--border);
}

.evaluator-card.eval-blue .evaluator-card-header {
    background: #eff6ff;
    border-left: 4px solid #3b82f6;
}
.evaluator-card.eval-green .evaluator-card-header {
    background: #f0fdf4;
    border-left: 4px solid #22c55e;
}
.evaluator-card.eval-red .evaluator-card-header {
    background: #fef2f2;
    border-left: 4px solid #ef4444;
}

.evaluator-name {
    color: var(--text);
}

.evaluator-verdict {
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 0.625rem;
}
.evaluator-verdict.verdict-DEVIATES {
    background: var(--danger-bg);
    color: var(--danger);
}
.evaluator-verdict.verdict-CONFORMS {
    background: var(--success-bg);
    color: var(--success);
}

.evaluator-card-body {
    padding: 0.625rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text);
}

/* ══════════════════════════════════════════════════════
   PIPELINE STAGES (1C)
   ══════════════════════════════════════════════════════ */

.pipeline-content {
    white-space: normal;
    max-height: none;
}

.pipeline-stage {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.pipeline-stage:last-child {
    border-bottom: none;
}

.stage-icon {
    flex-shrink: 0;
    width: 1.25rem;
    text-align: center;
}

.stage-name {
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

.stage-desc {
    color: var(--text-muted);
}

.pipeline-stage.stage-skipped {
    opacity: 0.6;
}

/* ══════════════════════════════════════════════════════
   FRAGILITY / DETECTION RULES (1D)
   ══════════════════════════════════════════════════════ */

.fragility-section {
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.fragility-header {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.fragility-rules {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.rule-line {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
    padding: 0.25rem 0;
}

.rule-name {
    font-weight: 500;
    text-transform: capitalize;
    color: var(--text);
    white-space: nowrap;
}

.rule-desc {
    color: var(--text-muted);
}

.rule-line.rule-fired .rule-name {
    color: var(--primary);
}

.rule-line.rule-clear {
    opacity: 0.5;
}

/* ══════════════════════════════════════════════════════
   CROSS-REFERENCE WARNINGS (Step 115)
   ══════════════════════════════════════════════════════ */

.crossref-section {
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: #fff7ed;
    border-radius: var(--radius);
    border: 1px solid #fed7aa;
}
.crossref-header {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: #c2410c;
    margin-bottom: 0.375rem;
}
.crossref-note {
    font-size: 0.8rem;
    color: #9a3412;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}
.crossref-items {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
.crossref-item {
    padding: 0.5rem 0.625rem;
    background: rgba(255,255,255,0.6);
    border-radius: 0.25rem;
    font-size: 0.8125rem;
}
.crossref-term {
    font-weight: 600;
    color: #9a3412;
}
.crossref-arrow {
    margin: 0 0.25rem;
    color: #c2410c;
}
.crossref-ref {
    color: var(--text-secondary, #475569);
}
.crossref-summary {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.4;
}

/* ══════════════════════════════════════════════════════
   CONFIDENCE DISPLAY (1E)
   ══════════════════════════════════════════════════════ */

.confidence-section {
    margin-top: 0.875rem;
    padding: 0.75rem;
    background: var(--bg-alt);
    border-radius: var(--radius);
    border: 1px solid var(--border);
}

.confidence-header {
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.confidence-line {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.25rem 0;
    font-size: 0.8125rem;
}

.confidence-name {
    flex: 0 0 13.75rem;
    font-weight: 500;
    color: var(--text);
}

.confidence-verdict {
    flex: 0 0 5rem;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
}

.confidence-bar-wrap {
    flex: 1;
    height: 0.5rem;
    background: var(--border);
    border-radius: 0.25rem;
    overflow: hidden;
}

.confidence-bar-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 0.25rem;
    transition: width 0.3s ease;
}

.confidence-pct {
    flex: 0 0 2.5rem;
    text-align: right;
    font-weight: 600;
    color: var(--text);
}

@media (max-width: 600px) {
    .confidence-name { flex: 0 0 7.5rem; font-size: 0.75rem; }
    .confidence-verdict { flex: 0 0 3.75rem; }
}

/* ══════════════════════════════════════════════════════
   ABOUT CAM MODAL (1G)
   ══════════════════════════════════════════════════════ */

.modal-content .numbered-list {
    padding-left: 1.5rem;
    counter-reset: step-counter;
    list-style: none;
}
.modal-content .numbered-list li {
    counter-increment: step-counter;
    margin-bottom: 0.75rem;
    padding-left: 0.25rem;
}
.modal-content .numbered-list li::before {
    content: counter(step-counter) ".";
    font-weight: 700;
    color: var(--primary);
    margin-right: 0.375rem;
}

/* ══════════════════════════════════════════════════════
   SECURITY NOTICE (Issue 3)
   ══════════════════════════════════════════════════════ */

.security-notice {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem 1.5rem;
    background: var(--bg);
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
}

.security-notice .security-title {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.security-notice ul {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
}

.security-notice li {
    margin-bottom: 0.25rem;
}

.security-notice-mini {
    font-size: 0.8125rem;
    color: var(--text-muted);
    padding: 0.625rem 1rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

/* ══════════════════════════════════════════════════════
   EXPIRY COUNTDOWN (Issue 4)
   ══════════════════════════════════════════════════════ */

.expiry-countdown {
    text-align: center;
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
}

.expiry-normal {
    color: var(--text-muted);
    font-weight: 500;
}

.expiry-urgent {
    color: var(--danger);
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   EMAIL CONFIRM (Issue 6)
   ══════════════════════════════════════════════════════ */

.email-mismatch-error {
    font-size: 0.75rem;
    color: var(--danger);
    margin-top: 0.25rem;
    font-weight: 500;
}

/* Email accordion (095) */
.email-accordion-card {
    padding: 0;
}
.email-open-label {
    padding: 0.75rem 1rem 0.25rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}
.email-accordion-optional {
    font-size: 0.8rem;
    color: var(--text-muted);
    font-weight: 400;
}
.email-accordion-body {
    padding: 0 1rem 0.75rem 1rem;
}
.security-list {
    list-style: disc;
    padding-left: 1.25rem;
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
}
.security-list li {
    margin-bottom: 0.25rem;
}

/* ══════════════════════════════════════════════════════
   DEAL OVERVIEW PANEL (above tabs, from deal_overview data)
   ══════════════════════════════════════════════════════ */

#deal-overview-panel {
    margin-bottom: 0.75rem;
}

.deal-overview-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.25rem 1.5rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.deal-overview-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.125rem;
    padding-bottom: 0;
}

.deal-overview-subtitle {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border);
}

.deal-overview-footer {
    margin-top: 0.75rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--border, #e2e8f0);
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}

/* Step 299: Provision Health Heatmap */
.provision-heatmap-section {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem 1.25rem 1rem;
    margin-bottom: 0.75rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.provision-heatmap-section-header {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    text-transform: uppercase;
    margin-bottom: 0.625rem;
}
.provision-heatmap-contract {
    margin-bottom: 0.75rem;
}
.provision-heatmap-contract:last-child {
    margin-bottom: 0;
}
.provision-heatmap-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.375rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.provision-heatmap-row {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
}
.provision-heatmap-cell {
    width: 40px;
    height: 40px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: filter 0.1s;
    user-select: none;
}
.provision-heatmap-cell:hover {
    filter: brightness(0.88);
}
/* Step 338: directional mismatch arrow badge — white on semi-transparent dark chip
   so it remains legible against all risk-level background colors (red, amber, green, gray) */
.heatmap-dir-badge {
    position: absolute;
    bottom: 2px;
    right: 2px;
    font-size: 8px;
    line-height: 1;
    color: #fff;
    background: rgba(0,0,0,0.30);
    border-radius: 2px;
    padding: 0 1px;
    pointer-events: none;
}

/* Step 338: risk map legend */
.provision-heatmap-legend {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    padding: 0.3rem 0.5rem 0.1rem;
    font-size: 0.65rem;
}
.hm-legend-item {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #6b7280;
    white-space: nowrap;
}
.hm-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.provision-heatmap-legend-note {
    padding: 0 0.5rem 0.4rem;
    font-size: 0.6rem;
    color: #9ca3af;
    line-height: 1.4;
}

.findings-panel-header {
    padding: 0.5rem 1rem 0.25rem 1rem;
    display: flex;
    align-items: baseline;
    gap: 1rem;
    flex-wrap: wrap;
}

.findings-panel-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    flex: 1;
}

.findings-panel-provcount {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
}

.deal-party {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.5;
}

.deal-role {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.deal-property {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 0.125rem;
    margin-bottom: 0.75rem;
}

.deal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.375rem 2rem;
    margin-bottom: 0.5rem;
}

@media (max-width: 600px) {
    .deal-grid {
        grid-template-columns: 1fr;
    }
}

.deal-grid-item {
    display: flex;
    gap: 0.5rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    padding: 0.125rem 0;
}

.deal-label {
    color: var(--text-muted);
    font-weight: 600;
    white-space: nowrap;
    min-width: 5.5rem;
}

.deal-value {
    color: var(--text);
}

/* ── Provisions Checklist (Traffic Light Layout) ── */
#provisions-checklist {
    margin-bottom: 0.75rem;
}
.provisions-checked-header {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}
.provisions-checked-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}

.prov-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-size: 0.6875rem;
    font-weight: 500;
    white-space: nowrap;
}
.prov-chip-conforms {
    color: var(--success);
    background: var(--success-bg);
    border: 1px solid #bbf7d0;
}
.prov-chip-deviates {
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.prov-chip-deviates:hover {
    opacity: 0.85;
}
.prov-chip-CRITICAL {
    color: var(--danger);
    background: var(--danger-bg);
    border: 1px solid #fecaca;
}
.prov-chip-HIGH {
    color: #c2410c;
    background: var(--high-bg);
    border: 1px solid #fed7aa;
}
.prov-chip-MEDIUM {
    color: #a16207;
    background: var(--medium-bg);
    border: 1px solid #fde68a;
}
.prov-chip-LOW {
    color: var(--info);
    background: var(--low-bg);
    border: 1px solid #e2e8f0;
}
.prov-chip-unclear {
    color: #6d28d9;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.prov-chip-unclear:hover { opacity: 0.85; }

/* Results Legend */
.results-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    margin-bottom: 0.75rem;
    font-size: 0.72rem;
    color: var(--text-secondary, #475569);
}
.legend-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3125rem;
    white-space: nowrap;
}
.legend-dot {
    width: 0.625rem;
    height: 0.625rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.legend-critical { background: #e11d48; }
.legend-high     { background: #f97316; }
.legend-medium   { background: #f59e0b; }
.legend-low      { background: #64748b; }
.legend-conforms { background: #16a34a; }


/* LP-00 Identity Block */
.identity-block {
    background: var(--bg-alt, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 1rem;
}
.identity-block-title {
    font-weight: 600;
    font-size: 0.8125rem;
    margin-bottom: 0.5rem;
    color: var(--text, #1e293b);
}
.identity-raw {
    font-size: 0.75rem;
    white-space: pre-wrap;
    color: var(--text-muted, #64748b);
    margin: 0;
    font-family: inherit;
}

/* ══════════════════════════════════════════════════════
   RESULTS TAB BAR (Findings / Document Comparison)
   ══════════════════════════════════════════════════════ */

.results-tab-bar {
    display: flex;
    gap: 0.5rem;
    margin: 1.25rem 0 1.5rem;
    padding: 0;
    border-bottom: none;
}

.results-tab {
    padding: 0.5rem 1.25rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    background: var(--bg, #ffffff);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
    letter-spacing: 0.01em;
}
.results-tab:hover:not(.active) {
    border-color: var(--primary, #1a365d);
    color: var(--primary, #1a365d);
    background: var(--bg, #ffffff);
}
.results-tab.active {
    background: var(--primary, #1a365d);
    color: #ffffff;
    border-color: var(--primary, #1a365d);
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.1));
}

/* ══════════════════════════════════════════════════════
   DOCUMENT COMPARISON VIEW (Item C)
   ══════════════════════════════════════════════════════ */

.docview-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
}

.docview-container-sbs {
    display: block;
    overflow: visible;
    border: none;
    border-radius: 0;
    background: transparent;
}

.docview-sbs-sticky-header {
    position: sticky;
    top: 0;
    z-index: 5;
    background: var(--bg);
    padding: 0 0 0.625rem;
    box-shadow: 0 14px 18px -22px rgba(15, 23, 42, 0.42);
}

.docview-sbs-column-header-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
}

.docview-sbs-body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
}
.docview-sbs-body > * {
    min-width: 0;
    overflow-wrap: break-word;
    word-break: break-word;
}

@media (max-width: 768px) {
    .docview-container {
        grid-template-columns: 1fr;
    }
    .docview-sbs-column-header-row,
    .docview-sbs-body {
        grid-template-columns: 1fr;
    }
}

/* Column headers */
.docview-column-header {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}
.docview-column-header:first-child {
    border-right: 1px solid var(--border);
}
.docview-column-header-primary {
    background: var(--primary);
    color: #fff;
}
.docview-column-header-secondary {
    background: var(--bg);
    color: var(--text-muted);
}

@media (max-width: 768px) {
    .docview-column-header:first-child {
        border-right: none;
    }
}

/* Provision header bar (spans full width via grid column) */
.docview-provision-header {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-alt);
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}

.docview-provision-header .severity-badge {
    font-size: 0.6875rem;
}

/* Provision header — deviation variant */
.docview-provision-header.docview-deviation {
    background: #FFF5F5;
}

/* Provision header — conforms variant */
.docview-provision-header.docview-conforms {
    background: var(--bg);
    border-left: 3px solid var(--success);
}

/* Provision header — omission variant */
.docview-provision-header.docview-omission {
    background: #FFF5F5;
}

.docview-provision-header .deviation-header-main {
    min-width: 0;
}

.docview-provision-header .deviation-header-left {
    min-width: 0;
}

.docview-provision-header .credibility-link {
    font-size: 0.8rem;
}

.docview-header-toggle {
    width: 2rem;
    height: 2rem;
    border-radius: 999px;
    border: 1px solid #cbd5e1;
    background: #ffffff;
    color: #64748b;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
}

.docview-header-toggle:hover {
    border-color: #94a3b8;
    color: #334155;
}

.docview-header-toggle.open {
    border-color: #93c5fd;
    background: #eff6ff;
    color: #1d4ed8;
}

.docview-row-controls {
    grid-column: 1 / -1;
    background: #ffffff;
}

.docview-clause-summary {
    grid-column: 1 / -1;
    padding: 0.85rem 1rem 0.25rem;
    background: #ffffff;
    border-top: 1px solid var(--border);
}

.docview-resolution-bar {
    border-top: none;
    border-bottom: 1px solid var(--border);
    background: #fbfdff;
    padding: 0.55rem 0.85rem 0.65rem;
}

.docview-resolution-bar .finding-workflow-row {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0;
    row-gap: 0.9rem;
    align-items: start;
}

.docview-resolution-bar .finding-workflow-row > .workflow-group {
    margin-right: 0;
}

.docview-resolution-bar .workflow-divider,
.docview-resolution-bar .workflow-divider-spacer {
    display: none;
}

.docview-resolution-bar .workflow-group-status {
    grid-column: 1 / -1;
    grid-row: 1;
    min-width: 0;
    flex-wrap: nowrap;
}

.docview-resolution-bar .workflow-group-status .res-pills {
    gap: 0.35rem;
}

.docview-resolution-bar .workflow-group-status::after {
    display: none;
}

.docview-pipe {
    display: inline-block;
    width: 0.0625rem;
    height: 1.5rem;
    background: #dbe3ee;
    border-radius: 999px;
    margin-left: 0.55rem;
    margin-right: 0.55rem;
    align-self: center;
    flex: 0 0 auto;
}

.docview-resolution-bar .workflow-group-decision {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    flex-wrap: wrap;
}

/* Tools is now inside .workflow-group-status in docview */

.docview-resolution-bar .workflow-open-actions {
    grid-column: 2;
    grid-row: 2;
    margin-left: 0;
    justify-content: flex-end;
    align-self: center;
    padding-top: 0;
    width: 100%;
    gap: 2%;
}

.docview-resolution-bar .workflow-group-decision::after {
    content: "";
    width: 0.0625rem;
    height: 1.5rem;
    background: #dbe3ee;
    border-radius: 999px;
    margin-left: 0.65rem;
    margin-right: 0.65rem;
    align-self: center;
    flex: 0 0 auto;
}

.docview-resolution-bar .workflow-open-actions > a {
    flex: 1 1 45%;
    min-width: 0;
    min-height: 2rem;
}

.docview-workflow-note {
    margin-top: 0.45rem;
    font-size: 0.72rem;
    color: var(--text-muted);
}

.docview-concern-bar {
    justify-content: space-between;
    border-top: none;
    border-bottom: 1px solid var(--border, #e2e8f0);
    padding: 0.55rem 0.85rem 0.65rem;
    background: #fbfdff;
}

.docview-concern-bar .workflow-open-actions {
    margin-left: auto;
}

.docview-res-notes-panel {
    margin-top: 0.65rem;
}

/* "Back to Summary" link in document comparison */
.docview-back-link {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    margin-bottom: 0.5rem;
}
.docview-back-link:hover {
    text-decoration: underline;
    background: var(--bg-alt);
}

/* "Back to Summary" link inside docview analysis panels */
.docview-back-to-card {
    text-align: right;
    padding: 0.75rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary, #2563eb);
    cursor: pointer;
    margin-top: 0.5rem;
}
.docview-back-to-card:hover {
    text-decoration: underline;
}

.docview-analysis-trigger {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--primary);
    background: #f0f4ff;
    border-top: 1px solid var(--border);
    border-left: 3px solid var(--primary);
    cursor: pointer;
    user-select: none;
    transition: background 0.15s ease;
}
.docview-analysis-trigger:hover {
    background: #e0e9ff;
}

/* "View in document comparison" link in finding cards */
.docview-link {
    font-size: 0.8125rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-top: 0.5rem;
}
.docview-link:hover {
    text-decoration: underline;
}

/* Text cells (left = template, right = tenant) */
.docview-text {
    padding: 0.75rem 1rem;
    font-size: 0.8125rem;
    line-height: 1.7;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
    border-top: 1px solid var(--border);
    min-height: 3.75rem;
}

/* Template column (left) gets a right border */
.docview-text.docview-template {
    border-right: 1px solid var(--border);
}

@media (max-width: 768px) {
    .docview-text.docview-template {
        border-right: none;
    }
}

/* Deviation highlighting — tenant text gets orange bg */
.docview-text.docview-tenant.docview-deviation {
    background: #fff7ed;
    border-left: 3px solid var(--warning);
}

/* Conforming — template text gets green left border */
.docview-text.docview-template.docview-conforms {
    border-left: 3px solid var(--success);
}

.docview-main-sbs .docview-provision-header:first-of-type {
    margin-top: 0.625rem;
}

/* Omission (template-only) — tenant text shows warning */
.docview-text.docview-tenant.docview-omission {
    background: var(--danger-bg);
    color: var(--text-muted);
    font-style: italic;
}

/* Click-to-expand analysis panel */
.docview-analysis {
    grid-column: 1 / -1;
    padding: 1rem 1.5rem;
    background: var(--info-bg);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    animation: docview-slide-in 0.2s ease;
}

@keyframes docview-slide-in {
    from { opacity: 0; max-height: 0; padding-top: 0; padding-bottom: 0; }
    to { opacity: 1; max-height: 37.5rem; }
}

.docview-analysis-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.docview-analysis-header .severity-badge {
    font-size: 0.8125rem;
}

.docview-analysis-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
}
.docview-analysis-close:hover {
    color: var(--text);
}

.docview-analysis .detail-section {
    margin-bottom: 0.625rem;
}
.docview-analysis .detail-label {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    margin-bottom: 0.125rem;
}
.docview-analysis .detail-text {
    font-size: 0.8125rem;
    line-height: 1.6;
}
.docview-analysis .evaluator-line {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

/* ══════════════════════════════════════════════════════
   FULL DOCUMENT VIEW (Item 5 — 039s)
   ══════════════════════════════════════════════════════ */

/* Toolbar (tenant selector + view mode toggle) */
.docview-sticky-controls {
    margin-top: 0.75rem;
    padding-top: 0.25rem;
}

.docview-toolbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}
.docview-mode-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.docview-sort-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
}
.docview-sort-label {
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--text-muted);
}
.docview-sort-toggle {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.docview-mode-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.docview-mode-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}
.docview-sort-btn {
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: none;
    background: var(--bg);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
}
.docview-sort-btn:not(:last-child) {
    border-right: 1px solid var(--border);
}
.docview-mode-btn.active {
    background: var(--primary);
    color: #fff;
}
.docview-sort-btn.active {
    background: var(--primary);
    color: #fff;
}
.docview-mode-btn:hover:not(.active) {
    background: var(--bg-alt);
}
.docview-sort-btn:hover:not(.active) {
    background: var(--bg-alt);
}

.docview-sticky-controls .docview-toolbar {
    margin-bottom: 0.625rem;
}

.docview-sticky-controls .docview-search-bar {
    margin-bottom: 0;
}

/* Full document layout: sidebar + main */
.docview-full-layout {
    display: flex;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: var(--bg);
    max-height: 80vh;
}

/* Sidebar */
.docview-sidebar {
    width: 13.75rem;
    min-width: 12.5rem;
    background: var(--bg-alt);
    border-right: 1px solid var(--border);
    overflow-y: auto;
    position: sticky;
    top: 0;
    flex-shrink: 0;
}
.fulldoc-sidebar-header {
    padding: 0.75rem 0.75rem 0.5rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}
.fulldoc-sidebar-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.4375rem 0.75rem;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 3px solid transparent;
}
.fulldoc-sidebar-item:hover {
    background: rgba(37, 99, 235, 0.06);
}
.fulldoc-sidebar-item.active {
    background: rgba(37, 99, 235, 0.08);
    border-left-color: var(--accent);
    font-weight: 600;
}
.fulldoc-sidebar-item.no-match {
    opacity: 0.5;
}
.fulldoc-sidebar-label {
    flex: 1;
    white-space: normal;
    word-wrap: break-word;
    line-height: 1.4;
}
.fulldoc-sidebar-sev {
    font-size: 0.625rem;
    font-weight: 600;
    opacity: 0.7;
}
.fulldoc-sidebar-divider {
    height: 0.0625rem;
    background: var(--border);
    margin: 0.375rem 0.75rem;
}
.fulldoc-dot {
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
    display: inline-block;
    font-size: 0.5rem;
    line-height: 0.5rem;
    text-align: center;
}
.fulldoc-dot-CRITICAL { background: #e11d48; }
.fulldoc-dot-HIGH     { background: #f97316; }
.fulldoc-dot-MEDIUM   { background: #f59e0b; }
.fulldoc-dot-LOW      { background: #64748b; }
.fulldoc-dot-conform {
    background: none;
    color: var(--success);
    font-size: 0.625rem;
    width: auto;
}

/* Main panel */
.docview-main, .docview-main-sbs {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
}

.docview-main-sbs {
    padding-top: 0;
}
.fulldoc-text {
    font-size: 0.8125rem;
    line-height: 1.8;
    color: var(--text);
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Highlighted provision text */
.fulldoc-highlight {
    border-radius: 0.125rem;
    padding: 0.0625rem 0;
    scroll-margin-top: 3.75rem;
}
.fulldoc-hl-CRITICAL { background: rgba(254, 202, 202, 0.5); }
.fulldoc-hl-HIGH { background: rgba(254, 215, 170, 0.5); }
.fulldoc-hl-MEDIUM { background: rgba(253, 230, 138, 0.4); }
.fulldoc-hl-LOW { background: rgba(226, 232, 240, 0.5); }

/* Margin callout cards — compact sticky-note style */
.fulldoc-callout {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.25rem 0.5rem;
    margin: 0.25rem 0;
    padding: 0.25rem 0.625rem;
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--border);
    background: var(--bg-alt);
    font-size: 0.8rem;
    line-height: 1.5;
}
.fulldoc-callout-CRITICAL { border-left-color: var(--danger); background: #fef2f2; }
.fulldoc-callout-HIGH { border-left-color: #ea580c; background: #fff7ed; }
.fulldoc-callout-MEDIUM { border-left-color: var(--warning); background: #fffbeb; }
.fulldoc-callout-LOW { border-left-color: var(--info); background: #f8fafc; }

.fulldoc-callout-header {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-weight: 600;
    font-size: 0.75rem;
}
.fulldoc-callout-header .severity-badge {
    font-size: 0.6875rem;
    padding: 0 0.375rem;
}
.fulldoc-callout-text {
    font-size: 0.75rem;
    color: var(--text);
    line-height: 1.4;
}
.fulldoc-callout-link {
    font-size: 0.7rem;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.fulldoc-callout-link:hover {
    text-decoration: underline;
}

@media (max-width: 768px) {
    .docview-full-layout {
        flex-direction: column;
        max-height: none;
    }
    .docview-sidebar {
        width: 100%;
        min-width: unset;
        max-height: 12.5rem;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .docview-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ── Template vs Tenant Language Blocks (039d) ── */

.finding-language-pair {
    margin-bottom: 0.75rem;
}

.finding-language {
    margin-bottom: 0.5rem;
}

.finding-language-label {
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-bottom: 0.25rem;
}

.finding-language-text {
    font-size: 0.8125rem;
    line-height: 1.6;
    padding: 0.5rem 0.75rem;
    background: var(--bg);
    border-radius: var(--radius-sm, 0.25rem);
    border-left: 2px solid var(--border);
    /* No max-height — expands to full clause length */
}

/* ══════════════════════════════════════════════════════
   CLAUSE COMPARISON DIFF (051)
   ══════════════════════════════════════════════════════ */

/* Side-by-side pair layout */
.finding-language-pair--diff {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    align-items: start; /* columns align to top; height equalised via flex below */
}
/* Make both text boxes in a diff pair match height of the taller one */
.finding-language-pair--diff .finding-language {
    display: flex;
    flex-direction: column;
}
.finding-language-pair--diff .finding-language-text {
    flex: 1;
}

/* Word-level diff spans */
.diff-removed {
    background: #fee2e2;
    color: #991b1b;
    text-decoration: line-through;
    text-decoration-color: #dc2626;
    border-radius: 0.125rem;
    padding: 0 0.0625rem;
}
.diff-added {
    background: #fef9c3;
    color: #713f12;
    border-radius: 0.125rem;
    padding: 0 0.0625rem;
    font-weight: 500;
}

/* Legend pills next to label */
.diff-legend {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.0625rem 0.3125rem;
    border-radius: 999px;
    margin-left: 0.375rem;
    vertical-align: middle;
}
.diff-legend--removed {
    background: #fee2e2;
    color: #991b1b;
}
.diff-legend--added {
    background: #fef9c3;
    color: #713f12;
}

/* Modified template side */
.finding-language-text--template-diff {
    border-left: 2px solid #fca5a5;
    background: #fff5f5;
}

/* Modified tenant side */
.finding-language-label--modified {
    color: #92400e;
}
.finding-language-text--tenant-diff {
    border-left: 2px solid #fbbf24;
    background: #fffbf0;
}

/* ── Case 2: ADDED (tenant-inserted) ── */
.finding-language--added .finding-language-label--added {
    color: #1d4ed8;
    font-weight: 700;
}
.finding-language-text--added {
    border-left: 3px solid #3b82f6;
    background: #eff6ff;
    font-style: italic;
}

/* ── Case 3: REMOVED (omitted from tenant) ── */
.finding-language--removed .finding-language-label--removed {
    color: #991b1b;
    font-weight: 700;
}
.finding-language-text--removed {
    border-left: 3px solid #dc2626;
    background: #fff5f5;
    opacity: 0.85;
}
.finding-language-text--removed-placeholder {
    border-left: 3px solid #e5e7eb;
    background: #f9fafb;
    color: var(--text-muted, #64748b);
    font-style: italic;
    font-size: 0.8125rem;
}
.finding-language--removed-placeholder .finding-language-label {
    color: var(--text-muted, #64748b);
}

/* ── Cross-Reference Links (039c) ── */

.provision-link {
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline dotted;
    font-weight: 500;
}
.provision-link:hover {
    text-decoration: underline solid;
}

.provision-link-unanalyzed {
    color: var(--text-muted);
    font-style: italic;
    cursor: help;
}

.cascade-badge {
    display: inline-block;
    font-size: 0.75rem;
    background: var(--warning-bg);
    color: var(--warning);
    border-radius: var(--radius-sm);
    padding: 0.125rem 0.5rem;
    margin-left: 0.5rem;
    font-weight: 500;
}

/* Cascade source callout (039t Item 4) */
.cascade-source-callout {
    padding: 0.375rem 1rem;
    background: #fffbeb;
    border-left: 3px solid var(--warning);
    font-size: 0.8125rem;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.cascade-source-link {
    font-size: 0.75rem;
    color: var(--accent);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}
.cascade-source-link:hover {
    text-decoration: underline;
}

@keyframes highlightFlash {
    0%   { background-color: rgba(255, 213, 79, 0.45); }
    100% { background-color: transparent; }
}
.highlight-flash {
    animation: highlightFlash 1.5s ease-out;
}

/* ══════════════════════════════════════════════════════
   DOCUMENT VIEW SEARCH BAR (039t Item 3)
   ══════════════════════════════════════════════════════ */

.docview-search-bar {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    margin-bottom: 0.75rem;
    padding: 0.375rem 0.625rem;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.docview-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 0.8125rem;
    font-family: var(--font);
    padding: 0.25rem 0.375rem;
    background: transparent;
    min-width: 7.5rem;
}
.docview-search-count {
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
}
.docview-search-nav {
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    line-height: 1;
}
.docview-search-nav:hover {
    background: var(--bg-alt);
    color: var(--text);
}
.docview-search-clear {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    font-size: 1rem;
    padding: 0.125rem 0.25rem;
    line-height: 1;
}
.docview-search-clear:hover {
    color: var(--danger);
}

/* Search match highlights */
.search-match {
    background: #fde68a;
    border-radius: 0.125rem;
    padding: 0 0.0625rem;
}
.search-match-active {
    background: #f59e0b;
    outline: 2px solid #d97706;
    border-radius: 0.125rem;
    padding: 0 0.0625rem;
}

/* ══════════════════════════════════════════════════════
   SIDEBAR TABLE OF CONTENTS (039t Item 9b)
   ══════════════════════════════════════════════════════ */

.sidebar-toc-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.sidebar-toc-toggle:hover {
    color: var(--text);
    background: rgba(37, 99, 235, 0.04);
}
.toc-arrow {
    font-size: 0.625rem;
}
.sidebar-toc-content {
    padding: 0 0.5rem 0.5rem;
}
.sidebar-toc-expand-all {
    width: calc(100% - 1rem);
    margin: 0 0.5rem 0.5rem;
    padding: 0.35rem 0.625rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--bg);
    color: var(--text-muted);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    cursor: pointer;
}
.sidebar-toc-expand-all:hover {
    background: rgba(37, 99, 235, 0.05);
    color: var(--text);
}
.sidebar-toc-group + .sidebar-toc-group {
    margin-top: 0.125rem;
}
.sidebar-toc-item {
    padding: 0.25rem 0.75rem;
    font-size: 0.6875rem;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    line-height: 1.4;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.sidebar-toc-item-article {
    font-weight: 600;
}
.sidebar-toc-item:hover {
    background: rgba(37, 99, 235, 0.06);
    color: var(--text);
}
.sidebar-toc-group-toggle {
    width: 1rem;
    height: 1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    flex: 0 0 auto;
    font-size: 0.625rem;
}
.sidebar-toc-group-toggle:hover {
    color: var(--text);
}
.sidebar-toc-group-toggle-hidden {
    visibility: hidden;
    pointer-events: none;
}
.sidebar-toc-sections {
    margin: 0.125rem 0 0.25rem;
}
.sidebar-toc-item-section {
    padding-left: 1.25rem;
    font-size: 0.665rem;
}
.sidebar-toc-severity {
    width: 0.45rem;
    height: 0.45rem;
    border-radius: 999px;
    flex: 0 0 auto;
}
.sidebar-toc-severity-CRITICAL { background: #e11d48; }
.sidebar-toc-severity-HIGH { background: #f97316; }
.sidebar-toc-severity-MEDIUM { background: #f59e0b; }
.sidebar-toc-severity-LOW { background: #64748b; }

/* ══════════════════════════════════════════════════════
   CROSS-TENANT ISSUE MATRIX (039t Item 11)
   ══════════════════════════════════════════════════════ */

.cross-tenant-card {
    margin-bottom: 1.25rem;
}
.xtenant-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    margin-bottom: 0.25rem;
    border-left: 3px solid var(--border);
}
.xtenant-icon {
    flex-shrink: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}
.xtenant-issue {
    font-size: 0.8125rem;
    font-weight: 600;
    min-width: 11.25rem;
    flex-shrink: 0;
}
.xtenant-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}
.xtenant-chip {
    font-size: 0.75rem;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.08);
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    transition: background 0.15s;
}
.xtenant-chip:hover {
    background: rgba(37, 99, 235, 0.18);
}
.xtenant-row-CRITICAL { background: #fef2f2; border-left-color: var(--danger); }
.xtenant-row-HIGH { background: #fff7ed; border-left-color: #ea580c; }
.xtenant-row-MEDIUM { background: #fffbeb; border-left-color: var(--warning); }
.xtenant-row-LOW { background: #f8fafc; border-left-color: var(--text-light); }
.xtenant-row-CONFORMS { background: #f0fdf4; border-left-color: var(--success); }

/* ══════════════════════════════════════════════════════
   ALWAYS-ON CHAT PANEL (039v — replaces FAB/drawer)
   ══════════════════════════════════════════════════════ */

/* ── Three-column results layout ── */
.results-layout {
    display: grid;
    grid-template-columns: 18% minmax(0, 1fr) 18%;
    grid-template-rows: auto auto 1fr;
    column-gap: 1rem;
    row-gap: 0;
    flex: 1;
    height: 100%;
    min-height: 0;
    overflow: hidden;
}
.results-layout > .top-tab-bar {
    grid-column: 2;
    grid-row: 1;
}
.results-layout > .tab-subheader {
    grid-column: 2;
    grid-row: 2;
}
.results-layout > .nav-sidebar {
    grid-column: 1;
    grid-row: 1 / 4;
}
.results-layout > .results-content {
    grid-column: 2;
    grid-row: 3;
}
.results-layout > .chat-panel {
    grid-column: 3;
    grid-row: 1 / 4;
    align-self: stretch;
    min-height: 0;
}

/* ── Left nav sidebar ── */
.nav-sidebar {
    width: 100%;
    min-width: 0;
    flex-shrink: 0;
    border-right: none;
    overflow-y: auto;
    background: linear-gradient(180deg, #f8fafc 0%, #fbfcfe 24%, #ffffff 100%);
    padding: 0;
    display: flex;
    flex-direction: column;
    box-shadow: 6px 0 18px rgba(15, 23, 42, 0.04);
    position: relative;
    z-index: 1;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.nav-sidebar-header {
    padding: 0.875rem 0.5rem 0.75rem;
    color: var(--text, #1e293b);
    border-bottom: 1px solid var(--border, #e2e8f0);
    position: sticky;
    top: 0;
    background: rgba(248, 250, 252, 0.96);
    backdrop-filter: blur(6px);
    z-index: 2;
    box-sizing: border-box;
}

.nav-sidebar-header-main {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #64748b;
    padding-left: 1rem;
}

.nav-sidebar-header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-right: 0.5rem;
}
.nav-sidebar-header-meta {
    margin-top: 0.25rem;
    font-size: 0.76rem;
    font-weight: 600;
    color: #334155;
    padding-left: 1rem;
}

/* ── Sidebar Legend ── */
.nav-legend-toggle {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
    cursor: pointer;
    white-space: nowrap;
    user-select: none;
}
.nav-legend-toggle input {
    margin: 0;
    cursor: pointer;
}
.nav-legend-panel {
    padding: 0.5rem 0.75rem 0.65rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: #f8fafc;
}
.nav-legend-entry {
    padding: 0.4rem 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.5);
}
.nav-legend-entry:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.nav-legend-entry-header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    flex-wrap: wrap;
}
.nav-legend-conf-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: #64748b;
}
.nav-legend-count {
    font-size: 0.65rem;
    font-weight: 600;
    color: #94a3b8;
}
.nav-legend-meaning {
    font-size: 0.7rem;
    line-height: 1.45;
    color: #475569;
    margin-top: 0.2rem;
    padding-left: 0.15rem;
}
.nav-legend-empty {
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
    padding: 0.5rem 0;
}

.nav-sidebar-content {
    padding: 0.625rem 0.5rem 0.75rem;
    flex: 1;
    overflow-y: auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #94a3b8 #e2e8f0;
}

.nav-sidebar::-webkit-scrollbar,
.nav-sidebar-content::-webkit-scrollbar {
    width: 0.6875rem;
}

.nav-sidebar::-webkit-scrollbar-track,
.nav-sidebar-content::-webkit-scrollbar-track {
    background: #e2e8f0;
    border-radius: 999px;
}

.nav-sidebar::-webkit-scrollbar-thumb,
.nav-sidebar-content::-webkit-scrollbar-thumb {
    background: #94a3b8;
    border-radius: 999px;
    border: 2px solid #e2e8f0;
}

.nav-sidebar::-webkit-scrollbar-thumb:hover,
.nav-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #64748b;
}

.nav-tenant {
    margin: 0 0 0.625rem;
    padding: 0.5rem 0 0.375rem;
    border-radius: 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-left: 4px solid #cbd5e1;
    background: #ffffff;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.05);
    overflow: hidden;
    position: relative;
}

.nav-tenant.active {
    border-color: rgba(36, 59, 107, 0.28);
    border-left-color: transparent;
    box-shadow: 0 18px 34px rgba(15, 23, 42, 0.12);
    padding-top: 0;
}

.nav-tenant.active::after {
    content: "";
    position: absolute;
    left: 0;
    top: 2.875rem;
    bottom: 0;
    width: 0.25rem;
    background: #cbd5e1;
}

/* Severity-colored left border on cards */
.nav-tenant.sev-critical { border-left-color: #ef4444; }
.nav-tenant.sev-high     { border-left-color: #f97316; }
.nav-tenant.sev-medium   { border-left-color: #eab308; }
.nav-tenant.sev-clear    { border-left-color: #22c55e; }

.nav-tenant.active.sev-critical,
.nav-tenant.active.sev-high,
.nav-tenant.active.sev-medium,
.nav-tenant.active.sev-clear {
    border-left-color: transparent;
}

.nav-tenant.active.sev-critical::after { background: #ef4444; }
.nav-tenant.active.sev-high::after     { background: #f97316; }
.nav-tenant.active.sev-medium::after   { background: #eab308; }
.nav-tenant.active.sev-clear::after    { background: #22c55e; }

.nav-tenant-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem 0.375rem;
    font-size: 0.8125rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text, #1e293b);
    transition: background 0.15s;
    position: relative;
    z-index: 1;
}

.nav-tenant-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-width: 0;
}

.nav-tenant-header-status {
    display: none;
}

.nav-tenant-title-text {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nav-tenant-label:hover {
    background: var(--bg-alt, #f1f5f9);
}

.nav-tenant-label.active {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    background: #243b6b;
    box-shadow: none;
    color: #ffffff;
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    gap: 0.5rem;
}

.nav-tenant-label.active .nav-tenant-title-text {
    font-weight: 800;
}

.nav-tenant-label.active .nav-tenant-status {
    color: #ffffff;
}

.nav-tenant.active .nav-tenant-header-status {
    display: block;
    margin-left: 1.375rem;
    padding: 0;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1.2;
    opacity: 0.92;
    white-space: nowrap;
}

.nav-tenant.active .nav-tenant-title-wrap {
    width: 100%;
}

.nav-tenant.active .nav-status-label {
    display: none;
}

.nav-tenant-status {
    font-size: 0.75rem;
}

.nav-provisions {
    padding: 0.125rem 0 0.375rem 1.6875rem;
}

.nav-provision-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.375rem;
    margin: 0.125rem;
    font-size: 0.6875rem;
    border-radius: 0.1875rem;
    cursor: pointer;
    color: var(--text-muted, #64748b);
    transition: background 0.15s;
}

.nav-provision-item:hover {
    background: var(--bg-alt, #f1f5f9);
}

.nav-provision-item.deviation {
    font-weight: 500;
    color: var(--text, #1e293b);
}

/* Severity dots in nav */
.nav-dot {
    width: 0.375rem;
    height: 0.375rem;
    border-radius: 50%;
    display: inline-block;
    flex-shrink: 0;
}
.nav-dot.critical { background: #e11d48; }
.nav-dot.high     { background: #f97316; }
.nav-dot.medium   { background: #f59e0b; }
.nav-dot.low      { background: #64748b; }

/* ── New sidebar section headers ── */
.nav-section-header {
    padding: 0.5rem 0.75rem 0.25rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
}
.nav-section-header--all {
    margin-top: 0.25rem;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 0.375rem;
}
.nav-section-toggle {
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    user-select: none;
}
.nav-section-toggle:hover {
    color: var(--primary, #1a365d);
}
.nav-all-count {
    font-weight: 400;
    color: var(--text-muted, #94a3b8);
}

.nav-section-toggle-label {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
}

/* ── Open Issues list ── */
.nav-issues-list {
    padding: 0.1875rem 0.5rem 0.3125rem;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.nav-issue-item {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 0.1875rem 0.5625rem;
    border-radius: 0.625rem;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
    border-left: 3px solid transparent;
    border: 1px solid transparent;
    position: relative;
}
.nav-issue-item:hover {
    background: #f8fafc;
    transform: translateX(1px);
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.18);
}
.nav-issue-critical { border-left-color: #e11d48; border-left-width: 4px; }
.nav-issue-high     { border-left-color: #f97316; border-left-width: 4px; }
.nav-issue-medium   { border-left-color: #f59e0b; border-left-width: 3px; }
.nav-issue-low      { border-left-color: #94a3b8; border-left-width: 3px; }
.nav-issue-critical {
    background: linear-gradient(90deg, rgba(225, 29, 72, 0.05) 0%, rgba(255, 255, 255, 0) 48%);
}
.nav-issue-high {
    background: linear-gradient(90deg, rgba(249, 115, 22, 0.04) 0%, rgba(255, 255, 255, 0) 42%);
}
.nav-issue-topfocus {
    box-shadow: inset 0 0 0 1px rgba(148, 163, 184, 0.22);
    background-color: rgba(248, 250, 252, 0.9);
}
.nav-issue-topfocus .nav-issue-name {
    font-weight: 700;
}

/* ── Sidebar issue row: two-row layout (step 218) ── */
.nav-issue-main-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}
.nav-issue-sub-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 0.15rem;
    margin-top: 0.2rem;
}
.nav-confidence-label {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    color: var(--text-secondary, #475569);
}
.nav-confidence-label.nav-confidence-confirmed  { color: #15803d; }
.nav-confidence-label.nav-confidence-fragile    { color: #b45309; }
.nav-confidence-label.nav-confidence-uncertain  { color: #64748b; }
.nav-confidence-label.nav-confidence-unverified { color: #94a3b8; }

.nav-issue-topfocus:nth-child(1) {
    box-shadow: inset 0 0 0 1px rgba(36, 59, 107, 0.18);
    background-image: linear-gradient(90deg, rgba(36, 59, 107, 0.065) 0%, rgba(255, 255, 255, 0) 52%);
}
.nav-issue-priority + .nav-issue-item:not(.nav-issue-priority) {
    margin-top: 0.125rem;
    padding-top: 0.5rem;
    border-top-color: rgba(226, 232, 240, 0.95);
}

.nav-issue-signal {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    flex: 0 0 auto;
    min-width: max-content;
    padding-top: 0.0625rem;
}

.nav-issue-sev {
    font-size: 0.58rem;
    font-weight: 700;
    padding: 0.125rem 0.375rem;
    border-radius: 999px;
    flex-shrink: 0;
    letter-spacing: 0.045em;
    border: 1px solid transparent;
}
.nav-issue-sev-critical { background: #fee2e2; color: #991b1b; border-color: #fecaca; }
.nav-issue-sev-high     { background: #fff7ed; color: #9a3412; border-color: #fed7aa; }
.nav-issue-sev-medium   { background: #fef3c7; color: #92400e; border-color: #fde68a; }
.nav-issue-sev-low      { background: #f8fafc; color: #475569; border-color: #cbd5e1; }

.nav-issue-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    line-height: 1.2;
    flex: 1 1 auto;
    min-width: 0;
}

/* ── Sidebar issue row sub-row (Step 218) ── */
.nav-issue-main-row {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    width: 100%;
}

.nav-issue-sub-row {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    padding-left: 0.25rem;
    margin-top: 0.15rem;
}

.nav-confidence-label {
    font-size: 0.67rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

/* Sidebar confidence label colors */
.nav-confidence-label.nav-confidence-confirmed  { color: #15803d; }
.nav-confidence-label.nav-confidence-fragile    { color: #b45309; }
.nav-confidence-label.nav-confidence-uncertain  { color: #64748b; }
.nav-confidence-label.nav-confidence-unverified { color: #94a3b8; }

.nav-issue-explanation {
    font-size: 0.8rem;
    color: #1e293b;
    font-style: normal;
    font-weight: 500;
    line-height: 1.45;
    white-space: normal;
    word-break: break-word;
    margin-top: 0.125rem;
}

/* ── All Provisions list ── */
.nav-all-provisions {
    padding: 0.125rem 0.5rem 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.1875rem;
}
.nav-all-item {
    display: flex;
    align-items: center;
    gap: 0.3125rem;
    padding: 0.25rem 0.375rem;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: background 0.15s;
}
.nav-all-item:hover { background: #f8fafc; }
.nav-all-deviates { opacity: 1; }
.nav-all-conforms { opacity: 0.75; }
.nav-all-conforms:hover { opacity: 1; }
.nav-all-resolved {
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
}
.nav-all-resolved:hover {
    background: #ecfdf5;
}
.nav-all-name {
    font-size: 0.7rem;
    color: var(--text, #1e293b);
    line-height: 1.3;
}
.nav-all-icon {
    font-size: 0.65rem;
    flex-shrink: 0;
    width: 0.625rem;
    text-align: center;
}
.nav-all-check { color: #16a34a; }
.nav-all-resolved-icon {
    color: #16a34a;
    font-weight: 700;
}
.nav-all-resolved-label {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    color: #15803d;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}


.results-content {
    overflow-y: auto;
    padding: 1.25rem 1.8% 1.5rem;
    min-width: 0;
    min-height: 0;
}
.results-content.results-content-detail {
    padding-top: 0;
    background: var(--bg-alt, #f8fafc);
}

/* ── Chat panel (right column) ── */
.chat-panel {
    width: 100%;
    min-width: 0;
    max-width: none;
    border-left: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    background: var(--bg, #ffffff);
    position: relative;
    flex-shrink: 0;
    height: 100%;
    min-height: 0;
}

.chat-panel-resize {
    position: absolute;
    left: -0.1875rem;
    top: 0;
    bottom: 0;
    width: 0.375rem;
    cursor: col-resize;
    z-index: 10;
    background: transparent;
}
.chat-panel-resize:hover,
.chat-panel-resize.active {
    background: var(--accent, #2563eb);
    opacity: 0.3;
}

.chat-panel-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.chat-panel-title {
    font-weight: 600;
    font-size: 0.9375rem;
}

.chat-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.chat-header-btn {
    background: none;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.25rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}
.chat-header-btn:hover {
    background: var(--bg-alt);
    color: var(--text);
}

.chat-close-btn {
    background: none;
    border: none;
    font-size: 1.125rem;
    cursor: pointer;
    color: var(--text-muted);
    padding: 0 0.25rem;
    display: none;  /* hidden on wide screens */
}

/* Messages area fills available space */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 18.75rem;
}

/* Input area pinned to top (above messages) */
.chat-input-area {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}
.chat-input-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.5rem;
    align-items: stretch;
}
.chat-input-row > * {
    min-width: 0;
}
.chat-advisor-prompts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem 0 0.625rem;
}
.chat-advisor-prompts.hidden {
    display: none;
}
.chat-advisor-label {
    width: 100%;
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.chat-advisor-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.625rem;
    border-radius: 999px;
    border: 1px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.chat-advisor-chip:hover {
    background: #e0e7ff;
    border-color: #a5b4fc;
}
.chat-analysis-welcome {
    flex: 1;
    min-height: 100%;
    box-sizing: border-box;
    padding: 0.875rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    background: var(--bg-alt, #f8fafc);
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}
.chat-analysis-starters {
    margin-top: 0.625rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-content: flex-start;
}
.chat-analysis-starter {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid #b7cdf8;
    border-radius: 1rem;
    cursor: pointer;
    background: linear-gradient(180deg, #eef5ff 0%, #e3efff 100%);
    color: #1d4ed8;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.3;
}
.chat-analysis-starter:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #cfe2ff 100%);
    border-color: #93b4f6;
    color: #1e40af;
}
.chat-input {
    width: 100%;
    min-width: 0;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-family: var(--font);
    outline: none;
}
.chat-input-row .btn {
    width: auto;
    min-width: 3.5rem;
    white-space: nowrap;
}
.chat-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.08);
}
.chat-controls-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-top: 0.5rem;
}
.chat-mode-select {
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    font-family: var(--font);
    background: var(--bg);
    cursor: pointer;
}
.chat-multi-options {
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 0.375rem;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}
.chat-multi-label {
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.125rem;
}
.chat-model-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.625rem;
}
.chat-model-options label {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    cursor: pointer;
    color: var(--text, #1e293b);
}
.chat-multi-divider {
    height: 0.0625rem;
    background: var(--border, #e2e8f0);
    margin: 0.125rem 0;
}
.chat-synth-row {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}
.chat-synthesis-toggle {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
}
.synth-option {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.75rem;
    color: var(--text, #1e293b);
    cursor: pointer;
    white-space: nowrap;
}
.synth-option input[type="radio"] {
    cursor: pointer;
    accent-color: var(--primary, #2563eb);
}
.chat-disclaimer {
    padding: 0.375rem 1rem;
    font-size: 0.6875rem;
    color: var(--text-light, #94a3b8);
    border-top: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
    text-align: center;
    font-style: italic;
}

/* expiry-notice styles are now in .app-header .expiry-notice above */

/* ── Mobile FAB (narrow screens only) ── */
.chat-fab-mobile {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    width: 3.5rem;
    height: 3.5rem;
    border-radius: 50%;
    background: var(--primary, #2563eb);
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.25);
    z-index: 1000;
    transition: transform 0.2s, box-shadow 0.2s;
    display: none;  /* hidden by default */
    align-items: center;
    justify-content: center;
}
.chat-fab-mobile:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

/* ── Narrow screen fallback (< 900px) ── */
@media (max-width: 900px) {
    .nav-sidebar {
        display: none;  /* hide nav sidebar on narrow screens */
    }
    .results-layout {
        display: block;
        height: auto;
    }
    .top-tab-bar {
        display: flex;
        padding: 0.75rem 3%;
        margin: 0 2%;
        overflow-x: auto;
    }
    .top-tab-nav {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        justify-self: auto;
    }
    .tab-subheader {
        padding: 0.625rem 3%;
        margin: 0 2%;
    }
    .results-content {
        height: auto;
        padding: 0.75rem 2%;
    }
    .chat-panel {
        display: none;  /* hidden by default on narrow */
    }
    .chat-panel.mobile-open {
        display: flex;
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        max-width: 25rem;
        z-index: 1000;
        box-shadow: -4px 0 20px rgba(0,0,0,0.15);
    }
    .chat-close-btn {
        display: block;  /* show close button on narrow */
    }
    .chat-fab-mobile:not(.hidden) {
        display: flex;  /* show FAB on narrow screens */
    }
    .chat-panel-resize {
        display: none;  /* no resize on mobile */
    }
}

@media (min-width: 901px) {
    .chat-fab-mobile {
        display: none !important;  /* never show FAB on wide screens */
    }
}

/* ── Chat messages ── */
.chat-msg {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.8125rem;
    line-height: 1.5;
}
.chat-msg-user {
    background: var(--bg-alt);
    font-weight: 500;
    white-space: pre-wrap;
}
.chat-msg-ai {
    background: #f0f7ff;
    border-left: 3px solid var(--primary);
    padding-left: 0.75rem;
}
.chat-msg-ai h2, .chat-msg-ai h3, .chat-msg-ai h4 {
    margin: 0.5rem 0 0.25rem;
    font-size: 0.875rem;
}
.chat-msg-ai li {
    margin-left: 1rem;
    margin-bottom: 0.125rem;
}
.chat-msg-label {
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.chat-msg-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}
.chat-save-note-btn {
    padding: 0.25rem 0.625rem;
    border: 1px solid #cbd5e1;
    border-radius: 999px;
    background: #ffffff;
    color: var(--primary, #1a365d);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.chat-save-note-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}
.chat-save-note-btn:disabled {
    cursor: default;
    opacity: 0.8;
}
.chat-msg-synthesis {
    background: #fffbeb;
    border-left: 3px solid var(--warning);
}
.chat-typing {
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.8125rem;
    padding: 0.5rem 0.75rem;
}
.chat-ask-btn {
    font-size: 0.6875rem;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
    padding: 0.125rem 0.375rem;
    border-radius: var(--radius-sm);
    background: rgba(37, 99, 235, 0.06);
}
.chat-ask-btn:hover {
    background: rgba(37, 99, 235, 0.12);
}

/* ── Multi-model colored dots ── */
.chat-model-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
}
.chat-model-dot.claude { background: #c77dba; }
.chat-model-dot.gpt { background: #10a37f; }
.chat-model-dot.grok { background: #1da1f2; }
.chat-model-dot.gemini { background: #4285f4; }
.chat-model-dot.synthesized { background: var(--primary, #2563eb); }

.chat-msg-ai[data-model="claude"] { border-left: 3px solid #c77dba; }
.chat-msg-ai[data-model="gpt"] { border-left: 3px solid #10a37f; }
.chat-msg-ai[data-model="grok"] { border-left: 3px solid #1da1f2; }
.chat-msg-ai[data-model="gemini"] { border-left: 3px solid #4285f4; }

/* ── Live provision links (Item 7) ── */
.chat-provision-link {
    color: var(--primary, #2563eb);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}
.highlight-flash {
    animation: flash-highlight 2s ease;
}
@keyframes flash-highlight {
    0%, 100% { background: transparent; }
    25% { background: rgba(37, 99, 235, 0.15); }
}

/* ── Code block handling (Item 8) ── */
.chat-code-block {
    background: var(--bg-alt, #f8fafc);
    border-left: 3px solid var(--border, #e2e8f0);
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    font-size: 0.8125rem;
    white-space: pre-wrap;
    font-family: inherit;  /* NOT monospace — this is contract language, not code */
}

/* ── Help Chat Column (upload page) ── */
.help-chat-column {
    display: flex;
    flex-direction: column;
}
.help-chat-card {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.help-chat-card .chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 12.5rem;
}
.help-chat-card .chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.help-chat-input-area {
    padding: 0.625rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}
.help-chat-welcome {
    padding: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}
.help-chat-starters {
    margin-top: 0.625rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.help-chat-starter {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid #b7cdf8;
    border-radius: 1rem;
    cursor: pointer;
    background: linear-gradient(180deg, #eef5ff 0%, #e3efff 100%);
    color: #1d4ed8;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.3;
}
.help-chat-starter:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #cfe2ff 100%);
    border-color: #93b4f6;
    color: #1e40af;
}
.help-chat-hint {
    display: block;
    font-size: 0.6875rem;
    font-style: italic;
    color: var(--text-muted, #94a3b8);
    padding: 0.25rem 0.125rem;
}

/* ── Delete Analysis button ── */
.btn-danger-outline {
    color: var(--danger, #dc2626);
    border: 1px solid var(--danger, #dc2626);
    background: transparent;
    border-radius: 0.375rem;
    padding: 0.375rem 0.75rem;
    cursor: pointer;
    font-size: 0.8125rem;
}
.btn-danger-outline:hover {
    background: var(--danger, #dc2626);
    color: white;
}

/* ══════════════════════════════════════════════════════
   FILTER BAR (043c) — results header row, btn-outline style
   ══════════════════════════════════════════════════════ */

/* Filter dropdown container — position anchor for floating panel */
.filter-dropdown {
    position: relative;
}

/* Trigger inherits .btn .btn-outline — just needs font-size and chevron gap */
.filter-dropdown-trigger {
    gap: 0.375rem;
    font-size: 0.8125rem;
    white-space: nowrap;
}

/* Step 346: provision filter select replaces checkbox dropdown */
.filter-provision-select {
    font-size: 0.8125rem;
    padding: 0.25rem 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    max-width: 16rem;
    height: 2rem;
}

/* Active state — filled navy when filter is on */
.filter-dropdown-trigger.filter-trigger-active {
    background: var(--primary, #1a365d);
    color: white;
    border-color: var(--primary, #1a365d);
    font-weight: 600;
}
.filter-dropdown-trigger.filter-trigger-active:hover {
    background: var(--primary-dark, #0f2444);
}

/* Floating checkbox panel */
.filter-dropdown-panel {
    position: fixed;
    min-width: 12.5rem;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    z-index: 500;
    padding: 0.375rem 0;
    overflow: hidden;
}
/* Clause filter dropdowns (inside scrollable content area) */
.clause-filter-dropdown {
    position: relative;
    display: inline-block;
}
.clause-filter-panel {
    position: fixed;
    min-width: 11.25rem;
    z-index: 600;
}
.clause-filter-trigger {
    font-size: 0.8rem;
    padding: 0.35rem 0.65rem;
}
.snap-filter-btn {
    min-width: 10rem;
    text-align: left;
}

/* Checkbox rows */
.filter-option {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text, #1e293b);
    cursor: pointer;
    transition: background 0.1s;
    user-select: none;
}
.filter-option:hover {
    background: var(--bg-alt, #f8fafc);
}
.filter-option-all {
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5625rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
.filter-option input[type="checkbox"] {
    accent-color: var(--primary, #1a365d);
    width: 0.875rem;
    height: 0.875rem;
    cursor: pointer;
    flex-shrink: 0;
}

/* Severity color dots */
.sev-dot {
    display: inline-block;
    width: 0.5rem;
    height: 0.5rem;
    border-radius: 50%;
    flex-shrink: 0;
}
.sev-dot-critical { background: var(--danger, #dc2626); }
.sev-dot-high     { background: #c2410c; }
.sev-dot-medium   { background: var(--warning, #d97706); }
.sev-dot-low      { background: var(--info, #64748b); }

/* Count indicator */
.filter-active-count {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-weight: 500;
    white-space: nowrap;
    align-self: center;
}

/* Clear button — already inherits .btn .btn-outline */
/* No extra rules needed */

/* ══════════════════════════════════════════════════════
   SEVERITY VISIBILITY (046)
   ══════════════════════════════════════════════════════ */

/* Severity breakdown in batch table (046) */
.sev-breakdown {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: center;
}

/* ══════════════════════════════════════════════════════
   CONTRACT STATUS PANEL (047)
   ══════════════════════════════════════════════════════ */

#contract-status-panel {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    margin-bottom: 1rem;
}

.contract-card {
    background: var(--bg, #ffffff);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    overflow: hidden;
    transition: border-color 0.15s, box-shadow 0.15s;
    cursor: default;
}
.contract-card:hover {
    border-color: var(--primary-light, #2b4c7e);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
/* Step 120: Active card in Run Snapshot — left accent border */
.contract-card-active {
    border-left: 3px solid var(--accent, #2563eb);
    background: rgba(37, 99, 235, 0.02);
}

/* Card header row */
.contract-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.625rem 0.875rem;
    cursor: pointer;
    background: var(--bg-alt, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
    user-select: none;
}
.contract-card-header:hover {
    background: #f1f5f9;
}
.contract-card-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text, #1e293b);
}

/* Status badges */
.contract-card-status {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.125rem 0.625rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    cursor: default;
    pointer-events: none;
    user-select: none;
}
.status-critical { background: #fee2e2; color: #7f1d1d; }
.status-high     { background: #fff7ed; color: #7c2d12; }
.status-medium   { background: #fffbeb; color: #78350f; }
.status-clear    { background: #f0fdf4; color: #14532d; }
.status-empty    { background: var(--bg-alt); color: var(--text-muted); }

/* Clean contract line */
.contract-card-clean {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}

/* Deviation rows */
.contract-card-deviations {
    display: flex;
    flex-direction: column;
}
.contract-deviation-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.875rem;
    font-size: 0.8125rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border, #f1f5f9);
    transition: background 0.1s;
}
.contract-deviation-row:last-child {
    border-bottom: none;
}
.contract-deviation-row:hover {
    background: var(--bg-alt, #f8fafc);
}
.contract-deviation-CRITICAL:hover { background: #fef2f2; }
.contract-deviation-HIGH:hover     { background: #fff7ed; }
.contract-deviation-MEDIUM:hover   { background: #fffbeb; }
.contract-deviation-LOW:hover      { background: #f8fafc; }

.contract-dev-icon {
    font-size: 0.875rem;
    flex-shrink: 0;
    width: 1.125rem;
}
.contract-dev-label {
    flex: 1;
    color: var(--text, #1e293b);
    font-weight: 500;
}
.contract-dev-sev {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   DISCOVERED UNIQUE PROVISIONS (045)
   ══════════════════════════════════════════════════════ */

/* Discovered unique provision badges */
.discovered-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
    border-radius: 999px;
    margin-left: 0.375rem;
    white-space: nowrap;
}
.discovered-inline {
    font-size: 0.75rem;
    opacity: 0.7;
    margin-left: 0.1875rem;
}

/* ══════════════════════════════════════════════════════
   AI SUMMARY BAR (048)
   ══════════════════════════════════════════════════════ */

.ai-summary-bar {
    background: #f0f5ff;
    border: 1px solid #c7d7f9;
    border-left: 4px solid var(--primary, #1a365d);
    border-radius: var(--radius, 0.5rem);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    position: relative;
}

.ai-summary-bar::before {
    content: 'KEY FINDINGS';
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--primary, #1a365d);
    opacity: 0.6;
    margin-bottom: 0.5rem;
}

.ai-summary-paragraph {
    font-size: 0.975rem;
    line-height: 1.7;
    color: var(--text, #1e293b);
    margin-bottom: 0.875rem;
    font-style: normal;
    font-weight: 450;
}

.ai-summary-loading {
    color: var(--text-muted, #64748b);
    font-size: 0.8125rem;
}

.ai-summary-error {
    color: var(--text-muted, #64748b);
    font-size: 0.8125rem;
}

.ai-summary-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    border-top: 1px solid #c7d7f9;
    padding-top: 0.75rem;
}

.ai-summary-stats {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    flex: 1;
    min-width: 0;
}

.ai-summary-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tech-details-toggle {
    font-size: 0.8125rem;
    color: var(--primary, #1a365d);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm, 0.25rem);
    user-select: none;
}
.tech-details-toggle:hover {
    background: var(--bg-alt, #f8fafc);
}

.tech-details-content {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
    font-size: 0.8125rem;
}

/* ══════════════════════════════════════════════════════
   FILTER BAR INLINE (048)
   ══════════════════════════════════════════════════════ */

.filter-bar-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0;
    border-top: 1px solid var(--border, #e2e8f0);
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* ══════════════════════════════════════════════════════
   PROVISION FILTER (049)
   ══════════════════════════════════════════════════════ */

.filter-provision-group-label {
    padding: 0.375rem 0.875rem 0.1875rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    background: var(--bg-alt, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-top: 0.125rem;
}
.filter-provision-group-custom {
    color: #15803d;
}
.filter-provision-pid {
    font-size: 0.6875rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    min-width: 4rem;
}
.filter-provision-pid-custom {
    color: #15803d;
}
.filter-provision-name {
    color: var(--text, #1e293b);
}
#filter-provision-panel {
    max-height: 20rem;
    overflow-y: auto;
}

/* ══════════════════════════════════════════════════════
   THREE-TIER PROVISIONS PANEL (050)
   ══════════════════════════════════════════════════════ */

.provisions-tier-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    margin: 0.5rem 0 0.375rem 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.provisions-tier-label-custom { color: #15803d; }
.provisions-tier-label-added  { color: #2563eb; }

.provisions-panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 0.5rem;
}
.provisions-panel-title {
    font-size: 1rem;
    font-weight: 600;
}
.provisions-title-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.provisions-panel-subtitle {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.375rem;
    line-height: 1.4;
}

.provisions-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    margin-top: 0;
    margin-bottom: 0.5rem;
    line-height: 1.4;
}

.processing-back-link {
    display: inline-block;
    margin-top: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
}
.processing-back-link:hover {
    color: var(--text-secondary, #475569);
    text-decoration: underline;
}

.addmore-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--primary, #6366f1);
    text-decoration: none;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--primary, #6366f1);
    border-radius: 0.25rem;
    white-space: nowrap;
    flex-shrink: 0;
}
.addmore-back-link:hover {
    background: var(--primary-soft, #eef2ff);
    text-decoration: none;
}

.provisions-divider {
    border-top: 1px solid var(--border, #e2e8f0);
    margin: 0.375rem 0;
}
.provision-section-label {
    list-style: none;
    padding: 0.375rem 0.5rem 0.1875rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    pointer-events: none;
    margin-top: 0.25rem;
}
.provision-section-new {
    color: var(--primary, #6366f1);
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

/* Full-width custom provision row */
.custom-provision-add.full-width {
    width: 100%;
    display: flex;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.custom-provision-add.full-width input {
    flex: 1;
}

/* Upload card header with inline Analyze button (053) */
.upload-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.upload-card-header .btn {
    flex-shrink: 0;
}
/* When in add-more mode, back link takes the left slot */
.upload-card-header:has(.addmore-back-link:not(.hidden)) #upload-step-label {
    flex: 1;
    text-align: center;
}
.upload-card-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 0.25rem 0 0.75rem 0;
    line-height: 1.5;
}

/* ── Additional Findings (Discovery Cards — 112) ── */
.additional-findings-wrapper {
    margin-top: 2rem;
}

.additional-findings-wrapper .section-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.discovery-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--bg-alt, #f8fafc);
}

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

.discovery-card .discovery-name {
    font-weight: 600;
    font-size: 0.95rem;
}

.discovery-card .discovery-resolution-badge {
    font-size: 0.75rem;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    background: #f0e8ff;
    color: #6b21a8;
}

.discovery-card .discovery-section-ref {
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
    margin-bottom: 0.5rem;
}

.discovery-card .discovery-clause-text {
    font-family: monospace;
    font-size: 0.82rem;
    background: var(--bg-card, #fff);
    padding: 0.5rem 0.75rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.discovery-card .discovery-meta {
    font-size: 0.82rem;
    color: var(--text-secondary, #475569);
}

/* ── Processing email capture ── */
.processing-email-card {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 1.25rem 1.35rem 1.25rem;
    margin: 0;
    max-width: none;
    box-shadow: none;
    text-align: left;
}
.processing-email-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.35rem;
    color: var(--primary, #1a365d);
}
.processing-email-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.9rem;
}
.processing-email-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    justify-content: flex-end;
}
.processing-email-row .chat-input {
    flex: 1;
}
.processing-email-status {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
}
.processing-email-status.success { color: var(--success, #16a34a); }
.processing-email-status.error { color: var(--danger, #dc2626); }

/* ── Educational carousel ── */
.cam-carousel {
    max-width: 100%;
    margin: 0 0 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #fcfdff 100%);
    border: 1px solid #e8edf5;
    border-radius: 1.125rem;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.cam-carousel-track {
    /* JS controls translateX to slide */
    display: flex;
    transition: transform 0.4s ease;
}

.cam-slide {
    min-width: 100%;
    padding: 1.5rem 1.85rem;
    box-sizing: border-box;
    text-align: left;
}

.cam-slide-icon {
    font-size: 2rem;
    margin-bottom: 0.65rem;
}

.cam-slide-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 0.65rem;
}

.cam-slide-body {
    font-size: 0.96rem;
    color: var(--text-muted);
    line-height: 1.75;
}

.cam-slide-disclaimer-grid {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin: 0.5rem 0;
}
.cam-disclaimer-img {
    width: 100%;
    max-width: 16.25rem;
    border-radius: 0.375rem;
    border: 1px solid var(--border, #e5e7eb);
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.cam-slide-disclaimers .cam-slide-body {
    margin-top: 0.5rem;
    font-style: italic;
}

.cam-carousel-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--bg-subtle, #f9fafb);
}

.cam-carousel-btn {
    background: none;
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 50%;
    width: 1.75rem;
    height: 1.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.15s;
}
.cam-carousel-btn:hover {
    background: var(--primary-light, #eff6ff);
    color: var(--primary);
}

.cam-carousel-dots {
    display: flex;
    gap: 0.375rem;
    align-items: center;
}
.cam-carousel-dot {
    width: 0.4375rem;
    height: 0.4375rem;
    border-radius: 50%;
    background: var(--border, #e5e7eb);
    cursor: pointer;
    transition: background 0.2s;
}
.cam-carousel-dot.active {
    background: var(--primary, #2563eb);
}

/* ── Processing chat panel ── */
.processing-chat-panel {
    display: flex;
    flex-direction: column;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border, #e5e7eb);
    border-radius: 1.125rem;
    height: 100%;
    max-height: none;
    min-height: 31.25rem;
    overflow: hidden;
    box-shadow: 0 16px 34px rgba(15, 23, 42, 0.06);
    width: 100%;
}
.processing-chat-panel .chat-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
    background: #fbfdff;
}
.processing-chat-panel .chat-panel-title {
    font-weight: 700;
    font-size: 1rem;
}
.processing-chat-input-area {
    padding: 0.75rem 1.125rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}
.processing-chat-panel .chat-messages {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}
.processing-chat-panel .chat-disclaimer {
    padding: 0.375rem 1rem;
    font-size: 0.6875rem;
    color: var(--text-muted, #94a3b8);
    border-top: 1px solid var(--border, #e2e8f0);
    text-align: center;
    flex-shrink: 0;
}
.processing-chat-welcome {
    padding: 1rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}
.processing-chat-starters {
    margin-top: 0.625rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
}
.processing-chat-starter {
    display: inline-block;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border: 1px solid #b7cdf8;
    border-radius: 1rem;
    cursor: pointer;
    background: linear-gradient(180deg, #eef5ff 0%, #e3efff 100%);
    color: #1d4ed8;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
    text-align: left;
    line-height: 1.3;
}
.processing-chat-starter:hover {
    background: linear-gradient(180deg, #dbeafe 0%, #cfe2ff 100%);
    border-color: #93b4f6;
    color: #1e40af;
}

/* ── Audit Trail Tab ── */
/* Step 346: file + processed date header at top of audit trail */
.audit-run-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.75rem;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    margin-bottom: 0.75rem;
    font-size: 0.8125rem;
    color: #64748b;
}
.audit-run-header-sep { color: #cbd5e1; }

.audit-run-meta {
    display: grid;
    grid-template-columns: repeat(3, minmax(13.75rem, 1fr));
    gap: 1rem;
    flex-wrap: wrap;
    padding: 0.35rem;
    background: linear-gradient(180deg, #f8fbff 0%, #f3f7fb 100%);
    border: 1px solid #dbe5f1;
    border-radius: 0.75rem;
    margin-bottom: 1.25rem;
    font-size: 0.8rem;
    color: var(--text-secondary, #475569);
}
.audit-meta-section {
    min-width: 12.5rem;
    padding: 0.95rem 1rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.625rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.audit-meta-tech {
    margin-top: 0.45rem;
}
.audit-meta-tech > summary {
    cursor: pointer;
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--primary, #243b73);
}
.audit-meta-tech > div {
    margin-top: 0.45rem;
}
.audit-meta-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.25rem;
}
.audit-controls-bar {
    display: block;
    padding: 0.55rem 0.75rem;
    margin-bottom: 0.5rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.625rem;
    font-size: 0.8rem;
}
.audit-controls-count {
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
}
.audit-controls-buttons {
    display: flex;
    gap: 0.5rem;
}
.btn-audit-control {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 999px;
    padding: 0.28rem 0.75rem;
    font-size: 0.75rem;
    color: var(--primary, #243b73);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.btn-audit-control:hover {
    background: var(--bg-hover, #f1f5f9);
    color: var(--text, #1e293b);
}

.audit-provision-list {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.audit-provision-row {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.625rem;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.03);
}
/* Audit header: strict 5-column grid so every row lines up for scanning
   Col 1: provision ID   (fixed 5rem)
   Col 2: provision name (flex)
   Col 3: severity badge (fixed 6rem)
   Col 4: confidence dots+label (fixed 10rem)
   Col 5: reviewer agreement (fixed 14rem)
   Col 6: chevron (fixed 1.5rem)
*/
.audit-table-header {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr) 5.75rem 11.5rem 13.5rem 7.25rem 6.5rem 1.75rem;
    align-items: center;
    gap: 0 0.75rem;
    min-width: 0;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    padding: 0;
    box-sizing: border-box;
}
.audit-sort-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
    white-space: nowrap;
}
.audit-sort-btn:hover { color: var(--text, #1e293b); }
.audit-sort-btn.active { color: var(--text, #1e293b); }
.audit-sort-icon { font-size: 0.6rem; opacity: 0.5; }
.audit-sort-btn.active .audit-sort-icon { opacity: 1; }
.audit-table-header .audit-controls-buttons {
    grid-column: 7 / 9;
    justify-self: end;
    display: flex;
    align-items: center;
}
.audit-header-count {
    grid-column: 1 / 3;
    color: var(--text, #1e293b);
}
.audit-expand-btn {
    margin: 0;
    min-width: 6.1rem;
    padding-inline: 0.9rem;
    white-space: nowrap;
    font-size: 0.72rem;
}
.audit-sort-btn-provision {
    grid-column: 1 / 3;
}
.audit-export-run-stats {
    margin-left: auto;
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    align-self: center;
    padding: 0 0.5rem;
    white-space: nowrap;
}
.contract-detail-run-stats {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-weight: 400;
    margin-left: 0.5rem;
    white-space: nowrap;
}
.audit-tech-controls {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.6rem;
    border-left: 1px solid var(--border, #e2e8f0);
    flex-shrink: 0;
}

.audit-provision-header {
    display: grid;
    grid-template-columns: 5.75rem minmax(0, 1fr) 5.75rem 11.5rem 13.5rem 7.25rem 6.5rem 1.75rem;
    align-items: center;
    gap: 0 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    background: var(--bg-card, #fff);
}
.audit-provision-header:hover {
    background: var(--bg-subtle, #f8fafc);
}
.audit-pid {
    font-weight: 700;
    color: var(--text-muted, #64748b);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}
.audit-pname {
    color: var(--text, #1e293b);
    font-weight: 600;
    padding-right: 1.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.audit-verdict {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    justify-self: start;
}
.audit-verdict-conforms { background: #dcfce7; color: #166534; }
.audit-verdict-deviates { background: #fee2e2; color: #991b1b; }
.audit-verdict-unclear  { background: #fef9c3; color: #854d0e; }
/* Legacy elements hidden — kept in expanded detail only */
.audit-stages,
.audit-rules-badge,
.audit-rules-none,
.audit-agreement,
.audit-fragile-badge { display: none; }
.audit-chevron {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    grid-column: 8;
    justify-self: end;
    width: 1.5rem;
    height: 1.5rem;
    border: 1px solid var(--border, #cbd5e1);
    border-radius: 999px;
    background: #fff;
    color: var(--text-muted, #94a3b8);
}
/* Signal group: sits in col 4+5 via .audit-row-signals wrapper */
.audit-row-signals {
    display: contents; /* lets children participate in the parent grid */
}
.audit-provision-detail {
    padding: 0.85rem 1rem 1rem;
    background: #f8fafc;
    border-top: 1px solid var(--border, #e2e8f0);
    font-size: 0.8rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
}
.audit-detail-section {
    min-width: 13.75rem;
    flex: 1;
}
.audit-detail-label {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #94a3b8);
    margin-bottom: 0.4rem;
}
.audit-stage-row {
    margin-bottom: 0.15rem;
    color: var(--text-secondary, #475569);
}
.audit-eval-row {
    margin-bottom: 0.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.audit-eval-row:last-of-type { border-bottom: none; }
.audit-eval-header {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.2rem;
}
.audit-eval-id {
    font-weight: 500;
    font-size: 0.75rem;
    color: var(--text-primary, #1e293b);
}
.audit-eval-verdict {
    font-size: 0.7rem;
    font-weight: 600;
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.1875rem;
}
.audit-eval-conforms { background: #dcfce7; color: #166534; }
.audit-eval-deviates { background: #fee2e2; color: #991b1b; }
.audit-eval-na       { background: #f1f5f9; color: var(--text-muted, #94a3b8); }
.audit-eval-conf { font-size: 0.7rem; color: var(--text-muted, #64748b); }
.audit-eval-reasoning {
    font-size: 0.75rem;
    color: var(--text-secondary, #475569);
    font-style: italic;
    padding-left: 0.5rem;
    border-left: 2px solid var(--border, #e2e8f0);
    margin-top: 0.2rem;
}
.audit-agreement-line {
    font-size: 0.75rem;
    color: var(--text-secondary, #475569);
    margin-top: 0.3rem;
}

/* ── Audit Trail Export Bar ── */
.audit-export-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem 1.25rem;
    align-items: center;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
    background: var(--bg-subtle, #f8fafc);
}
.audit-export-group {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}
.audit-export-label {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-right: 0;
    white-space: nowrap;
}

/* ── Resolution Workflow ── */

.resolution-bar {
    border-top: 1px solid #e5e7eb;
    padding: 0.6rem 1rem 0.5rem;
    background: #f9fafb;
}

/* ── Summary resolution bar 2-row grid ── */

.summary-resolution-bar .finding-workflow-row {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: 0;
    row-gap: 0.9rem;
    align-items: center;
}

.summary-resolution-bar .finding-workflow-row > .workflow-group {
    margin-right: 0;
}

.summary-resolution-bar .workflow-group-status {
    grid-column: 1 / -1;
    grid-row: 1;
    flex-wrap: nowrap;
}

.summary-resolution-bar .workflow-group-decision {
    grid-column: 1;
    grid-row: 2;
    min-width: 0;
    flex-wrap: wrap;
}

.summary-resolution-bar .workflow-open-actions {
    grid-column: 2;
    grid-row: 2;
    margin-left: auto;
    justify-content: flex-end;
    align-self: center;
    gap: 2%;
}

.summary-resolution-bar .workflow-open-actions > a {
    flex: 0 1 auto;
    width: auto;
    min-width: 0;
    min-height: 2rem;
    white-space: nowrap;
}

.summary-pipe {
    display: inline-block;
    width: 0.0625rem;
    height: 1.5rem;
    background: #dbe3ee;
    border-radius: 999px;
    margin-left: 0.55rem;
    margin-right: 0.55rem;
    align-self: center;
    flex: 0 0 auto;
}

.res-status-row {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
}

.finding-workflow-row {
    row-gap: 0.85rem;
}

.workflow-group {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.workflow-group-status {
    flex-wrap: wrap;
}

.finding-workflow-row > .workflow-group,
.finding-workflow-row > .workflow-divider {
    margin-right: 0.35rem;
}

.workflow-group-tools,
.workflow-group-decision {
    gap: 0.55rem;
}

.workflow-divider {
    width: 0.0625rem;
    height: 1.5rem;
    background: #dbe3ee;
    border-radius: 999px;
    flex: 0 0 auto;
    margin-left: 0.25rem;
    margin-right: 0.55rem;
}

.workflow-divider-spacer {
    margin-left: auto;
    margin-right: 0.75rem;
}

.workflow-open-actions {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: nowrap;
    margin-left: auto;
}

.workflow-open-actions > a {
    flex: 0 1 12.8125rem;
    min-width: 12.8125rem;
    width: auto;
    margin: 0 !important;
    align-self: center;
}

.res-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #6b7280;
    white-space: nowrap;
}

.res-tools-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #94a3b8;
    white-space: nowrap;
}

.res-passive-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #86efac;
    background: #f0fdf4;
    color: #166534;
    font-size: 0.7rem;
    font-weight: 600;
    white-space: nowrap;
}

.res-pills {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
}

.res-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.875rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.2rem 0.65rem;
    border-radius: 999px;
    border: 1.5px solid #d1d5db;
    background: white;
    color: #1e293b;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}
.res-pill:hover { border-color: #9ca3af; color: #374151; }

/* Active states per status */
.res-open.res-pill-active          { background: #fef2f2; border-color: #f87171; color: #b91c1c; }
.res-inreview.res-pill-active      { background: #fffbeb; border-color: #f59e0b; color: #92400e; }
.res-resolved.res-pill-active      { background: #f0fdf4; border-color: #34d399; color: #065f46; }
.res-escalated.res-pill-active     { background: #eff6ff; border-color: #60a5fa; color: #1e40af; }
.res-notdeviation.res-pill-active  { background: #f0fdf4; border-color: #86efac; color: #166534; }

.res-notes-toggle,
.res-advisor-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.875rem;
    font-size: 0.76rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 0.5rem;
    border: 1.5px solid #d1d5db;
    background: white;
    color: #374151;
    line-height: 1;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s;
}
.res-notes-toggle:hover,
.res-advisor-btn:hover { background: #f3f4f6; border-color: #9ca3af; }
.res-notes-toggle {
    border-color: var(--border, #d1d5db);
    color: #1e293b;
}
.res-notes-toggle:hover {
    background: var(--bg-alt, #f8fafc);
    border-color: #94a3b8;
    color: var(--primary, #1a365d);
}
.res-advisor-btn {
    border-color: rgba(26, 54, 93, 0.18);
    background: var(--primary-bg, #f0f4f8);
    color: #1e293b;
}
.res-advisor-btn:hover {
    background: #e2ebf3;
    border-color: rgba(26, 54, 93, 0.28);
}

.finding-workflow-row .card-docview-link,
.finding-workflow-row .card-audit-link--btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.875rem;
    line-height: 1;
}

.finding-read-toggle {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.22rem 0.65rem;
    border-radius: 999px;
    border: 1px solid #d1d5db;
    background: #ffffff;
    color: #64748b;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.15s ease;
}

.finding-read-toggle:hover {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #334155;
}

.finding-read-toggle.noted-active {
    background: #eff6ff;
    border-color: #93c5fd;
    color: #1d4ed8;
}

.res-note-count {
    display: inline-block;
    background: #6366f1;
    color: white;
    border-radius: 999px;
    font-size: 0.65rem;
    padding: 0 0.4rem;
    margin-left: 0.2rem;
    font-weight: 700;
}

/* Notes panel */
.res-notes-panel,
.res-advisor-panel {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed #e5e7eb;
}
.hidden { display: none !important; }

.res-note-entry {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
    align-items: flex-start;
}
.res-note-ts {
    font-size: 0.68rem;
    color: #9ca3af;
    white-space: nowrap;
    min-width: 5.625rem;
    padding-top: 0.1rem;
}
.res-note-text {
    font-size: 0.78rem;
    color: #374151;
    line-height: 1.45;
}

.res-note-delete {
    margin-left: auto;
    border: none;
    background: none;
    color: #dc2626;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
}

.res-note-delete:hover {
    color: #b91c1c;
    text-decoration: underline;
}

.res-note-input-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.4rem;
    align-items: flex-end;
}
.res-note-input {
    flex: 1;
    font-size: 0.78rem;
    border: 1.5px solid #d1d5db;
    border-radius: 0.375rem;
    padding: 0.4rem 0.6rem;
    resize: vertical;
    min-height: 2.5rem;
    font-family: inherit;
}
.res-note-input:focus { border-color: #6366f1; outline: none; }
.res-note-save-btn {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 0.35rem 0.75rem;
    border-radius: 0.375rem;
    border: none;
    background: #6366f1;
    color: white;
    cursor: pointer;
    white-space: nowrap;
    height: fit-content;
}
.res-note-save-btn:hover { background: #4f46e5; }

/* AI Advisor panel */
.res-advisor-prompts {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.res-advisor-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #6b7280;
    margin-bottom: 0.15rem;
}
.res-advisor-prompt {
    font-size: 0.75rem;
    text-align: left;
    padding: 0.4rem 0.75rem;
    border-radius: 0.375rem;
    border: 1.5px solid #c7d2fe;
    background: #eef2ff;
    color: #3730a3;
    cursor: pointer;
    transition: all 0.15s;
}
.res-advisor-prompt:hover { background: #e0e7ff; border-color: #a5b4fc; }

/* Resolved card treatment */
.finding-card.resolution-resolved {
    opacity: 0.7;
    border-left-color: #34d399 !important;
}
.finding-card.resolution-resolved .card-summary,
.finding-card.resolution-resolved .card-details {
    display: none;
}
.finding-card.resolution-resolved.card-expanded .card-summary,
.finding-card.resolution-resolved.card-expanded .card-details {
    display: block;
}
.finding-card.resolution-resolved .deviation-header::after {
    content: " \2713 Resolved";
    font-size: 0.72rem;
    font-weight: 600;
    color: #059669;
    margin-left: 0.5rem;
}

/* Resolution progress bar */
.resolution-progress {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.4rem 0 0.6rem;
}
.res-progress-bar-wrap {
    flex: 1;
    max-width: 12.5rem;
    height: 0.375rem;
    background: #e5e7eb;
    border-radius: 999px;
    overflow: hidden;
}
.res-progress-bar {
    height: 100%;
    background: #34d399;
    border-radius: 999px;
    transition: width 0.3s ease;
}
.res-progress-label {
    font-size: 0.75rem;
    color: #6b7280;
    font-weight: 500;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   STEP 116 — Top-Level Tabs, Run Snapshot, Contract Detail,
              Resolution Workflow, Noted Toggle, Completion Banner
   ══════════════════════════════════════════════════════ */

/* ── Top-Level Tab Bar ── */
.top-tab-bar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.2%;
    margin: 0 calc(1.8% + var(--scrollbar-w, 0)) 0 1.8%;
    z-index: 20;
    background: var(--bg, #ffffff);
    border-bottom: 1px solid var(--border, #e2e8f0);
}
.top-tab-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    min-width: 0;
}
.top-tab-actions {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-shrink: 0;
    margin-left: auto;
}
.tab-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: transparent;
    border-radius: 0.375rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: background 0.15s ease, color 0.15s ease;
    line-height: 1;
}
.tab-action-btn:hover {
    background: var(--bg-alt);
    color: var(--text);
}
.tab-action-btn--danger:hover {
    background: #fee2e2;
    color: #b91c1c;
}
.tab-action-divider {
    width: 0.0625rem;
    height: 1.25rem;
    background: var(--border);
    margin: 0 0.25rem;
}
.top-tab {
    padding: 0.5rem 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    background: #edf2f7;
    border: 2px solid #cbd5e1;
    border-radius: 999px;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: var(--font);
    letter-spacing: 0.01em;
}
.top-tab:hover:not(.active) {
    border-color: var(--primary, #1a365d);
    color: var(--primary, #1a365d);
    background: #e2e8f0;
}
.top-tab.active {
    background: var(--primary, #1a365d);
    color: #ffffff;
    border-color: var(--primary, #1a365d);
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.1));
}

.top-tab-divider {
    width: 0.0625rem;
    background: var(--border, #e2e8f0);
    margin: 0.25rem 0.25rem;
    align-self: stretch;
}

/* ── Sidebar Resolution Indicators ── */
.nav-status-unreviewed {
    color: #d97706;
    font-weight: 700;
}
.nav-status-resolved {
    color: #059669;
    font-weight: 700;
}
.nav-status-clean {
    color: #86efac;
    font-weight: 700;
}

/* ══════════════════════════════════════════════════════
   RUN SNAPSHOT WORK QUEUE (Step 122)
   ══════════════════════════════════════════════════════ */

.snapshot-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.snapshot-card {
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 0.75rem);
    margin-bottom: 0;
    overflow: hidden;
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
    transition: box-shadow 0.15s ease;
}
.snapshot-card:hover {
    box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.08));
}

.snapshot-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem 0.375rem;
    gap: 1rem;
    cursor: pointer;
}
.snapshot-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text, #1e293b);
}
.snapshot-card-badges {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0;
}

.snapshot-card-meta {
    padding: 0 1rem 0.375rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.snapshot-card-counts {
    padding: 0 1rem 0.375rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text, #1e293b);
}

.snapshot-card-summary {
    padding: 0 1rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
    font-style: italic;
}

.snapshot-card-body {
    padding: 0;
}
.snapshot-card-body-clean {
    color: #166534;
    font-size: 0.8125rem;
    line-height: 1.6;
    padding: 0.5rem 1rem 0.75rem;
}

.snapshot-provisions {
    border-top: 1px solid var(--border, #e2e8f0);
    padding: 0.5rem 0;
}

.snapshot-provision-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 1rem;
    font-size: 0.8125rem;
    cursor: pointer;
    transition: background 0.1s ease;
}
.snapshot-provision-row:hover {
    background: var(--bg-alt, #f8fafc);
}
.snapshot-provision-left {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.snapshot-provision-sev {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.snapshot-card-findings {
    /* findings cards default */
}
.snapshot-card-clean {
    border-color: #bbf7d0;
    background: #f0fdf4;
}
.snapshot-card-clean .snapshot-card-header {
    cursor: default;
}
.snapshot-card-clean:hover {
    border-color: #86efac;
}
.snapshot-card-empty {
    opacity: 0.6;
}

.snapshot-card-footer {
    display: flex;
    justify-content: flex-end;
    padding: 0.5rem 1rem 0.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 0.25rem;
}

.snapshot-open-btn {
    background: var(--accent, #2563eb);
    border: none;
    color: #ffffff;
    border-radius: 999px;
    padding: 0.3rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font);
    transition: all 0.15s ease;
}

.snapshot-open-btn:hover {
    background: var(--accent-hover, #1d4ed8);
    box-shadow: var(--shadow-md);
}

/* Step 128: Contract picker empty state */
.contract-picker-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 2rem;
    gap: 1rem;
}

.contract-picker-prompt {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}

.contract-picker-select {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--bg, #ffffff);
    color: var(--text, #1e293b);
    min-width: 16.25rem;
    cursor: pointer;
    font-family: var(--font);
}

.contract-picker-select:focus {
    outline: none;
    border-color: var(--primary, #1a365d);
}

/* Step 129: Contract selector dropdown bar */
.contract-selector-bar {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    padding: 0.5rem 0 0;
    background: #ffffff;
    margin-bottom: 0;
    position: relative;
    z-index: 1;
}

.contract-controls-row {
    display: grid;
    grid-template-columns: minmax(13.75rem, 0.92fr) minmax(0, 2.35fr);
    gap: 0.875rem 1.125rem;
    align-items: start;
    width: 100%;
}

.contract-controls-row-head {
    align-items: end;
}

.contract-controls-row-main {
    align-items: start;
}

.contract-selector-main {
    display: grid;
    gap: 0;
    min-width: 0;
    width: 100%;
}

.contract-selector-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.contract-selector-select {
    padding: 0.45rem 0.7rem;
    font-size: 0.875rem;
    font-weight: 500;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--bg, #ffffff);
    color: var(--text, #1e293b);
    min-width: 0;
    flex: 1 1 18%;
    cursor: pointer;
    font-family: var(--font);
    transition: border-color 0.15s ease;
}

@media (max-width: 1200px) {
    .contract-controls-row {
        grid-template-columns: 1fr;
    }

    .contract-clause-filter-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 900px) {
    .contract-clause-filter-controls {
        flex-wrap: wrap;
    }
    .contract-clause-filter-controls > select {
        flex: 1 1 40%;
    }
}

.contract-selector-select:focus {
    outline: none;
    border-color: var(--primary, #1a365d);
}

/* Step 130: Contract name filter dropdown */
.snapshot-contract-filter-wrap {
    position: relative;
}

.snapshot-contract-filter-btn {
    white-space: nowrap;
    cursor: pointer;
}

.snapshot-contract-dropdown {
    position: absolute;
    top: calc(100% + 0.375rem);
    left: 0;
    z-index: 200;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.625rem;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    min-width: 20vw;
    max-width: 24vw;
    overflow: hidden;
}

.snapshot-contract-dropdown-inner {
    max-height: 17.5rem;
    overflow-y: auto;
    padding: 0.375rem 0;
}

.snapshot-contract-dropdown-empty {
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}

.snapshot-contract-check-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4rem 0.875rem;
    cursor: pointer;
    font-size: 0.8125rem;
    color: var(--text, #1e293b);
    transition: background 0.1s ease;
}

.snapshot-contract-check-row:hover {
    background: var(--bg-subtle, #f8fafc);
}

.snapshot-contract-all-row {
    font-weight: 600;
    border-bottom: 1px solid var(--border, #e2e8f0);
    margin-bottom: 0.25rem;
    padding-bottom: 0.5rem;
}

.snapshot-contract-check-name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.snapshot-contract-check-status {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
}

/* ── Deal Brief Banner (Step 132) ── */
.deal-brief-banner {
    background: var(--bg-card, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.875rem 1.25rem;
    margin-bottom: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.deal-brief-identity {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    letter-spacing: 0.01em;
}

.deal-brief-verdict {
    font-size: 1.0rem;
    font-weight: 600;
    color: var(--text-primary, #1e293b);
}

.deal-brief-topflag {
    font-size: 0.83rem;
    color: var(--text-secondary, #475569);
}

.deal-brief-topflag strong {
    color: var(--text-primary, #1e293b);
}

/* ── Provisions Scope Card (Step 131) ── */
.provisions-scope-card {
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 0.75rem);
    padding: 1rem 1.25rem 1rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
}

.pscope-header {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.625rem;
}

.pscope-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem;
    align-items: center;
}

.pscope-pill {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.72rem;
    font-weight: 500;
    font-family: var(--font);
    white-space: nowrap;
    cursor: default;
}

.pscope-pill-critical {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fca5a5;
}
.pscope-pill-high {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fdba74;
}
.pscope-pill-medium {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fcd34d;
}
.pscope-pill-low {
    background: #f8fafc;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.pscope-pill-conforms {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}

.pscope-scan-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-family: var(--font);
    white-space: nowrap;
    cursor: default;
    pointer-events: none;
    user-select: none;
}

.pscope-scan-clean {
    background: #f0fdf4;
    color: #15803d;
    border: 1px dashed #86efac;
    font-style: italic;
}

.pscope-scan-found {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px dashed #93c5fd;
    font-style: italic;
}

.snapshot-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    color: var(--accent, #2563eb);
    cursor: pointer;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
    background: none;
    border: none;
    font-family: var(--font);
    font-weight: 500;
}
.snapshot-back-btn:hover {
    text-decoration: underline;
}

/* ── Snapshot Badges ── */
.snapshot-sev-badge {
    font-size: 0.6875rem;
    font-weight: 700;
    padding: 0.125rem 0.625rem;
    border-radius: 0.25rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    cursor: default;
    pointer-events: none;
    user-select: none;
}
.sev-badge-critical { background: #fee2e2; color: #7f1d1d; }
.sev-badge-high     { background: #fff7ed; color: #7c2d12; }
.sev-badge-medium   { background: #fffbeb; color: #78350f; }
.sev-badge-low      { background: #f1f5f9; color: #475569; }

.snapshot-resolution-badge {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.625rem;
    border-radius: 0.25rem;
    cursor: default;
    pointer-events: none;
    user-select: none;
}
.res-badge-unreviewed { background: #fef3c7; color: #92400e; }
.res-badge-resolved   { background: #d1fae5; color: #065f46; }
.res-badge-clean      { background: #d1fae5; color: #065f46; opacity: 0.8; }
.res-badge-empty      { background: var(--bg-alt); color: var(--text-muted); }

/* ── Contract Detail View ── */
.contract-detail-sticky-shell {
    position: sticky;
    top: 0;
    z-index: 50;
    background: #ffffff;
    padding: 0.75rem 1.8% 0.5rem;
    margin: 0 0 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-top: none;
    border-bottom-left-radius: 0.875rem;
    border-bottom-right-radius: 0.875rem;
    box-shadow: 0 12px 22px -20px rgba(15, 23, 42, 0.38);
    isolation: isolate;
    overflow: hidden;
}
.contract-detail-sticky-shell::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #ffffff;
    z-index: -1;
}
.contract-detail-back-btn {
    margin-bottom: 1rem;
}
.contract-detail-header {
    margin-bottom: 0.25rem;
    background: #ffffff;
    position: relative;
    z-index: 1;
}

.contract-detail-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.contract-final-draft-status {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: var(--text, #1e293b);
    font-size: 0.86rem;
    line-height: 1.35;
    text-align: right;
    white-space: nowrap;
    margin-left: auto;
}

.contract-clause-filter-heading {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 0.75rem;
    width: 100%;
}

#findings-tab,
#docview-tab,
#audittrail-tab {
    margin-top: 0;
    padding-top: 0;
}

#contract-summary-section {
    margin-top: 0;
    margin-bottom: 1.75rem;
    padding: 1.125rem 1.5rem 2rem;
}

.results-content.results-content-detail #contract-summary-section {
    margin-left: 0;
    margin-right: 0;
    border-radius: 0.875rem;
}

#contract-detail-view {
    position: relative;
    margin-top: 0;
    padding-top: 0;
    background: transparent;
    isolation: isolate;
}
#contract-detail-view::before {
    display: none;
}
.contract-detail-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text, #1e293b);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.625rem;
    flex-wrap: wrap;
}

.contract-detail-open-count {
    color: #64748b;
    font-size: 0.95em;
    font-weight: 700;
}

.contract-detail-deviation-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.28rem 0.72rem;
    border-radius: 999px;
    background: #fff7ed;
    border: 1px solid #fdba74;
    color: #c2410c;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* ── Contract-Level Resolution Controls ── */
.contract-resolution-controls {
    margin-top: 1.5rem;
}
.contract-res-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: var(--bg-alt, #f8fafc);
    border: 1.5px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
}
.contract-res-clean {
    background: #f0fdf4;
    border-color: #bbf7d0;
    color: #166534;
    font-weight: 600;
    font-size: 0.875rem;
}
.contract-res-resolved {
    background: #f0fdf4;
    border-color: #bbf7d0;
}
.contract-res-status {
    font-weight: 600;
    color: #059669;
    font-size: 0.875rem;
}
.contract-res-hint {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
}

/* ── Per-Provision Noted Toggle ── */
.noted-toggle {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0.125rem 0.625rem;
    border-radius: 999px;
    border: 1.5px solid var(--border, #e2e8f0);
    background: var(--bg, #ffffff);
    color: var(--text-muted, #64748b);
    cursor: pointer;
    transition: all 0.15s;
    margin-left: auto;
    flex-shrink: 0;
}
.noted-toggle:hover {
    border-color: #059669;
    color: #059669;
}
.noted-toggle.noted-active {
    background: #d1fae5;
    border-color: #059669;
    color: #065f46;
}

/* ── Completion Banner ── */
.review-completion-banner {
    padding: 1rem 1.25rem;
    background: #f0fdf4;
    border: 1.5px solid #bbf7d0;
    border-radius: var(--radius, 0.5rem);
    color: #166534;
    font-weight: 600;
    font-size: 0.9375rem;
    margin-top: 1rem;
    text-align: center;
}

/* ══════════════════════════════════════════════════════
   STEP 118 — Discovery nil notice
   ══════════════════════════════════════════════════════ */
.discovery-nil-notice {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    padding: 0.625rem 0.75rem;
    background: var(--bg-alt, #f8fafc);
    border-radius: var(--radius, 0.5rem);
    border: 1px solid var(--border, #e2e8f0);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════
   CONTRACT CARD META LINE (Step 119)
   ══════════════════════════════════════════════════════ */

.contract-card-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.875rem 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    flex-wrap: wrap;
}

.contract-meta-item {
    /* Step 123: no truncation — let full address show; container flex-wraps */
}

.contract-meta-sep {
    color: var(--text-light, #94a3b8);
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════
   ANALYSIS OVERVIEW / RUN SNAPSHOT MODE SEPARATION (Step 120)
   ══════════════════════════════════════════════════════ */

/* Overview cards — read-only briefing, no pointer, no hover */
#contract-status-panel .contract-card-header {
    cursor: default;
}
#contract-status-panel .contract-card-header:hover {
    background: var(--bg-alt, #f8fafc);
}
#contract-status-panel .contract-deviation-row {
    cursor: default;
}
#contract-status-panel .contract-deviation-row:hover {
    background: none;
}
#contract-status-panel .contract-deviation-CRITICAL:hover,
#contract-status-panel .contract-deviation-HIGH:hover,
#contract-status-panel .contract-deviation-MEDIUM:hover,
#contract-status-panel .contract-deviation-LOW:hover {
    background: none;
}
#contract-status-panel .contract-card:hover {
    border-color: var(--border, #e2e8f0);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

/* Step 120 snapshot card overrides removed — superseded by Step 122 snapshot styles */

/* ══════════════════════════════════════════════════════
   SIDEBAR STATUS LABEL (Step 121)
   ══════════════════════════════════════════════════════ */

.nav-status-label {
    font-size: 0.6875rem;
    font-weight: 600;
    padding: 0 0.875rem 0.35rem;
    letter-spacing: 0.01em;
}
.nav-status-processing {
    color: var(--accent, #2563eb);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.spinner-inline {
    display: inline-block;
    width: 0.75rem;
    height: 0.75rem;
    border: 2px solid rgba(37, 99, 235, 0.25);
    border-top-color: var(--accent, #2563eb);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.nav-tenant-processing {
    opacity: 0.7;
}

.nav-tenant-counts {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.875rem 0.95rem;
    margin-top: 0.5rem;
}

.nav-count-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.5rem;
    border-radius: 999px;
    font-size: 0.66rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: 0.01em;
    white-space: nowrap;
}

.nav-count-chip.critical {
    background: #fee2e2;
    color: #991b1b;
}

.nav-count-chip.high {
    background: #ffedd5;
    color: #9a3412;
}

.nav-count-chip.medium {
    background: #fef3c7;
    color: #92400e;
}

.nav-count-chip.low {
    background: #eef2f7;
    color: #475569;
}

.nav-count-chip.neutral {
    background: #eff6ff;
    color: #1d4ed8;
}

.nav-status-critical { color: #e11d48; }
.nav-status-high     { color: #f97316; }
.nav-status-medium   { color: #f59e0b; }
.nav-status-clear    { color: #16a34a; }

/* ══════════════════════════════════════════════════════
   NON-STANDARD SCAN TAG (Step 123)
   ══════════════════════════════════════════════════════ */

.provision-scan-tag {
    display: inline-flex;
    align-items: center;
    padding: 0.1875rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-muted, #64748b);
    background: var(--bg-alt, #f8fafc);
    border: 1px dashed var(--border, #e2e8f0);
    border-radius: 999px;
    white-space: nowrap;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════
   RUN SNAPSHOT TOOLBAR (Step 124)
   ══════════════════════════════════════════════════════ */

.snapshot-toolbar {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.snapshot-toolbar-select {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    background: var(--bg, #ffffff);
    color: var(--text, #1e293b);
    font-family: var(--font);
    cursor: pointer;
    min-width: 8.125rem;
}
.snapshot-toolbar-select:focus {
    outline: none;
    border-color: var(--border-focus, #93c5fd);
}

.snapshot-toolbar-search {
    margin-left: auto;
    position: relative;
    display: flex;
    align-items: center;
}
.snapshot-toolbar-search input {
    padding: 0.375rem 0.75rem 0.375rem 2rem;
    font-size: 0.8125rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    background: var(--bg, #ffffff);
    color: var(--text, #1e293b);
    font-family: var(--font);
    width: 16vw;
    transition: border-color 0.15s, width 0.2s;
}
.snapshot-toolbar-search input:focus {
    outline: none;
    border-color: var(--border-focus, #93c5fd);
    width: 22vw;
}
.snapshot-toolbar-search .search-icon {
    position: absolute;
    left: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-light, #94a3b8);
    pointer-events: none;
}

.snapshot-no-results {
    padding: 2rem;
    text-align: center;
    color: var(--text-muted, #64748b);
    font-size: 0.875rem;
}

.snapshot-toolbar-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

/* ══════════════════════════════════════════════════════
   TWO-LEVEL DEAL SUMMARY (Step 125)
   ══════════════════════════════════════════════════════ */

/* Level 1: Lease blurb on cards */
.contract-card-blurb {
    padding: 0 0.875rem 0.375rem;
    font-size: 0.8125rem;
    color: var(--text, #1e293b);
    font-style: normal;
    line-height: 1.4;
}

/* Level 2: Deal overview table in Contract Summary */
.deal-overview-section {
    margin-bottom: 1.25rem;
    padding: 1.25rem 1.25rem 1.75rem;
    background: #ffffff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: var(--radius-lg, 0.75rem);
}

#contract-summary-section > .section-header {
    display: none;
}

.deal-overview-heading {
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.875rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--border, #e2e8f0);
}

.deal-overview-table {
    display: grid;
    grid-template-columns: 12% 1fr;
    gap: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.deal-overview-label {
    font-weight: 600;
    color: var(--text-muted, #64748b);
    padding-top: 0.125rem;
    white-space: nowrap;
}

.deal-overview-value {
    color: var(--text, #1e293b);
    line-height: 1.5;
}

.deal-overview-value.empty {
    color: var(--text-light, #94a3b8);
}

.deal-key-terms {
    margin-top: 0.875rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border, #e2e8f0);
}

.deal-key-terms-heading {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.5rem;
}

.deal-key-terms ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.deal-key-terms li {
    font-size: 0.8125rem;
    color: var(--text, #1e293b);
    line-height: 1.5;
    padding-left: 1rem;
    position: relative;
}

.deal-key-terms li::before {
    content: "\00B7";
    position: absolute;
    left: 0.25rem;
    color: var(--text-muted, #64748b);
}

/* ── Step 2 inactive state (upload page, before template processed) ── */
.step2-inactive {
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}

.provisions-sidebar.review-areas-inactive .provisions-panel-controls,
.provisions-sidebar.review-areas-inactive .provisions-col-standard,
.provisions-sidebar.review-areas-inactive .custom-provision-add {
    opacity: 0.42;
    pointer-events: none;
    user-select: none;
    transition: opacity 0.3s ease;
}

/* ── Step 140: User Rules ── */
.not-deviation-btn {
    font-size: 0.75rem;
    color: var(--text-muted);
    background: none;
    border: 1px solid var(--border);
    border-radius: 0.25rem;
    padding: 0.125rem 0.5rem;
    cursor: pointer;
    margin-top: 0.5rem;
}
.not-deviation-btn:hover {
    color: var(--text);
    border-color: var(--text-muted);
}

.rules-dialog-textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 0.625rem;
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    background: var(--bg);
    color: var(--text);
    font-size: 0.875rem;
    resize: vertical;
    margin-top: 0.5rem;
    font-family: inherit;
}

.rules-dialog-status {
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.rules-panel-item {
    border: 1px solid var(--border);
    border-radius: 0.375rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    position: relative;
}

.rules-panel-item-text {
    font-size: 0.875rem;
    color: var(--text);
    margin-bottom: 0.375rem;
    padding-right: 3rem;
}

.rules-panel-item-meta {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.rules-panel-tag {
    font-size: 0.75rem;
    background: var(--primary-light, rgba(59,130,246,0.1));
    color: var(--primary);
    padding: 0.0625rem 0.375rem;
    border-radius: 0.25rem;
}

.rules-panel-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.rules-panel-delete {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: var(--danger, #ef4444);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}
.rules-panel-delete:hover { text-decoration: underline; }

/* ── Final Draft Bar ─────────────────────────────────── */
.final-draft-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--surface-2, #f8fafc);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    margin-top: 0;
    margin-bottom: 1.25rem;
    position: relative;
}
.fd-bar-label { font-weight: 600; font-size: 0.88rem; color: var(--text-muted, #64748b); }
.fd-counter { font-size: 0.88rem; color: var(--text, #1e293b); flex: 1; }
.fd-generate-btn {
    padding: 0.375rem 1rem;
    background: var(--accent, #1a365d);
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.fd-generate-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.fd-generate-btn:not(:disabled):hover { opacity: 0.88; }

/* ── Decision Row on Card ────────────────────────────── */
.fd-decision-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1rem 0.5rem;
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 0;
    flex-wrap: wrap;
    background: #f9fafb;
}
.fd-decision-label { font-size: 0.8rem; font-weight: 600; color: var(--text-muted, #64748b); }
.fd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 1.875rem;
    padding: 0.3rem 0.85rem;
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 0.5rem;
    background: var(--surface, #fff);
    color: var(--text, #1e293b);
    font-size: 0.76rem;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: all 0.15s;
}
.fd-btn:hover {
    border-color: rgba(26, 54, 93, 0.22);
    background: var(--bg-alt, #f8fafc);
    color: var(--primary, #1a365d);
}
.fd-btn-active {
    background: var(--primary, #1a365d);
    color: #fff !important;
    border-color: var(--primary, #1a365d);
}

/* ── Modify Panel ────────────────────────────────────── */
.fd-modify-panel {
    padding: 0.875rem 1rem 0.75rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    background: #ffffff;
    margin: 0.625rem 0.625rem 0.875rem;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.04);
}
.fd-modify-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.625rem;
    margin-bottom: 0.5rem;
}
.fd-modify-col-label { font-size: 0.75rem; font-weight: 600; color: var(--text-muted, #64748b); margin-bottom: 0.1875rem; }
.fd-modify-col-text { font-size: 0.82rem; color: var(--text, #1e293b); line-height: 1.4; }
.fd-modify-textarea {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.85rem;
    padding: 0.5rem;
    border: 1.5px solid var(--border, #cbd5e1);
    border-radius: 0.375rem;
    resize: vertical;
    font-family: inherit;
    line-height: 1.4;
    color: var(--text, #1e293b);
    background: var(--surface, #fff);
}
.fd-modify-textarea:focus { outline: none; border-color: var(--accent, #1a365d); }
.fd-ai-draft-btn {
    padding: 0.3125rem 0.875rem;
    background: #f0f9ff;
    border: 1.5px solid #7dd3fc;
    border-radius: 0.3125rem;
    color: #0369a1;
    font-size: 0.8rem;
    font-weight: 600;
    min-height: 2rem;
    cursor: pointer;
}
.fd-ai-draft-btn:hover { background: #e0f2fe; }
.fd-ai-draft-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.fd-modify-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.5rem;
    align-items: center;
}

.fd-save-btn {
    background: #16a34a;
    color: #fff;
    border: none;
    border-radius: 0.3125rem;
    padding: 0.3125rem 0.875rem;
    min-height: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.fd-save-btn:hover { background: #15803d; }
.fd-save-btn:disabled { background: #86efac; cursor: default; }

.fd-note-btn {
    background: #ffffff;
    color: var(--primary, #1a365d);
    border: 1px solid #cbd5e1;
    border-radius: 0.3125rem;
    padding: 0.3125rem 0.75rem;
    min-height: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fd-note-btn:hover:not(:disabled) {
    background: #f8fafc;
    border-color: #94a3b8;
}
.fd-note-btn:disabled {
    cursor: default;
    opacity: 0.8;
}

.fd-save-open-btn {
    background: #ffffff;
    color: #1f2937;
    border: 1px solid #cbd5e1;
    border-radius: 0.3125rem;
    padding: 0.3125rem 0.75rem;
    min-height: 2rem;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fd-save-open-btn:hover {
    background: #f8fafc;
    border-color: #94a3b8;
}

.fd-clear-btn {
    background: transparent;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 0.3125rem;
    padding: 0.3125rem 0.75rem;
    min-height: 2rem;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.15s ease;
}
.fd-clear-btn:hover { background: #f3f4f6; color: #374151; }

/* Persistent tab sub-header bar — always directly below nav buttons */
.tab-subheader {
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #374151;
    padding: 0.625rem 1.8%;
    z-index: 19;
    margin: 0 calc(1.8% + var(--scrollbar-w, 0)) 0 1.8%;
}

/* Step 281: Coverage & Gaps subheader in Mode C carries a right-aligned
   "Perspective: <value>" indicator. The flex variant kicks in only when
   `setSubheader` is called with a rightHtml argument; otherwise the bar
   continues to render its single text label exactly as before. */
.tab-subheader.tab-subheader-flex {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 1rem;
}
.tab-subheader-label {
    flex: 0 1 auto;
}
.tab-subheader-right {
    flex: 0 0 auto;
    font-size: 0.85rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: none;
    color: rgba(255, 255, 255, 0.85);
}
.tab-subheader-perspective-key {
    font-weight: 600;
    color: rgba(255, 255, 255, 0.7);
    margin-right: 0.25rem;
}

/* Section heading bars (Run Synopsis collapsible / legacy) */
.section-heading {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #374151;
    padding: 0.625rem 1rem;
    margin: 1rem -1.5rem 1.25rem -1.5rem;
}
.section-heading:first-child {
    margin-top: 0;
}

/* Divider before Contracts — handled by heading bar margin */
.contracts-section-divider {
    display: none;
}

/* Contracts section heading bar */
.contracts-section-heading {
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
    background: #374151;
    padding: 0.625rem 1rem;
    margin: 1.75rem -1.5rem 1.25rem -1.5rem;
}

/* Collapsible section headings */
.section-heading-collapsible {
    cursor: pointer;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.section-heading-collapsible:hover {
    opacity: 0.85;
}
.section-toggle-icon {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-left: 0.5rem;
}

/* Snapshot card action-level badge */
.snapshot-action-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 0.1875rem 0.625rem;
    border-radius: 0.75rem;
    white-space: nowrap;
    margin-right: 0.25rem;
}
.action-badge-critical {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.action-badge-high {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
}
.action-badge-medium {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.action-badge-fragile {
    background: #fffbeb;
    border: 1.5px solid #d97706;
    color: #92400e;
    font-weight: 600;
    font-size: 0.72rem;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: 0.01em;
}
.action-badge-clear {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #86efac;
}

/* Top overview card — severity chips */
.overview-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
    padding: 0.5rem 1rem 0.875rem;
}
.overview-chip {
    display: inline-flex;
    align-items: center;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.1875rem 0.5625rem;
    border-radius: 0.75rem;
    white-space: nowrap;
}
.chip-jumpable {
    cursor: pointer;
    transition: opacity 0.12s;
}
.chip-jumpable:hover {
    opacity: 0.75;
}
.overview-chip-critical {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.overview-chip-high {
    background: #ffedd5;
    color: #9a3412;
    border: 1px solid #fdba74;
}
.overview-chip-medium {
    background: #fef9c3;
    color: #854d0e;
    border: 1px solid #fde047;
}
.overview-chip-low {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.overview-chip-conforming {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #86efac;
}
.overview-chip-gap {
    background: #fff;
    color: #6b7280;
    border: 1px dashed #9ca3af;
}
.overview-chip-gap-overflow {
    background: transparent;
    color: #9ca3af;
    border: none;
    font-size: 0.68rem;
    padding: 0.1875rem 0.25rem;
}
.overview-gap-chip-row {
    padding-top: 0;
}
.conforming-chip-row {
    padding: 0 1rem 0.625rem;
}
.conforming-count-badge {
    background: none;
    border: 1px solid #86efac;
    border-radius: 0.75rem;
    color: #15803d;
    font-size: 0.72rem;
    font-weight: 600;
    padding: 0.125rem 0.5rem;
    cursor: pointer;
    transition: background 0.12s;
}
.conforming-count-badge:hover {
    background: #f0fdf4;
}
.conforming-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3125rem;
    padding-top: 0.375rem;
}
.conforming-chips.hidden {
    display: none;
}

/* Contract filter dropdown footer + Apply button */
.snapshot-contract-dropdown-footer {
    padding: 0.5rem 0.875rem 0.625rem;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex;
    justify-content: flex-end;
}
.snapshot-contract-apply-btn {
    background: #2563eb;
    color: #fff;
    border: none;
    border-radius: 0.375rem;
    padding: 0.35rem 1rem;
    font-size: 0.8125rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s ease;
}
.snapshot-contract-apply-btn:hover { background: #1d4ed8; }

/* UNCLEAR provision chips */
.prov-chip-unclear {
    color: #6d28d9;
    background: #f5f3ff;
    border: 1px solid #ddd6fe;
    cursor: pointer;
    transition: opacity 0.15s ease;
}
.prov-chip-unclear:hover { opacity: 0.85; }

/* No-contract placeholder (Step 153) */
#no-contract-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 20rem;
    padding: 2rem;
}
#no-contract-placeholder.hidden { display: none; }
.ncp-inner {
    text-align: center;
    max-width: 26.25rem;
}
.ncp-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}
.ncp-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}
.ncp-msg {
    font-size: 0.9rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 1.5rem;
}
.ncp-back-btn {
    font-size: 0.875rem;
}

/* Audit export bar scope labels */
.audit-export-label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-right: 0.25rem;
}
.audit-export-label-sep {
    margin-left: 1rem;
}

.audit-controls-buttons .btn-audit-control + .btn-audit-control {
    display: none;
}

/* Full-run audit: per-tenant section dividers */
.audit-tenant-section {
    margin-bottom: 2rem;
}
.audit-tenant-heading {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.5rem 0;
    border-bottom: 2px solid var(--border);
    margin-bottom: 0.75rem;
}

/* Per-contract AI comment bar */
.contract-ai-comment {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin: 0.75rem 1.25rem 0.25rem;
    padding: 0.625rem 0.875rem;
    background: #f0f9ff;
    border: 1px solid #bae6fd;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    color: #0c4a6e;
    line-height: 1.55;
}
.contract-ai-comment-icon {
    flex-shrink: 0;
    font-size: 1rem;
    margin-top: 0.05rem;
}
.contract-ai-comment-text { flex: 1; }
.contract-ai-comment-loading {
    color: var(--text-muted, #94a3b8);
    font-style: italic;
    font-size: 0.85rem;
}

/* ── CAM / ASG Scoring UI (Step 182) ── */

/* CAM badge — appears on nav sidebar provision labels */
.cam-badge {
    font-size: 0.625rem;
    font-weight: 500;
    padding: 0.0625rem 0.3125rem;
    border-radius: 0.1875rem;
    margin-left: 0.25rem;
    white-space: nowrap;
}
.cam-verified  { background: #dcfce7; color: #15803d; }
.cam-complex   { background: #fef9c3; color: #a16207; }
.cam-review    { background: #f1f5f9; color: #64748b; }
.cam-uncertain { background: #f1f5f9; color: #64748b; }

/* Contract hero confidence line */
.cam-confidence-line {
    font-size: 0.8125rem;
    color: #475569;
    margin-top: 0.375rem;
    padding: 0.25rem 0;
    border-top: 1px solid #f1f5f9;
}
.cam-confidence-line strong { color: #1e40af; }

/* CAM score row in provision detail */
.cam-score-line {
    font-size: 0.75rem;
    color: #64748b;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid #f1f5f9;
}
.cam-val { font-weight: 600; color: #334155; }
.cam-signal { font-weight: 500; }

/* CAM confidence help link (circled ?) */
.cam-confidence-help {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 0.9375rem;
    height: 0.9375rem;
    font-size: 0.625rem;
    font-weight: 700;
    color: #64748b;
    border: 1px solid #cbd5e1;
    border-radius: 50%;
    text-decoration: none;
    margin-left: 0.3125rem;
    vertical-align: middle;
    line-height: 1;
}
.cam-confidence-help:hover {
    color: #2563eb;
    border-color: #2563eb;
}

.cam-confidence-note {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.8rem;
}

/* Analysis completeness (Step 192) */
.analysis-completeness {
    font-size: 0.8125rem;
    padding: 0.25rem 0.75rem;
    border-radius: 0.25rem;
    margin-top: 0.25rem;
    display: inline-block;
}
.completeness-complete  { background: #f0fdf4; color: #15803d; }
.completeness-resolved  { background: #fffbeb; color: #92400e; }
.completeness-unresolved{ background: #fef2f2; color: #991b1b; }

/* Extraction integrity in audit trail (Step 192) */
.audit-integrity {
    font-size: 0.75rem;
    padding: 0.375rem 0.625rem;
    margin-top: 0.5rem;
    border-radius: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    flex-wrap: wrap;
}
.audit-integrity-ok      { background: #f0fdf4; color: #15803d; }
.audit-integrity-warn    { background: #fef2f2; color: #991b1b; }
.audit-integrity-neutral { background: #f8fafc; color: #64748b; }
.audit-integrity-label   { font-weight: 600; }
.audit-integrity-status  { font-weight: 500; text-transform: capitalize; }
.audit-integrity-ratio   { color: #64748b; }
.audit-integrity-repair  { background: #fffbeb; color: #92400e; padding: 0 0.375rem; border-radius: 0.1875rem; font-weight: 500; }
.audit-integrity-frozen  { color: #15803d; font-weight: 500; }

/* Confidence indicator on provision pills (Step 184) */
.prov-chip-conf-dot {
    font-size: 0.65rem;
    font-weight: 700;
    opacity: 0.7;
    margin-left: 0.125rem;
    vertical-align: middle;
    cursor: default;
}

/* Subtle dashed border for lower-confidence pills */
.prov-chip-conf-review {
    border-style: dashed;
    opacity: 0.9;
}
.prov-chip-conf-uncertain {
    border-style: dashed;
    opacity: 0.85;
}

/* Step 190: card-details removed from finding cards — hide if any residual HTML */
.finding-card .card-details { display: none !important; }
.finding-card .card-expand-bar-inline { display: none !important; }

/* Audit trail link in card actions row */
.card-audit-link {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.15s;
}
.card-audit-link:hover {
    color: var(--primary, #1a365d);
}
.card-audit-link--btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 13.125rem;
    min-height: 1.875rem;
    margin-top: 0;
    padding: 0.3rem 0.85rem;
    border: 1.5px solid var(--accent, #4f46e5);
    border-radius: 0.5rem;
    background: var(--accent, #4f46e5);
    font-size: 0.76rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1;
    transition: background 0.15s, border-color 0.15s;
}
.card-audit-link--btn:hover {
    background: #4338ca;
    color: #ffffff;
    border-color: #4338ca;
}

/* ══════════════════════════════════════════════════════
   AUDIT TRAIL NARRATIVE (Step 190)
   ══════════════════════════════════════════════════════ */

.audit-narrative {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.audit-stage-block {
    border-bottom: 1px solid var(--border, #e2e8f0);
    padding: 0.875rem 1rem;
}
.audit-stage-block:last-child {
    border-bottom: none;
}
.audit-stage-block.audit-stage-skipped {
    opacity: 0.55;
    background: var(--bg-alt, #f8fafc);
}
.audit-disposition-block {
    background: var(--bg-alt, #f8fafc);
}

.audit-stage-title {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    margin-bottom: 0.625rem;
    flex-wrap: wrap;
}
.audit-stage-num {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    background: var(--bg-alt, #f1f5f9);
    border-radius: 0.1875rem;
    padding: 0.0625rem 0.375rem;
}
.audit-stage-name {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--text, #1e293b);
}
.audit-stage-model {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}
.audit-stage-skipped-label {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}

.audit-stage-body {
    padding-left: 0.25rem;
}

/* Text pair (template vs tenant) */
.audit-text-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}
@media (max-width: 700px) {
    .audit-text-pair { grid-template-columns: 1fr; }
}
.audit-text-col {}
.audit-text-label {
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.25rem;
}
.audit-text-content {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
    white-space: pre-wrap;
    word-wrap: break-word;
    padding: 0.5rem 0.625rem;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.25rem;
    font-family: inherit;
}

/* Triage */
.audit-triage-result {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    display: inline-block;
}
.audit-triage-flagged { background: #fff7ed; color: #c2410c; }
.audit-triage-passed  { background: #f0fdf4; color: #15803d; }

/* Rules */
.audit-rules-list { display: flex; flex-direction: column; gap: 0.5rem; }
.audit-rule-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8125rem;
}
.audit-rule-id { font-weight: 600; color: var(--text, #1e293b); white-space: nowrap; }
.audit-rule-detail { color: var(--text-muted, #64748b); }
.audit-rule-none { color: var(--text-muted, #64748b); font-style: italic; }

/* Rule block with excerpt (Step 198) */
.audit-rule-block {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    font-size: 0.8125rem;
}
.audit-rule-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
}
.audit-rule-excerpt {
    font-size: 0.8rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
    background: var(--bg, #ffffff);
    border-left: 3px solid #e2e8f0;
    padding: 0.375rem 0.625rem;
    border-radius: 0 0.25rem 0.25rem 0;
    font-style: italic;
}
mark.audit-rule-highlight {
    background: #fef08a;  /* yellow highlight */
    color: inherit;
    border-radius: 0.125rem;
    padding: 0 0.0625rem;
    font-style: normal;
    font-weight: 500;
}

/* Evaluator cards */
.audit-evaluators { display: flex; flex-direction: column; gap: 0.625rem; margin-bottom: 0.5rem; }
.audit-eval-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.375rem;
    overflow: hidden;
}
.audit-eval-header2 {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.4375rem 0.75rem;
    background: var(--bg-alt, #f8fafc);
    border-bottom: 1px solid var(--border, #e2e8f0);
    flex-wrap: wrap;
}
.audit-eval-key {
    font-size: 0.75rem;
    font-weight: 700;
    width: 1.25rem;
    color: var(--text-muted, #64748b);
}
.audit-eval-model-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    flex: 1;
}
.audit-eval-verdict2 {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.0625rem 0.375rem;
    border-radius: 0.1875rem;
}
.audit-eval-deviates { background: #fee2e2; color: #991b1b; }
.audit-eval-conforms { background: #dcfce7; color: #166534; }
.audit-eval-na       { background: #f1f5f9; color: #64748b; }
.audit-eval-conf2 {
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
}
.audit-eval-basis {
    font-size: 0.7rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}
.audit-eval-reasoning2 {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
    padding: 0.5rem 0.75rem;
    font-style: italic;
}
.audit-eval-diffs {
    margin: 0 0 0 1rem;
    padding: 0.25rem 0.75rem 0.5rem;
    font-size: 0.8rem;
    color: var(--text, #1e293b);
}
.audit-eval-diffs li { margin-bottom: 0.2rem; }

.audit-agreement-summary {
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    padding: 0.25rem 0;
}

/* Challenge */
.audit-challenge-verdict {
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    margin-bottom: 0.5rem;
    display: inline-block;
}
.audit-challenge-sub { background: #fef2f2; color: #991b1b; }
.audit-challenge-cos { background: #f0fdf4; color: #15803d; }
.audit-challenge-exp { background: #fffbeb; color: #92400e; }
.audit-challenge-finding {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
    margin-bottom: 0.5rem;
}
.audit-hidden-deps {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
}
.audit-hidden-deps ul { margin-left: 1.25rem; }
.audit-hidden-deps li { margin-bottom: 0.2rem; }

/* Severity */
.audit-severity-rating {
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
}
.audit-floor-note { font-weight: 400; font-style: italic; color: var(--text-muted); }
.audit-sev-reasoning {
    font-size: 0.8125rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
}

/* Fragility */
.audit-fragility-row {
    font-size: 0.8125rem;
    margin-bottom: 0.375rem;
}
.audit-frag-signals { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 0.5rem; }
.audit-frag-signal-row {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    font-size: 0.8rem;
    flex-wrap: wrap;
}
.audit-frag-signal-name { color: var(--text-muted); }
.audit-frag-detail { color: var(--text-muted); font-style: italic; flex: 1; }
.audit-frag-conf { color: var(--text-light, #94a3b8); white-space: nowrap; }

/* CAM scores */
.audit-cam-scores {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 1.5rem;
    font-size: 0.8125rem;
    margin-top: 0.5rem;
    padding: 0.625rem 0.75rem;
    background: var(--bg, #ffffff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.25rem;
}
.audit-cam-row { display: flex; justify-content: space-between; gap: 1rem; }
.audit-cam-label { color: var(--text-muted, #64748b); }
.audit-cam-val { font-weight: 600; color: var(--text, #1e293b); text-align: right; }

/* Disposition */
.audit-disp-row {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text, #1e293b);
}

.audit-proof-card {
    display: flex;
    flex-direction: column;
    gap: 1.05rem;
}
.audit-proof-overview,
.audit-proof-section {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    padding: 1rem 1.125rem;
}
.audit-proof-topline {
    display: grid;
    grid-template-columns: 48% 52%;
    gap: 1rem;
    margin-bottom: 1rem;
}
.audit-proof-kicker,
.audit-proof-summary-title,
.audit-proof-text-label,
.audit-proof-explainer-label,
.audit-proof-section-title,
.audit-dimension-title,
.audit-score-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--text-muted, #64748b);
}
.audit-proof-headline {
    margin-top: 0.25rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text, #1e293b);
}
.audit-proof-subline {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}
.audit-proof-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    background: #eef2ff;
    color: #243b73;
    font-size: 0.75rem;
    font-weight: 600;
}
.audit-proof-summary {
    background: linear-gradient(135deg, #f8fbff 0%, #f4f7fb 100%);
    border: 1px solid #d8e5fb;
    border-radius: 0.75rem;
    padding: 0.9rem 1rem;
}
.audit-proof-summary-text,
.audit-proof-explainer-text,
.audit-dimension-text,
.audit-proof-microcopy,
.audit-eval-basis-plain {
    margin-top: 0.3rem;
    font-size: 0.875rem;
    line-height: 1.65;
    color: var(--text, #1e293b);
}
.audit-proof-text-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.audit-proof-text-col .audit-text-content {
    margin-top: 0.35rem;
}
.audit-proof-explainer-grid,
.audit-dimension-grid,
.audit-score-grid,
.audit-technical-grid {
    display: grid;
    gap: 0.9rem;
}
.audit-proof-explainer-grid,
.audit-dimension-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 1rem;
}
.audit-proof-explainer-grid > .interpretation-note-section {
    grid-column: 1 / -1;
}
/* ── Interpretation note paragraphs ── */
.interpretation-note-body p {
    margin: 0 0 0.6rem 0;
    line-height: 1.55;
}
.interpretation-note-body p:last-child {
    margin-bottom: 0;
}
.interpretation-note-body strong {
    font-weight: 600;
    color: var(--text-primary);
}
.audit-score-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 0.25rem;
}
.audit-score-card,
.audit-dimension-card,
.audit-challenge-summary-card {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.85rem 0.95rem;
}
.audit-score-head,
.audit-challenge-summary-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}
.audit-score-value {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text, #1e293b);
}
.audit-score-track {
    margin-top: 0.6rem;
    height: 0.5625rem;
    border-radius: 999px;
    background: #e5e7eb;
    overflow: hidden;
}
.audit-score-fill {
    display: block;
    height: 100%;
    border-radius: inherit;
}
.audit-score-fill-good { background: #22c55e; }
.audit-score-fill-caution { background: #f59e0b; }
.audit-score-fill-warning { background: #f97316; }
.audit-score-fill-danger { background: #ef4444; }
.audit-score-fill-neutral { background: #94a3b8; }
.audit-score-helper {
    margin-top: 0.45rem;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted, #64748b);
}
.audit-score-good { border-color: #bbf7d0; }
.audit-score-caution { border-color: #fde68a; }
.audit-score-warning { border-color: #fdba74; }
.audit-score-danger { border-color: #fecaca; }
.audit-score-neutral { border-color: var(--border, #e2e8f0); }
.audit-proof-microcopy {
    margin-top: 0.75rem;
    color: var(--text-muted, #64748b);
}
.audit-technical-block {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
    padding: 0.8rem 0.95rem;
}
.audit-technical-block > summary,
.audit-raw-record > summary {
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    color: #243b73;
}
.audit-technical-grid {
    margin-top: 0.9rem;
    display: grid;
    gap: 0.85rem;
}
.audit-technical-group {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.75rem;
    background: #f8fafc;
    padding: 0.85rem;
}
.audit-technical-group-title {
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.55rem;
}
.audit-raw-record {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.625rem;
    background: #f8fafc;
    padding: 0.75rem 0.85rem;
}
.audit-technical-group .audit-raw-record + .audit-raw-record {
    margin-top: 0.6rem;
}
.audit-raw-record pre {
    margin: 0.8rem 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 0.75rem;
    line-height: 1.55;
    color: #1f2937;
}

@media (max-width: 1200px) {
    .audit-run-meta {
        grid-template-columns: 1fr;
    }
    .audit-proof-topline,
    .audit-proof-text-pair,
    .audit-proof-explainer-grid,
    .audit-dimension-grid,
    .audit-score-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Demo file library (Step 206) ── */
.demo-tenant-section {
    margin-top: 0.75rem;
    border-top: 1px solid var(--border);
    padding-top: 0.75rem;
}
.demo-toggle-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.demo-toggle-btn:hover {
    color: var(--primary);
}
.demo-toggle-arrow {
    transition: transform 0.15s ease;
}
.demo-tenant-picker {
    margin-top: 0.625rem;
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem;
}
.demo-tenant-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}
.demo-tenant-option {
    display: flex;
    align-items: flex-start;
    gap: 0.625rem;
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: var(--radius);
    transition: background 0.1s ease;
}
.demo-tenant-option:hover {
    background: var(--bg);
}
.demo-tenant-option input[type="checkbox"] {
    margin-top: 0.2rem;
    flex-shrink: 0;
    accent-color: var(--accent);
}
.demo-tenant-info {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.demo-tenant-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text);
}
.demo-tenant-desc {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.4;
}
.demo-load-btn {
    width: 100%;
    justify-content: center;
}

/* ── Notable Clauses sub-section (inside finding cards, Step 207) ── */
.notable-clauses-section {
    border-top: 1px solid var(--border);
    margin-top: 0.5rem;
}
.notable-clauses-toggle {
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    padding: 0.5rem 1rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.375rem;
}
.notable-clauses-toggle:hover {
    color: var(--primary);
    background: var(--bg-alt);
}
.notable-clauses-body {
    padding: 0.25rem 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.notable-clause-item {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.5rem 0.75rem;
}
.notable-clause-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
}
.notable-clause-name {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.notable-section-ref {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.notable-clause-text {
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    color: var(--text);
    background: var(--bg);
    border-left: 2px solid var(--border);
    padding: 0.375rem 0.5rem;
    margin: 0.25rem 0;
    white-space: pre-wrap;
    word-break: break-word;
}
.notable-reasoning {
    margin-top: 0.375rem;
}
.notable-reasoning summary {
    font-size: 0.75rem;
    color: var(--accent);
    cursor: pointer;
    user-select: none;
}
.notable-reasoning-body {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
    padding-left: 0.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

/* ── CAM Confidence Badge ── */
.cam-confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 0.18rem 0.5rem;
    border-radius: 999px;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.cam-confidence-badge.confirmed {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}
.cam-confidence-badge.fragile {
    background: #fffbeb;
    border-color: #d97706;
    color: #b45309;
}
.cam-confidence-badge.uncertain {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #64748b;
}
.cam-confidence-badge.unverified {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
}
.cam-confidence-dots {
    font-size: 0.6rem;
    letter-spacing: 0.05em;
}
.nav-confidence-dots {
    display: inline-flex;
    align-items: center;
    font-size: 0.62rem;
    line-height: 1;
    letter-spacing: 0.015em;
    color: #475569;
    opacity: 0.98;
    cursor: help;
}

.nav-confidence-dots .empty,
.nav-confidence-dots .dot-empty {
    color: #cbd5e1;
    opacity: 0.95;
}
/* High-severity + low-confidence "Needs Review" indicator */
.cam-confidence-badge.needs-review-combo {
    border-color: #f59e0b;
    background: #fffbeb;
    color: #92400e;
}
.cam-confidence-needs-review {
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-left: 0.3rem;
    padding: 0.1rem 0.35rem;
    border-radius: 999px;
    background: #fde68a;
    color: #92400e;
    border: 1px solid #f59e0b;
}

/* ── Email confirmed notice (shown after email is entered) ── */
.email-confirmed-notice {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text, #1e293b);
    padding: 0.75rem 1rem;
    background: #f0fdf4;
    border: 1px solid #bbf7d0;
    border-radius: 0.5rem;
    line-height: 1.5;
}

/* ── Mobile results notice (hidden on desktop) ── */
.mobile-results-notice {
    display: none;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    padding: 5%;
}
.mobile-results-card {
    background: var(--bg, #fff);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 1rem;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.06);
    padding: 2rem 1.5rem;
    text-align: center;
    width: 100%;
    max-width: 25rem;
}
.mobile-results-icon {
    font-size: 2.5rem;
    margin-bottom: 0.75rem;
}
.mobile-results-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary, #1a365d);
    margin-bottom: 0.5rem;
}
.mobile-results-text {
    font-size: 0.875rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 1.5rem;
    line-height: 1.5;
}
.mobile-results-link-row {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.mobile-results-url {
    flex: 1;
    font-size: 0.75rem;
    padding: 0.5rem 0.65rem;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    background: var(--bg-alt, #f8fafc);
    color: var(--text, #1e293b);
    min-width: 0;
}
.mobile-copy-btn {
    flex-shrink: 0;
    white-space: nowrap;
}
.mobile-results-email-label {
    font-size: 0.8rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
}
.mobile-results-email-input {
    display: flex;
    gap: 0.5rem;
}
.mobile-results-email-input .input-field {
    flex: 1;
    font-size: 0.85rem;
    min-width: 0;
}
.mobile-results-email-input .btn {
    flex-shrink: 0;
    white-space: nowrap;
}
.mobile-results-email-status {
    font-size: 0.8rem;
    margin-top: 0.5rem;
    color: var(--success, #16a34a);
}

/* ── Audit Detail V3 (Step 229) ── */
.audit-detail-v3 {
    padding: 1rem 1.1rem 1.25rem;
    background: #f8fafc;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 1.1rem;
}
.adv3-section-label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.5rem;
}
.adv3-model-tag {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    margin-left: 0.4em;
    color: var(--text-light, #94a3b8);
}
/* Confidence label explainer — top of expanded detail */
.adv3-confidence-explainer {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0.75rem;
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    font-size: 0.8rem;
}
.adv3-confidence-explainer-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    white-space: nowrap;
    flex-shrink: 0;
}
.adv3-confidence-explainer-text {
    color: var(--text-muted, #64748b);
    font-style: italic;
}

/* Interpretation note */
.adv3-interp-note {
    background: #fffbeb;
    border: 1px solid #fde68a;
    border-radius: 0.5rem;
    padding: 0.75rem 0.9rem;
}
.adv3-interp-body p {
    font-size: 0.82rem;
    line-height: 1.6;
    color: var(--text, #1e293b);
    margin: 0 0 0.4rem;
}
.adv3-interp-body p:last-child { margin-bottom: 0; }
/* Evaluator cards */
.adv3-evaluators {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.adv3-eval-card {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
}
.adv3-eval-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.45rem;
}
.adv3-eval-model {
    font-weight: 600;
    font-size: 0.82rem;
    color: var(--text, #1e293b);
}
.adv3-eval-verdict {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.125rem 0.5rem;
    border-radius: 999px;
}
.adv3-verdict-flag  { background: #fee2e2; color: #991b1b; }
.adv3-verdict-ok    { background: #dcfce7; color: #166534; }
.adv3-verdict-unclear { background: #fef9c3; color: #854d0e; }
.adv3-eval-reasoning {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text, #1e293b);
    margin-bottom: 0.35rem;
}
.adv3-eval-diffs {
    margin: 0.35rem 0 0 1rem;
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    line-height: 1.5;
}
.adv3-eval-diffs li { margin-bottom: 0.15rem; }
/* Challenge card */
.adv3-challenge-card {
    background: #fff;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
}
.adv3-challenge-text {
    font-size: 0.82rem;
    line-height: 1.55;
    color: var(--text, #1e293b);
}
/* Confidence scores — collapsed <details> */
.adv3-scores-details {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    background: #fff;
    overflow: hidden;
}
.adv3-scores-summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.55rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    list-style: none;
    user-select: none;
}
.adv3-scores-summary::-webkit-details-marker { display: none; }
.adv3-scores-summary::before {
    content: '\25B6';
    font-size: 0.6rem;
    transition: transform 0.15s;
}
details[open] .adv3-scores-summary::before { transform: rotate(90deg); }
.adv3-scores-num {
    margin-left: auto;
    font-variant-numeric: tabular-nums;
    color: var(--text-muted, #64748b);
}
.adv3-scores-body {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border, #e2e8f0);
}
.adv3-scores-section {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}
/* Complexity badge in collapsed audit row */
.audit-complexity-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.68rem;
    font-weight: 600;
    padding: 0.125rem 0.4375rem;
    border-radius: 999px;
    white-space: nowrap;
    border: 1.5px solid transparent;
    justify-self: start;
    width: fit-content;
}
.audit-complexity-simple   { background: #dcfce7; color: #166534; border-color: #bbf7d0; }
.audit-complexity-moderate { background: #fef9c3; color: #854d0e; border-color: #fde68a; }
.audit-complexity-complex  { background: #ffedd5; color: #9a3412; border-color: #fed7aa; }
.audit-complexity-high     { background: #fee2e2; color: #991b1b; border-color: #fecaca; }

.adv3-score-num {
    font-size: 0.72rem;
    font-weight: 400;
    color: var(--text-muted, #94a3b8);
    margin-left: 0.4em;
}
.audit-score-context {
    font-size: 0.74rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
    margin-top: 0.35rem;
    line-height: 1.45;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 0.35rem;
}

/* ── Technical Details Section ── */
/* About CAM modal — scoring explainer */
.about-cam-content {
    max-height: 85vh;
    overflow-y: auto;
}
.about-cam-story {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0;
}
.about-cam-story-block {
    display: flex;
    gap: 0.85rem;
    align-items: flex-start;
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
}
.about-cam-story-icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1;
    margin-top: 0.1rem;
}
.about-cam-story-title {
    font-weight: 700;
    font-size: 0.875rem;
    color: var(--text, #1e293b);
    margin-bottom: 0.35rem;
}
.about-cam-story-text {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    line-height: 1.6;
    margin: 0;
}
.about-cam-indicators {
    list-style: none;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 0.75rem 0;
}
.about-cam-indicators li {
    font-size: 0.875rem;
    line-height: 1.5;
}
.about-cam-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.15rem 0.55rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    margin-right: 0.4em;
    border: 1.5px solid transparent;
}
.about-cam-badge.confirmed  { background: #dcfce7; color: #166534; border-color: #86efac; }
.about-cam-badge.fragile    { background: #fff7ed; color: #9a3412; border-color: #fdba74; }
.about-cam-badge.uncertain  { background: #f1f5f9; color: #475569; border-color: #cbd5e1; }
.about-cam-badge.unverified { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }
.about-cam-score-block {
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
}
.about-cam-score-title {
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text, #1e293b);
    margin-bottom: 0.35rem;
}
.about-cam-score-desc {
    font-size: 0.82rem;
    color: var(--text-muted, #64748b);
    margin-bottom: 0.4rem;
}
.about-cam-score-list {
    font-size: 0.82rem;
    color: var(--text, #1e293b);
    margin: 0.35rem 0 0.35rem 1.25rem;
    line-height: 1.6;
}
.about-cam-score-note {
    font-size: 0.78rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
    margin-top: 0.4rem;
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 0.35rem;
}
/* ⓘ info button next to section label */
.adv3-scores-info {
    background: none;
    border: none;
    padding: 0 0.2rem;
    font-size: 0.9rem;
    color: var(--text-light, #94a3b8);
    cursor: pointer;
    vertical-align: middle;
    line-height: 1;
    transition: color 0.15s;
}
.adv3-scores-info:hover { color: var(--accent, #2563eb); }

.adv3-tech-details {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.5rem;
    overflow: hidden;
    background: #fff;
}
.adv3-tech-toggle-row,
.adv3-tech-close-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.4rem 0.75rem;
}
.adv3-tech-open .adv3-tech-toggle-row {
    display: none;
}
.adv3-tech-close-row {
    border-top: 1px solid var(--border, #e2e8f0);
    margin-top: 0.5rem;
}
.adv3-tech-toggle-label {
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
}
.adv3-tech-btn {
    cursor: pointer;
}
.adv3-tech-body {
    padding: 0.75rem 0.85rem;
    border-top: 1px solid var(--border, #e2e8f0);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.adv3-tech-section {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}
.adv3-tech-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted, #64748b);
}
.adv3-tech-formula {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    font-family: var(--font-mono, monospace);
    font-size: 0.75rem;
    background: #f8fafc;
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.375rem;
    padding: 0.6rem 0.75rem;
}
.adv3-tech-formula-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.4em;
}
.adv3-tech-term {
    color: var(--text-muted, #64748b);
    font-size: 0.7rem;
}
.adv3-tech-val {
    font-weight: 700;
    color: var(--text, #1e293b);
}
.adv3-tech-op {
    color: var(--text-muted, #64748b);
}
.adv3-tech-result {
    font-weight: 700;
    color: var(--accent, #2563eb);
}
.adv3-tech-raw {
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 0.375rem;
    overflow: hidden;
}
.adv3-tech-raw > summary {
    padding: 0.4rem 0.75rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    cursor: pointer;
    background: #f8fafc;
    list-style: none;
}
.adv3-tech-raw > summary::-webkit-details-marker { display: none; }
.adv3-tech-pre {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    line-height: 1.5;
    padding: 0.6rem 0.75rem;
    overflow-x: auto;
    white-space: pre;
    color: var(--text, #1e293b);
    background: #fff;
    max-height: 18.75rem;
    overflow-y: auto;
}
.adv3-tech-list {
    margin: 0 0 0 1rem;
    font-size: 0.77rem;
    color: var(--text-muted, #64748b);
    font-family: var(--font-mono, monospace);
}

/* ── Audit Trail Row Redesign (Step 229) ── */
/* .audit-row-signals uses display:contents so children drop into parent grid cols 4+5 */
.audit-confidence-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.18rem 0.55rem;
    border-radius: 999px;
    font-size: 0.73rem;
    font-weight: 500;
    border: 1.5px solid transparent;
    white-space: nowrap;
    justify-self: start;
    align-self: center;
}
.audit-confidence-confirmed {
    background: #f0fdf4;
    border-color: #16a34a;
    color: #15803d;
}
.audit-confidence-fragile {
    background: #fffbeb;
    border-color: #d97706;
    color: #b45309;
}
.audit-confidence-uncertain {
    background: #f8fafc;
    border-color: #94a3b8;
    color: #64748b;
}
.audit-confidence-unverified {
    background: #f8fafc;
    border-color: #cbd5e1;
    color: #94a3b8;
}
.audit-reviewer-agreement {
    white-space: nowrap;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    white-space: nowrap;
    align-self: center;
}

/* ── Aggressive Read (Step 228) ── */
.btn-aggressive-read {
    display: inline-flex;
    align-items: center;
    gap: 0.3em;
    padding: 0.28rem 0.7rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #92400e;
    background: #fffbeb;
    border: 1px solid #f59e0b;
    border-radius: 0.3125rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
    max-width: 22%;          /* percentage-based, not pixel */
    min-width: 0;
}
.btn-aggressive-read:hover {
    background: #fef3c7;
    color: #78350f;
}
.btn-aggressive-read:disabled {
    opacity: 0.6;
    cursor: wait;
}

.aggressive-read-panel {
    margin: 0.5rem 0 0.25rem;
    border: 1px solid #f59e0b;
    border-radius: 0.375rem;
    background: #fffdf0;
    font-size: 0.85rem;
    line-height: 1.55;
    overflow: hidden;
}
.aggressive-read-panel.hidden {
    display: none;
}
.aggressive-read-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0.85rem;
    background: #fef3c7;
    border-bottom: 1px solid #f59e0b;
}
.aggressive-read-label {
    font-weight: 600;
    color: #78350f;
    font-size: 0.82rem;
    white-space: nowrap;
}
.aggressive-read-advisory {
    font-size: 0.75rem;
    color: #92400e;
    font-style: italic;
    flex: 1;
}
.aggressive-read-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #92400e;
    font-size: 0.85rem;
    padding: 0 0.2rem;
    line-height: 1;
    margin-left: auto;
}
.aggressive-read-body {
    padding: 0.75rem 0.85rem;
    color: var(--text-primary);
}
.aggressive-read-body p {
    margin: 0 0 0.6rem;
}
.aggressive-read-body p:last-child {
    margin-bottom: 0;
}

/* ══════════════════════════════════════════════════════
   MOBILE RESPONSIVE (≤ 480px)
   Scope: login gate, upload, processing/progress
   ══════════════════════════════════════════════════════ */

@media (max-width: 480px) {

    /* ── App Header ── */
    .app-header {
        padding: 0.5rem 3%;
        gap: 0.5rem;
        flex-wrap: wrap;
    }
    .app-header .logo {
        font-size: 1.15rem;
    }
    .app-header .tagline {
        display: none;
    }
    .app-header .privacy-link {
        font-size: 0.65rem;
    }
    .app-header .expiry-notice {
        font-size: 0.65rem;
        margin-right: 0.5rem;
    }

    /* ── Workflow Nav ── */
    .workflow-nav {
        top: 2.625rem;
    }
    .workflow-nav-inner {
        padding: 0.5rem 3%;
        gap: 0.4rem;
        flex-wrap: wrap;
        justify-content: center;
    }
    .workflow-nav-tab {
        font-size: 0.75rem;
        padding: 0.4rem 0.7rem;
    }

    /* ── Login Gate ── */
    #state-gate {
        min-height: 60vh;
        padding: 5% 5%;
    }
    .gate-card {
        max-width: 100%;
        padding: 2rem 1.5rem;
    }
    .gate-card .logo {
        font-size: 2rem;
    }
    .gate-card .subtitle {
        font-size: 0.85rem;
        margin-bottom: 1.5rem;
    }

    /* ── Upload Page ── */
    .upload-layout,
    .upload-layout:has(.contracts-column.hidden) {
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 0.75rem 3%;
    }
    .upload-cols-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    .upload-columns {
        grid-template-columns: 1fr;
    }
    .drop-zone {
        padding: 1.25rem;
        min-height: 5.625rem;
    }
    .drop-zone .drop-icon {
        font-size: 1.5rem;
    }
    .drop-zone .drop-text {
        font-size: 0.8rem;
    }
    .provisions-sidebar,
    .help-chat-column {
        grid-column: 1;
    }

    /* ── Processing Page ── */
    .processing-layout {
        padding: 0.75rem 3% 1.5rem;
        gap: 1rem;
    }
    .processing-status-card {
        padding: 1rem 1rem 0.85rem;
        border-radius: 0.75rem;
    }
    .processing-title {
        font-size: 1.3rem;
    }
    .processing-subtitle {
        font-size: 0.85rem;
        margin-bottom: 1rem;
    }
    .processing-secondary-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }
    .processing-checklist-column,
    .processing-main-stack {
        min-width: 0;
        width: 100%;
        max-width: 100%;
    }
    .processing-detail-card,
    .processing-checklist-card,
    .processing-return-panel,
    .processing-ready-card {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    .processing-tenant-top {
        flex-direction: column;
        gap: 0.5rem;
    }
    .processing-tenant-status-wrap {
        min-width: 0;
        width: 100%;
        align-items: flex-start;
        flex-direction: row;
        gap: 0.75rem;
    }
    .processing-tenant-status,
    .processing-tenant-status-meta {
        white-space: normal;
    }
    .processing-tenant-detail-row {
        flex-direction: column;
        gap: 0.4rem;
        min-height: auto;
    }
    .processing-tenant-percent {
        font-size: 1.5rem;
    }
    .processing-tenant-card {
        padding: 0.75rem;
    }
    .processing-detail-card {
        padding: 0.75rem;
    }
    .processing-sidebar {
        display: none;
    }
    .processing-knowledge-band {
        display: none;
    }

    /* ── Results: desktop-only notice ── */
    .results-layout {
        display: none;
    }
    .mobile-results-notice {
        display: flex;
    }
}

/* ── Step 245: Coverage & Gaps Panel ── */
#coverage-tab { padding: 1rem 1.25rem; }
.coverage-empty { padding: 1.5rem; text-align: center; color: var(--text-muted); }
.coverage-summary-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 0.75rem;
    padding: 0.75rem 1rem; margin-bottom: 1rem;
    background: var(--bg-elevated, #f8f9fa); border: 1px solid var(--border, #e1e4e8); border-radius: 0.375rem;
}
.coverage-summary-label { font-weight: 600; color: var(--text); margin-right: 0.5rem; }
.coverage-summary-stat { font-size: 0.9rem; padding: 0.25rem 0.625rem; border-radius: 0.75rem; font-weight: 500; }
.coverage-stat-problem { background: #fee; color: #c33; }
.coverage-stat-review  { background: #fff4e0; color: #b86500; }
.coverage-stat-ok      { background: #e8f5e9; color: #2e7d32; }
.coverage-stat-typical { background: #eef; color: #555; }
.coverage-all-clear { padding: 1rem; background: #e8f5e9; color: #2e7d32; border-radius: 0.375rem; margin-bottom: 1rem; font-weight: 500; }

.cv-section { margin-bottom: 1.25rem; border: 1px solid var(--border, #e1e4e8); border-radius: 0.375rem; overflow: hidden; }
.cv-section-header { padding: 0.625rem 0.875rem; font-weight: 600; font-size: 0.95rem; border-bottom: 1px solid var(--border, #e1e4e8); }
.cv-section-problems  { background: #fee; color: #c33; }
.cv-section-review    { background: #fff4e0; color: #b86500; }
.cv-section-ok        { background: #f4f6f8; color: #555; }
.cv-section-favorable { background: #dcfce7; color: #166534; }
.cv-section-toggle-hint { font-weight: 400; font-size: 0.8rem; color: var(--text-muted); margin-left: 0.5rem; }

/* Step 307: cv-item converges to finding-card design language */
.cv-item {
    padding: 0.75rem 0.875rem;
    border: 1px solid var(--border, #e2e8f0);
    border-left: 4px solid var(--border, #e2e8f0);
    border-radius: var(--radius, 0.5rem);
    margin-bottom: 1rem;
    overflow: hidden;
    background: var(--bg, #ffffff);
    box-shadow: var(--shadow, 0 1px 3px rgba(0,0,0,0.06));
    transition: box-shadow 0.15s ease;
    color: var(--text);
}
.cv-item:hover { box-shadow: var(--shadow-md, 0 4px 6px -1px rgba(0,0,0,0.08)); }
.cv-item:last-child { margin-bottom: 0; }
/* Tier colors: border-left-color + tinted background matching finding-card severity */
.cv-item-problem  { border-left-color: var(--danger, #dc2626); background: #fffafa; }
.cv-item-review   { border-left-color: #d97706; background: #fffbeb; }
.cv-item-ok       { border-left-color: var(--info, #64748b); background: #f8fafc; }
.cv-item-favorable { border-left-color: #16a34a; background: #f0fdf4; }
/* Header: border-bottom separates from body, matches deviation-header rhythm */
.cv-item-header { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding-bottom: 0.5rem; margin-bottom: 0.5rem; border-bottom: 1px solid var(--border-light, #f1f5f9); }
.cv-item-id { font-family: monospace; font-size: 0.85rem; color: var(--text-muted); }
.cv-item-name { font-weight: 600; font-size: 0.9375rem; color: var(--text); }
/* Step 280: combined-line item header in the main pane mirrors the
   Synopsis PDF / DOCX [GAP] shape from Step 279. The em-dash separator
   and the headline span sit between the LP name and the state badge. */
.cv-item-headline-sep { color: var(--text-muted); font-weight: 400; }
.cv-item-headline { color: var(--text); font-weight: 500; }
.cv-badge { font-size: 0.75rem; padding: 0.125rem 0.5rem; border-radius: 0.75rem; font-weight: 600; white-space: nowrap; display: inline-flex; align-items: center; }
.cv-badge-ok         { background: #e8f5e9; color: #2e7d32; }
.cv-badge-favorable   { background: #16a34a; color: #ffffff; }
.cv-badge-asymmetric  { background: #f9a8d4; color: #9d174d; }
.cv-badge-unfav       { background: #fee; color: #c33; }
.cv-badge-partial { background: #fff4e0; color: #b86500; }
.cv-badge-missing { background: #f4f4f4; color: #666; }
.cv-badge-na      { background: #f0f0f0; color: #999; }
.cv-pcls-badge { font-size: 0.7rem; padding: 0.125rem 0.4375rem; border-radius: 0.625rem; font-weight: 500; }
.cv-pcls-material { background: #fee; color: #c33; }
.cv-pcls-review   { background: #fff4e0; color: #b86500; }
.cv-item-stmt { font-size: 0.88rem; color: var(--text); line-height: 1.4; margin: 0.25rem 0; }
.cv-source-model { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-left: 0.25rem; }
.cv-missing-elements, .cv-ns-signals { margin-top: 0.375rem; font-size: 0.8rem; }
.cv-missing-label { color: var(--text-muted); margin-right: 0.375rem; }
.cv-missing-item, .cv-ns-signal { display: inline-block; padding: 0.125rem 0.4375rem; margin: 0.125rem 0.25rem 0.125rem 0; background: #f4f4f4; border-radius: 0.625rem; color: #555; }
.cv-missing-more { font-size: 0.78rem; color: var(--text-muted); font-style: italic; }

/* Coverage nav links */
.cv-item-nav { display: flex; align-items: center; gap: 0.375rem; margin-top: 0.5rem; padding-top: 0.375rem; border-top: 1px solid var(--border-light, #f1f5f9); }
.cv-nav-link { font-size: 0.75rem; color: var(--primary); text-decoration: none; }
.cv-nav-link:hover { text-decoration: underline; }
.cv-nav-sep { font-size: 0.75rem; color: var(--text-muted); }

/* Coverage tier filter buttons */
.cv-tier-btn { font-size: 0.8rem !important; padding: 0.25rem 0.75rem !important; margin: 0 !important; }
.cv-tier-btn-active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }

/* ── Coverage toolbar (Step 246) ── */
.cov-toolbar { border-top: 1px solid #e5e7eb; padding: 0.6rem 1rem 0.5rem; margin: 0 -0.875rem -0.75rem; display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; background: #f9fafb; }
.cov-pill { display: inline-flex; align-items: center; justify-content: center; min-height: 1.875rem; font-size: 0.76rem; font-weight: 600; padding: 0.2rem 0.65rem; border-radius: 999px; border: 1.5px solid #d1d5db; background: white; color: #1e293b; line-height: 1; cursor: pointer; transition: all 0.15s; white-space: nowrap; }
.cov-pill:hover { border-color: #9ca3af; color: #374151; }
.cov-pill-active { background: var(--primary) !important; color: #fff !important; border-color: var(--primary) !important; }
.cov-pill-flagged.cov-pill-active { background: #d97706 !important; border-color: #d97706 !important; }
.cov-pill-accepted.cov-pill-active { background: #16a34a !important; border-color: #16a34a !important; }
.cov-notes-btn { font-size: 0.8rem; }
.cov-notes-panel { padding: 0.75rem 1rem; margin: 0 -0.875rem -0.75rem; background: #f9fafb; border-top: 1px solid #e5e7eb; }
.cov-note-input-row { display: flex; gap: 0.5rem; align-items: flex-start; }

/* ── Sidebar coverage callout (Step 246) ── */
.nav-coverage-callout { font-size: 0.75rem; color: #d97706; cursor: pointer; padding: 0.2rem 0; margin-top: 0.2rem; }
.nav-coverage-callout:hover { text-decoration: underline; }

/* ── Audit trail coverage block (Step 246b) ── */
.audit-coverage-block { margin: 1rem 0 0; padding: 0.875rem 1rem; background: #fefce8; border: 1px solid #fde68a; border-radius: 6px; }
.audit-coverage-header { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.375rem; flex-wrap: wrap; }
.audit-coverage-label { font-size: 0.8rem; font-weight: 600; color: #92400e; }
.audit-coverage-state-badge { font-size: 0.7rem; font-weight: 600; padding: 2px 6px; border-radius: 3px; background: #fef3c7; color: #92400e; }
.audit-cov-covered-unfavorable { background: #fee2e2; color: #991b1b; }
.audit-cov-missing { background: #fce7f3; color: #9d174d; }
.audit-coverage-stmt { font-size: 0.85rem; color: var(--text-secondary); line-height: 1.5; margin-bottom: 0.375rem; }
.audit-coverage-link { font-size: 0.75rem; color: var(--primary); text-decoration: none; }
.audit-coverage-link:hover { text-decoration: underline; }

/* ── Finding card coverage link ── */
.card-coverage-link--btn { font-size: 0.8rem; padding: 0.25rem 0.75rem; border: 1px solid #fde68a; background: #fefce8; color: #92400e; border-radius: 4px; text-decoration: none; white-space: nowrap; }
.card-coverage-link--btn:hover { background: #fef3c7; }

/* ── Sidebar coverage callout (inside contract box) ── */
.nav-coverage-callout { font-size: 0.73rem; color: #d97706; cursor: pointer; padding: 0.15rem 0; margin-top: 0.25rem; display: block; }
.nav-coverage-callout:hover { text-decoration: underline; }

/* Fix: coverage callout indent in sidebar */
.nav-coverage-callout { padding-left: 0.5rem !important; margin-left: 0.1rem; }

/* Fix: coverage source label in audit trail */
.audit-coverage-source { font-size: 0.68rem; color: var(--text-muted); font-style: italic; margin-left: auto; }

/* Coverage status filter bar */
.coverage-status-filter-bar { display: flex; align-items: center; gap: 0.375rem; padding: 0.5rem 0 0; flex-wrap: wrap; }
.cv-status-filter-btn { font-size: 0.75rem !important; padding: 0.2rem 0.6rem !important; margin: 0 !important; }

/* Merge coverage filter bars into one line */
.coverage-status-filter-bar { display: none; } /* old two-row approach - hidden */
.cv-filter-divider { color: var(--border); font-size: 1rem; padding: 0 0.25rem; user-select: none; }
.cv-status-filter-btn { font-size: 0.75rem !important; padding: 0.2rem 0.6rem !important; margin: 0 !important; }

/* Missing provision callout */
.cv-missing-provision-note { font-size: 0.8rem; color: #92400e; background: #fefce8; border: 1px solid #fde68a; border-radius: 4px; padding: 0.375rem 0.625rem; margin: 0.375rem 0; }

/* Step 286: inline lease text toggle */
.cv-lease-text-row { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; font-size: 0.8rem; color: var(--text-muted, #888); margin: 0.2rem 0 0.25rem; user-select: none; }
.cv-lease-text-row:hover { color: var(--primary, #0366d6); }
.cv-lt-arrow { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #ffffff; color: #64748b; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.cv-lease-text-row:hover .cv-lt-arrow { border-color: #94a3b8; color: #334155; background: #f8fafc; }
.cv-lease-text-body { margin: 0 0 0.375rem; }
.cv-lease-text-pre { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.78rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; background: #f6f8fa; border: 1px solid #e1e4e8; border-radius: 4px; padding: 0.625rem 0.75rem; margin: 0; max-height: 18rem; overflow-y: auto; color: #24292e; }

/* Step 306b: Evidence View tab */
.ev-doc-wrap { padding: 1rem 1.25rem; }
.ev-pre { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: 0.78rem; line-height: 1.6; white-space: pre-wrap; word-break: break-word; color: #24292e; margin: 0; background: none; border: none; padding: 0; }
.ev-heading { display: block; font-weight: 700; font-size: 0.82rem; color: #1a1a2e; border-left: 3px solid var(--primary, #0366d6); padding-left: 0.5rem; margin: 0.875rem 0 0.125rem -0.5rem; background: rgba(3, 102, 214, 0.04); }
.ev-empty { padding: 3rem 2rem; color: var(--text-muted, #888); font-style: italic; text-align: center; font-size: 0.9rem; }

/* Step 306a: per-element detail — summary row + table */
.cv-elem-summary-row { display: inline-flex; align-items: center; gap: 0.25rem; cursor: pointer; font-size: 0.8rem; color: var(--text-muted, #888); margin: 0.2rem 0 0.25rem; user-select: none; }
.cv-elem-summary-row:hover { color: var(--primary, #0366d6); }
.cv-elem-chevron { display: inline-flex; align-items: center; justify-content: center; width: 1.25rem; height: 1.25rem; border-radius: 999px; border: 1px solid #cbd5e1; background: #ffffff; color: #64748b; font-size: 0.65rem; font-weight: 700; flex-shrink: 0; }
.cv-elem-summary-row:hover .cv-elem-chevron { border-color: #94a3b8; color: #334155; background: #f8fafc; }
.cv-elem-summary-text { }
.cv-elem-table-body { margin: 0 0 0.375rem; }
.cv-ev-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.cv-ev-th { text-align: left; font-weight: 600; color: var(--text-muted, #888); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.03em; padding: 0.25rem 0.5rem 0.25rem 0; border-bottom: 1px solid var(--border, #eee); }
.cv-ev-th-label { width: 60%; }
.cv-ev-th-status { width: 22%; }
.cv-ev-th-citation { width: 18%; }
.cv-ev-row td { padding: 0.25rem 0.5rem 0.25rem 0; vertical-align: top; border-bottom: 1px solid var(--border-light, #f1f5f9); }
.cv-ev-row:last-child td { border-bottom: none; }
.cv-ev-label { color: var(--text, #333); line-height: 1.3; }
.cv-ev-status { }
.cv-ev-citation { font-family: monospace; font-size: 0.75rem; color: var(--text-muted, #888); }
.cv-ev-pill { font-size: 0.7rem; padding: 0.1rem 0.4rem; border-radius: 0.625rem; font-weight: 500; display: inline-block; }
.cv-ev-present  { background: #e8f5e9; color: #2e7d32; }
.cv-ev-implicit { background: #f1f8e9; color: #558b2f; }
.cv-ev-default  { background: #e8eaf6; color: #3949ab; }
.cv-ev-crosslp  { background: #e3f2fd; color: #1565c0; }
.cv-ev-missing  { background: #f4f4f4; color: #666; }
.cv-ev-unclear  { background: #fff8e1; color: #f57f17; }
.cv-ev-disag-btn { cursor: pointer; font-size: 0.7rem; color: #b86500; margin-left: 0.25rem; user-select: none; }
.cv-ev-disag-body { font-size: 0.72rem; color: var(--text-muted, #888); padding: 0.2rem 0 0.1rem 0.5rem; font-style: italic; }

/* Step 307b: element-level confidence dots in element table */
.ev-conf-dots { font-size: 0.6rem; letter-spacing: 0.05em; margin-left: 0.3rem; vertical-align: middle; }
.ev-conf-high   { color: #16a34a; }
.ev-conf-medium { color: #d97706; }
.ev-conf-low    { color: #dc2626; }

/* Step 349b: disputed element verdict — amber "review" treatment */
.element-status-disputed,
.element-merged-disputed {
    color: #b45309;
    background-color: #fef3c7;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid #f59e0b;
    font-size: 0.7rem;
    display: inline-block;
}
.element-vote-count,
.element-merged-votes {
    color: #6b7280;
    font-size: 0.85em;
    margin-left: 4px;
}

/* Step 307b: sidebar confidence label for Mode C LP items */
.nav-item-conf { font-size: 0.65rem; color: var(--text-muted, #888); white-space: nowrap; margin-left: auto; padding-left: 0.25rem; }

/* Step 339: dots-only variant — slightly larger for the dot symbols to read well */
.nav-item-conf-dots { font-size: 0.7rem; letter-spacing: 0.02em; cursor: default; }

/* Step 339: directional row confidence distribution line */
.nav-dir-conf { display: block; font-size: 0.62rem; color: #92400e; padding: 0.1rem 0.6rem 0.3rem; }

/* Step 307b: score bars container in coverage audit trail */
.audit-cov-score-bars { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: 0.5rem; margin: 0.5rem 0; }

/* Step 306c: citation jump links */
.cv-section-link { cursor: pointer; text-decoration: underline dotted; color: var(--primary, #0366d6); }
.cv-section-link:hover { text-decoration: underline solid; }
.cv-elem-lp-jump { font-size: 0.75rem; color: var(--primary, #0366d6); margin-left: 0.5rem; white-space: nowrap; }

/* Step 308 — per-evaluator expandable panel */

/* Toggle button in element row status cell */
.cv-ev-evals-btn {
    display: inline-flex;
    align-items: center;
    margin-left: 0.4rem;
    padding: 0.125rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border: 1.5px solid #cbd5e1;
    border-radius: 999px;
    background: #fff;
    color: #475569;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.12s, background 0.12s;
    vertical-align: middle;
}
.cv-ev-evals-btn:hover { border-color: #94a3b8; background: #f8fafc; }
.cv-ev-evals-btn.cv-ev-evals-open { border-color: #6366f1; color: #4338ca; background: #eef2ff; }
.cv-ev-evals-btn.cv-ev-evals-btn-disag { border-color: #f59e0b; color: #92400e; background: #fffbeb; }
.cv-ev-evals-btn.cv-ev-evals-btn-disag.cv-ev-evals-open { border-color: #d97706; background: #fef3c7; }

/* Panel row (hidden by default, toggled by button) */
.cv-ev-panel-row { background: #f8fafc; }
.cv-ev-panel-cell {
    padding: 0.5rem 0.75rem 0.75rem;
    border-top: 1px solid #e2e8f0;
}
.cv-eval-panel { display: flex; flex-direction: column; gap: 0.5rem; }

/* Per-evaluator row inside the panel */
.cv-eval-row {
    display: grid;
    grid-template-columns: 1.25rem 5rem auto 1fr;
    align-items: baseline;
    gap: 0.375rem;
    padding: 0.25rem 0;
}
.cv-eval-row-dissent { background: #fffbeb; border-radius: 0.25rem; padding: 0.25rem 0.375rem; }

/* Role badge (A/B/C chip) */
.cv-eval-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 999px;
    font-size: 0.625rem;
    font-weight: 700;
    color: #fff;
    flex-shrink: 0;
}
/* Reuse EVALUATOR_COLORS: eval-blue / eval-green / eval-red */
.eval-badge-A.eval-blue  { background: #3b82f6; }
.eval-badge-B.eval-green { background: #22c55e; }
.eval-badge-C.eval-red   { background: #ef4444; }

/* Model name label */
.cv-eval-name {
    font-size: 0.6875rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

/* Verdict pill inside the panel (slightly smaller than row-level pill) */
.cv-eval-verdict-pill {
    font-size: 0.625rem !important;
    padding: 0.0625rem 0.375rem !important;
}

/* Section ref inside the panel */
.cv-eval-ref {
    font-size: 0.6875rem;
    color: #6366f1;
    font-weight: 500;
    white-space: nowrap;
}

/* Reasoning text */
.cv-eval-reasoning {
    grid-column: 1 / -1;
    font-size: 0.6875rem;
    color: #64748b;
    line-height: 1.4;
    margin-top: 0.125rem;
    padding-left: 1.5rem;
}
@keyframes ev-heading-flash { 0% { background: rgba(3,102,214,0.25); } 100% { background: rgba(3,102,214,0.04); } }
.ev-heading-flash { animation: ev-heading-flash 2.2s ease-out; }
.ev-quote-highlight { background: #fffb8f; border-radius: 2px; transition: background 0.4s ease; }
.ev-quote-fade { background: transparent !important; }

/* Draft Missing Clause — primary advisor button */
.cov-advisor-primary { background: var(--primary) !important; color: #fff !important; border: none !important; border-radius: 4px !important; padding: 0.3rem 0.75rem !important; font-weight: 600 !important; cursor: pointer !important; }
.cov-advisor-primary:hover { opacity: 0.88 !important; }

/* Coverage Gap button — match the blue btn style */
.card-coverage-link--btn {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.875rem;
    background: var(--primary) !important;
    color: #fff !important;
    border: 1px solid var(--primary) !important;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 500;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}
.card-coverage-link--btn:hover { opacity: 0.88 !important; }

/* Coverage item flash highlight */
@keyframes cv-flash { 0%,100%{background:transparent} 30%,70%{background:#fef9c3} }
.cv-item-flash { animation: cv-flash 1.8s ease; }

/* ══════════════════════════════════════════════════════
   STEP 257 — MODE C RESULTS UX CLEANUP
   Mode C (single-document analysis) has no template, so deviation-oriented
   UI elements have no meaning. Coverage & Gaps tab is the primary output;
   Audit Trail kept visible for extraction-stage info; Document Comparison
   tab already hidden in Step 254. These rules hide the Mode-A artifacts that
   would otherwise show empty/misleading content.
   ══════════════════════════════════════════════════════ */
body.mode-c #filter-bar,
body.mode-c #deal-brief-banner,
body.mode-c #provisions-checklist,
body.mode-c #provisions-scope-card,
body.mode-c #review-completion-banner,
body.mode-c #results-legend {
    display: none !important;
}
/* Step 258: #ai-summary-bar is intentionally NOT hidden in Mode C — it now
   renders a coverage-oriented Mode C summary via renderModeCAISummaryBar(). */
/* In-card workflow rows: hide "Open Document Comparison" buttons (target tab
   is hidden in Mode C). "Open CAM Audit Trail" buttons stay visible. */
body.mode-c .card-docview-link {
    display: none !important;
}

/* ══════════════════════════════════════════════════════
   STEP 258 — MODE C AI SUMMARY BAR (Coverage Snapshot)
   Replaces the Mode A deviation-counted summary with a coverage-oriented
   four-bucket pill row. Buckets mirror the Coverage & Gaps tab framing
   so the Overview → contract drilldown narrative stays consistent.
   ══════════════════════════════════════════════════════ */
.ai-summary-modec {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    padding: 0.85rem 1rem;
}
.ai-summary-modec-headline {
    display: flex;
    align-items: baseline;
    gap: 0.75rem;
    flex-wrap: wrap;
}
.ai-summary-modec-headline strong {
    font-size: 1rem;
    color: var(--text-primary, #111);
}
.ai-summary-modec-meta {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
}
.ai-summary-modec-stats {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}
.ai-summary-modec-stat {
    display: inline-flex;
    align-items: baseline;
    gap: 0.4rem;
    padding: 0.35rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.875rem;
    border: 1px solid transparent;
}
.ai-summary-modec-stat strong {
    font-size: 1rem;
    font-weight: 700;
}
.ai-summary-modec-stat--ok          { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.ai-summary-modec-stat--attention   { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.ai-summary-modec-stat--review      { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.ai-summary-modec-stat--improvement { background: #dbeafe; border-color: #60a5fa; color: #1e40af; }
.ai-summary-modec-stat--na          { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.ai-summary-modec-cta {
    font-size: 0.875rem;
    color: var(--text-muted, #666);
}

/* ══════════════════════════════════════════════════════
   STEP 259 — MODE C RUN SNAPSHOT CARDS
   Mode C cards reuse the .snapshot-card base styles (already styled for Mode A)
   plus a .snapshot-card-modec marker that drives a coverage-tier accent border.
   The .modec-count-row is a horizontal pill row showing per-bucket counts;
   styling mirrors the Step 258 AI Summary pills for a consistent visual
   language between Overview → Leases → Coverage & Gaps.
   ══════════════════════════════════════════════════════ */
.snapshot-card-modec {
    border-left: 4px solid #cbd5e1;
}
.snapshot-card-modec-problems { border-left-color: #dc2626; }
.snapshot-card-modec-review   { border-left-color: #f59e0b; }
.snapshot-card-modec-ok       { border-left-color: #10b981; }
.snapshot-card-modec-empty    { border-left-color: #94a3b8; }

.modec-count-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.5rem 0;
    margin-bottom: 0.25rem;
}
.modec-count {
    display: inline-flex;
    align-items: baseline;
    gap: 0.3rem;
    padding: 0.25rem 0.6rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    border: 1px solid transparent;
}
.modec-count strong {
    font-weight: 700;
    font-size: 0.875rem;
}
.modec-count-ok      { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.modec-count-attn    { background: #fef2f2; border-color: #fecaca; color: #b91c1c; }
.modec-count-review  { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.modec-count-na      { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }

/* Step 340: secondary counts row and risk driver section */
.modec-secondary-row {
    font-size: 0.68rem;
    color: #6b7280;
    padding: 0 1rem 0.25rem;
    line-height: 1.4;
}
.modec-risk-drivers {
    padding: 0.25rem 1rem 0;
}
.modec-risk-drivers-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
    display: block;
}
.modec-risk-drivers .overview-chip-row {
    padding: 0 0 0.25rem;
}
/* Red risk-driver chips matching Risk Map red (#dc2626) */
.overview-chip-risk {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}
.overview-chip-risk:hover {
    background: #fecaca;
}
.modec-gap-line {
    font-size: 0.68rem;
    color: #6b7280;
    padding: 0.1rem 1rem 0.3rem;
}
.modec-gap-label {
    font-weight: 600;
    color: #4b5563;
}
.ai-summary-modec-combined-note {
    font-size: 0.7rem;
    color: #6b7280;
    margin: 0.15rem 0 0.1rem;
}

/* ══════════════════════════════════════════════════════
   STEP 341b — USE-IMPACT NOTE (Coverage & Gaps card)
   ══════════════════════════════════════════════════════ */
.cv-use-impact-note {
    font-size: 0.72rem;
    margin-top: 0.35rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    line-height: 1.4;
}
.cv-use-impact-favorable {
    background: #dcfce7;
    color: #166534;
    border-left: 3px solid #16a34a;
}
.cv-use-impact-neutral {
    background: #f3f4f6;
    color: #4b5563;
    border-left: 3px solid #9ca3af;
}
.cv-use-impact-adverse {
    background: #fff7ed;
    color: #9a3412;
    border-left: 3px solid #ea580c;
}

/* ══════════════════════════════════════════════════════
   STEP 342 — AUDIT TRAIL REASONING (per-evaluator in table + merge trace)
   ══════════════════════════════════════════════════════ */
.audit-cov-ev-reason {
    font-size: 0.7rem;
    color: #4b5563;
    font-style: italic;
    margin-top: 0.2rem;
    line-height: 1.35;
}
.audit-cov-trace-dissent-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.3rem;
    margin-bottom: 0.2rem;
}
.audit-cov-trace-reason {
    font-size: 0.7rem;
    color: #6b7280;
    font-style: italic;
}

/* ══════════════════════════════════════════════════════
   STEP 342 NEW — Coverage & Gaps provision filter select
   ══════════════════════════════════════════════════════ */
.cv-provision-select {
    font-size: 0.78rem;
    padding: 0.2rem 0.4rem;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    color: #374151;
    cursor: pointer;
    max-width: 16rem;
}
.cv-prov-hidden {
    display: none !important;
}

/* ══════════════════════════════════════════════════════
   STEP 261 — PERSPECTIVE SELECTOR (upload page)
   Three radios (tenant / landlord / neutral). Must select — no default.
   Visually mirrors the mode-selector card so the two read as a related pair.
   The 'required-indicator' class is toggled by JS to red-flag the card when
   the user tries to submit without choosing.
   ══════════════════════════════════════════════════════ */
.perspective-selector-wrapper {
    margin-bottom: 1rem;
}
.perspective-selector-card {
    padding: 1rem 1.25rem;
}
.perspective-selector-card.required-indicator {
    border: 1px solid #dc2626;
    background: #fef2f2;
}
.perspective-selector-label {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.15rem;
}
.perspective-selector-help {
    font-size: 0.8125rem;
    color: var(--text-muted, #666);
    margin-bottom: 0.6rem;
}
.perspective-selector-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.6rem;
}
@media (max-width: 720px) {
    .perspective-selector-options { grid-template-columns: 1fr; }
}
.perspective-option {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.65rem 0.8rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    background: #fff;
    transition: border-color 0.15s, background 0.15s;
}
.perspective-option:hover {
    border-color: #94a3b8;
}
.perspective-option input[type="radio"] {
    margin-top: 0.2rem;
}
.perspective-option:has(input[type="radio"]:checked) {
    border-color: #2563eb;
    background: #eff6ff;
}
.perspective-option-body {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}
.perspective-option-title {
    font-weight: 600;
    font-size: 0.9rem;
}
.perspective-option-help {
    font-size: 0.78rem;
    color: var(--text-muted, #666);
    line-height: 1.35;
}

/* Results-page perspective indicator (small label shown alongside Coverage Snapshot
   / AI Summary headlines so the user is always reminded of the analysis lens). */
.perspective-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--text-muted, #666);
    padding: 0.15rem 0.55rem;
    border-radius: 9999px;
    background: #f1f5f9;
    border: 1px solid #cbd5e1;
}
.perspective-indicator strong {
    color: #1e293b;
    font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────
   Step 263: Mode-aware results UI

   Mode C (analyze single document) skips the multi-evaluator framework
   (Stages 2/3/5), so the CAM Audit Trail tab has nothing meaningful to
   show. Hide it when body.mode-c is set. (See applyModeAwareTabVisibility
   in app.js, called from showState whenever state changes.)
   ────────────────────────────────────────────────────────────────── */
/* Step 307b: CAM Audit Trail tab is now shown in Mode C (306d added Coverage Evaluation content).
   Removed the display:none rules that were hiding it. */

/* CAM Audit Trail button in coverage card toolbars now works in Mode C — also un-hidden. */

/* ───────────────────────────────────────────────────────────────────
   Step 264: Unified left-sidebar enrichment (Mode A + Mode C)

   Both modes now use the same item layout: provision/area ID + name +
   state-or-severity badge on the top row, truncated risk/exposure
   descriptor on the second row. Mode A is grouped per-tenant by severity;
   Mode C is grouped per-tenant by attention tier. Class names are
   intentionally new (.nav-item-enriched, .nav-section, etc.) so they
   don't collide with whatever earlier .nav-sidebar item styles exist.
   ─────────────────────────────────────────────────────────────────── */

.nav-sidebar-content .nav-tenant-group {
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
}
.nav-sidebar-content .nav-tenant-group + .nav-tenant-group {
    border-top: 1px solid var(--border, #e2e8f0);
    padding-top: 0.75rem;
}

.nav-sidebar-content .nav-tenant-header {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted, #64748b);
    padding: 0.4rem 0.75rem 0.25rem;
    word-break: break-word;
}
.nav-sidebar-content .nav-tenant-active .nav-tenant-header {
    color: var(--accent, #2563eb);
}

.nav-sidebar-content .nav-section {
    margin-bottom: 0.5rem;
}
.nav-sidebar-content .nav-section-header {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted, #64748b);
    padding: 0.35rem 0.75rem 0.2rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.nav-sidebar-content .nav-section-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    padding: 0 0.35rem;
    height: 1rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--text-muted, #64748b);
    background: var(--bg-alt, #f1f5f9);
    border: 1px solid var(--border, #e2e8f0);
    border-radius: 9999px;
    line-height: 1;
}

/* Section header tints by severity / attention tier */
.nav-sidebar-content .nav-section-sev-critical .nav-section-header { color: #b91c1c; }
.nav-sidebar-content .nav-section-sev-high     .nav-section-header { color: #c2410c; }
.nav-sidebar-content .nav-section-sev-medium   .nav-section-header { color: #b45309; }
.nav-sidebar-content .nav-section-sev-low      .nav-section-header { color: #475569; }
.nav-sidebar-content .nav-section-attention    .nav-section-header { color: #b91c1c; }
.nav-sidebar-content .nav-section-review       .nav-section-header { color: #c2410c; }

/* Item button: full-width clickable card. Reset native button styles. */
.nav-sidebar-content .nav-item-enriched {
    display: block;
    width: 100%;
    text-align: left;
    background: transparent;
    border: 1px solid transparent;
    border-left: 3px solid transparent;
    border-radius: var(--radius, 0.5rem);
    padding: 0.5rem 0.7rem;
    margin: 0.15rem 0;
    cursor: pointer;
    color: var(--text, #1e293b);
    font-family: inherit;
    font-size: 0.8125rem;
    line-height: 1.35;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.nav-sidebar-content .nav-item-enriched:hover {
    background: var(--bg-alt, #f8fafc);
    border-color: var(--border, #e2e8f0);
}
.nav-sidebar-content .nav-item-enriched:focus-visible {
    outline: 2px solid var(--accent, #2563eb);
    outline-offset: 2px;
}
.nav-sidebar-content .nav-item-enriched.active {
    background: #eff6ff;
    border-color: #bfdbfe;
    border-left-color: var(--accent, #2563eb);
}

/* Top row: ID · name · badge (badge pinned right) */
.nav-sidebar-content .nav-item-top {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    min-width: 0;
}
.nav-sidebar-content .nav-item-id {
    font-family: var(--font-mono, monospace);
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted, #64748b);
    flex-shrink: 0;
    letter-spacing: 0.02em;
}
.nav-sidebar-content .nav-item-name {
    flex: 1 1 auto;
    min-width: 0;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text, #1e293b);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.nav-sidebar-content .nav-item-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    height: 1.1rem;
    padding: 0 0.4rem;
    border-radius: 9999px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1;
    border: 1px solid transparent;
    white-space: nowrap;
}

/* Severity badges (Mode A) */
.nav-sidebar-content .nav-badge-critical {
    background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.nav-sidebar-content .nav-badge-high {
    background: #ffedd5; color: #9a3412; border-color: #fed7aa;
}
.nav-sidebar-content .nav-badge-medium {
    background: #fef3c7; color: #92400e; border-color: #fde68a;
}
.nav-sidebar-content .nav-badge-low {
    background: #f1f5f9; color: #475569; border-color: #cbd5e1;
}
.nav-sidebar-content .nav-badge-review {
    background: #e0e7ff; color: #3730a3; border-color: #c7d2fe;
}

/* Coverage state badges (Mode C) */
.nav-sidebar-content .nav-badge-enforceability {
    background: #dc2626; color: #ffffff; border-color: #b91c1c;
    font-weight: 700; letter-spacing: 0.03em;
}
.nav-sidebar-content .nav-badge-favorable {
    background: #16a34a; color: #ffffff; border-color: #15803d;
    font-weight: 700; letter-spacing: 0.03em;
}
.nav-sidebar-content .nav-badge-asymmetric {
    background: #f9a8d4; color: #9d174d; border-color: #f472b6;
    font-weight: 700; letter-spacing: 0.03em;
}
.nav-sidebar-content .nav-badge-unfavorable {
    background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.nav-sidebar-content .nav-badge-missing {
    background: #fee2e2; color: #991b1b; border-color: #fca5a5;
}
.nav-sidebar-content .nav-badge-partial-material {
    background: #ffedd5; color: #9a3412; border-color: #fed7aa;
}
.nav-sidebar-content .nav-badge-partial-review {
    background: #fef3c7; color: #92400e; border-color: #fde68a;
}
.nav-sidebar-content .nav-badge-default {
    background: #f1f5f9; color: #475569; border-color: #cbd5e1;
}

/* Descriptor: 2-line clamp with ellipsis. Lighter than name; full text on hover via title attr. */
.nav-sidebar-content .nav-item-desc {
    margin-top: 0.25rem;
    color: var(--text-muted, #64748b);
    font-size: 0.75rem;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: break-word;
}

/* Empty states */
.nav-sidebar-content .nav-empty {
    padding: 0.4rem 0.75rem;
    font-size: 0.75rem;
    color: var(--text-muted, #64748b);
    font-style: italic;
}
.nav-sidebar-content .nav-empty-state {
    padding: 1rem 0.75rem;
    font-size: 0.8125rem;
    color: var(--text-muted, #64748b);
    text-align: center;
}

/* Step 297c: Provision Conflicts section in Coverage & Gaps tab */
.cv-conflicts-section {
    margin: 0 0 1.5rem 0;
    padding: 1rem 1.25rem;
    background: #fef9f3;
    border: 1px solid #f6d29c;
    border-radius: 8px;
}
.cv-conflicts-header-row { margin-bottom: 0.75rem; }
.cv-conflicts-header {
    margin: 0 0 0.4rem 0;
    font-size: 1rem;
    font-weight: 700;
    color: #92400e;
}
.cv-conflicts-intro {
    margin: 0;
    color: #78350f;
    font-size: 0.875rem;
    line-height: 1.5;
}
.cv-conflict-card {
    margin-top: 0.75rem;
    padding: 0.85rem 1rem;
    background: white;
    border: 1px solid #e5e7eb;
    border-left-width: 4px;
    border-radius: 6px;
}
.cv-conflict-high   { border-left-color: #b91c1c; }
.cv-conflict-medium { border-left-color: #d97706; }
.cv-conflict-low    { border-left-color: #6b7280; }
.cv-conflict-header {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}
.cv-conflict-id {
    font-weight: 700;
    color: #6b7280;
    font-family: ui-monospace, "SF Mono", Consolas, monospace;
    font-size: 0.85rem;
}
.cv-conflict-name { font-weight: 600; flex: 1 1 auto; min-width: 0; color: #111827; }
.cv-conflict-severity-badge {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    background: #f3f4f6;
    color: #4b5563;
}
.cv-conflict-high .cv-conflict-severity-badge   { background: #fee2e2; color: #991b1b; }
.cv-conflict-medium .cv-conflict-severity-badge { background: #fed7aa; color: #9a3412; }
.cv-conflict-lps {
    margin-bottom: 0.4rem;
    font-size: 0.875rem;
    color: #4b5563;
}
.cv-conflict-lp-link {
    color: #2563eb;
    cursor: pointer;
    text-decoration: underline;
}
.cv-conflict-lp-link:hover { color: #1d4ed8; }
.cv-conflict-description {
    color: #1f2937;
    line-height: 1.55;
    font-size: 0.9rem;
}

/* Step 297c.2: Conflict pill in summary bar */
.ai-summary-pill--conflict {
    background: #fef9f3;
    border: 1px solid #f6d29c;
    color: #92400e;
}

/* Step 297c.3: Jurisdiction escalation indicator on LP cards */
.cv-item-escalation {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0.4rem 0;
    padding: 0.35rem 0.6rem;
    background: #f0f9ff;
    border-left: 3px solid #0284c7;
    border-radius: 3px;
    font-size: 0.825rem;
    cursor: help;
}
.cv-escalation-badge {
    font-weight: 700;
    color: #075985;
    font-size: 0.75rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}
.cv-escalation-text { color: #0c4a6e; }

/* Step 311: Contract Interaction Review tab — synthesis panel */
.synthesis-panel { max-width: 900px; padding: 1.5rem; }
.synthesis-intro { margin-bottom: 1.5rem; color: #6b7280; font-size: 0.9rem; }
.cpf-group { margin-bottom: 2rem; }
.cpf-root-group {
    border: 1px solid var(--amber-300, #fcd34d);
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden;
}
.cpf-root-header {
    background: var(--amber-50, #fffbeb);
    padding: 0.6rem 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    border-bottom: 1px solid var(--amber-200, #fde68a);
}
.cpf-root-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--amber-700, #b45309);
    text-transform: uppercase;
    flex-shrink: 0;
}
.cpf-root-theme {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
    flex: 1;
}
.cpf-root-count {
    font-size: 0.7rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.cpf-root-findings {
    padding: 0.5rem;
}
.cpf-root-findings .cpf-card {
    margin-bottom: 0.4rem;
    border-left-width: 2px;
}
.cpf-root-findings .cpf-card:last-child {
    margin-bottom: 0;
}
.cpf-group-header {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #374151;
    padding: 0.5rem 0;
    border-bottom: 2px solid #e5e7eb;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.cpf-card {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: #fff;
}
.cpf-card.cpf-type-directional_mismatch { border-left: 4px solid #dc2626; }
.cpf-card.cpf-type-compound_risk         { border-left: 4px solid #d97706; }
.cpf-card.cpf-type-cross_coverage_gap    { border-left: 4px solid #6b7280; }
.cpf-card.cpf-type-cross_coverage_relief {
    border-left: 4px solid var(--green-500, #22c55e);
    background: var(--green-50, #f0fdf4);
}
.cpf-relief-badge {
    background: var(--green-100, #dcfce7);
    color: var(--green-700, #15803d);
    border: 1px solid var(--green-300, #86efac);
    border-radius: 4px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.1rem 0.4rem;
    text-transform: uppercase;
    flex-shrink: 0;
}
.cpf-group-header-relief { color: #166534; }
.cpf-relief-section { font-size: 0.78rem; color: #166534; margin-top: 0.2rem; }
.cv-relief-badge {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #15803d;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cv-relief-badge:hover { background: #dcfce7; }
.cpf-card-header {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-wrap: wrap;
    margin-bottom: 0.6rem;
}
.cpf-finding-id {
    font-weight: 700;
    font-size: 0.85rem;
    color: #374151;
    font-family: monospace;
}
.cpf-type-label {
    font-size: 0.8rem;
    color: #6b7280;
    font-weight: 500;
}
.cpf-agree-badge {
    font-size: 0.75rem;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    padding: 0.1rem 0.4rem;
    color: #374151;
    margin-left: auto;
}
.cpf-lps { margin-bottom: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem; }
.cpf-lp-pill {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 12px;
    padding: 0.15rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    font-family: monospace;
}
.cpf-lp-pill:hover { background: #dbeafe; }
.cpf-headline {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111827;
    margin-bottom: 0.4rem;
}
.cpf-detail {
    font-size: 0.875rem;
    color: #374151;
    line-height: 1.55;
    margin-bottom: 0.5rem;
    white-space: pre-line;
}
.cpf-directionality {
    font-size: 0.8rem;
    color: #7f1d1d;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 4px;
    padding: 0.25rem 0.5rem;
    margin-bottom: 0.4rem;
}
.cpf-dir-label { font-weight: 700; }
.cpf-cited { font-size: 0.8rem; color: #6b7280; margin-bottom: 0.4rem; }
.cpf-cited-label { font-weight: 600; color: #374151; }
.cpf-cited-section {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 0.1rem 0.35rem;
    font-family: monospace;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}
.cpf-ev-row {
    font-size: 0.78rem;
    color: #6b7280;
    border-top: 1px solid #f3f4f6;
    padding-top: 0.4rem;
    margin-top: 0.4rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}
.cpf-ev-verdict strong { color: #374151; }

/* Step 311: Synthesis badge on LP coverage cards */
.cv-synthesis-badge {
    background: #f0fdf4;
    border: 1px solid #86efac;
    color: #166534;
    border-radius: 4px;
    padding: 0.1rem 0.45rem;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.cv-synthesis-badge:hover { background: #dcfce7; }

/* Step 311: Synthesis entries in the open issues sidebar */
.nav-section-synthesis .nav-section-header { color: #92400e; }
.nav-item-synthesis { border-left: 3px solid #d97706; }

/* Step 347: Unified sidebar — four-bucket layout */
.nav-section-header-collapsible {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    user-select: none;
}
.nav-section-icon { font-size: 0.85rem; flex-shrink: 0; }
.nav-section-title { font-weight: 600; font-size: 0.75rem; letter-spacing: 0.04em; text-transform: uppercase; }
.nav-collapse-toggle {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.65rem;
    color: #9ca3af;
    padding: 0 0.15rem;
    line-height: 1;
}
.nav-collapse-toggle:hover { color: #374151; }
.nav-section-body { padding-bottom: 0.25rem; }

/* Section accent colors */
.nav-section-risk    .nav-section-header { color: #b91c1c; }
.nav-section-risk    .nav-section-title  { color: #b91c1c; }
.nav-section-review  .nav-section-header { color: #92400e; }
.nav-section-review  .nav-section-title  { color: #92400e; }
.nav-section-improvement .nav-section-header { color: #1e40af; }
.nav-section-improvement .nav-section-title  { color: #1e40af; }
.nav-section-addressed  .nav-section-header  { color: #166534; }
.nav-section-addressed  .nav-section-title   { color: #166534; }

/* Unified items */
.nav-item-unified {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    padding: 0.35rem 0.5rem 0.35rem 0.75rem;
    margin-bottom: 1px;
    cursor: pointer;
    border-radius: 0 3px 3px 0;
}
.nav-item-unified:hover { background: #f1f5f9; }
.nav-item-unified.active { background: #eff6ff; border-left-color: #3b82f6; }
.nav-item-sev-critical.nav-item-unified { border-left-color: #dc2626; }
.nav-item-sev-high.nav-item-unified     { border-left-color: #ea580c; }
.nav-item-sev-medium.nav-item-unified   { border-left-color: #ca8a04; }
.nav-item-sev-low.nav-item-unified      { border-left-color: #6b7280; }

/* Type label (COMPOUND / GAP / DEVIATION etc.) */
.nav-item-type-label {
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    color: #6b7280;
    background: #f3f4f6;
    border-radius: 3px;
    padding: 0.05rem 0.25rem;
    margin-left: 0.25rem;
    text-transform: uppercase;
    flex-shrink: 0;
}

/* Addressed chip-list */
.nav-chip-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    padding: 0.35rem 0.5rem;
}
.nav-chip {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: #374151;
    background: #f3f4f6;
    border: 1px solid #e5e7eb;
    border-radius: 3px;
    padding: 0.1rem 0.3rem;
    cursor: pointer;
    white-space: nowrap;
}
.nav-chip:hover { background: #dbeafe; border-color: #93c5fd; color: #1e40af; }
.nav-empty-inner { font-size: 0.75rem; color: #9ca3af; padding: 0.35rem 0.5rem; }

/* Step 347b: Risk sub-groups */
.nav-subgroup { margin: 0.2rem 0; }
.nav-subgroup-header {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem 0.2rem 0.75rem;
    background: #f8fafc;
    border-top: 1px solid #e5e7eb;
}
.nav-subgroup-title {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #6b7280;
}
.nav-subgroup-count {
    font-size: 0.65rem;
    color: #9ca3af;
    background: #e5e7eb;
    border-radius: 8px;
    padding: 0 0.3rem;
    margin-left: 0.15rem;
}
.nav-subgroup-toggle { color: #d1d5db; }

/* Step 313: CPF agreement badge color variants */
.cpf-agree-unanimous { background: #dcfce7; color: #166534; border-color: #86efac; font-weight: 700; }
.cpf-agree-majority  { background: #fef3c7; color: #92400e; border-color: #fcd34d; }
.cpf-agree-minority  { background: #fff7ed; color: #c2410c; border-color: #fdba74; font-weight: 600; }
.cpf-agree-none      { background: var(--surface-alt, #f8fafc); color: var(--text-muted, #6b7280); }

/* Step 313: minority-finding context note */
.cpf-minority-note {
    font-size: 0.72rem;
    color: var(--text-muted, #6b7280);
    font-style: italic;
    margin-top: 0.4rem;
    padding-top: 0.4rem;
    border-top: 1px solid var(--border-light, #f1f5f9);
}

/* Step 315: "Confidence:" label preceding the four-dot badge on coverage cards */
.cov-conf-label {
    font-size: 0.7rem;
    color: var(--text-muted, #6b7280);
    margin-right: 0.25rem;
    vertical-align: middle;
}

/* Step 315: flash animation for synthesis badge click — briefly highlights target CPF card */
@keyframes cpf-flash {
    0%   { box-shadow: 0 0 0 3px #3b5bdb88; }
    50%  { box-shadow: 0 0 0 6px #3b5bdb44; }
    100% { box-shadow: none; }
}
.highlight-flash { animation: cpf-flash 1.5s ease-out; }

/* Step 316: Stage 4 (synthesis) progress bar pulse — signals ongoing work when bar is parked at 75% */
@keyframes progressPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.6; }
}
.progress-fill--pulsing { animation: progressPulse 1.8s ease-in-out infinite; }

/* Step 332: directional risks collapsed summary line */
.nav-section-directional { padding: 0.25rem 0.5rem 0.5rem; }
.nav-directional-summary {
    display: flex; align-items: center; gap: 0.4rem;
    width: 100%; padding: 0.4rem 0.6rem;
    background: #fefce8; border: 1px solid #fde047; border-radius: 5px;
    cursor: pointer; font-size: 0.75rem; text-align: left;
}
.nav-directional-summary:hover { background: #fef9c3; }
.nav-dir-label { font-weight: 700; color: #713f12; letter-spacing: 0.02em; }
.nav-dir-count { background: #fbbf24; color: #78350f; font-weight: 700; border-radius: 10px; padding: 0.05rem 0.45rem; font-size: 0.72rem; }
.nav-dir-arrow { margin-left: auto; color: #92400e; font-weight: 700; font-size: 0.9rem; }

/* Step 331: pre-classified sidebar label */
.nav-item-conf-preclass { color: #9ca3af; font-style: italic; }

/* Step 331: assessment method label on coverage cards */
.cv-assess-method { font-size: 0.68rem; padding: 0.1rem 0.35rem; border-radius: 3px; white-space: nowrap; }
.cv-assess-method-eval    { color: #1e40af; background: #dbeafe; }
.cv-assess-method-preclass { color: #6b7280; background: #f3f4f6; }
