:root {
  --acad-blue: #003f6b;
  --acad-yellow: #fbb040;
  --acad-ink: #243746;
  --acad-soft-blue: #eef5fa;
}

.value-entry-shell {
  align-self: center;
  margin-top: 0.75rem;
  max-width: none;
  width: min(94vw, 42rem) !important;
}

.value-entry {
  align-items: baseline;
  border-bottom: 3px solid var(--acad-blue);
  display: flex;
  justify-content: center;
  margin: 0 auto;
  max-width: 42rem;
  min-height: 9rem;
  padding: 1.25rem 0.5rem 0.75rem;
  position: relative;
  overflow: hidden;
  transition: border-color 180ms ease, transform 180ms ease;
  width: 100%;
}

.value-entry:focus-within {
  border-color: var(--acad-yellow);
  transform: translateY(-2px);
}

.value-entry-prefix,
.value-entry-suffix {
  color: var(--acad-blue);
  flex: 0 0 auto;
  font-size: clamp(1.8rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1;
}

.value-entry-input {
  background: transparent;
  border: 0;
  caret-color: var(--acad-yellow);
  color: var(--acad-blue);
  font-size: clamp(3rem, 10vw, 5.5rem);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  letter-spacing: -0.055em;
  line-height: 1;
  flex: 1 1 auto;
  min-width: 0;
  outline: none;
  padding: 0 0.4rem;
  text-align: center;
  width: 0;
}

.value-entry-input::placeholder {
  color: color-mix(in srgb, var(--acad-blue) 18%, white);
  opacity: 1;
}

.value-entry-name {
  align-self: center;
  font-family: inherit;
  letter-spacing: -0.035em;
  line-height: 1.15;
  min-height: 2.4em;
  overflow: hidden;
  overflow-wrap: normal;
  resize: none;
  white-space: normal;
  word-break: normal;
}

input::placeholder {
  color: color-mix(in srgb, var(--acad-ink) 28%, white);
  opacity: 1;
}

.searchable-location {
  position: relative;
}

.searchable-location.is-open {
  z-index: 60;
}

.searchable-location input {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--acad-blue) 45%, white);
  border-radius: 0.75rem;
  color: var(--acad-ink);
  min-height: 3.25rem;
  outline: none;
  padding: 0.75rem 2.6rem 0.75rem 0.85rem;
  transition: border-color 180ms ease, box-shadow 180ms ease;
  width: 100%;
}

.searchable-location select {
  background-color: transparent;
  border: 0;
  border-left: 1px solid color-mix(in srgb, var(--acad-blue) 18%, white);
  bottom: 0.35rem;
  color: var(--acad-blue);
  cursor: pointer;
  font-size: 0;
  min-height: 0;
  opacity: 1;
  outline: none;
  pointer-events: none;
  position: absolute;
  right: 0.45rem;
  top: 0.35rem;
  width: 2.25rem;
}

.searchable-location select option {
  color: var(--acad-ink);
}

.searchable-location select:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.location-options {
  background: #fff;
  border: 1px solid color-mix(in srgb, var(--acad-blue) 24%, white);
  border-radius: 0.85rem;
  box-shadow: 0 18px 42px rgb(0 63 107 / 16%);
  left: 0;
  margin-top: 0.4rem;
  max-height: 15rem;
  overflow-y: auto;
  padding: 0.35rem;
  position: absolute;
  right: 0;
  top: 100%;
  width: 100%;
}

.location-options button {
  align-items: center;
  background: transparent;
  border: 0;
  border-radius: 0.55rem;
  color: var(--acad-ink);
  cursor: pointer;
  display: flex;
  font: inherit;
  justify-content: space-between;
  padding: 0.7rem 0.75rem;
  text-align: left;
  width: 100%;
}

.location-options button:hover,
.location-options button:focus-visible,
.location-options button[aria-selected="true"] {
  background: var(--acad-soft-blue);
  color: var(--acad-blue);
  outline: none;
}

