:root {
  --navy: #071f3d;
  --navy-2: #0a2d56;
  --navy-3: #123b72;
  --blue: #006fae;
  --blue-dark: #005a8d;
  --teal: #0c7f87;
  --purple: #5d3a9b;
  --brown: #70501f;
  --green: #287a4e;
  --gold: #9b6d14;
  --red: #a73546;
  --ink: #172334;
  --muted: #5f6b7a;
  --line: #c8d0da;
  --line-light: #e4e8ee;
  --bg: #eef1f4;
  --focus: #ffbf47;
  color-scheme: light;
  font-family: Arial, "Helvetica Neue", Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.screen {
  display: none;
  min-height: 100vh;
  padding: 24px;
}

.screen.active {
  display: block;
}

.visually-hidden {
  border: 0;
  clip: rect(0 0 0 0);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.prototype-restart {
  background: #fff;
  border: 1px solid #6f7e90;
  border-radius: 2px;
  bottom: 18px;
  box-shadow: 0 4px 12px rgba(13, 31, 55, 0.18);
  color: #123b5c;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  min-height: 34px;
  padding: 8px 12px;
  position: fixed;
  right: 18px;
  z-index: 20;
}

.prototype-restart:hover {
  background: #f4f7fa;
}

body[data-screen="login"] .prototype-restart {
  display: none;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

.btn {
  align-items: center;
  border-radius: 2px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 700;
  justify-content: center;
  line-height: 1.1;
  min-height: 34px;
  padding: 7px 13px;
  text-decoration: none;
}

.btn-primary {
  background: var(--blue);
  border: 1px solid var(--blue-dark);
  color: #fff;
}

.btn-primary:hover {
  background: var(--blue-dark);
}

.btn-secondary {
  background: #fff;
  border: 1px solid #7c8b9d;
  color: #174a72;
}

.btn-small {
  background: var(--blue-dark);
  border: 1px solid #004b74;
  color: #fff;
  min-height: 28px;
  padding: 5px 10px;
}

.btn-block {
  width: 100%;
}

input,
select,
textarea {
  background: #fff;
  border: 1px solid #8e9cac;
  border-radius: 2px;
  color: var(--ink);
  min-height: 34px;
  padding: 7px 9px;
}

textarea {
  line-height: 1.45;
  min-height: 92px;
  resize: vertical;
}

label {
  color: #1d2b3d;
  font-size: 12px;
  font-weight: 700;
}

.login-scene {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(8, 35, 70, 0.96), rgba(8, 43, 82, 0.96)),
    var(--navy);
  display: flex;
  isolation: isolate;
  justify-content: center;
  min-height: calc(100vh - 48px);
  overflow: hidden;
  position: relative;
}

.login-scene::before,
.login-scene::after {
  background: rgba(255, 255, 255, 0.06);
  border-radius: 26px;
  content: "";
  height: 420px;
  position: absolute;
  transform: rotate(45deg);
  width: 420px;
  z-index: -1;
}

.login-scene::before {
  right: 17%;
  top: -150px;
}

.login-scene::after {
  bottom: -190px;
  left: 16%;
}

.login-card {
  background: #fff;
  border: 1px solid #d5dbe3;
  border-radius: 3px;
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.18);
  display: grid;
  gap: 9px;
  max-width: 340px;
  padding: 28px;
  width: 100%;
}

.login-logo,
.brand-mini,
.user-dot {
  align-items: center;
  border-radius: 50%;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  text-transform: uppercase;
}

.login-logo {
  color: var(--navy);
  font-size: 21px;
  height: 36px;
  width: 36px;
}

.login-card h1 {
  font-size: 26px;
  line-height: 1.1;
  margin: 4px 0 5px;
}

.login-card h2 {
  font-size: 18px;
  font-weight: 500;
  margin: 0;
}

.login-card p {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 6px;
}

.login-card .btn {
  margin-top: 9px;
}

.kyc-screen {
  padding: 18px;
}

.kyc-frame {
  background: #fff;
  border: 1px solid #b9c4d0;
  box-shadow: 0 8px 22px rgba(25, 36, 48, 0.12);
  margin: 0 auto;
  max-width: 1180px;
  min-height: calc(100vh - 36px);
}

.wide-frame {
  max-width: 1360px;
}

.kyc-header {
  background:
    linear-gradient(135deg, rgba(8, 28, 56, 0.95), rgba(10, 45, 86, 0.95)),
    var(--navy);
  color: #fff;
  min-height: 156px;
  overflow: hidden;
  padding: 12px 18px 18px;
  position: relative;
}

.kyc-header::after {
  background: rgba(255, 255, 255, 0.045);
  border-radius: 22px;
  content: "";
  height: 210px;
  position: absolute;
  right: 11%;
  top: -92px;
  transform: rotate(45deg);
  width: 210px;
}

.header-top,
.header-search,
.page-title-row {
  position: relative;
  z-index: 1;
}

.header-top {
  align-items: center;
  display: flex;
  font-size: 12px;
  justify-content: space-between;
  margin-bottom: 22px;
}

.header-user {
  align-items: center;
  display: flex;
  gap: 9px;
}

.user-dot {
  background: #237b63;
  color: #fff;
  font-size: 11px;
  height: 24px;
  width: 24px;
}

.brand-mini {
  color: #fff;
  font-size: 13px;
}

.header-search {
  display: grid;
  gap: 7px;
  justify-items: center;
}

.header-search h1,
.page-title-row h1 {
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.15;
  margin: 0;
}

.header-search fieldset {
  align-items: center;
  border: 0;
  color: #d8e5f3;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin: 0;
  padding: 0;
}

.header-search legend {
  float: left;
  font-size: 11px;
  font-weight: 700;
  margin-right: 1px;
}

.header-search label,
.review-filter label {
  align-items: center;
  color: inherit;
  display: inline-flex;
  gap: 4px;
  line-height: 1;
}

.header-search input[type="radio"],
.review-filter input,
.result-line input,
.product-row input,
.data-table input,
.decision-options input {
  min-height: auto;
  padding: 0;
}

.search-row {
  display: grid;
  gap: 6px;
  grid-template-columns: minmax(240px, 420px) 78px;
}

.search-row input {
  min-height: 30px;
}

.search-row .btn {
  min-height: 30px;
}

.compact-search {
  gap: 6px;
}

.page-header {
  min-height: 108px;
}

.page-title-row {
  align-items: end;
  display: flex;
  gap: 20px;
  justify-content: space-between;
}

.page-title-row p {
  color: #bed0e4;
  font-size: 11px;
  margin: 0 0 6px;
}

.page-title-row span {
  color: #d8e5f3;
  font-size: 11px;
}

.canvas {
  background: #fff;
  min-height: 430px;
}

.search-empty-canvas {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 440px;
  padding: 42px;
}

.empty-state {
  align-items: center;
  color: var(--muted);
  display: grid;
  justify-items: center;
  max-width: 430px;
  text-align: center;
}

.empty-state img {
  height: auto;
  margin-bottom: 6px;
  max-width: 132px;
}

.empty-state h2 {
  color: #2d3746;
  font-size: 20px;
  font-weight: 500;
  margin: 8px 0;
}

.empty-state p {
  font-size: 12px;
  line-height: 1.55;
  margin: 0 0 16px;
}

.canvas-toolbar {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  min-height: 56px;
  padding: 12px 16px;
}

.canvas-toolbar h2 {
  font-size: 16px;
  margin: 0 0 4px;
}

.canvas-toolbar p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.result-board {
  display: grid;
  grid-template-columns: 1fr 1.1fr 1.4fr;
  min-height: 360px;
}

.result-column {
  border-right: 1px solid var(--line);
  padding: 12px 14px;
}

.result-column:last-child {
  border-right: 0;
}

.result-column h3 {
  border-bottom: 1px solid var(--line);
  color: #3b4655;
  font-size: 12px;
  margin: 0 0 8px;
  padding-bottom: 8px;
}

.result-line,
.product-row {
  border: 1px solid transparent;
  display: grid;
  gap: 3px;
  min-height: 46px;
  padding: 7px 6px;
}

.result-line.selected,
.product-row:has(input:checked) {
  background: #f3f9ff;
  border-color: #9dc2df;
}

.result-line label,
.product-row label {
  align-items: center;
  display: flex;
  gap: 6px;
}

.result-line span,
.product-row span,
.connected-tip {
  color: var(--muted);
  font-size: 11px;
  margin-left: 21px;
}

.connected-tip {
  background: #f5f7fa;
  border: 1px solid var(--line-light);
  margin: 8px 0 0;
  padding: 8px;
}

.tag {
  border: 1px solid currentColor;
  border-radius: 10px;
  display: inline-flex;
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  padding: 3px 7px;
  white-space: nowrap;
  width: fit-content;
}

.tag-green {
  background: #eff8f2;
  color: var(--green);
}

.tag-blue {
  background: #eef6ff;
  color: var(--blue-dark);
}

.tag-gold {
  background: #fff7e7;
  color: var(--gold);
}

.tag-red {
  background: #fff0f2;
  color: var(--red);
}

.product-row .tag {
  margin-left: 21px;
}

.review-filter {
  align-items: center;
  color: #3a4655;
  display: flex;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 700;
  gap: 12px;
}

.review-grid {
  display: grid;
  grid-template-columns: 278px minmax(0, 1fr);
}

.household-list {
  border-right: 1px solid var(--line);
  padding: 12px;
}

.household-list label {
  display: block;
  margin-bottom: 6px;
}

.household-list select {
  margin-bottom: 10px;
  width: 100%;
}

.member-card {
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid #8a98a9;
  display: grid;
  gap: 3px;
  margin-bottom: 8px;
  min-height: 78px;
  padding: 9px;
  text-align: left;
  width: 100%;
}

.member-card.active {
  background: #f7fbff;
  border-color: #8fb9da;
  border-left-color: var(--blue);
}

.member-card.warning-card {
  border-left-color: var(--red);
}

.member-card strong {
  font-size: 13px;
}

.member-card span,
.member-card em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.review-work {
  min-width: 0;
  padding: 12px 16px 18px;
}

.selected-person {
  align-items: start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.selected-person span {
  color: var(--blue-dark);
  display: block;
  font-size: 11px;
  font-weight: 700;
  margin-bottom: 4px;
  text-transform: uppercase;
}

.selected-person h2 {
  font-size: 18px;
  margin: 0;
}

.selected-person p {
  color: var(--muted);
  font-size: 12px;
  margin: 4px 0 0;
}

.status-cluster {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.cin-card-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cin-card {
  border: 1px solid var(--line);
  min-width: 0;
  padding: 0 10px 10px;
}

.card-bar {
  height: 6px;
  margin: 0 -10px 8px;
}

.bar-teal,
.legend.teal {
  background: var(--teal);
}

.bar-navy,
.legend.navy {
  background: var(--navy-3);
}

.bar-purple,
.legend.purple {
  background: var(--purple);
}

.legend.brown {
  background: var(--brown);
}

.cin-card h3 {
  font-size: 15px;
  margin: 0 0 5px;
}

.role-pill {
  background: #edf4fb;
  color: #225d89;
  display: inline-flex;
  font-size: 10px;
  font-weight: 700;
  margin-bottom: 8px;
  padding: 4px 7px;
}

.cin-card table,
.compare-table,
.data-table,
.matrix-table {
  border-collapse: collapse;
  width: 100%;
}

.cin-card th,
.cin-card td {
  border-top: 1px solid var(--line-light);
  font-size: 11px;
  padding: 6px 4px;
  text-align: left;
  vertical-align: top;
}

.cin-card th {
  color: var(--muted);
  width: 70px;
}

.overview-callout {
  align-items: center;
  border: 1px dashed #b9c4d0;
  display: grid;
  gap: 10px 16px;
  grid-template-columns: 62px 1fr;
  margin-top: 14px;
  min-height: 100px;
  padding: 16px;
}

.overview-symbol {
  align-items: center;
  background: #eef5fb;
  border-radius: 50%;
  display: flex;
  height: 54px;
  justify-content: center;
  position: relative;
  width: 54px;
}

.overview-symbol span {
  border: 2px solid #5b87a7;
  height: 25px;
  width: 18px;
}

.overview-symbol i {
  border: 2px solid #5b87a7;
  border-left: 0;
  border-top: 0;
  height: 12px;
  margin-left: -4px;
  transform: rotate(-45deg);
  width: 12px;
}

.overview-callout h2 {
  font-size: 18px;
  margin: 0;
}

.overview-callout p {
  color: var(--muted);
  font-size: 12px;
  grid-column: 2;
  line-height: 1.45;
  margin: -6px 0 0;
}

.compare-canvas {
  padding: 0;
}

.compare-table-wrap,
.matrix-wrap,
.cin-table-box {
  overflow: auto;
}

.compare-table {
  min-width: 900px;
}

.compare-table caption,
.data-table caption,
.matrix-table caption {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.compare-table th,
.compare-table td {
  border: 1px solid var(--line);
  font-size: 12px;
  padding: 9px 10px;
  text-align: center;
  vertical-align: top;
}

.compare-table thead th {
  background: #eef2f6;
  border-top: 6px solid var(--navy-3);
  font-size: 13px;
}

.compare-table thead th:nth-child(3) {
  border-top-color: var(--brown);
}

.compare-table thead th:nth-child(4) {
  border-top-color: var(--purple);
}

.compare-table thead span {
  color: #336383;
  font-size: 10px;
}

.compare-table tbody th {
  background: #f7f8fa;
  color: #2f3c4e;
  font-weight: 700;
  text-align: left;
  width: 180px;
}

.mismatch {
  background: #fff4d9;
  color: #684700;
  font-weight: 700;
}

.scope-tabs {
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 6px;
  padding: 10px 12px;
}

.scope-tab {
  background: #fff;
  border: 1px solid #8795a6;
  border-radius: 2px;
  color: #174a72;
  font-size: 12px;
  font-weight: 700;
  min-height: 30px;
  padding: 5px 12px;
}

.scope-tab.active {
  background: var(--blue);
  border-color: var(--blue-dark);
  color: #fff;
}

.analyze-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) 300px;
  padding: 12px;
}

.data-table {
  min-width: 760px;
}

.data-table th,
.data-table td,
.matrix-table th,
.matrix-table td {
  border: 1px solid var(--line);
  font-size: 12px;
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.data-table th,
.matrix-table th {
  background: #eef2f6;
  color: #2d3b4d;
  font-size: 11px;
  font-weight: 700;
}

.selected-stack {
  display: grid;
  gap: 9px;
  align-content: start;
}

.selected-stack article {
  border: 1px solid var(--line);
  border-left: 6px solid var(--blue);
  display: grid;
  gap: 5px;
  padding: 10px;
}

.selected-stack article:nth-child(2) {
  border-left-color: var(--navy-3);
}

.selected-stack article:nth-child(3) {
  border-left-color: var(--brown);
}

.selected-stack strong,
.selected-stack span,
.selected-stack small {
  font-size: 12px;
}

.selected-stack span {
  font-weight: 700;
}

.selected-stack small {
  color: var(--muted);
}

.matrix-controls {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
}

.matrix-controls label {
  margin-right: -4px;
}

.matrix-controls span {
  align-items: center;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 700;
  gap: 5px;
}

.legend {
  border-radius: 50%;
  display: inline-block;
  height: 8px;
  width: 8px;
}

.matrix-table {
  min-width: 1040px;
}

.matrix-table tbody tr.hidden {
  display: none;
}

.matrix-table td:first-child {
  color: var(--muted);
  font-weight: 700;
  width: 80px;
}

.matrix-table td:nth-child(2) {
  font-weight: 700;
  width: 210px;
}

.decision-canvas {
  display: grid;
  gap: 14px;
  grid-template-columns: 330px minmax(0, 1fr);
  padding: 14px;
}

.decision-summary,
.decision-form {
  border: 1px solid var(--line);
  min-width: 0;
  padding: 14px;
}

.decision-summary h2,
.decision-form h2 {
  font-size: 18px;
  margin: 0 0 14px;
}

.risk-score {
  align-items: center;
  background:
    radial-gradient(circle at center, #fff 55%, transparent 56%),
    conic-gradient(var(--red) 0 78%, #e2e8ef 78% 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  height: 150px;
  justify-content: center;
  margin-bottom: 16px;
  width: 150px;
}

.risk-score strong {
  color: var(--red);
  font-size: 38px;
  line-height: 1;
}

.risk-score span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.decision-summary dl {
  margin: 0;
}

.decision-summary dl > div {
  border-top: 1px solid var(--line-light);
  display: grid;
  grid-template-columns: 110px 1fr;
  padding: 8px 0;
}

.decision-summary dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.decision-summary dd {
  font-size: 12px;
  margin: 0;
}

.decision-options {
  border: 0;
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 0;
}

.decision-options label {
  align-items: center;
  border: 1px solid var(--line);
  display: flex;
  gap: 8px;
  min-height: 36px;
  padding: 8px;
}

.decision-options label.active {
  background: #f1f8ff;
  border-color: var(--blue);
}

.decision-form > label {
  display: block;
  margin: 12px 0 6px;
}

#decisionRationale {
  display: block;
  max-width: 760px;
  min-height: 110px;
  width: 100%;
}

.decision-form h3 {
  border-top: 1px solid var(--line-light);
  font-size: 15px;
  margin: 14px 0 8px;
  padding-top: 12px;
}

.decision-form ol {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin: 0;
  padding-left: 20px;
}

.case-complete {
  background: #eef8f1;
  color: var(--green);
  font-weight: 700;
}

.prototype-boundary {
  background: rgba(6, 12, 22, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  bottom: 14px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.1em;
  padding: 8px 10px;
  position: fixed;
  right: 14px;
  text-transform: uppercase;
  z-index: 40;
}

@media (max-width: 980px) {
  .screen,
  .kyc-screen {
    padding: 10px;
  }

  .kyc-frame {
    min-height: calc(100vh - 20px);
  }

  .result-board,
  .review-grid,
  .analyze-grid,
  .decision-canvas {
    grid-template-columns: 1fr;
  }

  .result-column,
  .household-list {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .cin-card-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .kyc-header {
    min-height: 174px;
    padding: 12px;
  }

  .page-header {
    min-height: 132px;
  }

  .header-search h1,
  .page-title-row h1 {
    font-size: 18px;
  }

  .search-row {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .header-search fieldset {
    justify-content: flex-start;
  }

  .canvas-toolbar,
  .page-title-row,
  .selected-person {
    align-items: flex-start;
    display: grid;
  }

  .toolbar-actions,
  .status-cluster {
    justify-content: flex-start;
  }

  .search-empty-canvas {
    min-height: 360px;
    padding: 24px;
  }

  .empty-state img {
    max-width: 105px;
  }

  .prototype-boundary {
    bottom: 8px;
    font-size: 9px;
    max-width: calc(100vw - 16px);
    right: 8px;
  }
}
