.calculator-detail-page main {
  background:
    radial-gradient(circle at 12% 12%, rgba(8, 174, 100, .06), transparent 240px),
    radial-gradient(circle at 88% 20%, rgba(22, 136, 255, .07), transparent 260px),
    linear-gradient(180deg, #fbfdff 0%, #f6fbff 55%, #fff 100%);
}

.calculator-detail-page .directory-header,
.calculator-detail-page .directory-footer,
.calculator-detail-page .cookie-bar {
  background: #fff;
}

.detail-hero {
  padding: 20px 0 18px;
  background:
    radial-gradient(circle at 78% 28%, rgba(8, 174, 100, .10), transparent 210px),
    linear-gradient(180deg, #ffffff 0%, #f8fcff 100%);
  border-bottom: 1px solid #e4ebf3;
}

.breadcrumbs,
.detail-title-row,
.detail-trust,
.panel-heading,
.summary-grid,
.breakdown-row,
.formula-tabs,
.faq-heading {
  display: flex;
  align-items: center;
}

.breadcrumbs {
  gap: 7px;
  margin-bottom: 14px;
  color: #6a7c95;
  font-size: 12px;
  font-weight: 650;
}

.breadcrumbs svg {
  width: 12px;
  height: 12px;
}

.detail-title-row {
  justify-content: space-between;
  gap: 28px;
}

.detail-title-row h1 {
  margin: 0;
  color: #061738;
  font-size: 34px;
  line-height: 1.05;
  font-weight: 850;
}

.detail-title-row p {
  margin: 8px 0 0;
  color: #48607f;
  font-size: 15px;
}

.detail-title-row h1::after {
  content: "";
  display: block;
  width: 74px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #08ae64, #20cfd0);
}

.detail-trust {
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  max-width: 520px;
}

.detail-trust span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #dce6f2;
  border-radius: 999px;
  background: #fff;
  color: #173153;
  font-size: 12px;
  font-weight: 750;
}

.detail-trust span:first-child {
  border-color: #c7f2df;
  background: #f0fbf6;
  color: #009b5c;
}

.calculator-workspace {
  padding: 20px 0 12px;
}

.workspace-grid {
  display: grid;
  grid-template-columns: minmax(340px, .88fr) minmax(420px, 1.12fr);
  gap: 22px;
}

.input-panel,
.result-panel,
.formula-card,
.schedule-card {
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 16px 40px rgba(25, 60, 102, .07);
}

.input-panel,
.result-panel {
  position: relative;
  padding: 20px;
}

.input-panel {
  overflow: visible;
}

.result-panel {
  overflow: hidden;
}

.input-panel::before,
.result-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 4px;
  background: linear-gradient(90deg, #08ae64, #20cfd0);
}

.result-panel::after {
  content: "";
  position: absolute;
  right: -90px;
  top: -90px;
  width: 230px;
  height: 230px;
  border-radius: 50%;
  background: rgba(8, 174, 100, .08);
  pointer-events: none;
}

.panel-heading {
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.panel-heading h2,
.formula-card h2,
.schedule-card h2,
.faq-heading h2 {
  margin: 0;
  color: #061738;
  font-size: 16px;
  font-weight: 850;
}

.soft-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 0;
  background: transparent;
  color: #1688ff;
  font-size: 12px;
  font-weight: 800;
}

.mortgage-form {
  display: grid;
  gap: 13px;
}

.mortgage-form label {
  display: grid;
  gap: 7px;
  color: #173153;
  font-size: 12px;
  font-weight: 750;
}

.field-box,
.split-field {
  display: flex;
  align-items: center;
  min-width: 0;
}

.field-box {
  height: 44px;
  gap: 8px;
  padding: 0 14px;
  border: 1px solid #dce6f2;
  border-radius: 6px;
  background: #fbfdff;
  transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.field-box:focus-within {
  border-color: rgba(8, 174, 100, .7);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(8, 174, 100, .08);
}

.field-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: #071b43;
  font-size: 13px;
  font-weight: 650;
  appearance: textfield;
}

.field-box input::-webkit-outer-spin-button,
.field-box input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.field-box input[type="month"] {
  color-scheme: light;
}

.field-box span {
  flex: 0 0 auto;
  color: #48607f;
  font-size: 12px;
  font-weight: 750;
}

.split-field {
  gap: 10px;
}

.split-field .prefix-field {
  flex: 1;
}

.percent-box {
  width: 104px;
  flex: 0 0 104px;
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 4px;
}

.primary-action,
.secondary-action {
  height: 38px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 850;
}

.primary-action {
  border: 1px solid #08ae64;
  background: linear-gradient(180deg, #12bd72, #00a85c);
  color: #fff;
  box-shadow: 0 12px 22px rgba(0, 166, 87, .18);
}

.secondary-action {
  border: 1px solid #dce6f2;
  background: #f8fbff;
  color: #173153;
}

.privacy-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  color: #48607f;
  font-size: 12px;
}

.result-panel {
  min-height: 100%;
}

.result-main {
  position: relative;
  z-index: 1;
  padding: 14px 16px;
  border-bottom: 1px solid #e7eef7;
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(8, 174, 100, .10), rgba(32, 207, 208, .06));
}

