.customer-identity-workspace {
  --customer-risk-green: #176858;
  --customer-risk-green-dark: #114c41;
  --customer-risk-green-soft: #eaf5f1;
  --customer-risk-ink: #17243a;
  --customer-risk-muted: #64748b;
  --customer-risk-line: #dce5ec;
  --customer-risk-surface: #f7fafc;
  --customer-risk-amber: #c56a08;
  --customer-risk-red: #c63434;
  padding: 0;
  overflow: hidden;
}

.identity-customer-risk-mode .identity-permission-topbar,
.identity-customer-risk-mode .workspace-tabs,
.identity-customer-risk-mode .identity-ops-workbench-shell > .crm-ops-workbench-header,
.identity-customer-risk-mode .identity-ops-workbench-shell > .crm-ops-subnav {
  display: none;
}

.identity-customer-risk-mode .identity-permission-root,
.identity-customer-risk-mode .identity-ops-workbench-body {
  padding-top: 0;
}

.identity-customer-risk-mode .identity-ops-workbench-shell {
  border-top: 0;
  margin-top: 0;
}

.customer-account-subnav {
  align-items: center;
  background: #fff;
  border-bottom: 1px solid var(--customer-risk-line);
  display: flex;
  gap: 4px;
  min-height: 54px;
  overflow-x: auto;
  padding: 0 18px;
}

.customer-account-subnav button {
  background: transparent;
  border: 0;
  border-bottom: 3px solid transparent;
  color: #526277;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  min-height: 54px;
  padding: 0 17px;
  white-space: nowrap;
}

.customer-account-subnav button:hover,
.customer-account-subnav button.is-active {
  border-bottom-color: var(--customer-risk-green);
  color: var(--customer-risk-green-dark);
}

.customer-account-subnav button:focus-visible,
.customer-risk-review button:focus-visible,
.customer-risk-review input:focus-visible,
.customer-risk-review select:focus-visible,
.customer-risk-review textarea:focus-visible {
  outline: 3px solid rgba(23, 104, 88, 0.24);
  outline-offset: 2px;
}

.customer-account-directory,
.customer-account-placeholder,
.customer-risk-review {
  color: var(--customer-risk-ink);
  padding: 22px;
}

.customer-account-section-header,
.customer-risk-page-header {
  align-items: flex-start;
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
}

.customer-risk-page-header h2 {
  align-items: baseline;
  display: flex;
  flex-wrap: wrap;
  font-size: 28px;
  gap: 16px;
  margin: 4px 0 8px;
}

