:root {
  color-scheme: light;
  --ink: #061f3d;
  --muted: #52627a;
  --line: #ead8bb;
  --surface: #ffffff;
  --soft: #f6f8fb;
  --cream: #fff7eb;
  --navy: #061f3d;
  --navy-2: #002d59;
  --orange: #ff5b00;
  --orange-2: #ff7a00;
  --gold: #c9862b;
  --gold-2: #f4c15d;
  --danger: #c62828;
  --ok: #137a3d;
  --shadow: 0 18px 42px rgba(6, 31, 61, 0.12);
  --gold-shadow: 0 14px 30px rgba(201, 134, 43, 0.18);
  --case-action-width: clamp(112px, 28vw, 132px);
  --case-action-height: 28px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top right, rgba(244, 193, 93, 0.2), transparent 34rem),
    linear-gradient(180deg, #ffffff 0%, #f4f7fb 58%, #eef3f8 100%);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  min-height: 46px;
  touch-action: manipulation;
  transition: transform 120ms ease, filter 120ms ease, box-shadow 120ms ease, background-color 120ms ease, border-color 120ms ease;
  -webkit-tap-highlight-color: rgba(255, 91, 0, 0.16);
}

button:active,
button.pressed {
  transform: translateY(1px) scale(0.985);
  filter: brightness(0.96);
}

button:disabled:active,
button:disabled.pressed {
  transform: none;
  filter: none;
}

.busy-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(6, 31, 61, 0.34);
  backdrop-filter: blur(3px);
}

.busy-overlay.hidden {
  display: none;
}

.busy-card {
  display: grid;
  justify-items: center;
  gap: 12px;
  min-width: min(260px, 82vw);
  padding: 22px 24px;
  border: 1px solid rgba(244, 193, 93, 0.55);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 60px rgba(6, 31, 61, 0.22);
  color: var(--navy);
  text-align: center;
}

.busy-card strong {
  font-size: 14px;
  line-height: 1.3;
}

.busy-spinner {
  width: 38px;
  height: 38px;
  border: 4px solid #ffe0c2;
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: busy-spin 760ms linear infinite;
}