.result-main span,
.summary-grid span {
  display: block;
  color: #48607f;
  font-size: 12px;
  font-weight: 650;
}

.result-main strong {
  display: block;
  margin-top: 5px;
  color: #009b5c;
  font-size: 30px;
  line-height: 1;
  font-weight: 850;
}

.summary-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid #e7eef7;
}

.summary-grid strong {
  display: block;
  margin-top: 5px;
  color: #061738;
  font-size: 13px;
  font-weight: 850;
}

.result-panel h3 {
  position: relative;
  z-index: 1;
  margin: 14px 0 14px;
  color: #061738;
  font-size: 14px;
  font-weight: 850;
}

.breakdown-row {
  position: relative;
  z-index: 1;
  align-items: center;
  justify-content: center;
  gap: 34px;
}

.donut {
  display: grid;
  place-items: center;
  position: relative;
  width: 150px;
  height: 150px;
  border-radius: 50%;
  background: conic-gradient(
    #08ae64 0 var(--principal-share, 20%),
    #3f86ff var(--principal-share, 20%) var(--interest-share, 78%),
    #ffbd20 var(--interest-share, 78%) 100%
  );
  box-shadow: 0 18px 34px rgba(8, 174, 100, .14);
}

.donut::after {
  content: "";
  position: absolute;
  inset: 31px;
  border-radius: 50%;
  background: #fff;
  box-shadow: inset 0 0 0 1px #e7eef7;
}

.donut span,
.donut small {
  position: relative;
  z-index: 1;
  text-align: center;
}

.donut span {
  margin-top: 10px;
  color: #061738;
  font-size: 16px;
  font-weight: 850;
}

.donut small {
  margin-top: -36px;
  color: #48607f;
  font-size: 10px;
  font-weight: 700;
}

.legend-list {
  display: grid;
  gap: 12px;
  min-width: 230px;
}

.legend-list span {
  display: grid;
  grid-template-columns: 10px 1fr auto;
  align-items: center;
  gap: 9px;
  color: #48607f;
  font-size: 12px;
}

.legend-list i {
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.principal-dot {
  background: #08ae64;
}

.interest-dot {
  background: #3f86ff;
}

.escrow-dot {
  background: #ffbd20;
}

.legend-list strong {
  color: #061738;
  font-weight: 850;
}

.formula-section {
  padding: 0 0 14px;
}

.formula-tabs {
  gap: 34px;
  border-bottom: 1px solid #dce6f2;
}

.formula-tabs button {
  position: relative;
  min-height: 42px;
  border: 0;
  background: transparent;
  color: #173153;
  font-size: 13px;
  font-weight: 800;
}

.formula-tabs button.is-active {
  color: #1688ff;
}

.formula-tabs button.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  border-radius: 999px;
  background: #1688ff;
}

.tab-panel {
  display: none;
}

.tab-panel.is-active {
  display: grid;
}