.customer-risk-page-header h2 small {
  color: var(--customer-risk-muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-risk-summary {
  align-items: center;
  color: #536176;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  gap: 12px;
}

.customer-risk-preview-badge {
  background: #fff7df;
  border: 1px solid #e9ca72;
  color: #7a5410;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  margin: 2px 0 10px;
  padding: 5px 8px;
}

.customer-risk-summary strong {
  color: var(--customer-risk-ink);
  font-size: 18px;
  margin-left: 4px;
}

.customer-risk-summary i {
  background: #cbd5e1;
  display: block;
  height: 14px;
  width: 1px;
}

.customer-risk-filters {
  align-items: end;
  background: var(--customer-risk-surface);
  border: 1px solid var(--customer-risk-line);
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(210px, 1.7fr) repeat(3, minmax(130px, .8fr)) auto auto auto;
  padding: 12px;
}

.customer-risk-filters label {
  color: #475569;
  display: grid;
  font-size: 11px;
  font-weight: 800;
  gap: 5px;
}

.customer-risk-filters input,
.customer-risk-filters select,
.customer-risk-decision select,
.customer-risk-decision textarea {
  background: #fff;
  border: 1px solid #cfd9e2;
  border-radius: 5px;
  color: var(--customer-risk-ink);
  font: inherit;
  min-height: 38px;
  padding: 8px 10px;
}

.customer-risk-pending {
  align-items: center;
  display: flex !important;
  gap: 7px !important;
  min-height: 38px;
  white-space: nowrap;
}

.customer-risk-pending input {
  accent-color: var(--customer-risk-green);
  min-height: auto;
}

.customer-risk-table-wrap {
  border: 1px solid var(--customer-risk-line);
  border-top: 0;
  max-height: 760px;
  overflow: auto;
}

.customer-risk-table {
  border-collapse: collapse;
  min-width: 980px;
  table-layout: fixed;
  width: 100%;
}

.customer-risk-table th {
  background: #f1f5f8;
  color: #3e4b5d;
  font-size: 12px;
  font-weight: 850;
  padding: 10px 8px;
  position: sticky;
  text-align: left;
  top: 0;
  z-index: 2;
}

.customer-risk-table th:first-child { width: 40px; }
.customer-risk-table th:nth-child(2) { width: 180px; }
.customer-risk-table th:nth-child(3) { width: 130px; }
.customer-risk-table th:nth-child(n+4):nth-child(-n+7) { width: 82px; }
.customer-risk-table th:nth-child(8) { width: 95px; }
.customer-risk-table th:nth-child(9) { width: 85px; }
.customer-risk-table th:last-child { width: 64px; }

.customer-risk-row td {
  background: #fff;
  border-top: 1px solid var(--customer-risk-line);
  color: #344256;
  font-size: 12px;
  padding: 10px 8px;
  vertical-align: middle;
}

.customer-risk-row:hover td,
.customer-risk-row.is-expanded td {
  background: #fbfdfc;
}

.customer-risk-row strong { color: var(--customer-risk-ink); }
.customer-risk-row td > small {
  color: var(--customer-risk-muted);
  display: block;
  line-height: 1.5;
  margin-top: 3px;
}

.customer-risk-row-toggle {
  background: #fff;
  border: 2px solid #aebdcc;
  border-radius: 50%;
  cursor: pointer;
  height: 16px;
  padding: 0;
  position: relative;
  width: 16px;
}

.customer-risk-row-toggle[aria-expanded="true"] {
  border-color: var(--customer-risk-green);
}

.customer-risk-row-toggle[aria-expanded="true"]::after {
  background: var(--customer-risk-green);
  border-radius: 50%;
  content: "";
  inset: 3px;
  position: absolute;
}

.customer-risk-score {
  align-items: center;
  display: grid;
  gap: 4px;
  justify-items: start;
}

.customer-risk-score > strong {
  border-radius: 4px;
  min-width: 34px;
  padding: 3px 6px;
  text-align: center;
}

.customer-risk-score > span {
  background: #e2e8f0;
  border-radius: 3px;
  height: 4px;
  overflow: hidden;
  position: relative;
  width: 48px;
}

.customer-risk-score > span::after {
  background: currentColor;
  content: "";
  height: 100%;
  left: 0;
  position: absolute;
  top: 0;
  width: var(--score);
}

.customer-risk-score.is-low { color: #15803d; }
.customer-risk-score.is-low > strong { background: #e9f8ef; }
.customer-risk-score.is-medium { color: var(--customer-risk-amber); }
.customer-risk-score.is-medium > strong { background: #fff3dc; }
.customer-risk-score.is-high { color: var(--customer-risk-red); }
.customer-risk-score.is-high > strong { background: #ffebeb; }
.customer-risk-score.is-missing { color: #78869a; }
.customer-risk-score.is-missing small { font-size: 10px; white-space: nowrap; }

.customer-risk-recommendation-pill,
.customer-review-status {
  border: 1px solid currentColor;
  border-radius: 4px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 7px;
  white-space: nowrap;
}

.customer-risk-recommendation-pill.is-low { color: #168044; }
.customer-risk-recommendation-pill.is-medium { color: var(--customer-risk-amber); }
.customer-risk-recommendation-pill.is-high { color: var(--customer-risk-red); }
.customer-risk-recommendation-pill.is-insufficient { color: #64748b; }
.customer-review-status.is-pending { background: #fff7e8; color: #b85f05; }
.customer-review-status.is-draft { background: #eef5ff; color: #2668a9; }
.customer-review-status.is-completed { background: #eaf7ef; color: #167445; }

.customer-risk-view-button {
  background: transparent;
  border: 0;
  color: #176bb8;
  cursor: pointer;
  font-weight: 800;
  padding: 6px;
}

.customer-risk-expanded-row > td {
  background: #fff;
  border-top: 0;
  padding: 0 8px 14px;
}

.customer-risk-expanded {
  border: 1px solid #efc0b9;
  box-shadow: 0 8px 22px rgba(30, 52, 68, 0.08);
  padding: 12px;
}

.customer-risk-recommendation {
  align-items: flex-start;
  background: #fbfdfc;
  border-bottom: 1px solid var(--customer-risk-line);
  display: grid;
  gap: 10px 20px;
  grid-template-columns: 1fr auto auto;
  margin: -12px -12px 12px;
  padding: 14px 16px;
}

.customer-risk-recommendation strong {
  color: var(--customer-risk-green-dark);
  display: block;
  font-size: 16px;
  margin-bottom: 5px;
}

.customer-risk-recommendation p,
.customer-risk-recommendation span {
  color: var(--customer-risk-muted);
  font-size: 11px;
  line-height: 1.5;
  margin: 0;
}

.customer-risk-detail-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1.6fr) minmax(290px, .9fr);
}

.customer-risk-card,
.customer-risk-decision {
  border: 1px solid var(--customer-risk-line);
  padding: 12px;
}

.customer-risk-card header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
}

.customer-risk-card h3,
.customer-risk-decision h3 {
  color: var(--customer-risk-ink);
  font-size: 15px;
  margin: 0;
}

.customer-risk-card header span,
.customer-risk-decision h3 small {
  color: var(--customer-risk-muted);
  font-size: 10px;
  font-weight: 700;
}

.customer-evidence-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
}

.customer-evidence-timeline li {
  align-items: start;
  border-left: 1px solid #cbd5e1;
  display: grid;
  gap: 10px;
  grid-template-columns: 128px minmax(0, 1fr) 118px;
  margin-left: 6px;
  padding: 0 0 14px 16px;
  position: relative;
}

.customer-evidence-timeline li::before {
  background: #fff;
  border: 2px solid #64748b;
  border-radius: 50%;
  content: "";
  height: 10px;
  left: -6px;
  position: absolute;
  top: 2px;
  width: 10px;
}

.customer-evidence-timeline li.is-low::before { border-color: #15925a; }
.customer-evidence-timeline li.is-medium::before { border-color: var(--customer-risk-amber); }
.customer-evidence-timeline li.is-high::before { border-color: var(--customer-risk-red); }
.customer-evidence-timeline time,
.customer-evidence-timeline li > span { color: var(--customer-risk-muted); font-size: 10px; }
.customer-evidence-timeline p { color: var(--customer-risk-muted); font-size: 11px; line-height: 1.5; margin: 3px 0 0; }

.customer-risk-portrait { display: grid; gap: 9px; }
.customer-risk-portrait > div {
  align-items: center;
  display: grid;
  font-size: 10px;
  gap: 8px;
  grid-template-columns: 72px 1fr 48px 70px;
}

.customer-portrait-track {
  background: #e2e8f0;
  border-radius: 4px;
  height: 5px;
  overflow: hidden;
}

.customer-portrait-track i {
  background: var(--customer-risk-green);
  display: block;
  height: 100%;
  width: var(--portrait-score);
}

.customer-risk-portrait small { color: var(--customer-risk-muted); }
.customer-risk-linked dl { display: grid; gap: 6px; margin: 0; }
.customer-risk-linked dl div { display: flex; justify-content: space-between; }
.customer-risk-linked dt { color: var(--customer-risk-muted); }
.customer-risk-linked dd { color: var(--customer-risk-ink); font-weight: 750; margin: 0; }

.customer-risk-decision { display: grid; gap: 10px; }
.customer-risk-checks { display: flex; flex-wrap: wrap; gap: 12px; }
.customer-risk-checks label { align-items: center; display: flex; font-size: 10px; gap: 5px; }
.customer-risk-checks input { accent-color: var(--customer-risk-green); }
.customer-risk-decision > label { color: #475569; display: grid; font-size: 10px; font-weight: 800; gap: 5px; }
.customer-risk-decision textarea { min-height: 72px; resize: vertical; }
.customer-risk-decision > label > small { color: var(--customer-risk-muted); justify-self: end; }

.customer-risk-decision-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.customer-risk-decision-actions button {
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
  min-height: 38px;
  padding: 8px 10px;
}

.customer-risk-decision-actions .warning-button {
  background: #eea20b;
  border: 1px solid #eea20b;
  color: #2f250b;
}

.customer-risk-decision-actions .danger-button {
  background: #d92b2b;
  border: 1px solid #d92b2b;
  color: #fff;
}

.customer-risk-boundary,
.customer-risk-data-note,
.customer-risk-draft-message {
  color: var(--customer-risk-muted);
  font-size: 11px;
  line-height: 1.55;
  margin: 0;
}

.customer-risk-data-note { margin-top: 10px; }
.customer-risk-draft-message {
  background: #eef7f4;
  border: 1px solid #b8dbcf;
  color: var(--customer-risk-green-dark);
  margin-top: 12px;
  padding: 10px 12px;
}

.customer-risk-empty {
  color: var(--customer-risk-muted);
  line-height: 1.7;
  padding: 24px;
  text-align: center;
}

.customer-account-placeholder {
  min-height: 360px;
}

.customer-control-approvals {
  min-height: 360px;
  padding: 20px;
}

.customer-control-approvals > p {
  color: var(--customer-risk-muted);
  line-height: 1.7;
}

.customer-control-list {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.customer-control-card {
  background: #fff;
  border: 1px solid #dbe5e2;
  border-left: 4px solid #2c705f;
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.customer-control-card.is-execution_failed { border-left-color: #d92b2b; }
.customer-control-card.is-rejected,
.customer-control-card.is-expired { border-left-color: #94a3b8; }
.customer-control-card.is-executed { border-left-color: #14865f; }

.customer-control-card > header {
  align-items: start;
  display: flex;
  gap: 16px;
  justify-content: space-between;
}

.customer-control-card h3 { color: var(--customer-risk-ink); margin: 5px 0; }
.customer-control-card header p { color: var(--customer-risk-muted); margin: 0; }
.customer-control-card code { color: #64748b; font-size: 10px; overflow-wrap: anywhere; }
.customer-control-status { background: #eef7f4; border-radius: 999px; color: var(--customer-risk-green-dark); display: inline-block; font-size: 10px; font-weight: 800; padding: 4px 8px; }

.customer-control-card dl {
  display: grid;
  gap: 8px 16px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.customer-control-card dl div { background: #f8faf9; border: 1px solid #e6eeeb; border-radius: 5px; padding: 9px; }
.customer-control-card dt { color: var(--customer-risk-muted); font-size: 10px; }
.customer-control-card dd { color: var(--customer-risk-ink); font-size: 12px; font-weight: 750; margin: 3px 0 0; overflow-wrap: anywhere; }
.customer-control-reason,
.customer-control-receipt { color: #475569; line-height: 1.6; margin: 0; }

.customer-control-decision-form,
.customer-control-retry-form { border-top: 1px solid #e2e8f0; display: grid; gap: 12px; padding-top: 14px; }
.customer-control-decision-form > label,
.customer-control-retry-form > label { color: #475569; display: grid; font-size: 11px; font-weight: 800; gap: 6px; }
.customer-control-decision-form textarea,
.customer-control-retry-form textarea { min-height: 70px; resize: vertical; }
.customer-control-actions { display: grid; gap: 10px; grid-template-columns: 1fr 1fr; }
.customer-control-actions button { border-radius: 5px; cursor: pointer; font-weight: 800; min-height: 40px; }
.customer-control-actions .warning-button { background: #eea20b; border: 1px solid #eea20b; color: #2f250b; }
.customer-control-actions .danger-button { background: #d92b2b; border: 1px solid #d92b2b; color: #fff; }

.customer-account-placeholder > p {
  color: var(--customer-risk-muted);
  line-height: 1.7;
  max-width: 760px;
}

.customer-account-audit-list {
  border-left: 1px solid #cbd5e1;
  display: grid;
  gap: 18px;
  list-style: none;
  margin: 24px 0 0 6px;
  padding: 0 0 0 22px;
}

.customer-account-audit-list li { display: grid; gap: 10px; grid-template-columns: 150px 1fr; }
.customer-account-audit-list time { color: var(--customer-risk-muted); font-size: 12px; }
.customer-account-audit-list p { color: var(--customer-risk-muted); margin: 4px 0 0; }

.sr-only {
  clip: rect(0, 0, 0, 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

@media (max-width: 1180px) {
  .customer-risk-filters { grid-template-columns: repeat(3, minmax(140px, 1fr)); }
  .customer-risk-search { grid-column: span 2; }
  .customer-risk-detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .customer-account-directory,
  .customer-account-placeholder,
  .customer-control-approvals,
  .customer-risk-review { padding: 14px; }
  .customer-account-subnav { padding: 0 8px; }
  .customer-risk-page-header h2 { font-size: 22px; }
  .customer-risk-filters { grid-template-columns: 1fr; }
  .customer-risk-search { grid-column: auto; }
  .customer-risk-recommendation { grid-template-columns: 1fr; }
  .customer-evidence-timeline li { grid-template-columns: 1fr; }
  .customer-risk-portrait > div { grid-template-columns: 70px 1fr 44px; }
  .customer-risk-portrait small { display: none; }
  .customer-risk-decision-actions { grid-template-columns: 1fr; }
  .customer-control-card > header { display: grid; }
  .customer-control-card dl,
  .customer-control-actions { grid-template-columns: 1fr; }
}