@keyframes busy-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-shell {
  width: min(100%, 1120px);
  margin: 0 auto;
  min-height: 100vh;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 60px rgba(6, 31, 61, 0.08);
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  gap: 14px;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 12px;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(90deg, #001934, #062f5c 48%, #001934);
  font-size: 12px;
  font-weight: 750;
}

.trust-strip span {
  position: relative;
  min-width: 0;
  padding-left: 16px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.trust-strip span::before {
  position: absolute;
  left: 0;
  color: var(--gold-2);
  content: "•";
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(234, 216, 187, 0.9);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  display: block;
}

.brand strong,
.brand span {
  display: block;
}

.brand strong {
  color: var(--navy);
  font-size: 16px;
  line-height: 1.12;
}

.brand span {
  color: #24466a;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.25;
}

.top-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 8px;
}

.profile-chip {
  display: inline-flex;
  align-items: center;
  max-width: 178px;
  min-height: 42px;
  gap: 8px;
  padding: 4px 10px 4px 4px;
  border: 1px solid rgba(201, 134, 43, 0.35);
  border-radius: 999px;
  background: #fff8ed;
  box-shadow: 0 8px 20px rgba(6, 31, 61, 0.08);
  cursor: pointer;
}

.profile-chip img {
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  object-fit: cover;
  background: linear-gradient(135deg, var(--gold-2), var(--orange));
}

.profile-chip span {
  overflow: hidden;
  color: var(--navy);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.settings-actions {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.expert-link {
  display: none;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid var(--navy-2);
  border-radius: 8px;
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
  background: #fff;
}

main {
  padding: 18px;
}

.view,
.tab-panel {
  display: none;
}

.view.active,
.tab-panel.active {
  display: block;
}

.hero-panel,
.panel,
.step-card {
  background: var(--surface);
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-panel {
  position: relative;
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
  padding: 14px;
  background:
    linear-gradient(112deg, #ffffff 0%, #fff8ed 52%, rgba(6, 31, 61, 0.05) 52%, rgba(6, 31, 61, 0.08) 100%),
    #fff;
}

.hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 18px;
  align-items: start;
  order: 2;
  padding-top: 6px;
}

.auth-card {
  position: relative;
  z-index: 1;
  align-self: start;
  order: 1;
  padding: 16px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 18px 36px rgba(6, 31, 61, 0.14);
}

.auth-card::before {
  display: block;
  margin-bottom: 10px;
  color: var(--orange);
  content: "Start your application";
  font-size: 13px;
  font-weight: 850;
}

.auth-card form + form {
  margin-top: 12px;
}

.login-otp-status {
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--orange);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
}

.auth-card input:disabled {
  color: #607086;
  background: #eef2f7;
  cursor: not-allowed;
}

.radio-group {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
}

.radio-group legend {
  padding: 0 4px;
  color: #314963;
  font-size: 13px;
  font-weight: 750;
}

.radio-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
}

.radio-option input {
  width: 18px;
  min-height: 18px;
  accent-color: var(--orange);
}

.conditional-fields {
  display: grid;
  gap: 12px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: 620px;
  color: var(--navy);
  font-size: clamp(32px, 8vw, 58px);
  line-height: 1.02;
}

h1 span {
  display: inline-block;
  color: var(--gold);
  background: linear-gradient(135deg, var(--gold) 0%, var(--orange) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  color: var(--navy);
  font-size: 20px;
  line-height: 1.2;
}

p {
  color: var(--muted);
  margin-top: 8px;
  line-height: 1.48;
}

.hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.hero-badges strong {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid rgba(201, 134, 43, 0.38);
  border-radius: 8px;
  color: var(--navy);
  background: rgba(255, 255, 255, 0.84);
  font-size: 12px;
  box-shadow: 0 8px 20px rgba(201, 134, 43, 0.12);
}

.panel,
.step-card {
  margin-top: 14px;
  padding: 16px;
}

.form-grid {
  display: grid;
  gap: 12px;
}

label {
  position: relative;
  display: grid;
  gap: 7px;
  color: #314963;
  font-weight: 750;
  font-size: 13px;
}

.upload-tile.required-field,
.check-row.required-field {
  position: relative;
  padding-right: 18px;
}

.upload-tile.required-field::after,
.check-row.required-field::after,
.radio-group.required-field legend::after {
  color: var(--danger);
  content: " *";
  font-weight: 950;
}

.upload-tile.required-field::after,
.check-row.required-field::after {
  position: absolute;
  top: 10px;
  right: 12px;
}

/* Inline red star sits right after the field name */
.req-star {
  color: var(--danger);
  font-weight: 950;
  margin-left: 3px;
}

.step-hint {
  margin: -2px 0 6px;
  color: #5a6b80;
  font-size: 13px;
  font-weight: 650;
}

.add-button-hint {
  margin: 12px 0 0;
  color: #5a6b80;
  font-size: 12.5px;
  font-weight: 650;
}

input,
select,
textarea {
  width: 100%;
  min-height: 48px;
  border: 1px solid #d7deea;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 12px;
  outline: none;
}

.lender-field,
.bank-combobox {
  position: relative;
}

.lender-field {
  z-index: 4;
}

.bank-combobox {
  display: block;
}

.bank-combobox input {
  padding-right: 48px;
}

.bank-dropdown-toggle {
  position: absolute;
  z-index: 2;
  top: 4px;
  right: 4px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--navy);
  font-size: 22px;
  line-height: 1;
}

.lender-dropdown {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  right: 0;
  left: 0;
  max-height: min(320px, 45dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 1px solid #c9d3e1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 14px 28px rgba(6, 31, 61, 0.18);
}

.lender-option {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid #edf1f6;
  border-radius: 0;
  background: #fff;
  color: var(--navy);
  text-align: left;
  font-weight: 700;
}

.lender-option:last-child {
  border-bottom: 0;
}

.lender-option:hover,
.lender-option:focus-visible {
  background: var(--soft);
  color: var(--orange);
}

.lender-empty {
  padding: 12px;
  color: var(--muted);
  font-size: 12px;
}

textarea {
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 91, 0, 0.16);
}

.primary-action,
.secondary-action,
.logout-button,
.tab,
.segment {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.primary-action {
  width: 100%;
  margin-top: 4px;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  color: #fff;
  font-weight: 850;
  padding: 13px 16px;
  box-shadow: 0 12px 22px rgba(255, 91, 0, 0.2);
}

.primary-action:hover,
.primary-action:focus-visible {
  filter: brightness(1.02);
  box-shadow: 0 14px 26px rgba(255, 91, 0, 0.26);
}

.primary-action.pressed,
.primary-action:active {
  box-shadow: 0 8px 16px rgba(255, 91, 0, 0.18);
}

.primary-action:disabled,
.secondary-action:disabled,
.logout-button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  box-shadow: none;
}

.primary-action.submitted {
  background: linear-gradient(135deg, #16864a, #0d6838);
}

.secondary-action {
  width: 100%;
  margin-top: 10px;
  border: 1px solid rgba(6, 31, 61, 0.34);
  background: #fff;
  color: var(--navy);
  font-weight: 850;
  padding: 13px 16px;
}

.secondary-action:hover,
.secondary-action:focus-visible,
.logout-button:hover,
.logout-button:focus-visible,
.tab:hover,
.tab:focus-visible,
.segment:hover,
.segment:focus-visible {
  border-color: rgba(255, 91, 0, 0.48);
  box-shadow: 0 8px 18px rgba(6, 31, 61, 0.08);
}

.nav-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.nav-action span {
  font-size: 22px;
  line-height: 1;
}

.logout-button {
  min-width: 86px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid rgba(255, 91, 0, 0.28);
  background: #fff2e6;
  color: var(--orange);
  font-weight: 850;
}

.tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  padding: 6px;
  background: #ffffff;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  box-shadow: 0 10px 24px rgba(6, 31, 61, 0.07);
}

.tab {
  position: relative;
  background: transparent;
  color: #49617b;
  font-weight: 850;
}

.tab.active {
  color: var(--orange);
  background: #fff7ed;
  box-shadow: inset 0 -3px 0 var(--orange);
}

.progress-wrap {
  margin: 16px 0;
  padding: 14px;
  border: 1px solid rgba(234, 216, 187, 0.9);
  border-radius: 8px;
  background: linear-gradient(180deg, #fff 0%, #fff8ed 100%);
  box-shadow: var(--gold-shadow);
}

.progress-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.progress-label strong {
  color: var(--orange);
}

.progress {
  height: 9px;
  margin-top: 8px;
  background: #e9eef5;
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 20%;
  background: linear-gradient(90deg, var(--orange), var(--gold-2));
  transition: width 180ms ease;
}

.step-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
}

.step-nav button {
  min-width: 0;
  margin-top: 0;
}

.segmented {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin: 14px 0;
}

.segment {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(6, 31, 61, 0.22);
  background: #f7f9fc;
  color: var(--navy);
  font-weight: 850;
  padding: 12px 14px;
  text-align: left;
  box-shadow: none;
}

.segment::before {
  width: 14px;
  height: 14px;
  flex: 0 0 14px;
  border: 2px solid rgba(6, 31, 61, 0.42);
  border-radius: 50%;
  content: "";
}

.segment.active {
  border-color: rgba(255, 91, 0, 0.7);
  background: #fff3e8;
  color: var(--navy);
  box-shadow: inset 3px 0 0 var(--orange);
}

.segment.active::before {
  border-color: var(--orange);
  background: radial-gradient(circle, var(--orange) 0 43%, transparent 47%);
}

.loan-purpose-card {
  display: grid;
}

.loan-purpose-card .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.loan-purpose-card .segment {
  justify-content: center;
  min-height: 48px;
  padding: 10px 8px;
  text-align: center;
  font-size: 12px;
  line-height: 1.15;
}

.loan-purpose-card .segment::before {
  display: none;
}

.loan-purpose-card .segment.active {
  box-shadow: inset 0 -3px 0 var(--orange);
}

.loan-purpose-card .requirement-grid {
  order: 3;
}

.loan-purpose-card #createCaseBtn {
  order: 4;
}

.requirement-grid {
  display: grid;
  gap: 10px;
  margin: 12px 0 14px;
}

.requirement-grid article {
  min-height: 116px;
  padding: 15px;
  border: 1px solid rgba(201, 134, 43, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 247, 235, 0.96), rgba(255, 255, 255, 0.98)),
    #fff;
  box-shadow: 0 10px 22px rgba(6, 31, 61, 0.06);
}