.location-options small {
  color: #628096;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.75rem;
}

.location-empty {
  color: #628096;
  font-size: 0.9rem;
  padding: 0.8rem;
  text-align: center;
}

.searchable-location input:focus {
  border-color: var(--acad-blue);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--acad-blue) 12%, transparent);
}

.searchable-location input:disabled {
  background: #f3f5f6;
  cursor: not-allowed;
  opacity: 0.65;
}

.result-panel {
  padding: 2rem 1rem;
}

.result-summary {
  width: min(100%, 38rem);
}

.result-total {
  box-shadow: 0 14px 34px rgb(251 176 64 / 24%);
  font-variant-numeric: tabular-nums;
}

.savings-breakdown {
  background: #fff;
  border: 1px solid rgb(0 63 107 / 14%);
  border-radius: 1.25rem;
  box-shadow: 0 16px 38px rgb(0 63 107 / 10%);
  color: var(--acad-blue);
  margin-top: 1.5rem;
  padding: 1.25rem;
  width: min(92%, 36rem);
}

.savings-breakdown-title {
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.rate-comparison,
.saving-periods {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1rem;
}

.saving-periods {
  grid-template-columns: minmax(0, 1fr);
}

.rate-stat,
.saving-stat {
  background: var(--acad-soft-blue);
  border-radius: 0.9rem;
  padding: 0.9rem 0.6rem;
}

.rate-stat {
  align-items: center;
  display: grid;
  grid-template-rows: 2.5rem auto;
}

.saving-stat {
  padding: 1rem 1.25rem;
  width: 100%;
}

.rate-stat.acad-rate,
.saving-stat.annual-saving {
  background: #fff4df;
}

.rate-stat span,
.saving-stat span {
  display: block;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rate-stat span {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: 2.5rem;
}

.rate-stat strong,
.saving-stat strong {
  display: block;
  font-size: clamp(1.35rem, 4vw, 2rem);
  font-variant-numeric: tabular-nums;
  margin-top: 0.2rem;
}

.rate-stat strong {
  margin-top: 0;
}

.saving-stat strong {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  width: 100%;
}

.animated-number {
  display: block;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.025em;
  line-height: 1.08;
  max-width: 100%;
  overflow: hidden;
  text-transform: none;
  white-space: nowrap;
  width: 100%;
}

.result-total,
.saving-stat {
  min-width: 0;
  overflow: hidden;
}

.rate-reduction {
  color: #42647c;
  font-size: 0.9rem;
  margin-top: 0.85rem;
}

@media (max-width: 640px) {
  .flex:has(> .searchable-location) {
    flex-wrap: wrap;
    justify-content: center;
  }

  .searchable-location {
    flex: 1 0 100%;
    width: 100% !important;
  }

  .value-entry {
    min-height: 7.5rem;
  }

  .result-panel {
    gap: 1.5rem !important;
    padding-top: 0.5rem;
  }

  .savings-breakdown {
    margin-top: 1rem;
    padding: 1rem;
  }
}

@media (max-width: 480px) {
  .value-entry-shell {
    width: 94vw !important;
  }

  .value-entry {
    min-height: 6.75rem;
    padding-inline: 0.25rem;
  }

  .value-entry-prefix,
  .value-entry-suffix {
    font-size: clamp(1.45rem, 7vw, 2rem);
  }

  .searchable-location input {
    font-size: 0.9rem;
    padding-inline: 0.7rem;
  }
}

@media (max-width: 1023px) {
  .overflow-y-hidden {
    overflow-y: auto;
  }
}

@supports (height: 100dvh) {
  .h-screen {
    height: 100dvh;
  }

  .min-h-screen {
    min-height: 100dvh;
  }
}

@media (prefers-reduced-motion: reduce) {
  .value-entry,
  .searchable-location input {
    transition: none;
  }
}
