/* The information button is separate from each repayment radio label. */
button.repayment-info-button[data-repayment-help] {
  display: inline-flex;
  position: relative;
  align-items: center;
  justify-content: center;
  margin: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #6c47c8;
  vertical-align: middle;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
  transition: color .16s ease, background-color .16s ease;
}

button.repayment-info-button[data-repayment-help] svg {
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

button.repayment-info-button[data-repayment-help]:hover,
button.repayment-info-button[data-repayment-help][aria-expanded="true"] {
  background: #eee6fb;
  color: #5932b8;
}

button.repayment-info-button[data-repayment-help]:active {
  background: #e4d7f8;
}

button.repayment-info-button[data-repayment-help]:focus-visible {
  outline: 3px solid #a38ada;
  outline-offset: 1px;
  background: #f2ebfc;
}

.repayment-options .repayment-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 0;
  min-height: 76px;
  margin: 0;
  padding: 12px;
  border: 1px solid #e4d9f0;
  border-radius: 14px;
  background: #fff;
  transition: background-color .18s ease, border-color .18s ease;
}

.repayment-options .repayment-choice:has(input:checked) {
  border-color: #bba3e2;
  background: #f5effe;
}

.repayment-options .repayment-choice:focus-within {
  border-color: #a88cd9;
}

.repayment-options .repayment-choice > input[type="radio"] {
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  margin: 6px 0 0;
  accent-color: var(--brand-purple, #7658df);
}

.repayment-options .repayment-choice-copy {
  flex: 1 1 auto;
  min-width: 0;
}

.repayment-options .repayment-choice-title {
  display: flex;
  align-items: center;
  gap: 0;
  min-width: 0;
}

/* Reset the legacy full-card label treatment on the new title-only label. */
.repayment-options .repayment-choice-title > label,
.repayment-options .repayment-choice-title > label:has(input:checked) {
  display: inline;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #34313d;
  font-size: 16px;
  line-height: 1.5;
  cursor: pointer;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.repayment-options .repayment-choice-title strong {
  display: inline;
  color: #34313d;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.5;
}

.repayment-options small.repayment-choice-description {
  display: block;
  margin: 3px 0 0;
  color: #51475f;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.repayment-tag {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  margin-top: 8px;
  padding: 2px 5px 2px 10px;
  border-radius: 10px;
  background: #f6e7da;
  color: #805538;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: middle;
}

.repayment-tag > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.repayment-tag > button.repayment-info-button[data-repayment-help] {
  color: inherit;
}

.repayment-tag > button.repayment-info-button[data-repayment-help]:hover,
.repayment-tag > button.repayment-info-button[data-repayment-help][aria-expanded="true"] {
  background: #f0dfd1;
  color: inherit;
}

.repayment-tag > button.repayment-info-button[data-repayment-help]:active {
  background: #ead5c4;
}

.repayment-tag > button.repayment-info-button[data-repayment-help]:focus-visible {
  outline-color: #b48261;
  background: #f0dfd1;
}

#funds-review .repayment-detail-value {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  max-width: 100%;
  vertical-align: middle;
}

#funds-review .repayment-detail-value > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.repayment-inline-term {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  max-width: 100%;
  vertical-align: middle;
  white-space: nowrap;
}