.formula-card {
  grid-template-columns: minmax(0, 1fr) minmax(260px, .9fr);
  gap: 38px;
  padding: 20px;
  background:
    radial-gradient(circle at 92% 28%, rgba(8, 174, 100, .12), transparent 220px),
    linear-gradient(90deg, #ffffff 0%, #f0fbf7 100%);
}

.equation {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 18px 0 0;
  padding: 18px 22px;
  border-radius: 7px;
  background: linear-gradient(90deg, #fff, #eaf9f3);
  color: #061738;
  font-size: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-style: italic;
}

.formula-card h3 {
  margin: 0 0 8px;
  color: #061738;
  font-size: 14px;
}

.formula-card ul {
  display: grid;
  gap: 7px;
  margin: 0;
  padding-left: 18px;
  color: #48607f;
  font-size: 13px;
}

.schedule-card {
  padding: 18px;
}

.schedule-table {
  overflow: hidden;
  border: 1px solid #dce6f2;
  border-radius: 7px;
}

.schedule-head,
.schedule-row {
  display: grid;
  grid-template-columns: .7fr 1fr 1fr 1fr;
  gap: 12px;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  font-size: 12px;
}

.schedule-head {
  background: linear-gradient(90deg, #f0fbf6, #f4f8fc);
  color: #073f2c;
  font-weight: 850;
}

.schedule-row {
  border-top: 1px solid #e7eef7;
  color: #48607f;
}

.mini-bars {
  display: grid;
  gap: 10px;
}

.mini-bar {
  display: grid;
  grid-template-columns: 70px 1fr 68px;
  align-items: center;
  gap: 12px;
  color: #48607f;
  font-size: 12px;
}

.mini-bar span:nth-child(2) {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7eef7;
}

.mini-bar span:nth-child(2)::before {
  content: "";
  display: block;
  width: var(--bar-width);
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #08ae64, #20cfd0);
}

.detail-related {
  background: #fff;
}

.faq-section {
  padding: 14px 0 18px;
  background: #fff;
}

.faq-heading {
  justify-content: space-between;
  margin-bottom: 10px;
}

.faq-list {
  overflow: hidden;
  border: 1px solid #dce6f2;
  border-radius: 8px;
  background: #fff;
}

.faq-item {
  border-bottom: 1px solid #e7eef7;
}

.faq-item:last-child {
  border-bottom: 0;
}

.faq-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  background: #fff;
  color: #061738;
  font-size: 13px;
  font-weight: 800;
  text-align: left;
}

.faq-item p {
  display: none;
  margin: 0;
  padding: 0 16px 14px;
  color: #48607f;
  font-size: 13px;
  line-height: 1.45;
}

.faq-item.is-open p {
  display: block;
  background: linear-gradient(90deg, rgba(8, 174, 100, .045), transparent);
}

.faq-item.is-open button svg {
  transform: rotate(180deg);
}

@media (max-width: 980px) {
  .detail-title-row,
  .workspace-grid,
  .formula-card,
  .summary-grid {
    grid-template-columns: 1fr;
  }

  .detail-title-row,
  .breakdown-row,
  .faq-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .detail-title-row h1 {
    font-size: 30px;
  }

  .detail-trust {
    justify-content: flex-start;
  }

  .workspace-grid {
    display: grid;
  }

  .formula-tabs {
    gap: 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .formula-tabs::-webkit-scrollbar {
    display: none;
  }

  .formula-tabs button {
    flex: 0 0 auto;
  }

  .schedule-head,
  .schedule-row {
    grid-template-columns: .55fr 1fr 1fr 1fr;
    padding: 0 10px;
  }
}

@media (max-width: 620px) {
  .detail-hero {
    padding: 14px 0;
  }

  .detail-title-row h1 {
    font-size: 26px;
  }

  .detail-title-row p {
    font-size: 13px;
  }

  .calculator-workspace {
    padding-top: 14px;
  }

  .workspace-grid {
    gap: 14px;
  }

  .input-panel,
  .result-panel,
  .formula-card,
  .schedule-card {
    padding: 14px;
  }

  .split-field,
  .form-actions {
    grid-template-columns: 1fr;
    display: grid;
  }

  .percent-box {
    width: 100%;
  }

  .result-main strong {
    font-size: 26px;
  }

  .breakdown-row {
    align-items: center;
  }

  .legend-list {
    width: 100%;
    min-width: 0;
  }

  .equation {
    display: block;
    width: 100%;
    overflow-x: auto;
    font-size: 17px;
    white-space: nowrap;
  }

  .schedule-table {
    overflow-x: auto;
  }

  .schedule-head,
  .schedule-row {
    min-width: 520px;
  }
}
