﻿/* ══ CONTRACT STUDIO CSS — copied from GlobalApp Contract Studio ══════════ */
:root { --muted2: #6b7280; }
/* ══ CONTRACT REVIEW ══════════════════════════════════════════ */
.cr-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 24px 28px 140px;   /* generous bottom space so content never feels cramped against the edge */
  overflow-y: auto;
  height: 100%;
  box-sizing: border-box;
}
.cr-panel::-webkit-scrollbar { width: 3px; }
.cr-panel::-webkit-scrollbar-thumb { background: #dedad4; border-radius: 4px; }

/* Header */
.cr-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.cr-header-left { display: flex; align-items: center; gap: 12px; }
.cr-header-ico { font-size: 22px; }
.cr-header-title { font-size: 17px; font-weight: 700; color: var(--text); }
.cr-header-sub { font-size: 12px; color: var(--muted2); margin-top: 2px; }
.cr-disclaimer { font-size: 11px; color: #6b7280; background: #f3f4f6; border: 1px solid #e5e7eb; border-radius: 6px; padding: 5px 10px; }

/* Upload Zone */
.cr-upload-zone {
  border: 2px dashed #d1d5db;
  border-radius: 12px;
  background: #fafaf9;
  text-align: center;
  padding: 40px 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cr-upload-zone:hover { border-color: #2563eb; background: #eff6ff; }
.cr-upload-icon { font-size: 32px; margin-bottom: 8px; }
.cr-upload-title { font-size: 15px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.cr-upload-sub { font-size: 12px; color: var(--muted2); margin-bottom: 16px; }
.cr-upload-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 7px;
  padding: 8px 20px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.cr-upload-btn:hover { background: #1d4ed8; }

/* File Bar */
.cr-file-bar {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}
.cr-file-info { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.cr-file-ico { font-size: 22px; }
.cr-file-name { font-size: 13px; font-weight: 600; color: var(--text); }
.cr-file-meta { font-size: 11px; color: var(--muted2); }
.cr-file-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; flex: 1; justify-content: flex-end; }
.cr-control-group { display: flex; flex-direction: column; gap: 3px; }
.cr-control-label { font-size: 10px; font-weight: 600; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.5px; }
.cr-select {
  background: #fff; border: 1px solid #d1d5db; border-radius: 7px;
  padding: 6px 10px; font-size: 12px; color: var(--text); cursor: pointer;
}
.cr-select:focus { outline: none; border-color: #2563eb; }
.cr-review-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  padding: 9px 20px; font-size: 13px; font-weight: 600; cursor: pointer;
  white-space: nowrap;
}
.cr-review-btn:hover { background: #1d4ed8; }
.cr-review-btn:disabled { opacity: 0.5; pointer-events: none; }
.cr-change-btn {
  background: none; border: 1px solid #d1d5db; border-radius: 8px;
  padding: 8px 14px; font-size: 12px; color: var(--muted2); cursor: pointer;
}
.cr-change-btn:hover { border-color: #9ca3af; color: var(--text); }

/* File bar two-row layout */
.cr-file-bar { flex-direction: column; gap: 12px; }
.cr-file-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; width: 100%; }
.cr-file-row .cr-file-info { flex: 0 0 auto; }
.cr-file-row .cr-file-controls { flex: 1; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }

/* Model selectors row */
.cr-model-selectors {
  display: flex; align-items: flex-end; gap: 8px;
  width: 100%; flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}
.cr-model-group { flex: 1; min-width: 140px; }
.cr-model-arrow { font-size: 14px; color: #9ca3af; padding-bottom: 8px; flex-shrink: 0; }
.cr-judge-label { display: flex; align-items: center; gap: 5px; }
.cr-judge-tip {
  font-size: 9px; font-weight: 600; padding: 1px 6px; border-radius: 99px;
  background: #ede9fe; color: #7c3aed; border: 1px solid #ddd6fe;
}
.cr-judge-select { border-color: #c4b5fd; background: #faf5ff; }
.cr-judge-select:focus { border-color: #7c3aed; }

/* Progress */
.cr-progress-wrap { display: flex; flex-direction: column; gap: 8px; }
.cr-progress-label { font-size: 12px; color: var(--muted2); }
.cr-progress-bar { height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.cr-progress-fill { height: 100%; background: #2563eb; border-radius: 99px; transition: width 0.4s ease; width: 0%; }

/* Tabs */
.cr-tabs { display: flex; gap: 4px; border-bottom: 2px solid #e5e7eb; margin-bottom: 18px; }
.cr-tab {
  background: none; border: none; border-bottom: 2px solid transparent;
  padding: 8px 18px; font-size: 13px; font-weight: 500; color: var(--muted2);
  cursor: pointer; margin-bottom: -2px; border-radius: 6px 6px 0 0;
  transition: color 0.15s;
}
.cr-tab:hover { color: var(--text); }
.cr-tab-active { color: #2563eb !important; border-bottom-color: #2563eb !important; font-weight: 700; }

/* Analysis grid */
.cr-models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}
.cr-model-card {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 16px;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.cr-card-findings-section {
  padding-bottom: 12px;
  border-bottom: 1px solid #f3f4f6;
  margin-bottom: 12px;
}
.cr-card-missing-section { flex: 1; }
.cr-model-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.cr-model-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.cr-dot-blue   { background: #2563eb; }
.cr-dot-orange { background: #f59e0b; }
.cr-dot-green  { background: #10b981; }
.cr-model-name { font-size: 13px; font-weight: 700; color: var(--text); }
.cr-model-badge {
  font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 99px;
  background: #eff6ff; color: #2563eb; margin-left: auto;
}
.cr-findings-title { font-size: 11px; font-weight: 700; color: var(--text); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.cr-finding {
  display: flex; align-items: flex-start; gap: 7px;
  font-size: 12px; color: var(--text); margin-bottom: 6px; line-height: 1.4;
}
.cr-risk-dot {
  width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; margin-top: 4px;
}
.cr-risk-high   { background: #ef4444; }
.cr-risk-medium { background: #f59e0b; }
.cr-risk-low    { background: #10b981; }
.cr-missing-list { margin: 0; padding: 0 0 0 14px; }
.cr-missing-list li { font-size: 12px; color: var(--muted2); margin-bottom: 4px; }
.cr-view-full {
  display: inline-block; margin-top: 10px; font-size: 12px; font-weight: 600;
  color: #2563eb; text-decoration: none; cursor: pointer; background: none; border: none; padding: 0;
}
.cr-view-full:hover { text-decoration: underline; }

/* Judge card */
.cr-judge-card { border-color: #d1d5db; background: #fff; }
.cr-judge-badge { background: #f3f4f6 !important; color: #374151 !important; }
.cr-judge-eval-block {
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.cr-judge-eval-header {
  font-size: 11px; font-weight: 700; color: #374151;
  background: #f3f4f6; padding: 7px 10px;
  border-bottom: 1px solid #e5e7eb;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.cr-judge-eval-section { padding: 8px 10px; background: #fff; }
.cr-judge-praise   { border-top: 1px solid #e5e7eb; }
.cr-judge-critique { border-top: 1px solid #e5e7eb; }
.cr-judge-eval-label {
  font-size: 10px; font-weight: 700; color: var(--muted2);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 5px;
}
.cr-judge-eval-item {
  font-size: 12px; color: var(--text); line-height: 1.5;
  padding: 2px 0 2px 10px; border-left: 2px solid #d1d5db; margin-bottom: 4px;
}
.cr-judge-praise .cr-judge-eval-item   { border-left-color: #16a34a; }
.cr-judge-critique .cr-judge-eval-item { border-left-color: #d97706; }
.cr-judge-verdict {
  margin-top: 14px;
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 12px 14px;
}
.cr-judge-verdict-label {
  font-size: 11px; font-weight: 700; color: var(--muted2);
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.cr-judge-verdict-text {
  font-size: 12px; color: var(--text); line-height: 1.6; margin-bottom: 8px;
}
.cr-judge-stronger { font-size: 11px; color: var(--muted2); }
.cr-judge-stronger strong { color: var(--text); }

/* Jurisdiction Deep Research */
.cr-deep-research {
  margin-top: 14px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 14px;
  background: #fff;
}
.cr-deep-research-label {
  font-size: 12px; font-weight: 700; color: var(--text);
  margin-bottom: 4px;
}
.cr-deep-research-sub {
  font-size: 11px; color: var(--muted2); margin-bottom: 12px; line-height: 1.5;
}
.cr-deep-dropdown-row {
  display: flex; flex-direction: column; gap: 8px;
}
.cr-deep-select {
  width: 100%; padding: 8px 10px; font-size: 12px;
  border: 1px solid #e5e7eb; border-radius: 7px;
  background: #f9fafb; color: var(--text);
  cursor: pointer; outline: none; box-sizing: border-box;
}
.cr-deep-select:focus { border-color: #2563eb; background: #fff; }
.cr-deep-select:disabled { opacity: 0.5; pointer-events: none; }
.cr-deep-run-btn {
  align-self: flex-end;
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  background: #2563eb; color: #fff; border: none; border-radius: 7px;
  cursor: pointer; white-space: nowrap; transition: background 0.15s;
}
.cr-deep-run-btn:hover { background: #1d4ed8; }
.cr-deep-run-btn:disabled { opacity: 0.5; pointer-events: none; }
.cr-deep-result {
  margin-top: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
}
.cr-deep-result-header {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 12px; background: #f3f4f6;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.cr-deep-result-body {
  padding: 12px 14px; font-size: 12px; color: var(--text); line-height: 1.7;
}
.cr-deep-result-item {
  padding: 4px 0 4px 10px; border-left: 2px solid #2563eb;
  margin-bottom: 10px;
}
.cr-deep-result-text { font-size: 12px; color: var(--text); line-height: 1.6; margin-bottom: 4px; }
.cr-deep-result-source {
  font-size: 10px; color: #2563eb;
  background: #eff6ff; border: 1px solid #bfdbfe;
  border-radius: 4px; padding: 3px 7px;
  display: inline-block; text-decoration: none;
  font-family: monospace; letter-spacing: 0.2px;
  margin-top: 3px;
}
.cr-deep-result-source:hover { background: #dbeafe; text-decoration: underline; }
.cr-deep-spinner {
  display: inline-block; width: 12px; height: 12px;
  border: 2px solid #d1d5db; border-top-color: #2563eb;
  border-radius: 50%; animation: crSpin 0.7s linear infinite;
}
@keyframes crSpin { to { transform: rotate(360deg); } }

/* Consensus */
.cr-consensus-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 14px;
}
.cr-consensus-card {
  border-radius: 10px;
  padding: 16px;
  border: 1px solid #e5e7eb;
}
.cr-consensus-agree   { background: #f0fdf4; border-color: #bbf7d0; }
.cr-consensus-partial { background: #fffbeb; border-color: #fde68a; }
.cr-consensus-insights { background: #eff6ff; border-color: #bfdbfe; }
.cr-consensus-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cr-consensus-icon { font-size: 15px; }
.cr-consensus-title { font-size: 13px; font-weight: 700; color: var(--text); }
.cr-consensus-body { font-size: 12px; color: var(--text); line-height: 1.5; }
.cr-consensus-item {
  display: flex; align-items: flex-start; gap: 7px; margin-bottom: 6px;
}

/* Redline */
.cr-redline-banner {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  background: #f9fafb; border: 1px solid #e5e7eb; border-radius: 10px;
  padding: 14px 16px; margin-bottom: 16px;
}
.cr-redline-confidence { display: flex; flex-direction: column; }
.cr-redline-pct { font-size: 22px; font-weight: 800; color: #2563eb; }
.cr-redline-label { font-size: 11px; color: var(--muted2); }
.cr-redline-models { display: flex; gap: 8px; flex-wrap: wrap; flex: 1; }
.cr-model-check {
  font-size: 11px; font-weight: 600; padding: 4px 10px; border-radius: 99px;
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
}
.cr-model-check.cr-check-fail { background: #fef2f2; color: #dc2626; border-color: #fecaca; }
.cr-viewer-btn {
  background: #fff; color: #2563eb; border: 1.5px solid #2563eb; border-radius: 8px;
  padding: 9px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  white-space: nowrap; margin-left: auto;
}
.cr-viewer-btn:hover { background: #eff6ff; }
.cr-download-btn {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  padding: 9px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
  margin-left: 8px; white-space: nowrap;
}
.cr-download-btn:hover { background: #1d4ed8; }

/* ── Clause-by-Clause Redline Viewer (full-screen split pane) — copied from GlobalApp ── */
.crv-header { display:flex;align-items:center;justify-content:space-between;padding:0 20px;height:52px;background:#1e293b;flex-shrink:0; }
.crv-header-title { color:#fff;font-size:15px;font-weight:700; }
.crv-hbtn { padding:6px 14px;border-radius:6px;font-size:13px;font-weight:600;cursor:pointer;border:1px solid rgba(255,255,255,0.2);background:rgba(255,255,255,0.1);color:#fff; }
.crv-hbtn:hover { background:rgba(255,255,255,0.2); }
.crv-hbtn-green { background:#16a34a;border-color:#16a34a; }
.crv-hbtn-green:hover { background:#15803d; }
.crv-hbtn-blue { background:#2563eb;border-color:#2563eb; }
.crv-hbtn-blue:hover { background:#1d4ed8; }
.crv-body { display:flex;flex:1;overflow:hidden;height:calc(100vh - 52px); }
.crv-doc { flex:1;overflow-y:auto;padding:52px 64px;background:#fff;font-family:Georgia,serif;font-size:14px;line-height:1.9;color:#1e293b;max-width:none; }
.crv-sidebar { width:320px;flex-shrink:0;overflow-y:auto;background:#f8fafc;border-left:1px solid #e2e8f0;padding:12px; }
.crv-del { text-decoration:line-through;color:#dc2626;background:#fef2f2; }
.crv-ins { text-decoration:underline;color:#15803d;background:#dcfce7;font-style:normal; }
.crv-change { border-radius:2px;transition:background .3s; }
.crv-approved { background:#f0fdf4;border-bottom:2px solid #16a34a;border-radius:2px; }
.crv-highlight { outline:2px solid #f59e0b;background:#fef9c3 !important;border-radius:3px; }
.crv-issue { background:#fff;border:1px solid #e2e8f0;border-radius:8px;padding:12px;margin-bottom:10px;cursor:default; }
.crv-issue-applied { opacity:.6;border-color:#bbf7d0; }
.crv-issue-skipped { opacity:.5; }
.crv-issue-header { display:flex;align-items:center;gap:6px;margin-bottom:6px;flex-wrap:wrap; }
.crv-issue-title { font-size:12px;font-weight:600;color:#1e293b;flex:1; }
.crv-issue-note { font-size:12px;color:#475569;line-height:1.5;margin-bottom:8px; }
.crv-issue-actions { display:flex;gap:6px;flex-wrap:wrap; }
.crv-apply-btn { padding:4px 10px;background:#16a34a;color:#fff;border:none;border-radius:5px;font-size:11px;font-weight:700;cursor:pointer; }
.crv-apply-btn:hover { background:#15803d; }
.crv-skip-btn { padding:4px 10px;background:#fff;color:#6b7280;border:1px solid #d1d5db;border-radius:5px;font-size:11px;font-weight:600;cursor:pointer; }
.crv-skip-btn:hover { background:#f1f5f9; }
.crv-goto-btn { padding:4px 10px;background:#eff6ff;color:#2563eb;border:1px solid #bfdbfe;border-radius:5px;font-size:11px;font-weight:600;cursor:pointer; }
.crv-goto-btn:hover { background:#dbeafe; }
.crv-insertion { margin-bottom:16px;padding:14px 16px;background:#f0fdf4;border:1px solid #bbf7d0;border-radius:8px; }
.crv-insertion-label { font-size:11px;font-weight:700;color:#15803d;text-transform:uppercase;letter-spacing:.5px;margin-bottom:8px; }
.crv-resizer { width:5px;background:#e2e8f0;cursor:col-resize;flex-shrink:0;transition:background .15s; }
.crv-resizer:hover, .crv-resizer:active { background:#94a3b8; }

/* Side-by-side */
.cr-sidebyside {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.cr-side { border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden; }
.cr-side-header {
  background: #f3f4f6; padding: 10px 14px;
  font-size: 12px; font-weight: 700; color: var(--text);
  border-bottom: 1px solid #e5e7eb;
}
.cr-side-original .cr-side-header { background: #f9fafb; }
.cr-side-redlined .cr-side-header { background: #eff6ff; color: #2563eb; }
.cr-side-body {
  padding: 14px;
  font-size: 12px; line-height: 1.7; color: var(--text);
  max-height: 300px; overflow-y: auto;
  font-family: 'Georgia', serif;
}
.cr-side-body::-webkit-scrollbar { width: 3px; }
.cr-side-body::-webkit-scrollbar-thumb { background: #dedad4; border-radius: 4px; }

/* Track-changes markup */
.cr-del { text-decoration: line-through; color: #dc2626; background: #fef2f2; padding: 0 2px; border-radius: 2px; }
.cr-ins { color: #16a34a; background: #f0fdf4; padding: 0 2px; border-radius: 2px; }

/* Review modal overlay */
.cr-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: crFadeIn 0.2s ease;
}
@keyframes crFadeIn { from { opacity:0 } to { opacity:1 } }
.cr-modal-box {
  position: relative;
  background: #fff;
  border-radius: 16px;
  padding: 40px 36px 32px;
  max-width: 480px;
  width: calc(100% - 40px);
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.18);
  animation: crSlideUp 0.25s ease;
}
@keyframes crSlideUp { from { transform:translateY(16px); opacity:0 } to { transform:translateY(0); opacity:1 } }
.cr-modal-close {
  position: absolute;
  top: 14px; right: 16px;
  background: none; border: none;
  font-size: 22px; color: #9ca3af;
  cursor: pointer; line-height: 1;
  padding: 2px 6px;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.cr-modal-close:hover { background: #f3f4f6; color: #374151; }
.cr-modal-icon { font-size: 44px; margin-bottom: 16px; }
.cr-modal-title {
  font-size: 18px; font-weight: 700; color: #111827;
  margin: 0 0 14px; line-height: 1.4;
}
.cr-modal-body {
  font-size: 14px; color: #374151; line-height: 1.7;
  margin: 0 0 10px;
}
.cr-modal-hint {
  font-size: 13px; color: #6b7280; line-height: 1.6;
  margin: 0 0 24px;
}
.cr-modal-confirm {
  display: inline-block;
  padding: 10px 28px;
  background: #111827; color: #fff;
  border: none; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.cr-modal-confirm:hover { background: #374151; }
.cr-modal-confirm-danger { background: #dc2626; }
.cr-modal-confirm-danger:hover { background: #b91c1c; }
.cr-modal-cancel {
  display: inline-block;
  padding: 10px 28px;
  background: #f3f4f6; color: #374151;
  border: 1px solid #e5e7eb; border-radius: 8px;
  font-size: 14px; font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.cr-modal-cancel:hover { background: #e5e7eb; }
.cr-restart-modal-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* Review in-progress flat banner (after modal dismissed) */
.cr-review-notice {
  margin-top: 16px;
  padding: 12px 18px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  gap: 10px;
}
.cr-review-notice-icon { font-size: 18px; flex-shrink: 0; }
.cr-review-notice-text { font-size: 13px; color: #6b7280; line-height: 1.5; }

/* Insertion section */
.cr-insertion-section { margin-top: 24px; }
.cr-insertion-section-title {
  font-size: 12px; font-weight: 700; color: #374151; margin-bottom: 4px;
  padding: 10px 14px; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px 8px 0 0; border-bottom: none;
}
.cr-insertion-section-sub {
  font-size: 12px; color: #6b7280; padding: 6px 14px 12px;
  background: #f0fdf4; border: 1px solid #bbf7d0; border-top: none;
  border-radius: 0 0 8px 8px; margin-bottom: 10px;
}
.cr-insertion-card { border-color: #bbf7d0; }

/* Accept all row */
.cr-accept-all-row { display: flex; justify-content: flex-end; margin-bottom: 10px; }
.cr-accept-all-btn {
  padding: 7px 16px; font-size: 12px; font-weight: 600;
  background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0;
  border-radius: 7px; cursor: pointer; transition: background 0.15s;
}
.cr-accept-all-btn:hover { background: #dcfce7; }

/* Playbook SVG icon */
.cr-playbook-upload-ico svg { display: block; color: #6b7280; }

/* Clause redline cards */
.cr-redline-list { display: flex; flex-direction: column; gap: 14px; }
.cr-redline-card {
  border: 1px solid #e5e7eb; border-radius: 10px; overflow: hidden;
  background: #fff; transition: opacity 0.2s, border-color 0.2s;
}
.cr-card-accepted { opacity: 0.65; border-color: #16a34a; }
.cr-card-rejected { opacity: 0.65; border-color: #dc2626; }
.cr-redline-card-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
}
.cr-redline-clause { font-size: 12px; font-weight: 700; color: var(--text); }
.cr-redline-risk {
  font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 99px;
}
.cr-risk-badge-high   { background: #fef2f2; color: #dc2626; }
.cr-risk-badge-medium { background: #fffbeb; color: #d97706; }
.cr-risk-badge-low    { background: #f0fdf4; color: #16a34a; }
.cr-redline-card-body { padding: 14px; }
.cr-redline-original {
  font-size: 12px; color: var(--text); line-height: 1.6;
  margin-bottom: 10px; font-family: 'Georgia', serif;
}
.cr-redline-original-label { font-size: 10px; font-weight: 700; color: var(--muted2); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.cr-redline-suggestion {
  background: #f0fdf4; border: 1px solid #bbf7d0; border-radius: 8px;
  padding: 10px 12px; margin-bottom: 10px;
}
.cr-redline-suggestion-label { font-size: 10px; font-weight: 700; color: #16a34a; text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 4px; }
.cr-redline-suggestion-text { font-size: 12px; color: var(--text); line-height: 1.6; font-family: 'Georgia', serif; }
.cr-redline-confidence-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.cr-conf-bar { flex: 1; height: 4px; background: #e5e7eb; border-radius: 99px; overflow: hidden; }
.cr-conf-fill { height: 100%; border-radius: 99px; background: #2563eb; }
.cr-conf-label { font-size: 11px; font-weight: 700; color: #2563eb; white-space: nowrap; }
.cr-redline-actions { display: flex; gap: 8px; }
.cr-action-accept {
  background: #16a34a; color: #fff; border: none; border-radius: 7px;
  padding: 7px 16px; font-size: 12px; font-weight: 600; cursor: pointer;
}
.cr-action-accept:hover { background: #15803d; }
.cr-action-reject {
  background: none; border: 1px solid #d1d5db; border-radius: 7px;
  padding: 7px 16px; font-size: 12px; color: var(--muted2); cursor: pointer;
}
.cr-action-reject:hover { border-color: #dc2626; color: #dc2626; }
.cr-action-edit {
  background: none; border: 1px solid #d1d5db; border-radius: 7px;
  padding: 7px 16px; font-size: 12px; color: var(--muted2); cursor: pointer;
}
.cr-action-edit:hover { border-color: #2563eb; color: #2563eb; }

/* Follow-up / Clause Q&A */
.cr-followup {
  display: flex; flex-direction: column; gap: 0;
  border: 1px solid #e5e7eb; border-radius: 12px;
  background: #fff; margin-top: 16px; overflow: hidden;
}
.cr-followup-header {
  display: flex; align-items: baseline; gap: 10px;
  padding: 12px 16px; border-bottom: 1px solid #f3f4f6; background: #fafafa;
}
.cr-followup-title { font-size: 13px; font-weight: 700; color: #111827; }
.cr-followup-hint  { font-size: 12px; color: #9ca3af; }
.cr-followup-messages {
  display: flex; flex-direction: column; gap: 12px;
  padding: 14px 16px; max-height: 320px; overflow-y: auto;
}
.cr-followup-messages:empty { display: none; }
.cr-fq-bubble {
  max-width: 85%; padding: 10px 14px; border-radius: 10px;
  font-size: 13px; line-height: 1.6; white-space: pre-wrap;
}
.cr-fq-user { align-self: flex-end; background: #2563eb; color: #fff; border-radius: 10px 10px 2px 10px; }
.cr-fq-ai   { align-self: flex-start; background: #f3f4f6; color: #111827; border-radius: 10px 10px 10px 2px; }
.cr-fq-typing { align-self: flex-start; background: #f3f4f6; color: #6b7280; font-style: italic; border-radius: 10px 10px 10px 2px; padding: 10px 14px; font-size: 13px; }
.cr-followup-bar {
  display: flex; gap: 8px; align-items: center;
  padding: 10px 12px; border-top: 1px solid #f3f4f6;
}
.cr-followup-input {
  flex: 1; border: 1px solid #d1d5db; border-radius: 8px;
  padding: 9px 12px; font-size: 13px; color: var(--text); background: #fafafa;
}
.cr-followup-input:focus { outline: none; border-color: #2563eb; background: #fff; }
.cr-followup-send {
  background: #2563eb; color: #fff; border: none; border-radius: 8px;
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0; transition: background 0.15s;
}
.cr-followup-send:hover { background: #1d4ed8; }
.cr-followup-send:disabled { background: #93c5fd; cursor: not-allowed; }

/* ── Summary tab ── */
.cr-summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .cr-summary-grid { grid-template-columns: 1fr; } }
.cr-summary-card { border: 1px solid #e5e7eb; border-radius: 12px; padding: 20px; background: #fff; }
.cr-summary-card-full { grid-column: 1 / -1; }
.cr-summary-card-title {
  font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  text-transform: uppercase; color: #6b7280; margin-bottom: 14px;
}
.cr-summary-kv { display: flex; flex-direction: column; gap: 10px; }
.cr-summary-row { display: flex; gap: 10px; align-items: baseline; }
.cr-summary-label { font-size: 12px; color: #9ca3af; min-width: 110px; flex-shrink: 0; }
.cr-summary-value { font-size: 13px; color: #111827; font-weight: 500; line-height: 1.5; }
.cr-summary-parties { display: flex; flex-direction: column; gap: 8px; }
.cr-summary-party { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: #f9fafb; border-radius: 8px; }
.cr-summary-party-role { font-size: 11px; color: #6b7280; min-width: 130px; }
.cr-summary-party-name { font-size: 13px; font-weight: 600; color: #111827; }
.cr-summary-risks { display: flex; flex-direction: column; gap: 8px; }
.cr-summary-risk { display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px; border-radius: 8px; }
.cr-summary-risk-high   { background: #fef2f2; border-left: 3px solid #ef4444; }
.cr-summary-risk-medium { background: #fffbeb; border-left: 3px solid #f59e0b; }
.cr-summary-risk-low    { background: #f0fdf4; border-left: 3px solid #22c55e; }
.cr-summary-risk-text { font-size: 13px; color: #111827; line-height: 1.5; }
.cr-summary-dealbreakers { display: flex; flex-direction: column; gap: 6px; }
.cr-summary-dealbreaker {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  background: #fef2f2; border-radius: 8px; font-size: 13px; color: #7f1d1d; line-height: 1.5;
}
.cr-summary-dealbreaker::before { content: '⛔'; flex-shrink: 0; }
/* Pre-signing alerts (blank fields / missing exhibits / consistency) */
.cr-precheck-card-alert { border-color: #fcd34d; background: #fffbeb; }
.cr-precheck-status {
  display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 10px; font-weight: 700; letter-spacing: 0.03em; text-transform: none; vertical-align: middle;
}
.cr-precheck-status-draft { background: #e0f2fe; color: #075985; }
.cr-precheck-status-exec  { background: #f3f4f6; color: #4b5563; }
.cr-precheck-group { margin-top: 12px; }
.cr-precheck-group:first-of-type { margin-top: 4px; }
.cr-precheck-group-title { font-size: 12px; font-weight: 700; color: #92400e; margin-bottom: 6px; }
.cr-precheck-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 5px; }
.cr-precheck-list li { font-size: 13px; color: #78350f; line-height: 1.5; }
.cr-payment-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cr-payment-table th {
  text-align: left; padding: 6px 10px; font-size: 11px; font-weight: 600;
  color: #6b7280; border-bottom: 1px solid #e5e7eb; text-transform: uppercase; letter-spacing: 0.04em;
}
.cr-payment-table td { padding: 8px 10px; border-bottom: 1px solid #f3f4f6; color: #111827; line-height: 1.4; }
.cr-payment-table tr:last-child td { border-bottom: none; }
.cr-obligations-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.cr-obligations-table th {
  text-align: left; padding: 8px 12px; font-size: 11px; font-weight: 600;
  color: #6b7280; background: #f9fafb; border-bottom: 1px solid #e5e7eb;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.cr-obligations-table td { padding: 10px 12px; border-bottom: 1px solid #f3f4f6; color: #111827; vertical-align: top; line-height: 1.5; }
.cr-obligations-table tr:last-child td { border-bottom: none; }
.cr-obligations-table tr:hover td { background: #fafafa; }
.cr-obl-party { display: inline-block; padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600; background: #e0e7ff; color: #3730a3; white-space: nowrap; }

/* Playbook */
.cr-playbook-wrap {
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 10px;
  padding: 14px 16px;
}
.cr-playbook-header { margin-bottom: 10px; }
.cr-playbook-title {
  font-size: 13px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 8px; margin-bottom: 3px;
}
.cr-playbook-optional {
  font-size: 10px; font-weight: 600; color: #d97706;
  background: #fef3c7; border: 1px solid #fde68a;
  border-radius: 99px; padding: 1px 7px;
}
.cr-playbook-sub { font-size: 12px; color: #92400e; }
.cr-playbook-input {
  width: 100%; box-sizing: border-box;
  border: 1px solid #fcd34d; border-radius: 8px;
  background: #fff; padding: 10px 12px;
  font-size: 12px; color: var(--text); line-height: 1.6;
  resize: vertical; font-family: inherit;
}
.cr-playbook-input:focus { outline: none; border-color: #d97706; }

.cr-playbook-upload-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cr-playbook-dropzone {
  flex: 1; display: flex; align-items: center; gap: 10px;
  border: 1px dashed #fcd34d; border-radius: 8px;
  background: #fff; padding: 10px 14px; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.cr-playbook-dropzone:hover { border-color: #d97706; background: #fffbeb; }
.cr-playbook-upload-ico { font-size: 18px; flex-shrink: 0; }
.cr-playbook-upload-info { display: flex; flex-direction: column; flex: 1; }
.cr-playbook-upload-label { font-size: 12px; font-weight: 600; color: var(--text); }
.cr-playbook-upload-sub { font-size: 11px; color: var(--muted2); }
.cr-playbook-upload-btn {
  background: none; border: 1px solid #fcd34d; border-radius: 6px;
  padding: 5px 12px; font-size: 11px; font-weight: 600; color: #92400e;
  cursor: pointer; white-space: nowrap; flex-shrink: 0;
}
.cr-playbook-upload-btn:hover { background: #fef3c7; border-color: #d97706; }
.cr-playbook-or {
  font-size: 11px; font-weight: 600; color: var(--muted2);
  flex-shrink: 0; padding: 0 2px;
}
.cr-playbook-file-pill {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; background: #fff; border: 1px solid #fcd34d;
  border-radius: 99px; padding: 4px 12px; width: fit-content;
}
.cr-playbook-file-ico { font-size: 13px; }
.cr-playbook-file-name { font-size: 12px; font-weight: 600; color: var(--text); }
.cr-playbook-file-remove {
  background: none; border: none; color: var(--muted2);
  font-size: 12px; cursor: pointer; padding: 0; line-height: 1;
}
.cr-playbook-file-remove:hover { color: #dc2626; }
.cr-playbook-input.cr-playbook-dimmed { opacity: 0.45; }

@media (max-width: 700px) {
  .cr-panel { padding: 14px 16px; }
  .cr-sidebyside { grid-template-columns: 1fr; }
  .cr-models-grid { grid-template-columns: 1fr; }
  .cr-consensus-grid { grid-template-columns: 1fr; }
  .cr-file-controls { justify-content: flex-start; }
}
/* Draft + Clause Library sub-views */
.cs-lbl { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; color: #33415a; }
.sm-new { background: #f0fdf4; color: #16a34a; border: 1px solid #bbf7d0; border-radius: 4px; padding: 1px 5px; font-size: 10px; font-weight: 700; }
.cr-redline-notice { margin-bottom: 14px; padding: 12px 14px; background: #eef2ff; border: 1px solid #c7d2fe; border-radius: 8px; color: #3730a3; font-size: 13px; line-height: 1.5; }