.requirement-grid strong,
.requirement-grid span {
  display: block;
}

.requirement-grid strong {
  color: var(--navy);
  line-height: 1.25;
}

.requirement-grid span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
}

.check-row input {
  width: 22px;
  min-height: 22px;
  accent-color: var(--orange);
}

.upload-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.upload-tile {
  min-height: 78px;
  padding: 14px;
  align-items: center;
  border: 1px dashed rgba(201, 134, 43, 0.78);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8ed 100%);
  color: var(--navy);
  text-align: center;
}

.upload-tile strong,
.upload-tile span {
  display: block;
}

.upload-tile strong {
  color: var(--navy);
}

.upload-tile span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.upload-tile input {
  margin-top: 8px;
  padding: 8px;
}

.single-upload {
  display: block;
  margin-top: 14px;
}

.upload-tile.complete {
  border-style: solid;
  border-color: rgba(19, 122, 61, 0.5);
  background: #eefaf3;
}

.consent-copy,
.evidence-status {
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.evidence-status {
  padding: 10px 12px;
  border: 1px solid rgba(201, 134, 43, 0.2);
  border-radius: 8px;
  background: #fff8ed;
}

.evidence-status.complete {
  color: var(--ok);
  background: #eefaf3;
  border-color: rgba(19, 122, 61, 0.22);
}

.evidence-status.ready {
  color: var(--ok);
  background: #eefaf3;
  border-color: rgba(19, 122, 61, 0.22);
}

.evidence-status.missing {
  color: var(--danger);
  background: #fff0ef;
  border: 1px solid rgba(198, 40, 40, 0.18);
}

.bridge-confirmation {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(255, 107, 0, 0.26);
  border-radius: 8px;
  background: #fff8ef;
  display: grid;
  gap: 12px;
}

.bridge-confirmation h3 {
  margin: 0;
  font-size: 1rem;
  color: var(--navy);
}

.bridge-confirmation p {
  margin: 0;
  color: #596579;
}

.bridge-confirmation label {
  display: grid;
  gap: 8px;
  font-weight: 800;
  color: var(--navy);
}

.agreement-box {
  display: grid;
  gap: 12px;
}

.document-link {
  width: 100%;
  padding: 12px;
  border: 1px solid rgba(201, 134, 43, 0.52);
  border-radius: 8px;
  background: #fff7ed;
  color: var(--navy);
  font: inherit;
  font-weight: 850;
  cursor: pointer;
}

.paperless-agreement {
  display: grid;
  min-width: 0;
  gap: 9px;
  overflow: hidden;
  padding: 16px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background:
    linear-gradient(180deg, #ffffff 0%, #fff8ed 100%);
  box-shadow: inset 4px 0 0 var(--gold);
}

.paperless-agreement h3,
.paperless-agreement h4,
.paperless-agreement p {
  margin: 0;
}

.paperless-agreement h3 {
  color: var(--navy);
  font-size: 19px;
}

.paperless-agreement h4 {
  margin-top: 8px;
  color: var(--orange);
  font-size: 14px;
}

.paperless-agreement p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.agreement-video-panel {
  display: grid;
  gap: 12px;
  margin: 16px 0;
}

.declaration-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff8ed;
  color: var(--navy);
}

.declaration-card p {
  margin: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.terms-list {
  display: grid;
  min-width: 0;
  gap: 10px;
  margin: 0;
  padding: 0;
  color: #1d3552;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.agreement-term {
  display: grid;
  gap: 4px;
}

.agreement-term h4,
.agreement-term p {
  margin: 0;
}

.agreement-term h4 {
  color: var(--orange);
  font-size: 14px;
}

.agreement-term p {
  color: #1d3552;
}

.agreement-language-heading {
  margin-top: 16px;
}

.hindi-terms {
  font-family: "Devanagari Sangam MN", "Kohinoor Devanagari", "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, sans-serif;
  font-size: 14.5px;
  line-height: 1.9;
  overflow-wrap: normal;
  word-break: normal;
  hyphens: none;
}

.hindi-terms .agreement-term h4,
.hindi-terms .agreement-term p,
.agreement-language-heading {
  font-family: "Devanagari Sangam MN", "Kohinoor Devanagari", "Noto Sans Devanagari", "Nirmala UI", "Mangal", system-ui, sans-serif;
}

.hindi-terms .agreement-term {
  gap: 8px;
}

.hindi-terms .agreement-term h4 {
  font-size: 15px;
  line-height: 1.7;
  overflow-wrap: normal;
  word-break: normal;
}

.hindi-terms .agreement-term p {
  font-size: 14.5px;
  line-height: 1.9;
  overflow-wrap: normal;
  word-break: normal;
}

.legal-check {
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(201, 134, 43, 0.32);
  border-radius: 8px;
  background: #fff8ed;
}

.signature-pad {
  width: 100%;
  height: 220px;
  margin-top: 12px;
  border: 2px solid rgba(201, 134, 43, 0.62);
  border-radius: 8px;
  background: #fffdf8;
  touch-action: none;
}

.signature-panel {
  display: grid;
  gap: 8px;
  margin: 14px 0;
  padding: 14px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff;
}

.signature-panel strong {
  color: var(--navy);
}

.signature-panel span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.signature-actions {
  grid-template-columns: 1fr 1fr;
}

.signature-actions button {
  margin-top: 0;
}

.action-row,
.otp-row {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.video-preview {
  display: block;
  width: 100%;
  height: auto;
  min-height: 220px;
  margin-top: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #071d37;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06);
}

.media-capture-frame {
  position: relative;
  display: grid;
  min-width: 0;
}

.selfie-preview {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transform: scaleX(-1);
}

.capture-thumbnail {
  width: 96px;
  height: 96px;
  position: absolute;
  right: 12px;
  bottom: 12px;
  border: 3px solid #fff;
  border-radius: 8px;
  object-fit: cover;
  background: #fff;
  box-shadow: 0 12px 26px rgba(6, 31, 61, 0.28);
}

.capture-thumbnail.full-preview {
  position: static;
  width: 100%;
  height: auto;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  border: 1px solid rgba(234, 216, 187, 0.95);
  object-fit: cover;
  box-shadow: none;
}

.pdc-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.pdc-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff 0%, #fff8ed 100%);
}

.pdc-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--navy);
  font-weight: 850;
}

