/* ===============================================================
   Compare view + Client Approval view
   =============================================================== */

/* ---------- Picker chips above the comparison grid ---------- */
.cmp-picker {
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  padding: 16px 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow-xs);
}
.cmp-picker-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--text-tertiary);
  margin-bottom: 10px;
}
.cmp-picker-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.cmp-pick {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  background: var(--surface-panel);
  font-size: 13px; font-weight: 500; color: var(--text-primary);
  cursor: pointer;
  transition: all var(--dur-fast) var(--ease-out);
}
.cmp-pick:hover:not(:disabled) { border-color: var(--sol-primary-300); background: var(--sol-primary-50); }
.cmp-pick.active {
  border-color: var(--sol-primary-500);
  background: var(--sol-primary-50);
  box-shadow: 0 0 0 1px var(--sol-primary-500) inset;
}
[data-theme="dark"] .cmp-pick.active { background: rgba(0,116,241,0.12); }
.cmp-pick.dim { opacity: 0.45; cursor: not-allowed; }
.cmp-pick-idx {
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  color: var(--text-tertiary);
}
.cmp-pick.active .cmp-pick-idx { color: var(--sol-primary-700); }
.cmp-pick-name { font-weight: 600; }
.cmp-pick-check {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--surface-subtle); color: var(--text-tertiary);
}
.cmp-pick.active .cmp-pick-check { background: var(--sol-primary-500); color: #fff; }
.cmp-picker-tools {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; margin-top: 12px;
  padding-top: 12px; border-top: 1px dashed var(--border-subtle);
}
.cmp-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-secondary); cursor: pointer;
}
.cmp-toggle input[type="checkbox"] { accent-color: var(--sol-primary-500); }
.cmp-counter { font-size: 12px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* ---------- Comparison grid ---------- */
.cmp-table {
  display: grid;
  background: var(--surface-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.cmp-row {
  display: grid;
  grid-template-columns: subgrid;
  grid-column: 1 / -1;
  border-bottom: 1px solid var(--border-subtle);
  min-height: 48px;
  align-items: center;
}
.cmp-row:last-child { border-bottom: 0; }
.cmp-row-label {
  padding: 14px 20px;
  font-size: 13px;
  color: var(--text-secondary);
  background: var(--surface-subtle);
  border-inline-end: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 2px;
  align-self: stretch; justify-content: center;
}
.cmp-row-hint { font-size: 11px; color: var(--text-tertiary); }

.cmp-row-section .cmp-row-label {
  background: var(--sol-primary-900);
  color: #fff;
  font-weight: 600; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.08em;
}
[data-theme="dark"] .cmp-row-section .cmp-row-label { background: var(--sol-primary-700); }
.cmp-row-section .cmp-cell-section {
  background: var(--sol-primary-900);
  align-self: stretch;
}
[data-theme="dark"] .cmp-row-section .cmp-cell-section { background: var(--sol-primary-700); }

.cmp-row-diff .cmp-row-label { color: var(--sol-primary-700); font-weight: 600; }
[data-theme="dark"] .cmp-row-diff .cmp-row-label { color: var(--sol-primary-300); }
.cmp-row-diff { background: rgba(0,116,241,0.025); }

.cmp-cell {
  position: relative;
  padding: 14px 18px;
  font-size: 14px;
  color: var(--text-primary);
  border-inline-end: 1px solid var(--border-subtle);
  align-self: stretch;
  display: flex; align-items: center; gap: 8px;
  font-variant-numeric: tabular-nums;
}
.cmp-cell:last-child { border-inline-end: 0; }

.cmp-cell-emph { font-size: 16px; font-weight: 600; color: var(--sol-primary-700); }
[data-theme="dark"] .cmp-cell-emph { color: var(--sol-primary-300); }

.cmp-cell-best {
  background: var(--sol-success-soft);
}
.cmp-best-mark {
  position: absolute;
  top: 6px; inset-inline-end: 6px;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--sol-success);
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
}

/* Column heads */
.cmp-row-head { min-height: auto; }
.cmp-row-head .cmp-row-label { background: transparent; border-inline-end-color: transparent; }
.cmp-col-head {
  position: relative;
  padding: 18px 18px 14px;
  border-inline-end: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  display: flex; flex-direction: column; gap: 6px;
  background: var(--surface-panel);
}
.cmp-col-head:last-child { border-inline-end: 0; }
.cmp-col-approved { background: linear-gradient(180deg, var(--sol-success-soft) 0%, var(--surface-panel) 70%); }
.cmp-col-shared { background: linear-gradient(180deg, var(--sol-warning-soft) 0%, var(--surface-panel) 70%); }
.cmp-col-declined { background: linear-gradient(180deg, var(--sol-error-soft) 0%, var(--surface-panel) 70%); }

.cmp-col-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-col-title { font-size: 16px; font-weight: 600; color: var(--text-primary); margin-top: 4px; }
.cmp-col-quote { font-size: 12px; color: var(--text-tertiary); }
.cmp-col-premium {
  margin-top: 8px;
  display: flex; align-items: baseline; gap: 6px;
  padding-top: 8px; border-top: 1px dashed var(--border-subtle);
}
.cmp-col-premium-value {
  font-size: 22px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--sol-primary-700);
  font-variant-numeric: tabular-nums;
}
[data-theme="dark"] .cmp-col-premium-value { color: var(--sol-primary-300); }
.cmp-col-premium-sub { font-size: 12px; color: var(--text-tertiary); }
.cmp-col-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.cmp-col-tag {
  font-size: 10.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  padding: 3px 8px; border-radius: var(--r-full);
}
.tag-success { background: var(--sol-success-soft); color: var(--sol-success); }
.tag-info    { background: var(--sol-info-soft);    color: var(--sol-info); }
.cmp-col-actions { position: absolute; top: 12px; inset-inline-end: 12px; display: flex; gap: 4px; }

.cmp-row-actions { background: var(--surface-subtle); }
.cmp-row-actions .cmp-row-label { background: var(--surface-muted); font-weight: 600; color: var(--text-primary); }
.cmp-cell-action { padding: 14px 14px; }
.cmp-cell-action > * { width: 100%; }

/* Responsive: stack into rows under 900px */
@media (max-width: 900px) {
  .cmp-table { display: flex; flex-direction: column; }
  .cmp-row { display: flex; flex-wrap: wrap; }
  .cmp-row-label { width: 100%; border-inline-end: 0; border-bottom: 1px dashed var(--border-subtle); }
  .cmp-cell { flex: 1 1 50%; border-bottom: 1px solid var(--border-subtle); }
  .cmp-col-head { flex: 1 1 100%; }
}

/* ===============================================================
   Client Approval view
   =============================================================== */
.client-preview-screen { max-width: 1100px; }

.cp-frame {
  border-radius: var(--r-2xl);
  overflow: hidden;
  border: 1px solid var(--border-default);
  box-shadow: var(--shadow-xl);
  background: #f3f5fa;
}
[data-theme="dark"] .cp-frame { background: #0a0d17; }

.cp-chrome {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 14px;
  background: linear-gradient(180deg, #e7eaf1 0%, #d8dde7 100%);
  border-bottom: 1px solid var(--border-default);
}
[data-theme="dark"] .cp-chrome { background: linear-gradient(180deg, #1f2533 0%, #121624 100%); }
.cp-chrome-dots { display: flex; gap: 6px; }
.cp-chrome-dots span {
  width: 11px; height: 11px; border-radius: 50%;
  background: #c5c9d2;
}
.cp-chrome-dots span:nth-child(1) { background: #ff5f57; }
.cp-chrome-dots span:nth-child(2) { background: #febc2e; }
.cp-chrome-dots span:nth-child(3) { background: #28c840; }
.cp-chrome-url {
  flex: 1;
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface-panel);
  border: 1px solid var(--border-default);
  border-radius: var(--r-full);
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-tertiary);
  max-width: 540px;
  margin: 0 auto;
}
.cp-chrome-url-token { color: var(--sol-primary-700); font-weight: 600; }
[data-theme="dark"] .cp-chrome-url-token { color: var(--sol-primary-300); }

.cp-page {
  background: #ffffff;
  color: #1F2533;
  padding: 40px 56px 32px;
}
[data-theme="dark"] .cp-page { background: #fcfcfd; }

.cp-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px;
  padding-bottom: 24px; border-bottom: 1px solid #E4E7EE;
  margin-bottom: 28px;
}
.cp-brand { display: flex; align-items: center; gap: 14px; }
.cp-brand-name { font-size: 17px; font-weight: 700; color: #041C50; }
.cp-brand-sub  { font-size: 12px; color: #6B7385; margin-top: 2px; }
.cp-greeting { text-align: end; }
.cp-greeting-eyebrow { font-size: 12px; color: #6B7385; }
.cp-greeting-name { font-size: 18px; font-weight: 600; color: #1F2533; }

.cp-intro { margin-bottom: 32px; }
.cp-intro-title {
  font-size: 30px; font-weight: 600;
  letter-spacing: -0.02em; line-height: 1.25;
  color: #041C50;
  margin: 0 0 12px;
  max-width: 720px;
  text-wrap: pretty;
}
.cp-intro-body {
  font-size: 16px; line-height: 1.6; color: #4A5264;
  max-width: 680px;
  margin: 0 0 18px;
}
.cp-intro-body em { color: var(--sol-success); font-style: normal; font-weight: 500; }
.cp-intro-meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  padding: 14px 18px;
  background: #F8F9FB;
  border: 1px solid #E4E7EE;
  border-radius: var(--r-md);
}
.cp-intro-meta-item { display: flex; flex-direction: column; gap: 2px; }
.cp-intro-meta-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em; color: #6B7385; font-weight: 600; }
.cp-intro-meta-value { font-size: 13px; color: #1F2533; font-weight: 500; }
.cp-intro-meta-value.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* Tabs (one per option) */
.cp-tabs {
  display: flex; gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.cp-tab {
  flex: 1 1 200px;
  position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 4px;
  padding: 16px 18px;
  border: 1px solid #E4E7EE;
  border-radius: var(--r-lg);
  background: #fff;
  cursor: pointer;
  text-align: start;
  transition: all var(--dur-fast) var(--ease-out);
}
.cp-tab:hover { border-color: #99C7FA; }
.cp-tab.active {
  border-color: #0074F1;
  box-shadow: 0 0 0 3px rgba(0,116,241,0.14);
}
.cp-tab-label { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: #6B7385; }
.cp-tab.active .cp-tab-label { color: #0074F1; }
.cp-tab-name { font-size: 15px; font-weight: 600; color: #1F2533; }
.cp-tab-price { font-size: 18px; font-weight: 700; color: #041C50; font-variant-numeric: tabular-nums; }
.cp-tab-cad { font-size: 11px; font-weight: 500; color: #6B7385; }
.cp-tab-mark {
  position: absolute; top: 12px; inset-inline-end: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  color: #fff;
}
.cp-tab-mark-ok { background: var(--sol-success); }
.cp-tab-mark-no { background: var(--sol-error); }
.cp-tab-approved.active { border-color: var(--sol-success); box-shadow: 0 0 0 3px rgba(22,163,74,0.18); }
.cp-tab-declined.active { border-color: var(--sol-error); box-shadow: 0 0 0 3px rgba(194,65,12,0.16); }

/* Active option */
.cp-option {
  background: #fff;
  border: 1px solid #E4E7EE;
  border-radius: var(--r-xl);
  padding: 28px 32px;
  margin-bottom: 24px;
}
.cp-option-approved { border-color: var(--sol-success); box-shadow: 0 0 0 3px rgba(22,163,74,0.10); }
.cp-option-declined { border-color: #CDD2DC; opacity: 0.85; }

.cp-option-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 24px; flex-wrap: wrap;
  padding-bottom: 20px; border-bottom: 1px solid #F1F3F7;
  margin-bottom: 22px;
}
.cp-option-eyebrow { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: #0074F1; }
.cp-option-title { font-size: 24px; font-weight: 600; color: #1F2533; margin: 4px 0 8px; }
.cp-option-blurb { font-size: 15px; line-height: 1.55; color: #4A5264; max-width: 540px; margin: 0; text-wrap: pretty; }
.cp-option-price { text-align: end; }
.cp-option-price-cad { font-size: 12px; color: #6B7385; }
.cp-option-price-value {
  font-size: 36px; font-weight: 700;
  color: #041C50; letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.cp-option-price-sub { font-size: 13px; color: #6B7385; }

.cp-option-grid {
  display: grid; grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: #F1F3F7;
  border-radius: var(--r-md);
  overflow: hidden;
  border: 1px solid #F1F3F7;
}
.cp-fact {
  background: #fff;
  padding: 18px 20px;
  display: flex; flex-direction: column; gap: 6px;
}
.cp-fact-label { font-size: 12px; color: #6B7385; font-weight: 500; }
.cp-fact-value { font-size: 22px; font-weight: 600; color: #041C50; font-variant-numeric: tabular-nums; }
.cp-fact-sub { font-size: 12px; color: #6B7385; line-height: 1.45; }

.cp-riders { margin-top: 22px; }
.cp-riders-label,
.cp-funds-label,
.cp-projection-label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; color: #6B7385; margin-bottom: 8px; }
.cp-riders-list { display: flex; flex-wrap: wrap; gap: 8px; }
.cp-rider-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px;
  background: #E8F9EE; color: #16A34A;
  border-radius: var(--r-full);
  font-size: 13px; font-weight: 500;
}

/* Phase 10 — client surface: detailed rider cards (replaces the simple
   chip row when riders carry descriptions / per-rider SI). */
.cp-rider-cards { display: flex; flex-direction: column; gap: 8px; }
.cp-rider-card {
  border: 1px solid #E5E9F0;
  background: #F9FAFC;
  border-radius: 10px;
  padding: 10px 14px;
}
.cp-rider-card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.cp-rider-card-name { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #16A34A; font-size: 13.5px; }
.cp-rider-card-si { font-weight: 600; color: #1F2533; font-family: var(--font-mono); font-size: 13px; }
.cp-rider-card-desc { margin: 4px 0 0; font-size: 12.5px; color: #4A5264; line-height: 1.5; }

/* Phase 10 — client surface: fund allocation rows (Unit-Linked only). */
.cp-funds { margin-top: 22px; }
.cp-fund-rows { display: flex; flex-direction: column; gap: 8px; }
.cp-fund-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) 1fr 56px;
  align-items: center;
  gap: 14px;
  padding: 8px 14px;
  border: 1px solid #E5E9F0;
  background: #F9FAFC;
  border-radius: 10px;
}
.cp-fund-row-main { min-width: 0; }
.cp-fund-row-name { font-weight: 600; color: #1F2533; font-size: 13.5px; }
.cp-fund-row-meta { font-size: 12px; color: #6B7385; display: flex; gap: 6px; flex-wrap: wrap; }
.cp-fund-row-bar { height: 6px; border-radius: 999px; background: #E5E9F0; overflow: hidden; }
.cp-fund-row-bar-fill { height: 100%; background: linear-gradient(90deg, #0074F1, #041C50); }
.cp-fund-row-pct { font-weight: 700; font-family: var(--font-mono); color: #0074F1; text-align: end; }

/* Phase 10 — client surface: dual growth-rate projection accordions. */
.cp-projection { margin-top: 22px; }
.cp-projection-sub { font-size: 12.5px; color: #6B7385; margin: 0 0 10px; line-height: 1.5; }
.cp-proj-accordion {
  border: 1px solid #E5E9F0;
  background: #F9FAFC;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 8px;
}
.cp-proj-accordion.open { border-color: #0074F1; background: #fff; }
.cp-proj-head {
  width: 100%;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: start;
  color: #1F2533;
}
.cp-proj-head:hover { background: #F1F3F7; }
.cp-proj-tag {
  display: inline-grid; place-items: center;
  width: 26px; height: 26px;
  border-radius: 6px;
  background: #0074F1;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
}
.cp-proj-title { font-weight: 600; font-size: 13.5px; }
.cp-proj-sub { font-size: 12px; color: #6B7385; }
.cp-proj-chev { color: #6B7385; display: inline-flex; }
.cp-proj-body { padding: 0 14px 14px; }
.cp-proj-table-wrap { max-height: 340px; overflow-y: auto; border: 1px solid #E5E9F0; border-radius: 8px; }
@media (max-width: 640px) {
  .cp-proj-head { grid-template-columns: auto 1fr auto; }
  .cp-proj-sub { display: none; }
}

.cp-finer {
  margin-top: 22px;
  border-top: 1px solid #F1F3F7;
  padding-top: 16px;
}
.cp-finer summary {
  cursor: pointer;
  font-size: 13px; font-weight: 500; color: #6B7385;
  list-style: none;
  display: inline-flex; align-items: center; gap: 6px;
}
.cp-finer summary::-webkit-details-marker { display: none; }
.cp-finer-arrow { transition: transform var(--dur-fast); display: inline-block; }
.cp-finer[open] .cp-finer-arrow { transform: rotate(90deg); }
.cp-finer ul { margin: 12px 0 0; padding-inline-start: 18px; }
.cp-finer li { font-size: 12.5px; color: #6B7385; line-height: 1.6; margin-bottom: 4px; }

/* Decision actions */
.cp-decision {
  margin-top: 24px;
  padding: 24px 28px;
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, #F8F9FB 0%, #fff 100%);
  border: 1px solid #E4E7EE;
  display: flex; flex-direction: column; gap: 14px;
}
.cp-decision-prompt { font-size: 18px; font-weight: 600; color: #041C50; text-align: center; }
.cp-decision-actions {
  display: flex; gap: 12px; justify-content: center;
}
.cp-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 28px;
  border-radius: var(--r-md);
  font-size: 15px; font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  min-width: 200px;
  transition: all var(--dur-fast) var(--ease-out);
}
.cp-btn-approve {
  background: #0074F1; color: #fff;
  box-shadow: 0 4px 12px -2px rgba(0,116,241,0.4);
}
.cp-btn-approve:hover { background: #005DC1; transform: translateY(-1px); box-shadow: 0 6px 18px -4px rgba(0,116,241,0.5); }
.cp-btn-decline {
  background: #fff; color: #4A5264; border-color: #CDD2DC;
}
.cp-btn-decline:hover { background: #F8F9FB; border-color: #9AA1B1; }
.cp-decision-note {
  font-size: 12px; color: #6B7385; text-align: center;
  max-width: 480px; margin: 0 auto;
  line-height: 1.5;
}

.cp-decision-approved, .cp-decision-declined {
  flex-direction: row; align-items: center; gap: 16px;
  text-align: start;
}
.cp-decision-approved {
  background: var(--sol-success-soft);
  border-color: var(--sol-success);
}
.cp-decision-approved .cp-decision-icon { color: var(--sol-success); }
.cp-decision-declined {
  background: #F8F9FB;
  border-color: #CDD2DC;
}
.cp-decision-declined .cp-decision-icon { color: #9AA1B1; }
.cp-decision-icon {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.cp-decision-title { font-size: 15px; font-weight: 600; color: #1F2533; }
.cp-decision-approved .cp-decision-title { color: #16A34A; }

.cp-footer {
  margin-top: 32px; padding-top: 18px;
  border-top: 1px solid #F1F3F7;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
  font-size: 11px; color: #9AA1B1;
}
.cp-footer-links { display: flex; gap: 8px; align-items: center; }

@media (max-width: 800px) {
  .cp-page { padding: 28px 24px 24px; }
  .cp-option-grid { grid-template-columns: 1fr; }
  .cp-option-head { flex-direction: column; }
  .cp-option-price { text-align: start; }
  .cp-decision-actions { flex-direction: column; }
  .cp-btn { width: 100%; }
}
