@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=JetBrains+Mono:wght@500&display=swap");

:root {
  --bg: #eef2f7;
  --bg-2: #f8fafc;
  --card: #ffffff;
  --border: #e5e9f0;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-dark: #4338ca;
  --indigo-50: #eef2ff;
  --grey: #94a3b8;
  --blue: #3b82f6;
  --yellow: #eab308;
  --green: #16a34a;
  --red: #dc2626;
  --amber: #f59e0b;
  --teal: #0d9488;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 55%, #2563eb 100%);
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, .08);
}

/* ============================================================================
   UNDERWRITER THEME — scoped palette override so the underwriter surface has a
   distinct, professional look (deep teal / slate) WITHOUT affecting the
   customer app. Applied via the .uw-theme class on the underwriter app shell.
   ============================================================================ */
.uw-theme {
  --primary: #0f766e;          /* teal-700 */
  --primary-dark: #115e59;     /* teal-800 */
  --indigo-50: #ecfdf5;        /* soft teal tint for subtle backgrounds */
  --grad: linear-gradient(135deg, #0f766e 0%, #0e7490 55%, #155e75 100%);
  --bg: #eef3f2;               /* cool slate-teal page bg */
}
.uw-theme .btn.primary { background: var(--grad); box-shadow: 0 6px 18px rgba(15,118,110,.28); }
.uw-theme .btn.primary:hover { box-shadow: 0 8px 24px rgba(15,118,110,.38); }
/* Queue hero + accents follow the teal theme too. */
.uw-theme .queue-hero { background: linear-gradient(135deg, #0f766e, #0e7490); }
.uw-theme .top-tab.active { color: #fff; }
.uw-theme .qstat.run i { box-shadow: 0 0 0 3px rgba(15,118,110,.18); }
.uw-theme.app-shell { background: var(--bg); }

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

/* App shell + top tabs */
.app-shell { min-height: 100vh; }
.app-header {
  display: flex; align-items: center; gap: 32px;
  padding: 0 28px; height: 62px;
  background: var(--grad);
  color: #fff;
  box-shadow: var(--shadow-md);
  position: sticky; top: 0; z-index: 50;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { font-size: 20px; }
.brand-name { font-weight: 800; font-size: 17px; letter-spacing: .02em; }
.top-tabs { display: flex; gap: 6px; height: 100%; }
.top-tab {
  background: transparent; border: none; color: rgba(255,255,255,.75);
  font-family: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
  padding: 0 18px; height: 100%; border-bottom: 3px solid transparent;
  transition: color .15s, border-color .15s;
}
.top-tab:hover { color: #fff; }
.top-tab.active { color: #fff; border-bottom-color: #fff; }

.app-main { padding: 28px; }

/* Tab 1: full-width intake layout (upload left, chat right) */
.intake-layout {
  display: flex;
  align-items: stretch;
  gap: 24px;
  max-width: 1400px;
  margin: 0 auto;
}
.page { flex: 1; min-width: 0; }
.card-title { margin: 0 0 16px; font-size: 18px; font-weight: 700; }
h1 { font-size: 22px; }

@media (max-width: 980px) {
  .intake-layout { flex-direction: column; }
}

.proposal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.row { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.row label { width: 100px; color: var(--muted); font-size: 14px; }
.row input {
  flex: 1; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 8px; font-size: 14px;
}

.btn {
  border: none; border-radius: 8px; padding: 10px 16px;
  font-size: 14px; cursor: pointer;
}
.btn.primary { background: var(--primary); color: #fff; }
.btn.primary:hover { background: var(--primary-dark); }
.btn.secondary { background: #eef2f7; color: var(--text); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.overall { margin-top: 14px; font-size: 14px; font-weight: 600; }

/* Modal */
.overlay {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
.hidden { display: none; }
.modal {
  width: 720px; max-width: 94vw; background: var(--card);
  border-radius: 14px; overflow: hidden; box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.modal-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--border); font-weight: 600;
}
.close-btn {
  background: none; border: none; font-size: 24px; cursor: pointer;
  color: var(--muted); line-height: 1;
}
.close-btn:disabled { opacity: .3; cursor: not-allowed; }

.session-banner {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 20px; background: #eef2ff;
  border-bottom: 1px solid var(--border);
}
.session-label {
  font-size: 11px; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: var(--primary-dark);
  background: #dbe4ff; padding: 3px 8px; border-radius: 6px;
}
.session-value {
  font-family: "SF Mono", Menlo, Consolas, monospace;
  font-size: 14px; font-weight: 600; color: var(--text);
  letter-spacing: .02em;
}
.session-pending { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-weight: 500; }

.modal-body { display: flex; min-height: 320px; }
.tabs {
  width: 200px; border-right: 1px solid var(--border);
  padding: 12px 0; background: #fafbfc;
}
.tab {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 18px; cursor: pointer; font-size: 14px;
  border-left: 3px solid transparent;
}
.tab:hover { background: #f1f4f8; }
.tab.active { background: #eef2ff; border-left-color: var(--primary); font-weight: 600; }

.dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.dot.PENDING { background: var(--grey); }
.dot.UPLOADED { background: var(--blue); }
.dot.PROCESSING { background: var(--yellow); }
.dot.VERIFIED { background: var(--green); }
.dot.REUPLOAD_REQUIRED { background: var(--red); }

.content { flex: 1; padding: 24px; }
.content h2 { margin: 0 0 6px; font-size: 18px; }
.accepted { color: var(--muted); font-size: 13px; margin-bottom: 20px; }

.upload-row { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.upload-row select, .upload-row input[type=file] { font-size: 13px; }

.status-line { font-size: 14px; margin-top: 10px; }
.status-badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600; color: #fff;
}
.status-badge.PENDING { background: var(--grey); }
.status-badge.UPLOADED { background: var(--blue); }
.status-badge.PROCESSING { background: var(--yellow); }
.status-badge.VERIFIED { background: var(--green); }
.status-badge.REUPLOAD_REQUIRED { background: var(--red); }

.error { color: var(--red); font-size: 13px; margin-top: 8px; }
.success { color: var(--green); font-size: 13px; margin-top: 8px; }
.filename { color: var(--muted); font-size: 12px; word-break: break-all; }

.spinner {
  width: 16px; height: 16px; border: 2px solid #d1d5db;
  border-top-color: var(--primary); border-radius: 50%;
  display: inline-block; animation: spin .8s linear infinite; vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

.modal-footer {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 20px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--muted);
}
.hint { color: var(--red); }

/* Right-side chat panel */
.chat-panel {
  width: 400px;
  flex-shrink: 0;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  height: 620px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.chat-header {
  background: var(--grad);
  color: #fff;
}
@media (max-width: 980px) {
  .chat-panel { width: 100%; height: 460px; }
}
.chat-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  font-weight: 600;
  font-size: 15px;
}
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.chat-msg {
  max-width: 85%;
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.4;
  white-space: pre-wrap;
  word-break: break-word;
}
.chat-msg.assistant {
  align-self: flex-start;
  background: #eef2ff;
  color: var(--text);
  border-bottom-left-radius: 4px;
}
.chat-msg.user {
  align-self: flex-end;
  background: var(--primary);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.error {
  align-self: flex-start;
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
}
.chat-msg.status {
  align-self: flex-start;
  background: #f1f5f9;
  color: #475569;
  font-style: italic;
  border: 1px dashed #cbd5e1;
}
.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}
.chat-input {
  flex: 1;
  resize: none;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
}
.chat-input-row .btn { align-self: flex-end; }
.attach-btn {
  align-self: flex-end;
  background: #f1f5f9;
  border: 1px solid var(--border);
  font-size: 18px;
  line-height: 1;
  padding: 8px 10px;
}
.attach-btn:hover { background: #e2e8f0; }

/* In-chat attachment picker */
.chat-attach {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  background: #f8fafc;
}
.chat-attach select,
.chat-attach input[type="file"] {
  font-size: 13px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

/* ================= Tab 2: Underwriting Processing ================= */
.proc { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 20px; }

/* Hero */
.proc-hero {
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  background: var(--grad); color: #fff;
  border-radius: 16px; padding: 22px 26px; box-shadow: var(--shadow-md);
}
.proc-hero-left { display: flex; align-items: center; gap: 16px; }
.avatar {
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,.2); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; letter-spacing: .02em;
  border: 2px solid rgba(255,255,255,.4);
}
.proc-name { font-size: 20px; font-weight: 800; }
.proc-sub { font-size: 13px; opacity: .95; margin-top: 2px; }
.proc-sub.muted { opacity: .75; }
.proc-hero-right { display: flex; gap: 8px; flex-wrap: wrap; }
.pill {
  font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35);
}
.pill.hitl { background: rgba(245, 158, 11, .95); border-color: transparent; }
.pill.info { background: rgba(255,255,255,.2); }

/* Stat strip */
.proc-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px;
}

/* Underwriting dashboard: uploaded documents panel */
.uw-doc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px; }
.uw-doc-card { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px;
  border: 1px solid var(--border, #e5e9f0); border-radius: 12px; background: #f8fafc; }
.uw-doc-ico { font-size: 22px; line-height: 1; }
.uw-doc-type { font-size: 13px; font-weight: 800; color: #0f172a; text-transform: capitalize; }
.uw-doc-meta { font-size: 11px; color: #64748b; margin-top: 2px; text-transform: capitalize; }
.uw-doc-fields { font-size: 11px; color: #2563eb; font-weight: 600; margin-top: 4px; }
.uw-doc-empty { font-size: 13px; color: #94a3b8; padding: 8px 0; }

/* Underwriting dashboard: Tools Used (telemetry mirror) */
.panel-title.tools-title { display: flex; align-items: center; justify-content: space-between; }
.panel-title.tools-title .btn.sm { padding: 4px 12px; font-size: 12px; }
.tools-empty { font-size: 13px; color: #94a3b8; padding: 10px 0; display: flex; align-items: center; gap: 8px; }
.tools-wrap { display: flex; flex-direction: column; gap: 14px; }
.tools-agent-head { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #334155; margin-bottom: 6px; display: flex; align-items: center; gap: 10px; }
.tools-agent-count { font-size: 11px; font-weight: 600; color: #94a3b8; text-transform: none; letter-spacing: 0; }
.tool-row { border: 1px solid var(--border, #e5e9f0); border-radius: 10px; margin-bottom: 6px;
  overflow: hidden; background: #fff; }
.tool-row.err { border-color: #fecaca; }
.tool-row-head { display: flex; align-items: center; gap: 10px; padding: 9px 12px; cursor: pointer; }
.tool-row-head:hover { background: #f8fafc; }
.tool-status { font-weight: 800; }
.tool-status.ok { color: #047857; }
.tool-status.err { color: #b91c1c; }
.tool-name { font-size: 13px; font-weight: 700; color: #0f172a; flex: 1; }
.tool-dur { font-size: 11px; color: #64748b; }
.tool-caret { font-size: 10px; color: #94a3b8; }
.tool-row-body { padding: 4px 12px 12px; border-top: 1px solid #f1f5f9; }
.tool-field { margin-top: 8px; }
.tool-field em { display: block; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #94a3b8; font-style: normal; margin-bottom: 3px; }
.tool-field code { font-size: 12px; color: #334155; word-break: break-word; }
.tool-field.err code { color: #b91c1c; }
.tool-result { font-size: 11px; background: #0f172a; color: #d1fae5; padding: 10px 12px;
  border-radius: 8px; max-height: 240px; overflow: auto; white-space: pre-wrap; word-break: break-word; margin: 0; }

/* Per-agent "Tools used" section embedded inside each agent detail card. */
.agent-tools { margin-top: 14px; border-top: 1px dashed var(--border, #e5e9f0); padding-top: 12px; }
.agent-tools-head { display: flex; align-items: center; gap: 10px; }
.agent-tools-title { font-size: 12px; font-weight: 800; color: var(--mg-ink, #0f172a); }
.agent-tools-meta { display: flex; align-items: center; gap: 6px; flex: 1; }
.at-pill { font-size: 10.5px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.at-pill.ok { color: #047857; background: #ecfdf5; border: 1px solid #a7f3d0; }
.at-pill.err { color: #b42318; background: #fef3f2; border: 1px solid #fecdca; }
.at-toggle { font: inherit; font-size: 12px; font-weight: 700; color: var(--mg-blue, #2563eb);
  background: #eef4ff; border: 1px solid #dbe6ff; border-radius: 999px; padding: 5px 14px;
  cursor: pointer; transition: background .15s; white-space: nowrap; }
.at-toggle:hover { background: #e0ecff; }
.at-toggle.active { background: var(--mg-blue, #2563eb); color: #fff; border-color: var(--mg-blue, #2563eb); }

/* Quick-glance chips showing each tool that ran. */
.at-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.at-chip { font-size: 11px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--border, #e5e9f0); background: #fff; color: #334155; }
.at-chip.ok { border-color: #bbf7d0; }
.at-chip.err { border-color: #fecaca; color: #b42318; background: #fef3f2; }

.agent-tools-body { margin-top: 12px; }
.agent-tools-summary { background: #f8fafc; border: 1px solid var(--border, #e5e9f0);
  border-radius: 10px; padding: 14px 16px; font-size: 13px; color: #334155; line-height: 1.6; }
.agent-tools-line { margin-bottom: 5px; }
.agent-tools-line:last-child { margin-bottom: 0; }
.at-actions { display: flex; gap: 16px; align-items: center; margin-top: 10px; }
.at-raw { margin-top: 10px; }

.stat {
  background: var(--card); border: 1px solid var(--border); border-radius: 14px;
  padding: 18px; box-shadow: var(--shadow-sm);
}
.stat.accent { background: linear-gradient(135deg, #eef2ff, #faf5ff); border-color: #ddd6fe; }
.stat-value { font-size: 22px; font-weight: 800; color: var(--text); }
.stat.accent .stat-value { color: var(--primary-dark); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; font-weight: 600; }

/* Grid of panels */
.proc-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px;
}
.proc-grid .panel.wide { grid-column: 1 / -1; }
@media (max-width: 980px) { .proc-grid { grid-template-columns: 1fr; } .proc-stats { grid-template-columns: repeat(2, 1fr); } }

.panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 22px; box-shadow: var(--shadow-sm);
}
.panel-title {
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin-bottom: 16px;
}

/* Pipeline */
.pipeline { display: flex; flex-direction: column; gap: 4px; }
.pl-step { display: flex; gap: 14px; position: relative; padding-bottom: 16px; }
.pl-step:not(:last-child)::before {
  content: ""; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border);
}
.pl-step.done:not(:last-child)::before { background: var(--green); }
.pl-marker {
  width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; z-index: 1;
  background: #e2e8f0; color: var(--muted);
}
.pl-step.done .pl-marker { background: var(--green); color: #fff; }
.pl-step.active .pl-marker { background: var(--primary); color: #fff; box-shadow: 0 0 0 4px rgba(79,70,229,.18); }
.pl-step.hitl .pl-marker { background: var(--amber); color: #fff; box-shadow: 0 0 0 4px rgba(245,158,11,.18); }
.pl-step.failed .pl-marker { background: var(--red); color: #fff; }
/* Future (not-yet-built) agents: greyed out and visually de-emphasized. */
.pl-step.future { opacity: .45; }
.pl-step.future .pl-marker { background: #e2e8f0; color: var(--muted); }
.pl-step.pending .pl-marker { background: #e2e8f0; color: var(--muted); }
.pl-name { font-weight: 700; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.pl-desc { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Agent pipeline as a clean card grid (replaces the connected tree). */
.agent-cards {
  display: grid; gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}
.agent-card {
  border: 1px solid var(--border, #e2e8f0); border-radius: 14px;
  padding: 14px 16px; background: #fff;
  display: flex; flex-direction: column; gap: 6px;
  transition: box-shadow .15s ease, transform .1s ease, border-color .15s ease;
}
.agent-card:hover { box-shadow: 0 6px 18px -10px rgba(15,23,42,.3); transform: translateY(-1px); }
.agent-card-top { display: flex; align-items: center; justify-content: space-between; }
.agent-dot {
  width: 26px; height: 26px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800; background: #e2e8f0; color: #64748b;
}
.agent-card-name { font-weight: 700; font-size: 13.5px; color: var(--text, #0f172a); line-height: 1.35; }
.agent-card-desc { font-size: 12px; color: var(--muted, #64748b); line-height: 1.4; }

/* Status badge pill (top-right of each card). */
.agent-badge {
  font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
  padding: 3px 9px; border-radius: 999px; background: #f1f5f9; color: #64748b;
}
.agent-badge.done   { background: #dcfce7; color: #15803d; }
.agent-badge.active { background: #dbeafe; color: #1d4ed8; }
.agent-badge.failed { background: #fee2e2; color: #b91c1c; }
.agent-badge.hitl   { background: #fef3c7; color: #b45309; }
.agent-badge.future { background: #f1f5f9; color: #94a3b8; }

/* Card accents by state. */
.agent-card.done   { border-color: #bbf7d0; }
.agent-card.done   .agent-dot { background: #16a34a; color: #fff; }
.agent-card.active { border-color: #bfdbfe; background: #f8fbff; }
.agent-card.active .agent-dot { background: #2563eb; color: #fff; }
.agent-card.failed { border-color: #fecaca; }
.agent-card.failed .agent-dot { background: #dc2626; color: #fff; }
.agent-card.hitl   { border-color: #fde68a; }
.agent-card.hitl   .agent-dot { background: #f59e0b; color: #fff; }
.agent-card.future { opacity: .6; }

/* Running spinner inside the dot. */
.agent-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.5); border-top-color: #fff;
  animation: agent-spin .7s linear infinite;
}
@keyframes agent-spin { to { transform: rotate(360deg); } }

/* Horizontal pipeline — a simple left-to-right row of connected steps.
   green = done, orange = running/review, red = failed, grey = pending. */
.pipeline-h {
  display: flex; align-items: flex-start; gap: 0;
  overflow-x: auto; padding: 8px 2px 4px;
}
.plh-step {
  position: relative; flex: 1 1 0; min-width: 92px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center;
}
/* Connector line between steps (behind the dots). */
.plh-step:not(:last-child)::after {
  content: ""; position: absolute; top: 15px; left: 50%; width: 100%;
  height: 3px; background: #e2e8f0; z-index: 0;
}
.plh-step.done:not(:last-child)::after { background: #16a34a; }
.plh-dot {
  position: relative; z-index: 1;
  width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 800;
  background: #e2e8f0; color: #64748b; border: 3px solid #fff;
  box-shadow: 0 0 0 1px #e2e8f0;
}
.plh-label { font-size: 11.5px; font-weight: 600; color: var(--muted, #64748b); line-height: 1.3; max-width: 110px; }

.plh-step.done   .plh-dot { background: #16a34a; color: #fff; box-shadow: 0 0 0 1px #16a34a; }
.plh-step.done   .plh-label { color: #15803d; }
.plh-step.active .plh-dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 1px #f59e0b, 0 0 0 4px rgba(245,158,11,.18); }
.plh-step.active .plh-label { color: #b45309; }
.plh-step.hitl   .plh-dot { background: #f59e0b; color: #fff; box-shadow: 0 0 0 1px #f59e0b; }
.plh-step.hitl   .plh-label { color: #b45309; }
.plh-step.failed .plh-dot { background: #dc2626; color: #fff; box-shadow: 0 0 0 1px #dc2626; }
.plh-step.failed .plh-label { color: #b91c1c; }
.plh-step.future { opacity: .5; }

/* ---- Professional document viewer (underwriter case page) --------------
   Scoped to .dv-panel-pro so the customer portal viewer is unchanged. Bigger
   touch targets, clearer cards, and a larger preview for non-technical users. */
.dv-panel-pro .dv-doc { border-radius: 14px; margin-bottom: 12px; }
.dv-panel-pro .dv-doc:hover { box-shadow: 0 6px 18px -10px rgba(15,23,42,.3); border-color: #c7d7f5; }
.dv-panel-pro .dv-doc-row { padding: 16px 18px; gap: 16px; }
.dv-panel-pro .dv-doc-icon {
  font-size: 18px; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: #eff6ff; }
.dv-panel-pro .dv-doc-name { font-size: 15px; }
.dv-panel-pro .dv-doc-sub { font-size: 12.5px; margin-top: 5px; }
.dv-panel-pro .dv-btn { font-size: 14px; padding: 10px 20px; border-radius: 10px; }
.dv-panel-pro .dv-doc-open { padding: 18px; }
.dv-panel-pro .dv-preview img,
.dv-panel-pro .dv-preview .dv-pdf { border-radius: 12px; }
.dv-panel-pro .dv-pdf { min-height: 560px; }
/* Friendlier group header. */
.dv-panel-pro .dv-acc-head { font-size: 14.5px; padding: 14px 16px; }
.dv-panel-pro .dv-acc-label { font-weight: 700; }

/* ---- Pipeline card (now at the top of the case) — a bit more lively ---- */
.pipeline-card {
  background: linear-gradient(180deg, #f8fbff 0%, #ffffff 60%);
  border-color: #dbe6fb;
}
.uw-theme .pipeline-card {
  background: linear-gradient(180deg, #f0faf8 0%, #ffffff 60%);
  border-color: #cdeae5;
}
.pipeline-card .panel-title { margin-bottom: 12px; }

/* ---- KPI stat boxes — colored top accent + hover lift for interest ---- */
.proc-stats .stat {
  position: relative; overflow: hidden; text-align: left;
  transition: transform .1s ease, box-shadow .15s ease;
}
.proc-stats .stat::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary, #2563eb);
}
.proc-stats .stat:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.proc-stats .stat:nth-child(1)::before { background: #2563eb; }  /* Sum Insured  */
.proc-stats .stat:nth-child(2)::before { background: #16a34a; }  /* Premium      */
.proc-stats .stat:nth-child(3)::before { background: #f59e0b; }  /* Documents    */
.proc-stats .stat:nth-child(4)::before { background: #8b5cf6; }  /* Fields       */

/* ---- Combined details + documents side-by-side ---- */
.proc-split {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr);
  gap: 20px; margin-bottom: 20px; align-items: stretch;   /* equal height */
}
@media (max-width: 980px) { .proc-split { grid-template-columns: 1fr; } }

/* Both side-by-side panels share one fixed height and scroll internally so the
   page stays compact. The panel-title stays pinned; the content scrolls. */
.proc-split > .panel {
  height: 520px; overflow-y: auto; scrollbar-gutter: stable;
}
.proc-split > .panel > .panel-title {
  position: sticky; top: 0; background: var(--card, #fff);
  padding-bottom: 10px; margin-top: -4px; padding-top: 4px; z-index: 2;
}
/* Make the document viewer heading match .panel-title exactly (same font,
   case, weight, color) and drop the extra top border/margin so both panels'
   headings look identical. */
.proc-split > .panel.dv-panel-pro .docview { margin-top: 0; border-top: none; padding-top: 0; }
.proc-split > .panel.dv-panel-pro .docview-title {
  position: sticky; top: 0; background: var(--card, #fff); z-index: 2;
  font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted); margin: -4px 0 10px; padding: 4px 0 10px;
}
.proc-split > .panel.dv-panel-pro .docview-title > span { display: inline-flex; align-items: center; }
.proc-split > .panel > .kv-section:first-of-type { margin-top: 0; }
/* Slimmer typography inside the combined details panel so more fits. */
.proc-split .kv > div { padding: 7px 0; }
.proc-split .kv dt { font-size: 11.5px; }
.proc-split .kv dd { font-size: 12.5px; }
.proc-split .kv-section { font-size: 10.5px; margin: 12px 0 6px; }
/* Compact the document viewer inside the split (smaller cards + buttons). */
.proc-split .dv-panel-pro .dv-doc-row { padding: 11px 13px; gap: 11px; }
.proc-split .dv-panel-pro .dv-doc-icon { width: 36px; height: 36px; font-size: 16px; }
.proc-split .dv-panel-pro .dv-doc-name { font-size: 13px; }
.proc-split .dv-panel-pro .dv-doc-sub { font-size: 11px; }
.proc-split .dv-panel-pro .dv-btn { font-size: 12.5px; padding: 7px 14px; }
.proc-split .dv-panel-pro .dv-acc-head { font-size: 13px; padding: 10px 12px; }
.proc-split .dv-panel-pro .dv-pdf { min-height: 360px; }
/* Thin, unobtrusive scrollbars. */
.proc-split > .panel::-webkit-scrollbar { width: 8px; }
.proc-split > .panel::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 8px; }
.proc-split > .panel::-webkit-scrollbar-track { background: transparent; }
/* Section sub-heading inside the combined Customer & Vehicle panel. */
.kv-section {
  font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--primary-dark, #1d4ed8); margin: 14px 0 8px;
  padding-bottom: 6px; border-bottom: 1px solid var(--border, #e5e9f0);
}
.kv-section:first-of-type { margin-top: 4px; }

/* ---- Agent assessment: score cards (2 per row) + expandable detail ---- */
.agent-score-grid {
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px;
}
@media (max-width: 1100px) { .agent-score-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) { .agent-score-grid { grid-template-columns: repeat(2, 1fr); } }

.agent-score-card {
  position: relative; overflow: hidden; text-align: left;
  display: flex; flex-direction: column; gap: 5px;
  padding: 14px 14px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--border, #e5e9f0); background: #fff; font-family: inherit;
  transition: transform .1s ease, box-shadow .15s ease, border-color .15s ease;
}
.agent-score-card::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: #cbd5e1;
}
.agent-score-card.ok::before   { background: #16a34a; }
.agent-score-card.warn::before { background: #f59e0b; }
.agent-score-card.err::before  { background: #dc2626; }
.agent-score-card.run::before  { background: #2563eb; }
.agent-score-card:hover { transform: translateY(-2px); box-shadow: 0 8px 20px -10px rgba(15,23,42,.3); }
.agent-score-card.active { border-color: var(--primary, #2563eb); box-shadow: 0 0 0 2px rgba(37,99,235,.18); }

.asc-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.asc-name { font-size: 11px; font-weight: 700; color: var(--muted, #64748b); text-transform: uppercase; letter-spacing: .02em; line-height: 1.25; }
.asc-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: #cbd5e1; }
.asc-dot.ok { background: #16a34a; } .asc-dot.warn { background: #f59e0b; }
.asc-dot.err { background: #dc2626; } .asc-dot.run { background: #2563eb; } .asc-dot.pend { background: #cbd5e1; }
.asc-val { font-size: 16px; font-weight: 800; color: var(--text, #0f172a); line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.asc-unit { font-size: 9.5px; text-transform: uppercase; letter-spacing: .03em; color: var(--muted, #94a3b8); }

/* Expanded detail panel below the cards. */
.agent-detail-open {
  margin-top: 16px; border: 1px solid #c7d7f5; border-radius: 14px;
  background: #fcfdff; overflow: hidden;
  box-shadow: 0 4px 16px -8px rgba(37,99,235,.25);
}
.agent-detail-open-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 18px; background: #f1f6ff; border-bottom: 1px solid #dbe6fb;
  font-weight: 800; font-size: 14px; color: var(--text, #0f172a);
}
.uw-theme .agent-detail-open { border-color: #cdeae5; box-shadow: 0 4px 16px -8px rgba(15,118,110,.25); }
.uw-theme .agent-detail-open-head { background: #effaf8; border-bottom-color: #cdeae5; }
.agent-detail-close {
  border: none; background: #fff; color: var(--muted, #64748b); cursor: pointer;
  font-family: inherit; font-size: 12.5px; font-weight: 700;
  padding: 6px 12px; border-radius: 8px; border: 1px solid var(--border, #e5e9f0);
  transition: background .12s, color .12s;
}
.agent-detail-close:hover { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.agent-detail-open > .agent-detail { padding: 16px 18px; }
.tag { font-size: 10px; font-weight: 800; padding: 2px 8px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.proc-tag { background: var(--indigo-50); color: var(--primary-dark); }
.hitl-tag { background: #fef3c7; color: #b45309; }

/* Key-value details */
.kv { margin: 0; display: flex; flex-direction: column; gap: 12px; }
.kv > div { display: flex; justify-content: space-between; gap: 16px; }
.kv dt { color: var(--muted); font-size: 13px; margin: 0; }
.kv dd { margin: 0; font-size: 13px; font-weight: 600; text-align: right; max-width: 62%; }

/* Checks */
.checks { display: flex; flex-direction: column; gap: 10px; }
.check { display: flex; gap: 10px; align-items: flex-start; }
.check-icon {
  width: 20px; height: 20px; border-radius: 50%; background: #dcfce7; color: var(--green);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.check-label { font-size: 13px; font-weight: 600; }
.check-detail { font-size: 12px; color: var(--muted); }

/* Queue table */
.queue { width: 100%; border-collapse: collapse; font-size: 13px; }
.queue thead th {
  text-align: left; padding: 10px 12px; color: var(--muted); font-weight: 700;
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border);
}
.queue tbody td { padding: 12px; border-bottom: 1px solid #f1f5f9; }
.queue tbody tr:hover { background: var(--bg-2); }
.mono { font-family: "JetBrains Mono", monospace; font-size: 12px; }
.queue .muted { color: var(--muted); }
.qbadge { font-size: 11px; font-weight: 800; padding: 4px 10px; border-radius: 999px; letter-spacing: .02em; }
.qbadge.HITL { background: #fef3c7; color: #b45309; }
.qbadge.PROCESSING { background: #dbeafe; color: #1d4ed8; }
.qbadge.APPROVED { background: #dcfce7; color: #15803d; }
.qbadge.DECLINED { background: #fee2e2; color: #b91c1c; }
.qbadge.REUPLOAD { background: #ffedd5; color: #c2410c; }
.qbadge.READY { background: #dcfce7; color: #15803d; text-transform: none; }
.risk { display: inline-flex; align-items: center; gap: 8px; min-width: 96px; }
.risk-bar { height: 6px; border-radius: 999px; display: inline-block; }
.risk-bar.low { background: var(--green); }
.risk-bar.mid { background: var(--amber); }
.risk-bar.high { background: var(--red); }
.risk-num { font-size: 12px; font-weight: 700; color: var(--muted); }

/* Timeline */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.tl-item { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.tl-time { font-family: "JetBrains Mono", monospace; font-size: 12px; color: var(--muted); width: 44px; flex-shrink: 0; }
.tl-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; background: var(--grey); }
.tl-dot.system { background: var(--grey); }
.tl-dot.intake { background: var(--blue); }
.tl-dot.ai { background: var(--primary); }
.tl-dot.hitl { background: var(--amber); }
.tl-text { color: var(--text); }

/* HITL action card */
.hitl-card { background: linear-gradient(135deg, #fffbeb, #ffffff); border-color: #fde68a; }
.hitl-note { font-size: 13px; line-height: 1.6; color: #374151; margin: 0 0 16px; }
.hitl-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.btn.success { background: var(--green); color: #fff; }
.btn.warn { background: var(--amber); color: #fff; }
.btn.danger { background: var(--red); color: #fff; }
.hitl-assignee { font-size: 12px; color: var(--muted); }

/* ===== Tab 2 layout: left queue (float) + right detail ===== */
.proc-cols {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 1080px) { .proc-cols { grid-template-columns: 1fr; } }
.proc-cols.single { grid-template-columns: 1fr; }   /* case mode: no queue panel */

/* ============================================================================
   Underwriter QUEUE home page
   ============================================================================ */
.queue-page { display: flex; flex-direction: column; gap: 20px; }
.queue-hero { display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap; background: linear-gradient(135deg, #1e3a8a, #2563eb);
  color: #fff; border-radius: 16px; padding: 24px 28px; }
.queue-h1 { font-size: 24px; font-weight: 800; margin: 0 0 6px; letter-spacing: -.01em; }
.queue-sub { font-size: 14px; color: #dbe6fb; margin: 0; max-width: 560px; line-height: 1.55; }
.queue-metrics { display: flex; gap: 14px; }
.queue-metric { background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px; padding: 12px 18px; text-align: center; min-width: 92px; }
.queue-metric b { display: block; font-size: 24px; font-weight: 800; }
.queue-metric span { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
/* Status-colored metrics (solid, high-contrast on the blue hero). */
.queue-metric.ok   { background: #16a34a; border-color: #16a34a; color: #fff; }
.queue-metric.err  { background: #dc2626; border-color: #dc2626; color: #fff; }
.queue-metric.run  { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.queue-metric.warn { background: #f59e0b; border-color: #f59e0b; color: #fff; }
.queue-metric.ok span, .queue-metric.err span,
.queue-metric.run span, .queue-metric.warn span { opacity: 1; }

/* Metric cards double as status filter buttons. */
.queue-metric { cursor: pointer; font: inherit; transition: transform .08s ease, box-shadow .12s ease, opacity .12s ease; }
.queue-metric:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(0,0,0,.18); }
.queue-metric:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
.queue-metric.active { box-shadow: 0 0 0 3px rgba(255,255,255,.6); }
.queue-metrics:has(.queue-metric.active) .queue-metric:not(.active) { opacity: .55; }

.queue-toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.filter-select { padding: 10px 12px; font-size: 13px; font-family: inherit; border-radius: 10px;
  border: 1px solid var(--border, #e5e9f0); background: #fff; color: var(--text, #1f2937);
  outline: none; min-width: 160px; }
.filter-select:focus { border-color: var(--primary, #2563eb); }
.queue-toolbar .filter-input { flex: 1; min-width: 240px; }
.queue-count { margin-left: auto; font-size: 12px; color: var(--muted, #64748b); font-weight: 600; }

.queue-loading { display: flex; align-items: center; gap: 10px; padding: 40px;
  color: var(--muted, #64748b); font-weight: 600; justify-content: center; }
.queue-empty-lg { padding: 48px; text-align: center; color: var(--muted, #64748b);
  background: #fff; border: 1px dashed var(--border, #e5e9f0); border-radius: 14px; }

.queue-table-wrap { background: #fff; border: 1px solid var(--border, #e5e9f0);
  border-radius: 14px; overflow: hidden; box-shadow: var(--shadow-sm, 0 1px 3px rgba(2,8,23,.06)); }
.queue-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.queue-table thead th { text-align: left; padding: 13px 14px; background: #f8fafc;
  font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted, #64748b);
  border-bottom: 1px solid var(--border, #e5e9f0); white-space: nowrap; }
.queue-table tbody td { padding: 12px 14px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.queue-table tbody tr:last-child td { border-bottom: none; }
.queue-table tbody tr:hover { background: #f8fbff; }
.qcell-cust { display: flex; align-items: center; gap: 10px; }
.qi-avatar.sm { width: 32px; height: 32px; font-size: 12px; }
.qcell-name { font-weight: 700; color: var(--text, #0f172a); }
.qcell-id { font-size: 11px; color: var(--muted, #94a3b8); }
.qcell-pid { font-size: 12px; color: #334155; white-space: nowrap; }
.qcell-action { text-align: right; white-space: nowrap; }
.qcell-action .btn.sm { padding: 7px 14px; font-size: 12.5px; }

/* Per-agent status chip */
.qstat { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600;
  white-space: nowrap; color: #475569; }
.qstat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: #cbd5e1; }
.qstat.ok   { color: #047857; } .qstat.ok i   { background: #16a34a; }
.qstat.err  { color: #b91c1c; } .qstat.err i  { background: #dc2626; }
.qstat.run  { color: #1d4ed8; } .qstat.run i  { background: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.18); }
.qstat.pend { color: #94a3b8; } .qstat.pend i { background: #cbd5e1; }

/* Overall status pill */
.qoverall { font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px;
  text-transform: uppercase; letter-spacing: .03em; }
.qoverall.ok   { background: #dcfce7; color: #15803d; }
.qoverall.err  { background: #fee2e2; color: #b91c1c; }
.qoverall.run  { background: #dbeafe; color: #1d4ed8; }
.qoverall.pend { background: #fef3c7; color: #b45309; }
.qcell-remarks { font-size: 13px; color: #475569; line-height: 1.5; max-width: 440px; }
.qflags { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.qflag { display: flex; flex-direction: column; gap: 2px; }
.qflag-head { display: flex; align-items: center; gap: 8px; }
.qflag-label { font-weight: 700; color: #b45309; font-size: 12.5px; }
.qflag-pts { font-weight: 800; font-size: 11px; color: #92400e; background: #fef3c7;
  border: 1px solid #fcd34d; border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.qflag-detail { font-size: 12px; color: #64748b; }

/* Case page top bar (Back to queue) — sticky so it stays visible while the
   case content scrolls; the whole row pins to the top of the scroll area. */
.case-topbar { display: flex; align-items: center; gap: 14px;
  position: sticky; top: 62px; z-index: 40;
  margin: -28px -28px 18px; padding: 12px 28px;
  background: #fff;
  border-bottom: 2px solid var(--primary, #2563eb);
  box-shadow: 0 8px 16px -10px rgba(15, 23, 42, .45); }
.case-topbar-id { font-size: 12px; color: var(--muted, #64748b); margin-left: auto; }

/* Prominent, clearly clickable back button. */
.case-back-btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: inherit; font-size: 14px; font-weight: 700; cursor: pointer;
  padding: 9px 18px; border-radius: 10px; border: none;
  background: var(--primary, #2563eb); color: #fff;
  box-shadow: 0 4px 12px -2px rgba(37, 99, 235, .45);
  transition: transform .1s ease, box-shadow .15s ease, background .15s ease;
}
.case-back-btn:hover { transform: translateX(-2px); box-shadow: 0 6px 16px -2px rgba(37, 99, 235, .55); }
.case-back-btn:active { transform: translateX(0); }
.case-back-arrow { font-size: 17px; line-height: 1; }
.uw-theme .case-topbar { border-bottom-color: var(--primary, #0f766e); }
.uw-theme .case-back-btn { background: var(--primary, #0f766e); box-shadow: 0 4px 12px -2px rgba(15, 118, 110, .45); }
.uw-theme .case-back-btn:hover { box-shadow: 0 6px 16px -2px rgba(15, 118, 110, .55); }

.detail-col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* Queue panel + filters */
.queue-panel {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  padding: 18px; box-shadow: var(--shadow-sm);
  position: sticky; top: 90px;
}
.filters { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.filter-input, .filters select {
  width: 100%; padding: 9px 11px; border: 1px solid var(--border); border-radius: 9px;
  font-size: 13px; font-family: inherit; background: var(--bg-2); color: var(--text);
}
.filter-input:focus, .filters select:focus {
  outline: none; border-color: var(--primary); background: #fff;
}
.filter-meta { display: flex; justify-content: space-between; align-items: center; font-size: 12px; color: var(--muted); }
.link-btn { background: none; border: none; color: var(--primary); font-weight: 600; cursor: pointer; font-size: 12px; }
.link-btn:hover { text-decoration: underline; }

.queue-list { display: flex; flex-direction: column; gap: 8px; max-height: 620px; overflow-y: auto; }
.queue-empty { font-size: 13px; color: var(--muted); padding: 16px; text-align: center; }
.queue-item {
  display: flex; gap: 11px; align-items: center; width: 100%; text-align: left;
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px;
  padding: 11px 12px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, transform .05s;
}
.queue-item:hover { border-color: #c7d2fe; }
.queue-item.active { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(79,70,229,.14); background: #fff; }
.qi-avatar {
  width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  background: var(--grad); color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 13px;
}
.qi-body { flex: 1; min-width: 0; }
.qi-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.qi-name { font-weight: 700; font-size: 14px; }
.qi-sub { font-size: 12px; color: var(--muted); margin: 2px 0 6px; }
.qi-risk { display: flex; align-items: center; gap: 8px; }
.qi-updated { margin-left: auto; font-size: 11px; color: var(--grey); }

/* Grouped queue: ONE card per customer, with their proposal IDs listed inside. */
.queue-group {
  border: 1px solid var(--border); border-radius: 14px; background: var(--bg-2);
  padding: 12px; display: flex; flex-direction: column; gap: 10px;
}
.qg-head { display: flex; align-items: center; gap: 11px; }
.qg-head-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 2px; }
.qg-head-body .qi-sub { margin: 0; }
.qg-count {
  font-size: 11px; font-weight: 700; color: var(--primary-dark, #3730a3);
  background: #eef2ff; border-radius: 999px; padding: 3px 10px; white-space: nowrap;
}
.qg-proposals { display: flex; flex-direction: column; gap: 6px; }
.qg-proposal {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  width: 100%; text-align: left; background: #fff;
  border: 1px solid var(--border); border-radius: 10px;
  padding: 9px 12px; cursor: pointer; font-family: inherit;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.qg-proposal:hover { border-color: #c7d2fe; background: #fafbff; }
.qg-proposal.active {
  border-color: var(--primary); background: #fff;
  box-shadow: 0 0 0 3px rgba(79,70,229,.14);
}
.qg-proposal-id { font-weight: 700; font-size: 13px; color: var(--text, #1f2937); }
.qg-proposal-go { color: var(--muted); font-size: 18px; font-weight: 700; line-height: 1; }
.qg-proposal.active .qg-proposal-go { color: var(--primary); }

/* Failed check icon variant */
.check-icon.bad { background: #fee2e2; color: var(--red); }

/* ===== AI Agents panel ===== */
.agents-panel { }
.agents-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
@media (max-width: 980px) { .agents-grid { grid-template-columns: 1fr; } }
.agent-card {
  background: var(--bg-2); border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px;
}
.agent-top { display: flex; align-items: center; gap: 8px; }
.agent-name { font-weight: 700; font-size: 14px; }
.agent-state {
  margin-left: auto; font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 2px 8px; border-radius: 999px;
}
.agent-state.online { background: #dcfce7; color: #15803d; }
.agent-state.busy { background: #dbeafe; color: #1d4ed8; }
.agent-state.degraded { background: #fee2e2; color: #b91c1c; }
.agent-dot { width: 9px; height: 9px; border-radius: 50%; }
.agent-dot.online { background: var(--green); box-shadow: 0 0 0 3px rgba(22,163,74,.18); }
.agent-dot.busy { background: var(--blue); box-shadow: 0 0 0 3px rgba(59,130,246,.18); }
.agent-dot.degraded { background: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,.18); }
.agent-role { font-size: 12px; color: var(--muted); margin: 8px 0 10px; }
.agent-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text); font-weight: 600; }


/* ---------- Intake progress panel (left column) ---------- */
.overall-pill {
  display: inline-flex;
  align-items: center;
  margin: 0;                 /* lives in the proposal header actions now */
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
  white-space: nowrap;
}
.overall-pill.success {
  background: #ecfdf5;
  color: #047857;
  border-color: #6ee7b7;
}

.proof-subtitle {
  font-size: 12.5px;
  color: #64748b;
  line-height: 1.5;
  margin: 2px 0 18px;
}

/* ---- Vertical intake timeline (Start -> proofs -> End) ---- */
.proof-timeline {
  position: relative;
  display: flex;
  flex-direction: column;
  margin-top: 6px;
  padding-left: 6px;
}
/* The continuous vertical line threading all nodes. */
.proof-timeline::before {
  content: "";
  position: absolute;
  left: 20px;                /* center of the 28px node column (6 + 14) */
  top: 14px;
  bottom: 14px;
  width: 2px;
  background: var(--border, #e5e9f0);
  z-index: 0;
}
.tl-item {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 8px 0;
}
.tl-node {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  flex-shrink: 0;
  background: var(--grey, #cbd5e1);
  border: 3px solid #fff;
  box-shadow: 0 0 0 1px var(--border, #e5e9f0);
}
.tl-node.success  { background: var(--green, #16a34a); box-shadow: 0 0 0 1px #6ee7b7; }
.tl-node.error    { background: var(--red, #dc2626);   box-shadow: 0 0 0 1px #fecaca; }
.tl-node.progress { background: var(--yellow, #f59e0b); color: #7c5e00; box-shadow: 0 0 0 1px #fde68a; }
.tl-node.pending  { background: #e2e8f0; color: #64748b; }
/* Endpoint nodes (Start / End) */
.tl-node.start { background: #64748b; font-size: 11px; }
.tl-node.start.done { background: var(--mg-blue, #2563eb); box-shadow: 0 0 0 1px #bfdbfe; }
.tl-node.end   { background: #94a3b8; font-size: 13px; }
.tl-node.end.done { background: var(--green, #16a34a); box-shadow: 0 0 0 1px #6ee7b7; }

.tl-body { display: flex; flex-direction: column; gap: 2px; padding-top: 2px; min-width: 0; }
.tl-label { font-weight: 700; font-size: 14px; color: var(--mg-ink, #0f172a); }
.tl-sub { font-size: 11.5px; color: #94a3b8; }
.tl-state { font-size: 12px; color: #64748b; font-weight: 600; }
.tl-state.success  { color: #047857; }
.tl-state.error    { color: var(--red, #dc2626); }
.tl-state.progress { color: #b45309; }
.tl-state.pending  { color: #94a3b8; }
/* Endpoint rows read as subtle guide text, not status */
.tl-endpoint .tl-label { color: #475569; }
.tl-endpoint.done .tl-label { color: var(--mg-ink, #0f172a); }

.proof-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 8px;
}
.proof-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--card);
}
.proof-item.success { border-color: #6ee7b7; background: #f0fdf4; }
.proof-item.error   { border-color: #fecaca; background: #fef2f2; }
.proof-item.progress{ border-color: #fde68a; background: #fffbeb; }
.proof-item.pending { border-color: var(--border); }

.proof-check {
  width: 26px; height: 26px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.proof-check.success  { background: var(--green); }
.proof-check.error    { background: var(--red); }
.proof-check.progress { background: var(--yellow); color: #7c5e00; }
.proof-check.pending  { background: var(--grey); }

.proof-label { flex: 1; font-weight: 600; font-size: 14px; }
.proof-state { font-size: 12px; color: #64748b; }
.proof-item.success .proof-state { color: #047857; }
.proof-item.error .proof-state   { color: var(--red); }

.proof-hint {
  margin-top: 18px;
  font-size: 12px;
  color: #94a3b8;
  line-height: 1.5;
}

/* ---- Proposal gate (shown until a proposal is chosen) ---- */
.proposal-gate .gate-actions {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-top: 10px;
}
.gate-new { align-self: flex-start; }
.gate-existing {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.gate-existing select {
  flex: 1;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: #fff;
}
.gate-error {
  margin-top: 14px;
  color: var(--red);
  font-size: 13px;
}

/* ---------- Orchestration status badges + live agent panel ---------- */
.status-badge.running   { background: var(--yellow); }
.status-badge.completed { background: var(--green); }
.status-badge.failed    { background: var(--red); }
.status-badge.skipped   { background: var(--grey); }

.orch-panel { width: 100%; }
.orch-panel .muted { color: var(--muted); font-weight: 400; font-size: 12px; }

/* Fraud / Risk sub-tabs */
.agent-tabs {
  display: flex; gap: 6px; border-bottom: 1px solid var(--border, #e3e3e3);
  margin: 4px 0 14px;
}
.agent-tab {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px; border: none; background: transparent; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.agent-tab:hover { color: var(--text, #1f2937); }
.agent-tab.active { color: var(--primary, #4f46e5); border-bottom-color: var(--primary, #4f46e5); }
.agent-tab-dot { width: 9px; height: 9px; border-radius: 50%; background: #cbd5e1; }
.agent-tab-dot.active { background: var(--yellow); }
.agent-tab-dot.done   { background: var(--green); }
.agent-tab-dot.failed { background: var(--red); }

/* Agent detail body */
.agent-detail { display: flex; flex-direction: column; gap: 14px; }
.agent-empty { color: var(--muted); font-size: 14px; padding: 12px 0; }
.agent-empty.failed { color: var(--red); }
.agent-clean {
  color: #166534; background: #f0fdf4; border: 1px solid #bbf7d0;
  border-radius: 8px; padding: 10px 12px; font-size: 14px; font-weight: 600;
}
.agent-summary {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px;
}
.agent-kpi {
  border: 1px solid var(--border, #e3e3e3); border-radius: 8px;
  padding: 10px 12px; background: #fafafa; text-align: center;
}
.agent-kpi-val { font-size: 18px; font-weight: 800; }
.agent-kpi-lab { font-size: 11px; color: var(--muted); margin-top: 4px;
  text-transform: uppercase; letter-spacing: .03em; }

.band-pill {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 13px; font-weight: 800; color: #fff;
}
.band-pill.low { background: var(--green); }
.band-pill.med { background: var(--yellow); }
.band-pill.high { background: var(--red); }
.band-pill.neutral { background: var(--grey); }

.finding-group {
  border: 1px solid var(--border, #e3e3e3); border-radius: 8px; padding: 10px 12px;
}
.finding-title { font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.finding {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; padding: 4px 0;
}
.finding.bad { color: #b91c1c; }
.finding.good { color: #166534; }
.finding-arrow { font-weight: 800; }
.finding-code { font-weight: 700; }
.finding-sev {
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  background: #fee2e2; color: #b91c1c;
}
.finding.good .finding-sev { background: #dcfce7; color: #166534; }
.finding-detail { color: var(--muted); }
.agent-kv { display: flex; flex-wrap: wrap; gap: 16px; font-size: 13px; }
.agent-foot { font-size: 12px; margin-top: 2px; }

/* LLM analysis + checks-performed chips */
.agent-llm-summary { font-size: 13px; line-height: 1.5; margin-bottom: 8px; }
.agent-llm-rec {
  margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--primary-dark, #3730a3);
}
.check-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.check-chip {
  font-size: 11px; padding: 3px 9px; border-radius: 999px;
  background: #dcfce7; color: #166534; font-weight: 600;
  text-transform: capitalize;
}
.check-chip.disabled {
  background: #f1f5f9; color: #94a3b8; text-decoration: line-through;
}

/* ============================================================================
   MARKETING + AUTH PAGES (Home / Login) — professional, generic Motor Insurance
   ============================================================================ */

:root {
  --mg-navy: #0b1b3a;
  --mg-navy-2: #122a56;
  --mg-blue: #2563eb;
  --mg-blue-dark: #1d4ed8;
  --mg-cyan: #06b6d4;
  --mg-ink: #0f172a;
  --mg-slate: #475569;
  --mg-mut: #64748b;
  --mg-line: #e5e9f0;
  --mg-bg: #f6f8fc;
  --mg-grad: linear-gradient(135deg, #2563eb 0%, #06b6d4 100%);
  --mg-grad-dark: linear-gradient(135deg, #0b1b3a 0%, #15336b 60%, #1e3a8a 100%);
}

.site { background: #fff; color: var(--mg-ink);
  font-family: inherit; }

/* ----- public site header ----- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--mg-line);
}
.site-nav {
  max-width: 1180px; margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; gap: 24px;
}
.brand-name { font-weight: 800; font-size: 18px; letter-spacing: -.01em; color: var(--mg-ink); }
.brand-sub { color: var(--mg-blue); font-weight: 800; margin-left: 2px; }
.brand-mark { color: var(--mg-blue); font-size: 20px; margin-right: 6px; }
.site-links { display: flex; gap: 22px; margin-left: 12px; flex: 1; }
.site-links a { color: var(--mg-slate); text-decoration: none; font-weight: 600; font-size: 14px; }
.site-links a:hover, .site-links a.active { color: var(--mg-blue); }
.site-cta { display: flex; align-items: center; gap: 10px; }

/* buttons (shared across pages) */
.btn { border: none; border-radius: 10px; font-weight: 700; font-size: 14px;
  padding: 10px 18px; cursor: pointer; font-family: inherit; transition: transform .05s, box-shadow .15s, background .15s; }
.btn.primary { background: var(--mg-grad); color: #fff; box-shadow: 0 6px 18px rgba(37,99,235,.28); }
.btn.primary:hover { box-shadow: 0 8px 24px rgba(37,99,235,.38); }
.btn.ghost { background: #fff; color: var(--mg-blue); border: 1.5px solid var(--mg-line); }
.btn.ghost:hover { border-color: var(--mg-blue); }
.btn.light { background: #fff; color: var(--mg-blue-dark); }
.btn.lg { padding: 13px 26px; font-size: 15px; border-radius: 12px; }
.btn.full { width: 100%; }
.ghost-btn { background: transparent; border: none; color: var(--mg-slate);
  font-weight: 700; font-size: 14px; cursor: pointer; font-family: inherit; }
.ghost-btn:hover { color: var(--mg-blue); }

/* ----- hero ----- */
.hero { background: var(--mg-grad-dark); color: #fff; position: relative; overflow: hidden; }
.hero::after { content: ""; position: absolute; right: -120px; top: -120px;
  width: 420px; height: 420px; border-radius: 50%;
  background: radial-gradient(circle, rgba(6,182,212,.35), transparent 70%); }
.hero-inner { max-width: 1180px; margin: 0 auto; padding: 72px 24px 84px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 48px; align-items: center; position: relative; z-index: 1; }
.eyebrow { display: inline-block; font-size: 13px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: #7dd3fc; margin-bottom: 14px; }
.hero-copy h1 { font-size: 48px; line-height: 1.08; font-weight: 800; letter-spacing: -.02em; margin: 0 0 18px; }
.grad-text { background: linear-gradient(90deg,#7dd3fc,#38bdf8); -webkit-background-clip: text;
  background-clip: text; color: transparent; }
.hero-copy p { font-size: 17px; line-height: 1.6; color: #c7d2e8; max-width: 540px; margin: 0 0 26px; }
.hero-actions { display: flex; gap: 14px; margin-bottom: 22px; }
.hero-trust { display: flex; flex-wrap: wrap; gap: 18px; color: #9fb3d6; font-size: 13px; font-weight: 600; }

/* Savings badge above the hero headline */
.save-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(16,185,129,.14); border: 1px solid rgba(16,185,129,.45);
  color: #6ee7b7; font-size: 13px; font-weight: 700; letter-spacing: .01em;
  padding: 7px 14px; border-radius: 999px; margin-bottom: 16px;
  animation: badgePop .5s ease both;
}
.save-badge b { color: #a7f3d0; }
.save-badge-dot {
  width: 8px; height: 8px; border-radius: 50%; background: #34d399;
  box-shadow: 0 0 0 0 rgba(52,211,153,.6); animation: pulseDot 1.8s infinite;
}
@keyframes pulseDot {
  0%   { box-shadow: 0 0 0 0 rgba(52,211,153,.6); }
  70%  { box-shadow: 0 0 0 7px rgba(52,211,153,0); }
  100% { box-shadow: 0 0 0 0 rgba(52,211,153,0); }
}
@keyframes badgePop {
  from { opacity: 0; transform: translateY(-6px) scale(.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Hero copy entrance */
.hero-copy { animation: heroIn .6s ease both; }
@keyframes heroIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Reusable reveal animation for cards (stats / products / steps / hero card).
   Starts hidden; animates in when JS adds .in-view (IntersectionObserver). */
.reveal {
  opacity: 0; transform: translateY(28px) scale(.97);
  transition: opacity .6s cubic-bezier(.22,.61,.36,1),
              transform .6s cubic-bezier(.22,.61,.36,1);
  will-change: opacity, transform;
}
.reveal.in-view { opacity: 1; transform: translateY(0) scale(1); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .hero-copy, .save-badge, .save-badge-dot { animation: none !important; opacity: 1 !important; }
}

.hero-art { display: flex; justify-content: center; }
.hero-card { width: 320px; background: #fff; color: var(--mg-ink);
  border-radius: 18px; padding: 22px; box-shadow: 0 30px 60px rgba(2,8,23,.45); }
.hero-card-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.hc-badge { background: #eff6ff; color: var(--mg-blue-dark); font-weight: 800; font-size: 12px;
  padding: 5px 12px; border-radius: 999px; }
.hc-price { font-weight: 800; font-size: 18px; }
.hero-card-row { display: flex; justify-content: space-between; padding: 9px 0;
  border-bottom: 1px solid var(--mg-line); font-size: 14px; color: var(--mg-slate); }
.hero-card-row b { color: var(--mg-ink); }
.hero-card-cta { margin-top: 16px; }
.hero-card-cta .btn { width: 100%; }

/* ----- stats strip ----- */
.stats-strip { max-width: 1180px; margin: -34px auto 0; padding: 0 24px; position: relative; z-index: 2;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.stat-cell { background: #fff; border: 1px solid var(--mg-line); border-radius: 14px;
  padding: 18px 20px; box-shadow: 0 10px 30px rgba(2,8,23,.06); text-align: center; }
.stat-cell-v { font-size: 24px; font-weight: 800; color: var(--mg-blue-dark); }
.stat-cell-l { font-size: 13px; color: var(--mg-mut); margin-top: 4px; }

/* ----- sections ----- */
.section { max-width: 1180px; margin: 0 auto; padding: 74px 24px; }
.section.alt { background: var(--mg-bg); max-width: none; }
.section.alt > * { max-width: 1180px; margin-left: auto; margin-right: auto; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 44px; }
.section-head h2 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 10px 0 12px; }
.section-head p { color: var(--mg-mut); font-size: 16px; line-height: 1.6; }

.cards-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.product-card { background: #fff; border: 1px solid var(--mg-line); border-radius: 16px;
  padding: 28px 24px; transition: transform .15s, box-shadow .15s, border-color .15s; }
.product-card:hover { transform: translateY(-4px); box-shadow: 0 18px 40px rgba(2,8,23,.1); border-color: #c7d2fe; }
.product-icon { width: 54px; height: 54px; border-radius: 14px; background: #eff6ff;
  display: flex; align-items: center; justify-content: center; font-size: 26px; margin-bottom: 16px; }
.product-card h3 { font-size: 19px; font-weight: 800; margin: 0 0 8px; }
.product-card p { color: var(--mg-mut); font-size: 14px; line-height: 1.6; margin: 0 0 16px; }
.link-cta { background: none; border: none; color: var(--mg-blue); font-weight: 700;
  font-size: 14px; cursor: pointer; padding: 0; font-family: inherit; }
.link-cta:hover { text-decoration: underline; }

.steps-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.step-card { background: #fff; border: 1px solid var(--mg-line); border-radius: 16px; padding: 24px; }
.step-n { width: 38px; height: 38px; border-radius: 10px; background: var(--mg-grad); color: #fff;
  font-weight: 800; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; }
.step-card h4 { font-size: 16px; font-weight: 800; margin: 0 0 6px; }
.step-card p { color: var(--mg-mut); font-size: 14px; line-height: 1.55; margin: 0; }
.section-cta { text-align: center; margin-top: 40px; }

/* ----- final CTA band ----- */
.cta-band { background: var(--mg-grad-dark); color: #fff; }
.cta-band-inner { max-width: 1180px; margin: 0 auto; padding: 48px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.cta-band-inner h2 { font-size: 28px; font-weight: 800; margin: 0 0 6px; }
.cta-band-inner p { color: #c7d2e8; margin: 0; }

/* ----- footer ----- */
.site-footer { background: var(--mg-navy); color: #c7d2e8; }
.site-footer-inner { max-width: 1180px; margin: 0 auto; padding: 48px 24px 24px;
  display: grid; grid-template-columns: 1.2fr 2fr; gap: 32px; }
.site-footer .brand-name { color: #fff; }
.footer-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.footer-cols h4 { color: #fff; font-size: 14px; margin: 0 0 12px; }
.footer-cols a { display: block; color: #9fb3d6; text-decoration: none; font-size: 14px; padding: 4px 0; }
.footer-cols a:hover { color: #fff; }
.site-copy { max-width: 1180px; margin: 0 auto; padding: 18px 24px;
  border-top: 1px solid rgba(255,255,255,.1); font-size: 13px; color: #7f93b8; }

/* ----- auth (login) page ----- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left { background: var(--mg-grad-dark); color: #fff; padding: 40px;
  display: flex; flex-direction: column; }
.auth-left .brand-name { color: #fff; }
.auth-left-body { margin: auto 0; max-width: 420px; }
.auth-left-body h2 { font-size: 34px; font-weight: 800; line-height: 1.15; margin: 0 0 14px; }
.auth-left-body p { color: #c7d2e8; font-size: 16px; line-height: 1.6; }
.auth-points { list-style: none; padding: 0; margin: 22px 0 0; display: flex; flex-direction: column; gap: 10px; }
.auth-points li { color: #dbe6fb; font-weight: 600; }
.auth-left-foot { color: #7f93b8; font-size: 13px; }

.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--mg-bg); }
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--mg-line);
  border-radius: 18px; padding: 32px; box-shadow: 0 20px 50px rgba(2,8,23,.1); }
.auth-back { background: none; border: none; color: var(--mg-mut); font-weight: 600;
  cursor: pointer; font-family: inherit; font-size: 13px; padding: 0 0 14px; }
.auth-back:hover { color: var(--mg-blue); }
.auth-card h1 { font-size: 26px; font-weight: 800; margin: 0 0 6px; }
.auth-sub { color: var(--mg-mut); font-size: 14px; margin: 0 0 20px; }
.auth-toggle { display: flex; background: #eef2f8; border-radius: 10px; padding: 4px; margin-bottom: 20px; }
.auth-toggle button { flex: 1; border: none; background: transparent; padding: 9px; border-radius: 8px;
  font-weight: 700; font-size: 14px; color: var(--mg-mut); cursor: pointer; font-family: inherit; }
.auth-toggle button.active { background: #fff; color: var(--mg-blue-dark); box-shadow: 0 2px 6px rgba(2,8,23,.08); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; color: var(--mg-slate); }
.auth-form input[type=text], .auth-form input[type=email], .auth-form input[type=password] {
  border: 1.5px solid var(--mg-line); border-radius: 10px; padding: 11px 13px; font-size: 14px; font-family: inherit;
  transition: border-color .15s, box-shadow .15s; }
.auth-form input:focus { outline: none; border-color: var(--mg-blue); box-shadow: 0 0 0 3px rgba(37,99,235,.14); }
.auth-row { display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.auth-check { flex-direction: row !important; align-items: center; gap: 7px !important; font-weight: 600 !important; color: var(--mg-slate); }
.auth-row a { color: var(--mg-blue); text-decoration: none; font-weight: 600; }
.auth-note { font-size: 13px; color: var(--mg-blue-dark); text-align: center; }
.auth-divider { text-align: center; position: relative; margin: 20px 0; color: var(--mg-mut); font-size: 13px; }
.auth-divider::before { content: ""; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--mg-line); }
.auth-divider span { position: relative; background: #fff; padding: 0 12px; }
.auth-fineprint { font-size: 12px; color: var(--mg-mut); text-align: center; margin: 14px 0 0; line-height: 1.5; }

/* workspace header: right-side home link */
.app-header-right { margin-left: auto; }

/* ----- responsive ----- */
@media (max-width: 900px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .hero-copy h1 { font-size: 36px; }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .cards-3 { grid-template-columns: 1fr; }
  .steps-row { grid-template-columns: 1fr 1fr; }
  .auth { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .site-footer-inner { grid-template-columns: 1fr; }
  .footer-cols { grid-template-columns: 1fr 1fr; }
  .site-links { display: none; }
}

/* ============================================================================
   Client document viewer (under each proof in the intake progress panel)
   ============================================================================ */
.docview { margin-top: 18px; border-top: 1px solid var(--border, #e5e9f0); padding-top: 16px; }
.docview-title { font-weight: 800; font-size: 14px; margin-bottom: 12px; color: var(--mg-ink, #0f172a);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.dv-refresh { font: inherit; font-size: 11px; font-weight: 700; color: var(--mg-blue, #2563eb);
  background: #eef4ff; border: 1px solid #dbe6ff; border-radius: 999px; padding: 4px 12px;
  cursor: pointer; transition: background .15s, opacity .15s; }
.dv-refresh:hover:not(:disabled) { background: #e0ecff; }
.dv-refresh:disabled { opacity: .6; cursor: default; }

/* Loading / error / empty states for the extracted-data panel */
.dv-loading { display: flex; align-items: center; gap: 10px; padding: 18px 4px;
  font-size: 13px; color: var(--mg-mut, #64748b); font-weight: 600; }
.dv-error { padding: 12px 14px; font-size: 13px; color: #b42318; background: #fef3f2;
  border: 1px solid #fecdca; border-radius: 10px; display: flex; align-items: center; gap: 10px; }
.dv-empty-panel { padding: 16px 4px; font-size: 13px; color: var(--mg-mut, #64748b); font-style: italic; }
.docview-count { font-size: 11px; color: var(--mg-mut, #64748b); background: #f1f5f9;
  padding: 2px 9px; border-radius: 999px; font-weight: 600; white-space: nowrap; }

/* Accordion per proof group */
.dv-acc { border: 1px solid var(--border, #e5e9f0); border-radius: 12px;
  margin-bottom: 10px; background: #fff; overflow: hidden; }
.dv-acc.open { box-shadow: 0 4px 14px rgba(2,8,23,.05); }
.dv-acc-head {
  display: flex; align-items: center; gap: 10px; width: 100%;
  background: #fafbfc; border: none; border-bottom: 1px solid transparent;
  padding: 12px 14px; cursor: pointer; font-family: inherit; text-align: left;
  transition: background .15s;
}
.dv-acc.open .dv-acc-head { border-bottom-color: var(--border, #e5e9f0); background: #f4f7ff; }
.dv-acc-head:hover { background: #f1f5f9; }
.dv-acc-caret { color: var(--mg-blue, #2563eb); font-size: 13px; width: 14px; flex-shrink: 0; }
.dv-acc-label { font-weight: 700; font-size: 13px; flex: 1; }
.dv-acc-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }

/* Document viewer when placed in the customer-journey RIGHT SIDEBAR. */
.cj-side-card.cj-side-docs { padding: 16px; }
.cj-side-docs .docview { margin-top: 0; border-top: none; padding-top: 0; }
.cj-side-docs .dv-kv { grid-template-columns: 1fr; }      /* single column in the narrow bar */
.cj-side-docs .dv-pdf { height: 360px; }
.cj-side-docs .dv-preview img { max-height: 320px; }

/* Total count chip next to the panel title. */
.docview-total { display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 7px; margin-left: 8px; font-size: 11px;
  font-weight: 800; color: #fff; background: var(--mg-blue, #2563eb); border-radius: 999px; }

/* One document = a clean card with a header row + expandable open view. */
.dv-doc { border: 1px solid var(--border, #e5e9f0); border-radius: 10px; overflow: hidden;
  background: #fff; transition: box-shadow .15s, border-color .15s; }
.dv-doc.open { border-color: #bfd4ff; box-shadow: 0 4px 16px rgba(37,99,235,.08); }
.dv-doc-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.dv-doc-icon { font-size: 20px; flex-shrink: 0; }
.dv-doc-info { flex: 1; min-width: 0; }
.dv-doc-name { font-size: 13px; font-weight: 700; color: var(--mg-ink, #0f172a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-doc-sub { display: flex; align-items: center; gap: 6px; margin-top: 3px;
  font-size: 11.5px; color: var(--mg-mut, #64748b); }
.dv-doc-type { font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--mg-blue-dark, #1d4ed8); background: #eff6ff; padding: 1px 8px; border-radius: 999px; }
.dv-doc-dot { color: #cbd5e1; }

.dv-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700;
  padding: 7px 14px; border-radius: 8px; border: none; cursor: pointer; font-family: inherit;
  background: var(--mg-blue, #2563eb); color: #fff; white-space: nowrap; flex-shrink: 0;
  transition: background .15s, opacity .15s; }
.dv-btn:hover:not(:disabled) { background: var(--mg-blue-dark, #1d4ed8); }
.dv-btn:disabled { opacity: .6; cursor: default; }
.dv-btn.active { background: #334155; }
.dv-btn.ghost { background: #fff; color: var(--mg-blue, #2563eb); border: 1.5px solid var(--border, #e5e9f0); }
.dv-btn.ghost:hover:not(:disabled) { border-color: var(--mg-blue, #2563eb); background: #f8fbff; }

/* Expanded view under a document: extracted fields + inline preview + download. */
.dv-doc-open { border-top: 1px solid var(--border, #e5e9f0); padding: 14px;
  background: #f8fafc; display: flex; flex-direction: column; gap: 12px; }
.dv-extract { background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 10px;
  padding: 12px 14px; }
.dv-extract-head { font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--mg-mut, #64748b); margin-bottom: 8px; }
.dv-kv { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px 18px; }
.dv-kv > div { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.dv-kv dt { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em;
  color: var(--mg-mut, #64748b); }
.dv-kv dd { margin: 0; font-size: 13px; font-weight: 600; color: var(--mg-ink, #0f172a);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dv-empty { font-size: 12px; color: var(--mg-mut, #64748b); font-style: italic; }
.dv-kv-title dd { font-size: 14px; font-weight: 800; white-space: normal; }

/* Inline preview area (image / pdf iframe / docx). */
.dv-preview { border: 1px solid var(--border, #e5e9f0); border-radius: 10px; overflow: hidden;
  background: #0b1b3a; display: flex; justify-content: center; }
.dv-preview img { max-width: 100%; max-height: 460px; object-fit: contain; display: block; }
.dv-pdf { width: 100%; height: 520px; border: none; background: #fff; }
.dv-open-actions { display: flex; justify-content: flex-end; }

/* Inline .docx render (docx-preview writes a document into here) */
.docview-docx { width: 100%; border: 1px solid var(--border, #e5e9f0); border-radius: 10px;
  max-height: 460px; overflow: auto; background: #f1f5f9; padding: 10px; }
.docview-docx .docx-wrapper { background: transparent; padding: 0; }
.docview-docx .docx-wrapper > section.docx { box-shadow: 0 1px 6px rgba(2,8,23,.12);
  margin: 0 auto 10px; background: #fff; }

/* ============================================================================
   Proposal header (ID + status tags + Save / Discard) on the Intake tab
   ============================================================================ */
.intake-wrap { display: flex; flex-direction: column; }
.proposal-header {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin: 0 0 14px; padding: 14px 18px;
  background: #fff; border: 1px solid var(--mg-line, #e5e9f0); border-radius: 14px;
  box-shadow: 0 6px 18px rgba(2,8,23,.05);
}
.ph-left { min-width: 0; }
.ph-eyebrow { display: block; font-size: 11px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--mg-mut, #64748b); margin-bottom: 6px; }
.ph-id-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ph-id { font-size: 18px; font-weight: 800; color: var(--mg-ink, #0f172a); letter-spacing: .01em; }
.ph-copy { border: 1px solid var(--mg-line, #e5e9f0); background: #fff; border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--mg-slate, #475569); padding: 4px 10px;
  cursor: pointer; font-family: inherit; }
.ph-copy:hover { border-color: var(--mg-blue, #2563eb); color: var(--mg-blue, #2563eb); }
.ph-tag { font-size: 11px; font-weight: 800; padding: 4px 11px; border-radius: 999px; letter-spacing: .02em; }
.ph-tag.saved { background: #dcfce7; color: #15803d; }
.ph-tag.draft { background: #fef3c7; color: #b45309; }
.ph-tag.ready { background: #dbeafe; color: #1d4ed8; }
.ph-tag.muted { background: #f1f5f9; color: #94a3b8; }
.ph-msg { font-size: 12px; color: var(--mg-blue-dark, #1d4ed8); margin-top: 8px; }
.ph-actions { display: flex; align-items: center; gap: 10px; }
.ph-actions .btn:disabled { opacity: .55; cursor: not-allowed; box-shadow: none; }

/* ============================================================================
   Proposal Gate — informative left panel + picker (populated intake landing)
   ============================================================================ */
.gate-wrap {
  display: grid; grid-template-columns: 1.35fr .9fr; gap: 28px;
  max-width: 1180px; margin: 0 auto; padding: 24px; align-items: start;
}

/* left info panel */
.gate-info {
  background: var(--mg-grad-dark, linear-gradient(135deg,#0b1b3a,#1e3a8a));
  color: #fff; border-radius: 18px; padding: 32px;
  box-shadow: 0 20px 50px rgba(2,8,23,.18);
}
.gate-info .eyebrow { color: #7dd3fc; }
.gate-info-title { font-size: 30px; font-weight: 800; line-height: 1.15; margin: 8px 0 14px; letter-spacing: -.02em; }
.gate-info-lead { color: #c7d2e8; font-size: 15px; line-height: 1.65; margin: 0 0 26px; }

.gate-how h3, .gate-adv h3, .gate-docs-needed h3 {
  font-size: 13px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: #9fc0f0; margin: 26px 0 14px;
}
.gate-how h3:first-child { margin-top: 0; }
.gate-steps { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 14px; }
.gate-steps li { display: flex; gap: 14px; align-items: flex-start; }
.gs-n { flex-shrink: 0; width: 30px; height: 30px; border-radius: 9px;
  background: linear-gradient(135deg,#38bdf8,#2563eb); color: #fff; font-weight: 800;
  display: flex; align-items: center; justify-content: center; font-size: 14px; }
.gate-steps b { font-size: 14px; }
.gate-steps p { margin: 3px 0 0; font-size: 13px; color: #aebfdd; line-height: 1.5; }

.gate-adv-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gate-adv-item { display: flex; gap: 11px; align-items: flex-start;
  background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1);
  border-radius: 12px; padding: 12px 14px; }
.gate-adv-item > span { font-size: 20px; }
.gate-adv-item b { font-size: 14px; }
.gate-adv-item p { margin: 2px 0 0; font-size: 12px; color: #aebfdd; line-height: 1.45; }

.gate-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gate-chip { font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 999px;
  background: rgba(255,255,255,.1); color: #e2ecff; }
.gate-chip.subtle { background: transparent; border: 1px dashed rgba(255,255,255,.25); color: #aebfdd; }

/* right picker panel */
.gate-panel { position: sticky; top: 24px; }
.gate-panel .proposal-gate { max-width: none; margin: 0; }
.gate-or { display: flex; align-items: center; text-align: center; color: var(--mg-mut,#64748b);
  font-size: 12px; font-weight: 600; margin: 14px 0; }
.gate-or::before, .gate-or::after { content: ""; flex: 1; height: 1px; background: var(--mg-line,#e5e9f0); }
.gate-or span { padding: 0 12px; }
.gate-foot { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--mg-line,#e5e9f0);
  font-size: 12px; color: var(--mg-mut,#64748b); display: flex; align-items: center; gap: 8px; }

@media (max-width: 900px) {
  .gate-wrap { grid-template-columns: 1fr; }
  .gate-panel { position: static; }
  .gate-adv-grid { grid-template-columns: 1fr; }
}

/* ============================================================================
   Signed-in user menu (workspace header) + auth loading
   ============================================================================ */
.app-header-right { display: flex; align-items: center; gap: 12px; }

.user-menu { position: relative; }
.user-chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.14); border: 1px solid rgba(255,255,255,.28);
  color: #fff; border-radius: 999px; padding: 5px 12px 5px 5px;
  cursor: pointer; font-family: inherit; font-size: 13px; font-weight: 600;
}
.user-chip:hover { background: rgba(255,255,255,.22); }
.user-ini {
  width: 26px; height: 26px; border-radius: 50%; background: #fff;
  color: var(--primary-dark, #4338ca); font-weight: 800; font-size: 12px;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.user-ini.lg { width: 40px; height: 40px; font-size: 15px; }
.user-label { max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-caret { font-size: 10px; opacity: .85; }

.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 60;
  width: 260px; background: #fff; color: var(--text, #0f172a);
  border: 1px solid var(--border, #e5e9f0); border-radius: 12px;
  box-shadow: 0 18px 40px rgba(2,8,23,.18); padding: 14px;
}
.user-dd-head { display: flex; align-items: center; gap: 11px; margin-bottom: 10px; }
.user-dd-head .user-ini { color: #fff; background: var(--grad, #4f46e5); }
.user-dd-id { min-width: 0; }
.user-dd-name { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dd-email { font-size: 12px; color: var(--muted, #64748b); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dd-groups { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.user-group { font-size: 11px; font-weight: 700; background: #eef2ff; color: #3730a3; padding: 2px 9px; border-radius: 999px; }
.user-profile-btn {
  width: 100%; border: 1px solid var(--border, #e5e9f0); background: #fff;
  color: var(--mg-blue, #2563eb); font-weight: 700; font-size: 13px;
  padding: 9px; border-radius: 9px; cursor: pointer; font-family: inherit;
  margin-bottom: 8px;
}
.user-profile-btn:hover { background: #eff6ff; border-color: #bfdbfe; }
.user-signout {
  width: 100%; border: 1px solid var(--border, #e5e9f0); background: #fff;
  color: var(--red, #dc2626); font-weight: 700; font-size: 13px;
  padding: 9px; border-radius: 9px; cursor: pointer; font-family: inherit;
}
.user-signout:hover { background: #fef2f2; border-color: #fecaca; }

.auth-loading {
  min-height: 60vh; display: flex; align-items: center; justify-content: center;
  gap: 10px; color: var(--muted, #64748b); font-size: 15px;
}

/* ============================================================================
   CUSTOMER INSURANCE JOURNEY (new) — vehicle search + quote wizard
   ============================================================================ */

/* Hero vehicle-number search */
.veh-search { margin: 22px 0 10px; max-width: 520px; }
.veh-search-label { display: block; font-size: 13px; font-weight: 700;
  color: var(--mg-ink, #0f172a); margin-bottom: 8px; }
.veh-search-row { display: flex; gap: 10px; }
.veh-search-input { flex: 1; min-width: 0; padding: 14px 16px; font-size: 16px;
  font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  border: 2px solid var(--border, #e5e9f0); border-radius: 12px; outline: none;
  transition: border-color .15s; font-family: inherit; }
.veh-search-input:focus { border-color: var(--mg-blue, #2563eb); }
.veh-search-hint { display: block; margin-top: 8px; font-size: 12px; color: #64748b; }

/* Journey shell */
.cj { min-height: 100vh; background: #f6f8fc; display: flex; flex-direction: column; }
.cj-header { display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; background: #fff; border-bottom: 1px solid var(--border, #e5e9f0); }

/* Tab stepper */
.cj-steps { display: flex; flex-wrap: wrap; gap: 6px; padding: 14px 28px;
  background: #fff; border-bottom: 1px solid var(--border, #e5e9f0); }
.cj-step { display: flex; align-items: center; gap: 8px; padding: 8px 14px;
  border: 1px solid var(--border, #e5e9f0); border-radius: 999px; background: #fff;
  cursor: pointer; font: inherit; font-size: 13px; color: #64748b; transition: all .15s; }
.cj-step:hover { background: #f1f5f9; }
.cj-step.active { border-color: var(--mg-blue, #2563eb); color: var(--mg-blue, #2563eb);
  background: #eff5ff; font-weight: 700; }
.cj-step.done { color: #047857; border-color: #6ee7b7; }
.cj-step-dot { width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
  align-items: center; justify-content: center; font-size: 12px; font-weight: 800;
  background: #e2e8f0; color: #475569; }
.cj-step.active .cj-step-dot { background: var(--mg-blue, #2563eb); color: #fff; }
.cj-step.done .cj-step-dot { background: var(--green, #16a34a); color: #fff; }

/* Body: main + sticky summary */
/* Two-column journey: main form (~70%) + contextual sidebar (~30%). The grid
   is centered with a bounded width so neither side feels empty. */
.cj-body { flex: 1; display: grid; grid-template-columns: minmax(0, 65fr) minmax(320px, 35fr);
  gap: 24px; max-width: 1320px; width: 100%; margin: 0 auto; padding: 28px; align-items: start; }
.cj-body.single { grid-template-columns: 1fr; max-width: 820px; }
@media (max-width: 920px) { .cj-body { grid-template-columns: 1fr; } .cj-aside { display: none; } }
.cj-main { min-width: 0; }

/* Sidebar cards */
.cj-aside { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 14px; }
.cj-side-card { background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 14px;
  padding: 16px 18px; box-shadow: 0 4px 14px rgba(2,8,23,.04); }
.cj-side-title { font-weight: 800; font-size: 14px; color: var(--mg-ink, #0f172a); margin-bottom: 10px; }
.cj-side-sub { font-size: 12.5px; color: #64748b; margin-bottom: 6px; }
.cj-side-list { margin: 0; padding-left: 18px; display: grid; gap: 7px; font-size: 12.5px;
  color: #475569; line-height: 1.5; }
.cj-side-help { background: linear-gradient(135deg, #eff5ff, #f6faff); border-color: #dbeafe; }
.cj-side-quote .cj-side-row { display: flex; justify-content: space-between; gap: 10px;
  font-size: 13px; padding: 5px 0; color: #475569; }
.cj-side-quote .cj-side-row b { color: var(--mg-ink, #0f172a); }
.cj-side-row.total { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--border, #e5e9f0); }
.cj-side-row.total b { color: var(--mg-blue, #2563eb); font-size: 16px; }
.cj-side-note { font-size: 11px; color: #94a3b8; margin-top: 8px; }
.cj-side-trust { display: grid; gap: 8px; }
.cj-trust-item { font-size: 12.5px; color: #334155; font-weight: 600; }
.cj-side-contact { font-size: 12px; color: var(--mg-blue, #2563eb); font-weight: 700; margin-top: 4px; }
.cj-loading { display: flex; align-items: center; gap: 12px; padding: 40px 10px;
  font-size: 15px; color: #64748b; font-weight: 600; }

/* Document upload cards */
.doc-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px; }
.doc-card { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; padding: 16px;
  background: #fff; }
.doc-card.done { border-color: #6ee7b7; background: #f0fdf4; }
.doc-card-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.doc-card-name { font-weight: 700; font-size: 14px; color: var(--mg-ink, #0f172a); }
.doc-card-status { font-size: 11px; font-weight: 700; color: #94a3b8; }
.doc-card-status.ok { color: #047857; }
.doc-card-file { font-size: 12px; color: #475569; margin-top: 8px; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; }
.doc-card-btn { display: inline-block; margin-top: 12px; padding: 8px 14px; font-size: 13px;
  font-weight: 700; color: var(--mg-blue, #2563eb); background: #eef4ff; border: 1px solid #dbe6ff;
  border-radius: 10px; cursor: pointer; }
.doc-card-btn:hover { background: #e0ecff; }

.cj-card { background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 16px;
  padding: 28px; box-shadow: 0 4px 18px rgba(2,8,23,.04); }
.cj-card h2 { margin: 0 0 6px; font-size: 22px; color: var(--mg-ink, #0f172a); }
.cj-sub { margin: 0 0 18px; color: #64748b; font-size: 14px; }

/* Forms */
.cj-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 16px; }
@media (max-width: 560px) { .cj-form { grid-template-columns: 1fr; } }
.cj-form label { display: flex; flex-direction: column; gap: 6px; font-size: 12px;
  font-weight: 700; color: #475569; }
.cj-form label.full { grid-column: 1 / -1; }
.cj-form input, .cj-form select { padding: 11px 13px; font-size: 14px; font-family: inherit;
  border: 1px solid var(--border, #e5e9f0); border-radius: 10px; outline: none; font-weight: 500; }
.cj-form input:focus, .cj-form select:focus { border-color: var(--mg-blue, #2563eb); }
.cj-form label .req { color: #dc2626; font-weight: 800; margin-left: 2px; }

/* Found-vehicle confirm */
.veh-found { display: grid; gap: 10px; }
.vf-row { display: flex; justify-content: space-between; padding: 10px 14px;
  background: #f8fafc; border: 1px solid var(--border, #e5e9f0); border-radius: 10px; font-size: 14px; }
.vf-row span { color: #64748b; }

/* Selection cards */
.cj-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; }
.sel-card { text-align: left; padding: 18px; border: 2px solid var(--border, #e5e9f0);
  border-radius: 14px; background: #fff; cursor: pointer; font: inherit; transition: all .15s; }
.sel-card:hover { border-color: #cbd5e1; }
.sel-card.active { border-color: var(--mg-blue, #2563eb); background: #eff5ff;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.sel-card.big { padding: 22px; }
.sel-card-title { font-weight: 800; font-size: 16px; color: var(--mg-ink, #0f172a); margin-bottom: 6px; }
.sel-card-desc { font-size: 13px; color: #64748b; margin-top: 8px; }
.sel-list { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px;
  font-size: 13px; color: #334155; }
.sel-list .muted { color: #94a3b8; }

/* Renewal block */
.cj-renewal { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--border, #e5e9f0); }
.cj-q { font-weight: 700; font-size: 14px; margin-bottom: 10px; color: var(--mg-ink, #0f172a); }
.cj-radio-row { display: flex; gap: 20px; font-size: 14px; }
.cj-radio-row label { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.cj-ncb { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; max-width: 220px;
  font-size: 12px; font-weight: 700; color: #475569; }
.cj-ncb select { padding: 10px 12px; border: 1px solid var(--border, #e5e9f0); border-radius: 10px;
  font: inherit; }
.cj-hint { margin-top: 14px; font-size: 12.5px; color: #64748b; background: #f8fafc;
  border-left: 3px solid var(--mg-blue, #2563eb); padding: 10px 12px; border-radius: 0 8px 8px 0; }

/* Add-on checkboxes */
.addon-list { display: grid; gap: 12px; }
.addon { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border: 2px solid var(--border, #e5e9f0); border-radius: 12px; cursor: pointer; transition: all .15s; }
.addon:hover { border-color: #cbd5e1; }
.addon.on { border-color: var(--mg-blue, #2563eb); background: #eff5ff; }
.addon.disabled { opacity: .5; cursor: not-allowed; }
.addon input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--mg-blue, #2563eb); }
.addon-body { flex: 1; min-width: 0; }
.addon-head { display: flex; justify-content: space-between; gap: 10px; }
.addon-name { font-weight: 700; font-size: 15px; color: var(--mg-ink, #0f172a); }
.addon-price { font-weight: 800; color: var(--mg-blue, #2563eb); white-space: nowrap; }
.addon-desc { font-size: 12.5px; color: #64748b; margin-top: 4px; }

/* IDV card */
.idv-card { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; overflow: hidden; }
.idv-row { display: flex; justify-content: space-between; padding: 12px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border, #e5e9f0); }
.idv-row span { color: #64748b; }
.idv-total { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 16px;
  font-weight: 800; background: #eff5ff; color: var(--mg-ink, #0f172a); }

/* Premium */
.prem-grid { display: grid; grid-template-columns: 1fr 260px; gap: 18px; align-items: start; }
@media (max-width: 620px) { .prem-grid { grid-template-columns: 1fr; } }
.prem-breakdown { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; overflow: hidden; }
.prem-row { display: flex; justify-content: space-between; padding: 11px 16px; font-size: 14px;
  border-bottom: 1px solid var(--border, #e5e9f0); }
.prem-row span { color: #475569; }
.prem-row.discount b { color: #047857; }
.prem-total { display: flex; justify-content: space-between; padding: 14px 16px; font-size: 16px;
  font-weight: 800; background: #f8fafc; }
.prem-card { background: linear-gradient(135deg, #2563eb, #1e40af); color: #fff; border-radius: 14px;
  padding: 22px; text-align: center; }
.prem-card-label { font-size: 13px; opacity: .9; }
.prem-card-amount { font-size: 34px; font-weight: 800; margin: 8px 0; }
.prem-card-idv { font-size: 13px; opacity: .9; }
/* HITL variant of the premium card: amber gradient + "agent will connect". */
.prem-card.hitl { background: linear-gradient(135deg, #d97706, #b45309); }
.prem-card-hitl-msg { font-size: 14px; line-height: 1.5; margin: 10px 0 14px; opacity: .97; }
.prem-card-cta { width: 100%; font-weight: 800; }

/* Review */
.rev-sec { padding: 14px 0; border-bottom: 1px solid var(--border, #e5e9f0); font-size: 14px; }
.rev-sec h3 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em;
  color: #64748b; }
.rev-sec ul { margin: 4px 0 0; padding-left: 18px; }
.rev-mut { color: #94a3b8; font-size: 13px; }

/* Nav buttons */
.cj-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 20px; }
.cj-nav .btn:only-child { margin-left: auto; }

/* Sticky summary */
.cj-summary { position: sticky; top: 20px; }
@media (max-width: 900px) { .cj-summary { position: static; } }
.qs { background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 16px;
  padding: 20px; box-shadow: 0 4px 18px rgba(2,8,23,.04); }
.qs-title { font-weight: 800; font-size: 15px; margin-bottom: 14px; color: var(--mg-ink, #0f172a); }
.qs-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px;
  padding: 6px 0; color: #475569; }
.qs-row b { color: var(--mg-ink, #0f172a); text-align: right; }
.qs-addons { margin: 8px 0; padding: 8px 0; border-top: 1px dashed var(--border, #e5e9f0);
  border-bottom: 1px dashed var(--border, #e5e9f0); }
.qs-addon { display: flex; justify-content: space-between; font-size: 12.5px; color: #64748b;
  padding: 3px 0; }
.qs-total { display: flex; justify-content: space-between; align-items: center; margin-top: 12px;
  padding-top: 12px; border-top: 2px solid var(--border, #e5e9f0); }
.qs-total b { font-size: 20px; color: var(--mg-blue, #2563eb); }
.qs-note { margin-top: 10px; font-size: 11px; color: #94a3b8; }

/* Success */
.cj-success { max-width: 480px; margin: 60px auto; text-align: center; padding: 0 20px; }
.cj-success-icon { width: 64px; height: 64px; border-radius: 50%; background: #16a34a; color: #fff;
  font-size: 32px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.cj-success h1 { font-size: 24px; margin: 0 0 20px; color: var(--mg-ink, #0f172a); }
.cj-success-box { background: #fff; border: 1px solid var(--border, #e5e9f0); border-radius: 14px;
  padding: 18px 20px; text-align: left; }
.cj-success-actions { display: flex; gap: 12px; justify-content: center; margin-top: 20px; }

/* ---- Customer journey: additions (coverage, upload, OTP, beautify) ---- */

/* Coverage cards: badges + 3-up grid */
.cov-cards { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.sel-card { position: relative; }
.cov-badge { position: absolute; top: -10px; right: 14px; font-size: 10px; font-weight: 800;
  text-transform: uppercase; letter-spacing: .05em; color: #fff; background: var(--mg-blue, #2563eb);
  padding: 3px 10px; border-radius: 999px; }
.cov-badge.best { background: #16a34a; }

/* Purchase: toggle (enter vs upload) */
.cj-toggle { display: inline-flex; background: #f1f5f9; border-radius: 999px; padding: 4px;
  gap: 4px; margin-bottom: 18px; }
.cj-toggle-btn { border: none; background: none; font: inherit; font-size: 13px; font-weight: 700;
  padding: 8px 18px; border-radius: 999px; cursor: pointer; color: #64748b; }
.cj-toggle-btn.active { background: #fff; color: var(--mg-blue, #2563eb);
  box-shadow: 0 1px 4px rgba(2,8,23,.12); }

/* Upload dropzone */
.cj-upload { display: grid; gap: 14px; }
.cj-dropzone { display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 30px 20px; border: 2px dashed var(--border, #cbd5e1);
  border-radius: 14px; background: #f8fafc; cursor: pointer; transition: border-color .15s, background .15s; }
.cj-dropzone:hover { border-color: var(--mg-blue, #2563eb); background: #f0f6ff; }
.cj-dz-icon { font-size: 34px; }
.cj-dz-title { font-weight: 800; font-size: 15px; color: var(--mg-ink, #0f172a); margin-top: 6px; }
.cj-dz-sub { font-size: 12.5px; color: #64748b; margin-top: 4px; }
.cj-upload-msg { font-size: 13px; color: var(--mg-blue-dark, #1d4ed8); background: #eff5ff;
  border-radius: 8px; padding: 10px 12px; }
.cj-extracted { border: 1px solid #6ee7b7; background: #f0fdf4; border-radius: 12px; padding: 14px 16px; }
.cj-extracted-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #047857; margin-bottom: 10px; }

/* Info note card (beautify) */
.cj-note-card { display: flex; gap: 12px; align-items: flex-start; margin-top: 18px;
  padding: 14px 16px; background: linear-gradient(135deg, #eff5ff, #f0fdf4);
  border: 1px solid #dbeafe; border-radius: 12px; font-size: 13px; color: #334155; line-height: 1.5; }
.cj-note-ico { font-size: 20px; }

/* IDV formula box */
.cj-formula { margin-top: 14px; font-size: 13px; color: #334155; background: #f8fafc;
  border: 1px solid var(--border, #e5e9f0); border-radius: 10px; padding: 12px 14px; line-height: 1.7; }

/* Section head inside a card (Your details documents) */
.cj-section-head { margin: 22px 0 4px; font-size: 14px; font-weight: 800;
  color: var(--mg-ink, #0f172a); padding-top: 18px; border-top: 1px solid var(--border, #e5e9f0); }

/* OTP modal — overlay fills the viewport and CENTERS the modal both axes. */
.otp-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; inset: 0;
  background: rgba(2,8,23,.55); display: flex !important;
  align-items: center !important; justify-content: center !important;
  z-index: 2147483647 !important; padding: 20px; margin: 0; overflow-y: auto; }
.otp-modal { position: relative; background: #fff; border-radius: 18px; padding: 28px;
  width: 100%; max-width: 380px; text-align: center; box-shadow: 0 24px 60px rgba(2,8,23,.3);
  margin: auto; }
.otp-close { position: absolute; top: 12px; right: 14px; border: none; background: none;
  font-size: 28px; line-height: 1; color: #475569; cursor: pointer; font-weight: 700;
  z-index: 1; }
.otp-ico { font-size: 32px; }
.otp-modal h2 { margin: 8px 0 4px; font-size: 20px; color: var(--mg-ink, #0f172a); }
.otp-sub { font-size: 13px; color: #64748b; margin: 0 0 18px; }
.otp-input { width: 100%; padding: 12px 14px; font-size: 15px; font-family: inherit; margin-bottom: 10px;
  border: 1px solid var(--border, #e5e9f0); border-radius: 10px; outline: none; }
.otp-input:focus { border-color: var(--mg-blue, #2563eb); }
.otp-code { text-align: center; letter-spacing: .6em; font-size: 22px; font-weight: 800; }
.btn.full { width: 100%; }
.otp-resend { background: none; border: none; color: var(--mg-blue, #2563eb); font: inherit;
  font-size: 13px; font-weight: 700; cursor: pointer; margin-top: 10px; }
.otp-msg { margin-top: 12px; font-size: 13px; color: var(--mg-blue-dark, #1d4ed8); }

/* Demo-mode OTP banner — shows the dummy OTP so the user can log in offline. */
.otp-demo-banner { margin-bottom: 12px; padding: 10px 12px; border-radius: 10px;
  background: #ecfdf5; border: 1px solid #a7f3d0; color: #065f46; font-size: 13px;
  line-height: 1.5; text-align: left; }
.otp-demo-banner b { font-size: 16px; letter-spacing: .12em; color: #047857; }

/* Vehicle step: invoice-upload panel at the top */
.veh-invoice { display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 18px; margin-bottom: 20px; border-radius: 14px;
  background: linear-gradient(135deg, #eff5ff, #eef7f0); border: 1px solid #dbeafe; }
.veh-invoice-copy { min-width: 0; }
.veh-invoice-title { font-weight: 800; font-size: 15px; color: var(--mg-ink, #0f172a); }
.veh-invoice-sub { font-size: 12.5px; color: #64748b; margin-top: 4px; }
.veh-invoice-msg { font-size: 12.5px; color: var(--mg-blue-dark, #1d4ed8); margin-top: 8px;
  font-weight: 600; }
.veh-invoice-btn { white-space: nowrap; cursor: pointer; }
@media (max-width: 560px) {
  .veh-invoice { flex-direction: column; align-items: stretch; text-align: left; }
  .veh-invoice-btn { text-align: center; }
}

/* Gate message (KYC/login required before premium) */
.cj-gate-msg { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412;
  border-radius: 10px; padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 16px; }

/* Premium: full details summary grid */
.prem-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; margin-bottom: 16px; }
.prem-sum-box { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; padding: 14px; background: #fff; }
.prem-sum-head { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: var(--mg-blue, #2563eb); margin-bottom: 8px; }
.prem-sum-row { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 4px 0; }
.prem-sum-row span { color: #64748b; }
.prem-sum-row b { color: var(--mg-ink, #0f172a); text-align: right; overflow: hidden;
  text-overflow: ellipsis; white-space: nowrap; max-width: 60%; }
.prem-sum-row b.ok { color: #047857; }
.prem-sum-row b.miss { color: #94a3b8; }
.prem-addon-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.prem-chip { font-size: 12px; font-weight: 700; color: #047857; background: #ecfdf5;
  border: 1px solid #a7f3d0; border-radius: 999px; padding: 4px 12px; }

/* IDV slider */
.idv-slider-card { background: linear-gradient(135deg, #eff5ff, #f6faff); border: 1px solid #dbeafe;
  border-radius: 14px; padding: 20px; margin-bottom: 16px; text-align: center; }
.idv-slider-value { font-size: 30px; font-weight: 800; color: var(--mg-blue, #2563eb); margin-bottom: 12px; }
.idv-slider { width: 100%; appearance: none; -webkit-appearance: none; height: 8px; border-radius: 999px;
  background: #cbd5e1; outline: none; cursor: pointer; }
.idv-slider::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--mg-blue, #2563eb); border: 3px solid #fff; box-shadow: 0 1px 5px rgba(2,8,23,.3); cursor: pointer; }
.idv-slider::-moz-range-thumb { width: 24px; height: 24px; border-radius: 50%; background: var(--mg-blue, #2563eb);
  border: 3px solid #fff; box-shadow: 0 1px 5px rgba(2,8,23,.3); cursor: pointer; }
.idv-slider-ends { display: flex; justify-content: space-between; font-size: 12px; color: #64748b;
  font-weight: 700; margin-top: 8px; }
.idv-slider-hint { font-size: 12px; color: #64748b; margin-top: 10px; line-height: 1.5; }

/* Full-screen loading overlay (vehicle lookup -> customer journey transition) */
.cj-fullscreen-loader { position: fixed; inset: 0; z-index: 2000;
  background: rgba(255,255,255,.92); display: flex; align-items: center; justify-content: center; }
.cj-fsl-box { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 14px; }
.cj-fsl-title { font-size: 18px; font-weight: 800; color: var(--mg-ink, #0f172a); }
.cj-fsl-sub { font-size: 13px; color: #64748b; }
.spinner.lg { width: 40px; height: 40px; border-width: 4px; }

/* Journey header: identity chip (demo vs signed-in) */
.cj-header-right { display: flex; align-items: center; gap: 12px; }
.cj-identity { display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px 5px 5px;
  border-radius: 999px; background: #eef4ff; border: 1px solid #dbe6ff; font-size: 13px;
  font-weight: 700; color: var(--mg-blue-dark, #1d4ed8); max-width: 220px; }
.cj-identity.demo { background: #f1f5f9; border-color: #e2e8f0; color: #64748b; }
.cj-identity-ini { width: 24px; height: 24px; border-radius: 50%; background: var(--mg-blue, #2563eb);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.cj-identity.demo .cj-identity-ini { background: #94a3b8; }
.cj-identity-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Premium: fraud/risk score boxes from the orchestrator */
.prem-scores { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px; margin: 16px 0; }
.prem-score-box { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; padding: 14px;
  text-align: center; background: #f8fafc; }
.prem-score-lab { font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  color: #64748b; margin-bottom: 6px; }
.prem-score-val { font-size: 24px; font-weight: 800; color: var(--mg-ink, #0f172a); }
.prem-score-val.sm { font-size: 14px; color: #047857; }
.prem-score-band { font-size: 12px; font-weight: 700; color: var(--mg-blue, #2563eb); }
.prem-score-box.inline { max-width: 220px; margin-top: 12px; }

/* Premium: orchestrator progress bar (matches the premium action width) */
.prem-progress-wrap { margin: 16px 0; padding: 14px 16px; border: 1px solid var(--border, #e5e9f0);
  border-radius: 12px; background: #f8fafc; }
.prem-progress-head { display: flex; align-items: center; gap: 8px; font-size: 13px;
  font-weight: 700; color: #0f172a; }
.prem-progress-pct { margin-left: auto; color: #2563eb; }
.prem-progress-bar { height: 8px; border-radius: 999px; background: #e5e9f0; overflow: hidden;
  margin: 10px 0; }
.prem-progress-fill { height: 100%; background: linear-gradient(90deg, #2563eb, #22c55e);
  border-radius: 999px; transition: width .5s ease; }
.prem-progress-steps { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11px; color: #94a3b8; }
.prem-progress-step.active { color: #2563eb; font-weight: 700; }
.prem-progress-step.done { color: #047857; font-weight: 700; }
.prem-progress-note { font-size: 12px; color: #64748b; margin-top: 8px; }

/* Premium: status message when the orchestrator returns no usable data */
.prem-status-msg { display: flex; align-items: center; gap: 12px; margin: 16px 0; padding: 12px 16px;
  border: 1px solid #fecaca; background: #fef2f2; color: #b91c1c; border-radius: 12px;
  font-size: 13px; font-weight: 600; }
.prem-status-msg .btn.sm { padding: 6px 12px; font-size: 12px; margin-left: auto; }

/* Premium: per-agent summary cards */
.prem-agents { margin: 20px 0; }
.prem-agents-title { font-size: 13px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #64748b; margin-bottom: 10px; }
.prem-agents-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px; }
.prem-agent-card { border: 1px solid var(--border, #e5e9f0); border-radius: 12px; padding: 14px;
  background: #fff; }
.prem-agent-card.st-failed { border-color: #fecaca; background: #fef2f2; }
.prem-agent-card.st-skipped { opacity: .7; }
.prem-agent-head { display: flex; align-items: center; justify-content: space-between; }
.prem-agent-label { font-size: 13px; font-weight: 800; color: #0f172a; }
.prem-agent-status { font-size: 11px; font-weight: 700; text-transform: uppercase; }
.prem-agent-status.completed { color: #047857; }
.prem-agent-status.failed { color: #b91c1c; }
.prem-agent-status.skipped { color: #94a3b8; }
.prem-agent-metrics { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
.prem-agent-metric { font-size: 13px; font-weight: 700; color: #0f172a; }
.prem-agent-metric em { display: block; font-size: 10px; font-weight: 800; font-style: normal;
  text-transform: uppercase; letter-spacing: .05em; color: #94a3b8; }
.prem-agent-note { font-size: 11px; color: #64748b; margin-top: 8px; line-height: 1.4; }

/* Dashboard: vehicle picker (one customer can own multiple vehicles) */
.veh-modal { max-width: 440px; }
.veh-list { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; max-height: 340px;
  overflow-y: auto; }
.veh-card { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; text-align: left; padding: 14px 16px; border: 1px solid var(--border, #e5e9f0);
  border-radius: 12px; background: #fff; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.veh-card:hover:not(:disabled) { border-color: #2563eb; box-shadow: 0 2px 10px rgba(37,99,235,.12); }
.veh-card:disabled { opacity: .6; cursor: default; }
.veh-card-reg { font-size: 15px; font-weight: 800; letter-spacing: .03em; color: #0f172a; }
.veh-card-name { font-size: 12px; color: #64748b; margin-top: 2px; }
.veh-card-year { color: #94a3b8; }
.veh-card-side { display: flex; align-items: center; gap: 10px; }
.veh-card-status { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .05em;
  padding: 3px 8px; border-radius: 999px; }
.veh-card-status.draft { background: #f1f5f9; color: #64748b; }
.veh-card-status.sub { background: #dcfce7; color: #047857; }
.veh-card-go { font-size: 22px; color: #94a3b8; line-height: 1; }
.btn.ghost.full { width: 100%; }

/* Dashboard: vehicle-number prompt — centered (overlay flex-centers it) */
.reg-prompt-modal { margin-top: 0; }
.reg-prompt-close { margin-top: 10px; }

/* Quote header: persistent proposal ID chip */
.cj-proposal-chip { margin-left: 16px; padding: 6px 12px; border-radius: 999px;
  background: #eff6ff; border: 1px solid #bfdbfe; color: #1d4ed8; font-size: 12px;
  font-weight: 600; white-space: nowrap; }
.cj-proposal-chip b { font-weight: 800; letter-spacing: .02em; }

/* Premium: HITL banner (provisional premium needing a live underwriter) */
.prem-hitl { display: flex; align-items: center; gap: 16px; margin: 16px 0; padding: 14px 18px;
  border: 1px solid #fcd34d; background: #fffbeb; border-radius: 12px; }
.prem-hitl-main { flex: 1; }
.prem-hitl-title { font-size: 14px; font-weight: 800; color: #b45309; }
.prem-hitl-sub { font-size: 13px; color: #78716c; margin-top: 4px; line-height: 1.4; }

/* Live-agent chat modal */
.live-chat-modal { max-width: 460px; text-align: left; }
.live-chat-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.live-chat-ico { font-size: 26px; }
.live-chat-title { font-size: 16px; font-weight: 800; color: #0f172a; }
.live-chat-sub { font-size: 12px; color: #94a3b8; }
.live-chat-body { display: flex; flex-direction: column; gap: 8px; max-height: 300px;
  overflow-y: auto; padding: 8px; background: #f8fafc; border-radius: 10px; margin-bottom: 10px; }
.live-chat-msg { padding: 9px 12px; border-radius: 12px; font-size: 13px; line-height: 1.4;
  max-width: 85%; }
.live-chat-msg.agent { background: #fff; border: 1px solid #e5e9f0; align-self: flex-start; }
.live-chat-msg.user { background: #2563eb; color: #fff; align-self: flex-end; }
.live-chat-input { display: flex; gap: 8px; }
.live-chat-input input { flex: 1; padding: 10px 12px; font-size: 14px; font-family: inherit;
  border: 1px solid #e5e9f0; border-radius: 10px; }

/* ── Compliance agent UI additions ─────────────────────────────────────── */
.agent-kpi-val.good  { color: #047857; }
.agent-kpi-val.bad   { color: #b91c1c; }
.agent-kpi-val.warn  { color: #b45309; }
.agent-kpi-val.neutral { color: #374151; }
.finding.warn        { background: #fffbeb; border-left: 3px solid #f59e0b; }
.finding.good        { background: #f0fdf4; border-left: 3px solid #22c55e; }
.finding-detail.muted { color: #6b7280; font-size: 0.82rem; margin-left: 4px; }

/* ============================================================ COPILOT PANEL */
.copilot-empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:48px 24px;text-align:center}
.copilot-empty-ico{font-size:28px;font-weight:800;color:#4f46e5}
.copilot-empty-title{font-size:16px;font-weight:800;color:var(--text,#0f172a)}
.copilot-empty-sub{font-size:13px;color:var(--muted,#64748b);max-width:340px;line-height:1.5}
.copilot-panel{display:flex;flex-direction:column;gap:16px}
.copilot-header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;background:linear-gradient(135deg,#4f46e5 0%,#7c3aed 100%);border-radius:10px;color:#fff;flex-wrap:wrap}
.copilot-header-left{display:flex;align-items:center;gap:12px}
.copilot-ico{font-size:18px;font-weight:900;background:rgba(255,255,255,.2);border-radius:6px;padding:4px 8px}
.copilot-title{font-size:16px;font-weight:800}
.copilot-sub{font-size:12px;opacity:.85;margin-top:2px}
.copilot-header-right{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.copilot-hitl-badge{background:rgba(255,255,255,.2);border:1px solid rgba(255,255,255,.4);border-radius:20px;padding:4px 12px;font-size:12px;font-weight:700}
.copilot-error{background:#fef2f2;border:1px solid #fecaca;border-radius:8px;padding:10px 14px;color:#b91c1c;font-size:13px}
.copilot-loading{display:flex;align-items:center;gap:8px;padding:20px;color:var(--muted,#64748b);font-size:13px}
.copilot-kpis{display:flex;gap:0;border:1px solid var(--border,#e2e8f0);border-radius:10px;overflow:hidden}
.copilot-kpi{flex:1;padding:12px 16px;border-right:1px solid var(--border,#e2e8f0);text-align:center}
.copilot-kpi:last-child{border-right:none}
.copilot-kpi-val{font-size:15px;font-weight:800;margin-bottom:4px}
.copilot-kpi-val.good{color:#047857}.copilot-kpi-val.bad{color:#b91c1c}.copilot-kpi-val.warn{color:#b45309}
.copilot-kpi-lab{font-size:11px;color:var(--muted,#64748b);text-transform:uppercase;letter-spacing:.04em}
.copilot-tabs{display:flex;gap:0;border-bottom:2px solid var(--border,#e2e8f0)}
.copilot-tab{background:none;border:none;border-bottom:2px solid transparent;margin-bottom:-2px;padding:8px 16px;font-size:13px;font-weight:600;color:var(--muted,#64748b);cursor:pointer}
.copilot-tab:hover{color:var(--text,#0f172a)}
.copilot-tab.active{color:var(--primary,#4f46e5);border-bottom-color:var(--primary,#4f46e5)}
.copilot-body{display:flex;flex-direction:column;gap:16px;padding:4px 0}
.copilot-section{display:flex;flex-direction:column;gap:8px}
.copilot-section-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--muted,#64748b)}
.copilot-prose{font-size:13.5px;color:#334155;line-height:1.65;background:#f8fafc;border-radius:8px;padding:12px 14px}
.copilot-chips{display:flex;flex-wrap:wrap;gap:6px}
.copilot-chip{background:#e0e7ff;color:#3730a3;border-radius:20px;padding:3px 10px;font-size:12px;font-weight:600}
.copilot-chip.warn{background:#fef3c7;color:#b45309}
.copilot-rec{border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:10px 14px}
.copilot-rec.good{border-color:#6ee7b7;background:#f0fdf4}.copilot-rec.bad{border-color:#fecaca;background:#fef2f2}.copilot-rec.warn{border-color:#fde68a;background:#fffbeb}
.copilot-rec-action{font-size:14px;font-weight:800}
.copilot-rec.good .copilot-rec-action{color:#047857}.copilot-rec.bad .copilot-rec-action{color:#b91c1c}.copilot-rec.warn .copilot-rec-action{color:#b45309}
.copilot-rec-rat{font-size:12.5px;color:#475569;margin-top:4px;line-height:1.5}
.copilot-draft-note{font-size:13px;color:#334155;background:#f8fafc;border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:12px 14px;line-height:1.6;white-space:pre-wrap}
.copilot-decision-section{background:#fffbeb;border:1px solid #fde68a;border-radius:10px;padding:14px}
.copilot-decision-note{font-size:13px;color:#374151;margin:0 0 12px}
.copilot-decision-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:10px}
.copilot-dec-btn{border:1px solid var(--border,#e2e8f0);background:#fff;border-radius:6px;padding:6px 14px;font-size:13px;font-weight:600;cursor:pointer}
.copilot-dec-btn:hover{border-color:#94a3b8}
.copilot-dec-btn.active.good{border-color:#16a34a;background:#dcfce7;color:#15803d}
.copilot-dec-btn.active.bad{border-color:#dc2626;background:#fee2e2;color:#b91c1c}
.copilot-dec-btn.active.warn{border-color:#f59e0b;background:#fef3c7;color:#b45309}
.copilot-dec-note{width:100%;border:1px solid var(--border,#e2e8f0);border-radius:6px;padding:8px 10px;font-size:13px;resize:vertical;margin-bottom:8px;box-sizing:border-box}
.copilot-dec-msg{border-radius:6px;padding:8px 12px;font-size:13px;font-weight:600;margin-top:8px}
.copilot-dec-msg.good{background:#dcfce7;color:#15803d}.copilot-dec-msg.bad{background:#fee2e2;color:#b91c1c}
.copilot-qa{padding:0 !important;gap:0 !important}
.copilot-qa-messages{flex:1;min-height:180px;max-height:320px;overflow-y:auto;display:flex;flex-direction:column;gap:10px;padding:14px}
.copilot-qa-hint{display:flex;flex-direction:column;align-items:center;gap:8px;padding:20px;text-align:center;color:var(--muted,#64748b);font-size:13px}
.copilot-qa-suggestions{display:flex;flex-wrap:wrap;gap:8px;justify-content:center;margin-top:6px}
.copilot-qa-sug{background:#f1f5f9;border:1px solid var(--border,#e2e8f0);border-radius:20px;padding:5px 12px;font-size:12px;cursor:pointer}
.copilot-qa-sug:hover{background:#eef2ff;border-color:#c7d2fe}
.copilot-qa-msg{display:flex;flex-direction:column;gap:3px;max-width:88%}
.copilot-qa-msg.user{align-self:flex-end}.copilot-qa-msg.assistant,.copilot-qa-msg.error{align-self:flex-start}
.copilot-qa-who{font-size:11px;font-weight:700;color:var(--muted,#64748b)}
.copilot-qa-msg.user .copilot-qa-who{text-align:right}
.copilot-qa-text{font-size:13px;line-height:1.55;padding:8px 12px;border-radius:10px}
.copilot-qa-msg.user .copilot-qa-text{background:#4f46e5;color:#fff;border-radius:10px 10px 2px 10px}
.copilot-qa-msg.assistant .copilot-qa-text{background:#f1f5f9;color:#1e293b;border-radius:10px 10px 10px 2px}
.copilot-qa-msg.error .copilot-qa-text{background:#fef2f2;color:#b91c1c}
.copilot-qa-input-row{display:flex;gap:8px;padding:10px 14px;border-top:1px solid var(--border,#e2e8f0)}
.copilot-qa-input{flex:1;border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:8px 10px;font-size:13px;resize:none}
.copilot-finding{border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:10px 14px}
.copilot-finding.bad{border-color:#fecaca;background:#fef2f2}.copilot-finding.warn{border-color:#fde68a;background:#fffbeb}
.copilot-finding-head{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.copilot-finding-type{font-weight:700;font-size:13px}
.copilot-finding-sev{background:#fecaca;color:#b91c1c;border-radius:4px;padding:1px 6px;font-size:11px;font-weight:700}
.copilot-finding.warn .copilot-finding-sev{background:#fef3c7;color:#b45309}
.copilot-finding-desc{font-size:13px;color:#374151;line-height:1.5}
.copilot-knowledge{border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:10px 14px}
.copilot-knowledge-title{font-weight:700;font-size:13px;color:#1d4ed8;margin-bottom:4px}
.copilot-knowledge-text{font-size:13px;color:#334155;line-height:1.55}
.copilot-similar{border:1px solid var(--border,#e2e8f0);border-radius:8px;padding:10px 14px}
.copilot-similar-head{display:flex;align-items:center;gap:10px;margin-bottom:6px;flex-wrap:wrap}
.copilot-similar-id{font-weight:700;font-size:13px}
.copilot-similar-dec{color:#fff;border-radius:4px;padding:2px 8px;font-size:11px;font-weight:700}
.copilot-similar-dec.good{background:#16a34a}.copilot-similar-dec.bad{background:#dc2626}.copilot-similar-dec.warn{background:#f59e0b}
.copilot-similar-score{font-size:11px;color:var(--muted,#64748b);margin-left:auto}
.copilot-similar-body{display:flex;flex-wrap:wrap;gap:14px;font-size:12.5px;color:#475569}
.copilot-similar-body b{color:var(--text,#0f172a)}
.copilot-empty-tab{color:var(--muted,#64748b);font-size:13px;padding:20px 0;text-align:center}
.pl-step.hitl .pl-marker{background:#f59e0b;color:#fff}
.pl-step.hitl .pl-name{color:#b45309}

/* ============================================================
   RISK ASSESSMENT — Evidence & Citations UI
   ============================================================ */

/* Sub-tabs (Summary / Findings / Evidence / Actions) */
.risk-tabs {
  display: flex; gap: 0;
  border-bottom: 2px solid var(--border, #e2e8f0);
  margin-bottom: 4px;
}
.risk-tab {
  background: none; border: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  padding: 7px 14px; font-size: 13px; font-weight: 600;
  color: var(--muted, #64748b); cursor: pointer; font-family: inherit;
}
.risk-tab:hover { color: var(--text, #0f172a); }
.risk-tab.active { color: var(--primary, #4f46e5); border-bottom-color: var(--primary, #4f46e5); }

/* Finding cards (Findings tab) */
.risk-finding-card {
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.risk-finding-card.bad  { border-color: #fecaca; background: #fef2f2; }
.risk-finding-card.warn { border-color: #fde68a; background: #fffbeb; }
.risk-finding-card.good { border-color: #bbf7d0; background: #f0fdf4; }

.rfc-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.rfc-code { font-family: monospace; font-size: 12px; font-weight: 700;
  color: var(--primary-dark, #3730a3); background: #eef2ff;
  padding: 1px 7px; border-radius: 4px; }
.rfc-sev { font-size: 10px; font-weight: 800; padding: 2px 7px;
  border-radius: 999px; color: #fff; }
.rfc-sev-critical, .rfc-sev-high { background: #dc2626; }
.rfc-sev-medium { background: #f59e0b; }
.rfc-sev-low, .rfc-sev-info { background: #16a34a; }
.rfc-cat { font-size: 11px; font-weight: 700; color: #475569;
  background: #f1f5f9; padding: 1px 7px; border-radius: 4px; }
.rfc-desc { font-size: 13px; color: #334155; line-height: 1.5; }

/* Citation chips on findings */
.rfc-refs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.rfc-ref-chip {
  font-size: 11px; font-weight: 600; padding: 2px 9px; border-radius: 999px;
  background: #eef2ff; color: #3730a3; border: 1px solid #c7d2fe;
  cursor: default; white-space: nowrap;
}
.rfc-ref-chip.muted { background: #f1f5f9; color: #94a3b8; border-color: #e2e8f0; }

/* Provenance badges */
.rfc-prov {
  font-size: 10px; font-weight: 700; padding: 1px 7px; border-radius: 999px;
  text-transform: capitalize;
}
.evd-ext     { background: #dcfce7; color: #15803d; }
.evd-doc     { background: #dbeafe; color: #1d4ed8; }
.evd-cust    { background: #fef3c7; color: #b45309; }
.evd-model   { background: #f3e8ff; color: #7e22ce; }
.evd-conflict{ background: #fee2e2; color: #b91c1c; }
.evd-derived { background: #e0f2fe; color: #0369a1; }
.evd-unknown { background: #f1f5f9; color: #64748b; }

/* Evidence table (Evidence tab) */
.evd-table-wrap {
  overflow-x: auto; border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
}
.evd-table {
  width: 100%; border-collapse: collapse; font-size: 12.5px;
}
.evd-table thead th {
  text-align: left; padding: 9px 12px; background: #f8fafc;
  font-size: 11px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: #64748b;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.evd-table tbody tr:hover { background: #f8fafc; }
.evd-table tbody td {
  padding: 8px 12px; border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}
.evd-table tbody tr:last-child td { border-bottom: none; }
.evd-ref-id {
  font-family: monospace; font-size: 12px; font-weight: 700;
  color: var(--primary-dark, #3730a3); background: #eef2ff;
  padding: 1px 7px; border-radius: 4px; white-space: nowrap;
}
.evd-source {
  font-size: 11px; font-weight: 700; background: #f1f5f9;
  color: #334155; padding: 2px 8px; border-radius: 4px; white-space: nowrap;
}
.evd-field  { font-weight: 600; color: #1e293b; }
.evd-value  { color: #475569; max-width: 180px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evd-prov-badge {
  font-size: 10px; font-weight: 700; padding: 2px 8px;
  border-radius: 999px; white-space: nowrap;
}
.evd-ts { color: #94a3b8; font-size: 11px; white-space: nowrap; }

/* Recommended action cards (Actions tab) */
.risk-action-card {
  border: 1px solid var(--border, #e2e8f0); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.risk-action-card.urgent { border-color: #fecaca; background: #fef2f2; }
.rac-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rac-action { font-weight: 700; font-size: 14px; color: #1e293b;
  text-transform: capitalize; }
.rac-urgent { font-size: 10px; font-weight: 800; padding: 2px 8px;
  border-radius: 999px; background: #dc2626; color: #fff; }
.rac-meta { display: flex; flex-wrap: wrap; gap: 14px;
  font-size: 12px; color: #64748b; }
.rac-meta b { color: #1e293b; }


/* Re-run premium action on the customer premium step. */
.prem-rerun { display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--mg-line, #e5e9f0); }
.prem-rerun .btn.ghost { white-space: nowrap; }
.prem-rerun-note { font-size: 12.5px; color: var(--mg-mut, #64748b); }