.pdc-card-header span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.add-button,
.remove-pdc-button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.add-button {
  width: 52px;
  height: 52px;
  min-height: 52px;
  margin-top: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
  font-size: 28px;
  font-weight: 850;
  line-height: 1;
  box-shadow: 0 12px 22px rgba(255, 91, 0, 0.2);
}

.remove-pdc-button {
  min-height: 34px;
  padding: 0 10px;
  color: var(--danger);
  background: #fff0ef;
  font-size: 12px;
  font-weight: 850;
}

.file-picker {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff8ed;
}

.file-picker span {
  color: var(--muted);
  font-size: 13px;
}

.file-picker input {
  margin-top: 8px;
}

.settings-photo-panel {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff8ed;
}

.settings-photo-panel > span {
  color: var(--navy);
  font-size: 13px;
  font-weight: 850;
}

.settings-photo-stage {
  position: relative;
  display: grid;
  place-items: center;
  width: min(260px, 100%);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid rgba(6, 31, 61, 0.12);
  border-radius: 8px;
  background: #fff;
}

.settings-photo-preview,
.settings-photo-camera {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-photo-preview {
  padding: 12px;
}

.settings-photo-camera {
  display: block;
  width: 100%;
  height: auto;
  transform: scaleX(-1);
}

.settings-photo-actions {
  margin-top: 0;
}

.summary-list,
.case-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.track-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.track-header h2 {
  margin: 0;
}

.compact-action {
  width: auto;
  min-height: 36px;
  padding: 0 14px;
}

.compact-action.active {
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.application-timeline {
  display: grid;
  gap: 0;
  margin-top: 16px;
  padding: 14px;
  border: 1px solid rgba(234, 216, 187, 0.92);
  border-radius: 8px;
  background: #fff;
}

.financial-journey {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.financial-section-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff;
}

.financial-section-card h3 {
  margin: 0;
  color: var(--navy);
  font-size: 15px;
}

.financial-reminder {
  margin: -2px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.financial-reminder strong {
  color: var(--orange);
}

.new-lender-section {
  background: linear-gradient(180deg, #fff, rgba(255, 248, 237, 0.86));
}

.financial-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.financial-jewellery-photo {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: var(--soft);
}

.financial-grid div {
  min-width: 0;
  padding: 8px;
  border-radius: 8px;
  background: rgba(255, 248, 237, 0.72);
}

.financial-grid span,
.financial-grid strong {
  display: block;
  overflow-wrap: anywhere;
}

.financial-grid span {
  color: var(--muted);
  font-size: 11px;
}

.financial-grid strong {
  margin-top: 3px;
  color: var(--navy);
  font-size: 13px;
}

.timeline-phase {
  position: relative;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 54px;
  padding-bottom: 14px;
  color: var(--muted);
  text-align: left;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
}

.timeline-phase > span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding-top: 1px;
}

.timeline-phase::before {
  position: absolute;
  top: 26px;
  bottom: -2px;
  left: 13px;
  width: 3px;
  background: #d7deea;
  content: "";
  z-index: 0;
}

.timeline-phase:last-child {
  min-height: 28px;
  padding-bottom: 0;
}

.timeline-phase:last-child::before {
  display: none;
}

.timeline-dot {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #d7deea;
  border: 4px solid #fff;
  box-shadow: 0 0 0 1px rgba(6, 31, 61, 0.12), 0 8px 16px rgba(6, 31, 61, 0.1);
}

.timeline-phase.done {
  color: var(--navy);
}

.timeline-phase.done .timeline-dot,
.timeline-phase.done::before {
  background: var(--ok);
}

.timeline-phase.done .timeline-dot::after {
  color: #fff;
  content: "✓";
  font-size: 14px;
  font-weight: 1000;
  line-height: 1;
}

.timeline-phase.active {
  color: var(--orange);
}

.timeline-phase.active .timeline-dot,
.timeline-phase.active::before {
  background: var(--orange);
}

.timeline-phase.pending {
  color: #8a95a5;
}

.summary-item,
.case-item {
  position: relative;
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px;
  border: 1px solid rgba(234, 216, 187, 0.95);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(6, 31, 61, 0.05);
}

.case-item.rejected {
  border-color: rgba(198, 40, 40, 0.42);
  background: #fff7f7;
}

.summary-item strong,
.case-item strong {
  overflow-wrap: anywhere;
}

.case-button {
  width: 100%;
  min-height: 72px;
  padding: 8px 12px;
  color: inherit;
  text-align: left;
  cursor: pointer;
  overflow-wrap: anywhere;
}

.case-main-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}

.case-copy {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.case-copy > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.case-button em {
  color: var(--orange);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.35;
}

.case-rejection-reason {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(198, 40, 40, 0.22);
  border-radius: 8px;
  color: var(--danger);
  background: #fff;
  font-size: clamp(11px, 2.8vw, 13px);
  font-weight: 750;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.case-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.case-status-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--case-action-width);
  min-width: var(--case-action-width);
  max-width: var(--case-action-width);
  min-height: var(--case-action-height);
  padding: 0 8px;
  border: 1px solid var(--orange);
  border-radius: 999px;
  color: var(--orange);
  background: #fff8ed;
  font-size: clamp(9.5px, 2.25vw, 10.5px);
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.05;
  margin-left: auto;
  text-align: center;
  white-space: normal;
}

.case-status-actions {
  display: grid;
  justify-items: end;
  gap: 4px;
  width: var(--case-action-width);
  min-width: var(--case-action-width);
  margin-left: auto;
}

.case-status-pill.approved {
  border-color: #0f6b35;
  color: #111827;
  background: #dcfce7;
}

.case-status-pill.disbursed {
  border-color: #0b4a7a;
  color: #0b2545;
  background: #e7f2ff;
}

.case-status-pill.released {
  border-color: #0f6b35;
  color: #0f3d22;
  background: #dcfce7;
}

.case-status-pill.gold-pending {
  border-color: #c78313;
  color: #7c4a03;
  background: #fff7d6;
}

.agent-open-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--case-action-width);
  min-width: var(--case-action-width);
  max-width: var(--case-action-width);
  min-height: var(--case-action-height);
  padding: 0 8px;
  border: 1px solid var(--navy);
  border-radius: 999px;
  color: #fff;
  background: var(--navy);
  font-size: clamp(9.5px, 2.25vw, 10.5px);
  font-weight: 900;
  line-height: 1.05;
  text-align: center;
  white-space: normal;
}

