body.journey-open {
  overflow: hidden;
}

.journey-launcher {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(420px, 1.4fr) auto;
  gap: 24px;
  align-items: center;
  margin: 18px 0;
  border-top: 1px solid rgba(63, 115, 184, 0.2);
  border-bottom: 1px solid rgba(63, 115, 184, 0.2);
  background: linear-gradient(90deg, #fff 0%, #f5f9ff 68%, #fff9d9 100%);
  padding: 24px;
}

.journey-launcher-copy span,
.journey-loan-heading span {
  color: #3f73b8;
  font-size: 12px;
  font-weight: 900;
}

.journey-launcher-copy h2,
.journey-loan-heading h3 {
  margin: 5px 0 6px;
  color: #101828;
  letter-spacing: 0;
}

.journey-launcher-copy h2 {
  font-size: 23px;
}

.journey-launcher-copy p,
.journey-loan-heading p {
  margin: 0;
  color: #5f6673;
}

.journey-launcher-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(82px, 1fr));
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.journey-launcher-steps li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  min-width: 0;
  color: #40516a;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.journey-launcher-steps li:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 16px;
  left: calc(50% + 18px);
  width: calc(100% - 36px);
  height: 2px;
  background: #c8d7ea;
}

.journey-launcher-steps b,
.journey-step-nav b {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #3f73b8;
  color: #fff;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.journey-launcher-actions {
  display: grid;
  gap: 8px;
  min-width: 190px;
}

.journey-dialog[hidden] {
  display: none;
}

.journey-dialog {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}

.journey-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(16, 24, 40, 0.58);
  backdrop-filter: blur(5px);
}

.journey-window {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  width: min(1240px, calc(100vw - 40px));
  height: min(900px, calc(100dvh - 40px));
  overflow: hidden;
  border: 1px solid #c8d7ea;
  border-radius: 8px;
  background: #f5f7fb;
  box-shadow: 0 30px 90px rgba(16, 24, 40, 0.28);
  outline: none;
}

.journey-window-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 92px;
  border-bottom: 1px solid #d7e0ed;
  background: #fff;
  padding: 16px 22px;
}

.journey-window-head > div {
  min-width: 0;
}

.journey-window-head span {
  color: #3f73b8;
  font-size: 12px;
  font-weight: 900;
}

.journey-window-head h2 {
  margin: 3px 0;
  color: #101828;
  font-size: 23px;
}

.journey-window-head p {
  margin: 0;
  color: #5f6673;
  font-size: 13px;
}

.journey-close {
  display: inline-grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  min-height: 42px;
  border: 1px solid #c8d7ea;
  background: #fff;
  color: #344054;
  padding: 0;
  font-size: 25px;
  line-height: 1;
}

.journey-close:hover {
  background: #eef4fc;
  color: #0b3670;
}

.journey-step-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid #d7e0ed;
  background: #fff;
  padding: 0 22px;
}

.journey-step-nav button {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 62px;
  border-radius: 0;
  background: transparent;
  color: #667085;
  padding: 8px 10px;
}

.journey-step-nav button::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 0;
  left: 10px;
  height: 3px;
  background: transparent;
}

.journey-step-nav button:hover:not(:disabled),
.journey-step-nav button.is-active {
  background: #f6f9fe;
  color: #0b3670;
}

.journey-step-nav button.is-active::after {
  background: #f6cd00;
}

.journey-step-nav button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
}

.journey-step-nav button:disabled b {
  background: #b8c5d6;
}

.journey-stage {
  min-height: 0;
  overflow: hidden;
}

.journey-pane {
  height: 100%;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 18px;
}

.journey-pane[hidden] {
  display: none;
}

.journey-pane .command-center,
.journey-pane .answer-grid,
.journey-pane .evidence-panel {
  margin: 0;
}

.journey-pane .chat-panel,
.journey-pane .panel {
  box-shadow: none;
}

.journey-pane[data-journey-pane="chat"] .chat-messages {
  min-height: 420px;
  max-height: none;
  height: min(540px, calc(100dvh - 390px));
}

.journey-pane[data-journey-pane="result"] .answer-grid {
  grid-template-columns: minmax(0, 1fr) 280px;
}

.journey-pane[data-journey-pane="evidence"] .evidence-panel {
  padding: 18px;
}

.journey-loan-heading {
  margin-bottom: 12px;
  border-left: 4px solid #f6cd00;
  background: #fff;
  padding: 14px 16px;
}

.journey-window-foot {
  display: grid;
  grid-template-columns: minmax(130px, auto) minmax(0, 1fr) minmax(170px, auto);
  gap: 14px;
  align-items: center;
  min-height: 70px;
  border-top: 1px solid #d7e0ed;
  background: #fff;
  padding: 12px 22px;
}

.journey-window-foot span {
  overflow: hidden;
  color: #5f6673;
  font-size: 13px;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-window-foot button {
  min-height: 44px;
}

.journey-window-foot button:disabled {
  border-color: #d7e0ed;
  background: #eef2f7;
  color: #98a2b3;
  cursor: not-allowed;
  opacity: 1;
}

@media (max-width: 980px) {
  .journey-launcher {
    grid-template-columns: 1fr;
  }

  .journey-launcher-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .journey-pane[data-journey-pane="result"] .answer-grid {
    grid-template-columns: 1fr;
  }

  .journey-pane[data-journey-pane="result"] .side-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .journey-launcher {
    gap: 18px;
    margin-right: -16px;
    margin-left: -16px;
    padding: 22px 16px;
  }

  .journey-launcher-copy h2 {
    font-size: 21px;
  }

  .journey-launcher-steps {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .journey-launcher-steps li {
    font-size: 11px;
  }

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

  .journey-dialog {
    padding: 0;
  }

  .journey-window {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }

  .journey-window-head {
    min-height: 76px;
    padding: 10px 14px;
  }

  .journey-window-head h2 {
    font-size: 18px;
  }

  .journey-window-head p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .journey-close {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    min-height: 40px;
  }

  .journey-step-nav {
    padding: 0 4px;
  }

  .journey-step-nav button {
    display: grid;
    justify-items: center;
    gap: 3px;
    min-height: 58px;
    padding: 5px 2px;
    font-size: 11px;
    line-height: 1.2;
  }

  .journey-step-nav b {
    width: 27px;
    height: 27px;
    font-size: 11px;
  }

  .journey-pane {
    padding: 10px;
  }

  .journey-pane[data-journey-pane="chat"] .chat-messages {
    min-height: 48dvh;
    height: 54dvh;
  }

  .journey-pane .chat-panel,
  .journey-pane .panel,
  .journey-pane[data-journey-pane="evidence"] .evidence-panel {
    padding: 12px;
  }

  .journey-window-foot {
    grid-template-columns: 104px minmax(0, 1fr) 132px;
    gap: 7px;
    min-height: 64px;
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
  }

  .journey-window-foot span {
    font-size: 11px;
  }

  .journey-window-foot button {
    min-height: 42px;
    padding: 0 8px;
    font-size: 12px;
  }
}

@media (max-width: 420px) {
  .journey-window-foot {
    grid-template-columns: 96px 1fr 122px;
  }

  .journey-window-foot span {
    display: none;
  }
}