.repayment-help-popover {
  --repayment-help-enter-y: -10px;
  --repayment-help-radius: 20px;
  --repayment-help-border-width: 1.5px;
  --repayment-help-scroll-inset: var(--repayment-help-radius);
  position: fixed;
  z-index: 2000;
  inset: auto;
  width: min(360px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  margin: 0;
  padding: 0;
  overflow: visible;
  border: var(--repayment-help-border-width) solid #cbb7e9;
  border-radius: var(--repayment-help-radius);
  background: #fff;
  box-shadow: 0 16px 48px rgba(64, 39, 96, .18), 0 4px 12px rgba(64, 39, 96, .08);
  color: #34303d;
  font-size: 16px;
  line-height: 1.6;
  text-align: left;
  transform-origin: var(--repayment-help-arrow-x, 50%) top;
}

.repayment-help-popover.is-visible {
  animation: repayment-help-pop-in .38s cubic-bezier(.2, .75, .3, 1) both;
}

.repayment-help-popover[data-closing] {
  pointer-events: none;
}

.repayment-help-popover[data-side="above"] {
  --repayment-help-enter-y: 10px;
  transform-origin: var(--repayment-help-arrow-x, 50%) bottom;
}

.repayment-help-popover::before {
  position: absolute;
  z-index: 1;
  top: -8px;
  left: clamp(22px, var(--repayment-help-arrow-x, 50%), calc(100% - 22px));
  width: 14px;
  height: 14px;
  border-top: 1.5px solid #cbb7e9;
  border-left: 1.5px solid #cbb7e9;
  border-radius: 3px 0 0 0;
  background: #fff;
  content: "";
  transform: translateX(-50%) rotate(45deg);
  pointer-events: none;
}

.repayment-help-popover[data-side="above"]::before {
  top: auto;
  bottom: -8px;
  border: 0;
  border-right: 1.5px solid #cbb7e9;
  border-bottom: 1.5px solid #cbb7e9;
  border-radius: 0 0 3px 0;
}

.repayment-help-clip {
  padding-block: var(--repayment-help-scroll-inset);
  overflow: hidden;
  border-radius: calc(var(--repayment-help-radius) - var(--repayment-help-border-width));
}

.repayment-help-content {
  max-height: calc(100vh - 28px - var(--repayment-help-scroll-inset) - var(--repayment-help-scroll-inset));
  max-height: calc(100dvh - 28px - var(--repayment-help-scroll-inset) - var(--repayment-help-scroll-inset));
  padding: max(0px, calc(24px - var(--repayment-help-scroll-inset))) 20px;
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: 0;
  scrollbar-width: thin;
  scrollbar-color: #cbb8e7 transparent;
}

.repayment-help-popover .repayment-help-close {
  display: inline-flex;
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 10px;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: 0;
  padding: 0 0 2px;
  border: 0;
  border-radius: 50%;
  background: #f4eefb;
  color: #665277;
  font-size: 25px;
  font-weight: 400;
  line-height: 1;
}

.repayment-help-popover .repayment-help-close:hover {
  background: #eadef8;
  color: #4d3562;
}

.repayment-help-popover .repayment-help-close:focus-visible {
  outline: 3px solid #a38ada;
  outline-offset: 2px;
}

.repayment-help-popover .repayment-help-title {
  margin: 0 28px 12px 0;
  color: #29232f;
  font-size: 20px;
  font-weight: 750;
  letter-spacing: -.5px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.repayment-help-popover .repayment-help-copy {
  margin: 0 0 14px;
  color: #39323f;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.repayment-help-popover .repayment-help-example {
  margin: 0 0 16px;
  padding: 12px 13px;
  border: 1px solid #e9def6;
  border-radius: 13px;
  background: #f5f0fc;
  color: #453650;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.repayment-help-popover .repayment-help-example strong {
  color: #3f2d53;
  font-weight: 700;
}

.repayment-help-graph {
  margin: 16px 0 11px;
  padding: 9px 6px 0;
  border-radius: 14px;
  background: #fbf8fe;
}

.repayment-help-graph > svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.repayment-help-graph svg text {
  fill: #51475e;
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
}

.repayment-help-graph .repayment-help-principal {
  fill: var(--brand-purple, #7658df);
}

.repayment-help-graph .repayment-help-interest {
  fill: #eab28e;
}

.repayment-help-popover.is-visible .repayment-help-bar {
  transform-box: fill-box;
  transform-origin: center bottom;
  animation: repayment-help-bar-grow .45s cubic-bezier(.2, .75, .3, 1) var(--bar-delay, 0ms) both;
}

.repayment-help-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  margin: 0;
  color: #51465c;
  font-size: 14px;
  line-height: 1.5;
}

.repayment-help-legend-principal,
.repayment-help-legend-interest {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.repayment-help-legend-principal::before,
.repayment-help-legend-interest::before {
  display: block;
  flex: 0 0 10px;
  width: 10px;
  height: 10px;
  border-radius: 3px;
  background: var(--brand-purple, #7658df);
  content: "";
}

.repayment-help-legend-interest::before {
  background: #eab28e;
}

.repayment-help-amounts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 0;
}

.repayment-help-amounts > div {
  min-width: 0;
  padding: 11px 12px;
  border-radius: 12px;
  background: #f7f3fc;
}

.repayment-help-amounts > div > span {
  display: block;
  color: #62566e;
  font-size: 13px;
  line-height: 1.5;
}

.repayment-help-amounts strong {
  display: block;
  margin-top: 4px;
  color: #3d2e4b;
  font-size: 18px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  letter-spacing: -.4px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.repayment-help-popover .repayment-help-note {
  margin: 15px 0 0;
  color: #55495f;
  font-size: 14px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.insurance-help-popover .info-bubble {
  position: static;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  animation: none;
  transform: none;
}

.insurance-help-popover .info-bubble::before {
  display: none;
}

.insurance-help-popover .bubble-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 14px;
}

.insurance-help-popover .bubble-heading strong {
  flex: 1 1 auto;
  min-width: 0;
  color: #2f253a;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -.35px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.insurance-help-popover .bubble-heading [data-close-bubble] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  margin: -3px -5px 0 0;
  padding: 7px;
  border: 0;
  border-radius: 50%;
  background: #f4eefb;
  color: #665277;
}

.insurance-help-popover .bubble-heading [data-close-bubble] .icon {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.insurance-help-popover .bubble-heading [data-close-bubble]:hover {
  background: #eadef8;
  color: #4d3562;
}

.insurance-help-popover .bubble-heading [data-close-bubble]:focus-visible {
  outline: 3px solid #a38ada;
  outline-offset: 2px;
}

.insurance-help-popover .info-bubble p {
  margin: 0 0 14px;
  color: #3d3347;
  font-size: 16px;
  line-height: 1.75;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.insurance-help-popover .info-bubble p strong {
  color: #42304f;
  font-weight: 700;
}

.insurance-help-popover .info-bubble a {
  display: inline-block;
  max-width: 100%;
  color: #6742b8;
  font-size: 15px;
  line-height: 1.7;
  text-decoration: underline;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.insurance-help-popover .rate-table-scroll {
  max-height: 200px;
  margin: 14px 0;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #e6dbf1;
  border-radius: 12px;
  scrollbar-width: thin;
  scrollbar-color: #cbb8e7 transparent;
}

.insurance-help-popover .rate-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  color: #40344b;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  line-height: 1.65;
}

.insurance-help-popover .rate-table th,
.insurance-help-popover .rate-table td {
  padding: 9px 10px;
  border-bottom: 1px solid #eee7f5;
  color: #47394f;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.insurance-help-popover .rate-table th {
  position: sticky;
  z-index: 1;
  top: 0;
  background: #f5effc;
  color: #564267;
  font-weight: 700;
}

.insurance-help-popover .rate-table th:last-child,
.insurance-help-popover .rate-table td:last-child {
  text-align: right;
}

.insurance-help-popover .rate-table tr:last-child td {
  border-bottom: 0;
}

.insurance-help-popover .rate-table .current-score td {
  background: #f0e5fb;
  color: #5933a4;
  font-weight: 700;
}

@keyframes repayment-help-pop-in {
  0% { opacity: 0; transform: translateY(var(--repayment-help-enter-y)) scale(.9, .82); }
  68% { opacity: 1; transform: translateY(0) scale(1.025); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes repayment-help-bar-grow {
  from { opacity: .5; transform: scaleY(.05); }
  to { opacity: 1; transform: scaleY(1); }
}

@media (pointer: coarse) and (min-width: 420px) {
  .repayment-help-popover .repayment-help-close {
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
  }

  .insurance-help-popover .bubble-heading [data-close-bubble] {
    flex-basis: 44px;
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    margin-top: -6px;
  }
}

@media (max-width: 360px) {
  .repayment-help-content {
    padding-right: 17px;
    padding-left: 17px;
  }

  .repayment-help-popover .repayment-help-title {
    font-size: 19px;
  }

  .repayment-help-amounts strong {
    font-size: 17px;
  }

  .insurance-help-popover .info-bubble p {
    font-size: 15px;
  }
}

@media (prefers-reduced-motion: reduce) {
  button.repayment-info-button[data-repayment-help],
  .repayment-options .repayment-choice,
  .repayment-help-popover,
  .repayment-help-popover * {
    animation: none !important;
    transition: none !important;
  }
}