.agent-panel {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 10px;
  border: 1px solid rgba(15, 107, 53, 0.35);
  border-radius: 8px;
  background: #f0fdf4;
}

.agent-panel img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #0f6b35;
}

.agent-panel div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.agent-panel span {
  color: var(--muted);
  font-size: 12px;
}

.agent-detail-btn {
  min-height: 36px;
  padding: 0 14px;
}

.case-status-pill.completed {
  border-color: var(--navy);
  color: #fff;
  background: var(--navy);
}

.case-status-pill.rejected {
  border-color: var(--danger);
  color: var(--danger);
  background: #fff2f2;
}

.case-item .case-status-pill.approved {
  color: #111827;
}

.case-item .case-status-pill.disbursed {
  color: #0b2545;
}

.case-item .case-status-pill.completed,
.case-item .agent-open-button {
  color: #fff;
}

.case-item .case-status-pill.rejected,
.case-item .case-delete-action {
  color: var(--danger);
}

.case-button:focus,
.case-button:hover {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(255, 91, 0, 0.14);
}

.case-footer-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.case-list.manage-mode .case-button {
  padding-right: 52px;
}

.case-delete-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  top: 8px;
  right: 8px;
  width: 34px;
  height: 34px;
  border: 2px solid var(--danger);
  border-radius: 50%;
  color: var(--danger);
  background: #fff7f7;
  font-size: 22px;
  line-height: 1;
  font-style: normal;
  font-weight: 900;
  z-index: 2;
}

.summary-item span,
.case-item span {
  color: var(--muted);
  font-size: 13px;
}

.case-item .case-rejection-reason {
  color: var(--danger);
  font-size: clamp(11px, 2.8vw, 13px);
}

.support-actions {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.support-actions a {
  display: block;
  padding: 14px;
  border: 1px solid rgba(6, 31, 61, 0.24);
  border-radius: 8px;
  background: #fff;
  color: var(--navy);
  font-weight: 850;
  text-decoration: none;
  text-align: center;
}

.trust-footer {
  display: grid;
  gap: 18px;
  margin-top: 18px;
  padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(244, 193, 93, 0.34);
  color: #fff;
  background:
    radial-gradient(circle at 50% 20%, rgba(244, 193, 93, 0.2), transparent 18rem),
    linear-gradient(110deg, #001934, #052f5d 54%, #001934);
}

.trust-footer h2 {
  color: var(--gold-2);
}

.trust-footer p {
  max-width: 640px;
  color: rgba(255, 255, 255, 0.88);
}

.footer-help {
  display: grid;
  gap: 10px;
  padding: 16px;
  border: 1px solid rgba(244, 193, 93, 0.64);
  border-radius: 8px;
  background: rgba(0, 25, 52, 0.38);
}

.footer-help strong {
  font-size: 20px;
}

.footer-help a {
  display: block;
  min-height: 42px;
  padding: 11px 14px;
  border-radius: 8px;
  color: #fff;
  font-weight: 850;
  text-align: center;
  text-decoration: none;
  background: linear-gradient(135deg, var(--orange-2), var(--orange));
}

.footer-help a:last-child {
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

#toast {
  position: fixed;
  left: 18px;
  right: 18px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  z-index: 20;
  display: none;
  padding: 13px 14px;
  border-radius: 8px;
  color: #fff;
  background: var(--navy);
  box-shadow: var(--shadow);
}

#toast.show {
  display: block;
}

#toast.error {
  background: var(--danger);
}

#toast.ok {
  background: var(--ok);
}

.agent-dialog {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(6, 31, 61, 0.42);
}

.agent-dialog-card {
  position: relative;
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  width: min(420px, 100%);
  padding: 18px;
  border: 1px solid rgba(255, 183, 77, 0.45);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.agent-dialog-card img {
  width: 76px;
  height: 76px;
  border: 3px solid #ffb347;
  border-radius: 50%;
  object-fit: cover;
}

.agent-dialog-card h2 {
  margin: 2px 0;
  color: var(--navy);
  font-size: 22px;
}

.agent-dialog-card p {
  margin: 0;
  color: var(--muted);
  font-weight: 750;
}

.agent-dialog-card .primary-action {
  grid-column: 1 / -1;
  text-align: center;
  text-decoration: none;
}

.icon-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: #f4f6fb;
  color: var(--navy);
  font-size: 22px;
  font-weight: 800;
  cursor: pointer;
}

.hidden {
  display: none !important;
}

@media (max-width: 559px) {
  .loan-purpose-card #createCaseBtn {
    order: 3;
    margin-bottom: 4px;
  }

  .loan-purpose-card .requirement-grid {
    order: 4;
  }
}

@media (min-width: 560px) {
  .expert-link {
    display: inline-flex;
  }

  .requirement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 720px) {
  .app-shell {
    border-left: 1px solid rgba(234, 216, 187, 0.95);
    border-right: 1px solid rgba(234, 216, 187, 0.95);
  }

  .topbar,
  main {
    padding-left: 26px;
    padding-right: 26px;
  }

  .form-grid,
  .upload-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .hero-panel {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    align-items: start;
    min-height: 320px;
    padding: 32px;
  }

  .hero-copy {
    order: 1;
    align-items: start;
  }

  .auth-card {
    order: 2;
    align-self: start;
  }

  .segmented {
    grid-template-columns: repeat(3, 1fr);
  }

  .trust-footer {
    grid-template-columns: 1fr 320px;
    align-items: center;
    padding-left: 26px;
    padding-right: 26px;
  }
}

@media (orientation: portrait) and (max-width: 719px) {
  .hero-panel {
    gap: 14px;
  }

  .auth-card {
    width: 100%;
  }

  .hero-copy {
    padding: 12px;
    border: 1px solid rgba(234, 216, 187, 0.8);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.76);
  }

  h1 {
    font-size: clamp(28px, 9vw, 38px);
  }
}

@media (orientation: landscape) and (min-width: 640px) {
  .hero-panel {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 390px);
    align-items: start;
  }

  .hero-copy {
    order: 1;
    align-items: start;
  }

  .auth-card {
    order: 2;
    align-self: start;
  }

}

@media (max-width: 420px) {
  .agent-panel {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .agent-panel img {
    width: 42px;
    height: 42px;
  }

  .agent-panel .agent-detail-btn {
    grid-column: 1 / -1;
    width: 100%;
  }

  .trust-strip {
    gap: 6px;
    min-height: 34px;
    padding: 6px 8px;
    font-size: clamp(8.5px, 2.45vw, 10.5px);
  }

  .trust-strip span {
    padding-left: 8px;
  }

  .topbar {
    align-items: flex-start;
  }

  .brand strong {
    font-size: 14px;
  }

  .brand-mark {
    width: 40px;
    height: 40px;
  }

  .logout-button {
    min-width: 78px;
    padding: 0 10px;
  }

  .profile-chip {
    max-width: 102px;
    padding-right: 6px;
  }

  .profile-chip span {
    display: inline;
    font-size: 11px;
  }

  .step-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }

  .step-nav .nav-action {
    padding-right: 8px;
    padding-left: 8px;
  }

  .financial-grid {
    grid-template-columns: 1fr;
  }

  .capture-thumbnail {
    width: 78px;
    height: 78px;
  }

  .capture-thumbnail.full-preview {
    width: 100%;
    height: auto;
  }

  .settings-actions {
    flex-direction: column;
  }
}

@media (max-width: 319px) {
  .step-nav .nav-label {
    display: none;
  }

  .step-nav .nav-action {
    min-height: 44px;
  }
}
