.mas-calculator {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 1.25rem;
  align-items: start;
  margin-top: 1.6rem;
  padding-top: 1rem;
  border-top: 1px dashed #8ea2b8;
}

.calc-inputs {
  order: 1;
}

.calc-cta {
  margin-top: 0.4rem;
}

.calc-inputs > h2 {
  margin: 1.4rem 0 0.8rem;
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  color: #1f3144;
}

.calc-inputs > h2:first-child {
  margin-top: 0;
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.field-span-2 {
  grid-column: 1 / -1;
}

.field-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.95rem;
  color: #2f4458;
  font-weight: 600;
}

.label-row {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.tip-wrap {
  position: relative;
  display: inline-flex;
}

.tip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 999px;
  border: 1px solid #89a4bf;
  color: #436282;
  font-size: 0.72rem;
  font-weight: 800;
  cursor: help;
  line-height: 1;
  background: #f6fbff;
}

.tip-text {
  position: absolute;
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  bottom: calc(100% + 6px);
  min-width: 220px;
  max-width: 280px;
  padding: 0.5rem 0.58rem;
  border-radius: 7px;
  background: #213245;
  border: 1px solid #41566c;
  color: #e8f1fb;
  font-size: 0.83rem;
  line-height: 1.45;
  box-shadow: 0 10px 24px rgba(13, 18, 24, 0.3);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
  z-index: 20;
}

.tip-wrap.open .tip-text {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (hover: hover) and (pointer: fine) {
  .tip-wrap:hover .tip-text {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

.applicant-groups {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}

.applicant-card {
  border: 1px solid #c5d1df;
  border-radius: 8px;
  padding: 0.7rem;
  background: #f7fbff;
}

.applicant-card h3 {
  margin: 0 0 0.65rem;
  font-size: 1.2rem;
  color: #27445f;
}

.applicant-field-grid {
  grid-template-columns: 1fr;
}

.applicant-hidden {
  display: none;
}

.field-grid input,
.field-grid select {
  width: 100%;
  min-height: 44px;
  padding: 0.62rem 0.72rem;
  border-radius: 8px;
  border: 1px solid #b9c8d6;
  background: #fefefe;
  color: #1f2f40;
  font-family: 'Barlow', sans-serif;
  font-size: 1rem;
  line-height: 1.35;
}

.field-grid input:focus,
.field-grid select:focus {
  outline: none;
  border-color: #7f99b3;
  box-shadow: 0 0 0 2px rgba(131, 160, 188, 0.22);
}

.calc-results {
  order: 2;
  position: sticky;
  top: 88px;
  border: 1px solid #536171;
  background: linear-gradient(180deg, #2f3944 0%, #28323d 100%);
  border-radius: 10px;
  padding: 1rem;
  box-shadow: 0 16px 30px rgba(8, 12, 18, 0.26);
}

.calc-results h2 {
  margin: 0;
  font-size: 1.55rem;
  line-height: 1.1;
  color: #f2f8ff;
}

.results-sub {
  margin: 0.35rem 0 0.75rem;
  font-size: 0.9rem;
  color: #ccd9e8;
}

.metric-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.results-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
  margin-bottom: 0.6rem;
}

.metric-card {
  background: #202a35;
  border: 1px solid #4d5d6f;
  border-radius: 8px;
  padding: 0.62rem 0.7rem;
}

.metric-card-primary {
  background: linear-gradient(180deg, #1b2632 0%, #16212c 100%);
  border-color: #6d8195;
}

.metric-card-compact {
  padding: 0.55rem 0.62rem;
}

.metric-label {
  margin: 0;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #b1c3d6;
}

.metric-value {
  margin: 0.18rem 0 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.85rem;
  line-height: 1;
  color: #f4f9ff;
}

.metric-value-sm {
  font-size: 1.35rem;
}

.metric-state {
  margin: 0.26rem 0 0;
  font-size: 0.87rem;
  font-weight: 700;
  color: #c2d6ea;
}

.metric-note {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: #afc2d7;
}

.compliance-strip {
  margin-top: 0.7rem;
  padding: 0.62rem;
  border: 1px solid #4f6174;
  border-radius: 8px;
  background: rgba(10, 18, 27, 0.45);
}

.compliance-title {
  margin: 0 0 0.5rem;
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #d3e2f1;
}

.compliance-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.boost-summary {
  margin-top: 0.7rem;
  padding: 0.62rem;
  border: 1px solid #4f6174;
  border-radius: 8px;
  background: rgba(10, 18, 27, 0.45);
}

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

.boost-model-note {
  margin: 0.55rem 0 0;
  font-size: 0.8rem;
  color: #b9ccdf;
}

.state-pass {
  color: #3f7a1d;
}

.state-borderline {
  color: #8b6800;
}

.state-fail {
  color: #a63b3b;
}

.state-na {
  color: #a3b5c9;
}

.assumptions {
  margin-top: 0.8rem;
  padding: 0.7rem;
  background: rgba(12, 19, 27, 0.38);
  border: 1px solid #4b5a6a;
  border-radius: 8px;
}

.assumptions h3 {
  margin: 0;
  font-size: 1.15rem;
  color: #dbe8f6;
}

.assumptions ul {
  margin: 0.5rem 0 0;
  padding-left: 1rem;
}

.assumptions li {
  color: #ccdae9;
  margin: 0.18rem 0;
  font-size: 0.95rem;
}

.boost-section {
  margin-top: 1rem;
  border: 1px solid #b8c8d8;
  border-radius: 10px;
  padding: 0.95rem;
  background: linear-gradient(180deg, #f4f8fd 0%, #edf4fb 100%);
  box-shadow: 0 8px 18px rgba(16, 32, 48, 0.1);
}

.boost-section h2 {
  margin-top: 0;
  color: #1f3144;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
}

.boost-intro {
  margin: 0 0 0.7rem;
  color: #2f465c;
  font-size: 1.02rem;
  line-height: 1.58;
}

.boost-cta-line {
  margin: 0;
  color: #1c3144;
  font-weight: 700;
  line-height: 1.55;
}

.boost-cta-box {
  margin-top: 0.85rem;
  border: 1px solid #aabed3;
  background: linear-gradient(180deg, #f7fbff 0%, #edf4fb 100%);
  border-radius: 9px;
  padding: 0.75rem;
}

.boost-cta-box .advice-buttons {
  margin-top: 0.65rem;
}

.boost-field .label-row {
  display: block;
  min-height: 3.4rem;
  color: #2b4257;
  font-weight: 700;
  line-height: 1.4;
}

.boost-section .field-grid {
  align-items: start;
}

.boost-section input[type="number"] {
  background: #ffffff;
  border-color: #9fb4c8;
  color: #1b2f41;
}

.boost-section input[type="number"]:focus {
  border-color: #6f8aa6;
  box-shadow: 0 0 0 2px rgba(111, 138, 166, 0.2);
}

.boost-section .advice-buttons .btn-secondary,
.calc-cta .advice-buttons .btn-secondary {
  color: #1b2c3f;
  border-color: #4d657b;
  background: #e6eff8;
  font-weight: 800;
}

.boost-section .advice-buttons .btn-secondary:hover,
.calc-cta .advice-buttons .btn-secondary:hover {
  background: #dce9f6;
  color: #152537;
  border-color: #3f586d;
}

.related-lite {
  margin-top: 1rem;
}

.related-lite h2 {
  margin-bottom: 0.45rem;
}

.cpf-cash-tool {
  border: 1px solid #c4d1df;
  border-radius: 10px;
  background: #f7fbff;
  padding: 0.9rem;
}

.cpf-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  margin-bottom: 0.7rem;
}

.cpf-result-card {
  background: #ffffff;
  border: 1px solid #b5c7d9;
  border-radius: 8px;
  padding: 0.62rem 0.7rem;
  box-shadow: 0 4px 10px rgba(20, 37, 55, 0.08);
}

.cpf-result-card .metric-label {
  color: #1f3347;
  font-weight: 700;
}

.cpf-result-card .metric-value {
  color: #17344d;
  text-shadow: none;
}

.cpf-tool-page {
  grid-template-columns: minmax(0, 1fr) 430px;
}

.cpf-tool-page .cpf-result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.cpf-tool-page .cpf-result-card {
  min-height: 150px;
}

.cpf-tool-page .cpf-result-card .metric-label {
  font-size: 0.86rem;
  line-height: 1.3;
  letter-spacing: 0.04em;
  word-break: normal;
  overflow-wrap: normal;
}

.cpf-tool-page .cpf-result-card .metric-value {
  margin-top: 0.45rem;
  font-size: 1.9rem;
  line-height: 1.05;
}

.simple-tool-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 1rem;
  align-items: start;
}

.simple-tool-inputs {
  display: grid;
  gap: 1rem;
  grid-column: 1;
  grid-row: 1;
}

.simple-tool-button {
  width: 100%;
  justify-content: center;
}

.simple-tool-result {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
}

.simple-tool-grid > .content-section:not(.simple-tool-inputs):not(.simple-tool-result) {
  grid-column: 1 / -1;
}

.simple-result-card {
  border: 1px solid #9cb1c6;
  border-radius: 14px;
  padding: 1.1rem;
  background: linear-gradient(180deg, #eff5fb 0%, #f7fbff 100%);
  box-shadow: 0 10px 24px rgba(20, 37, 55, 0.1);
}

.simple-result-card.result-card-pass {
  border-color: #74a763;
  background: linear-gradient(180deg, #edf8e9 0%, #f7fbf6 100%);
}

.simple-result-card.result-card-fail {
  border-color: #c97f7f;
  background: linear-gradient(180deg, #fff0f0 0%, #fff8f8 100%);
}

.simple-result-card.result-card-na {
  border-color: #9cb1c6;
}

.simple-result-label {
  margin: 0;
  color: #5a7389;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  font-weight: 700;
}

.simple-result-value {
  margin: 0.15rem 0 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 0.95;
  color: #132f47;
}

.simple-result-state {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 800;
}

.simple-result-note {
  margin: 0.55rem 0 0;
  color: #294760;
  font-size: 0.95rem;
}

.msr-simple-tool,
.tdsr-simple-tool,
.stamp-duty-tool {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  gap: 1rem;
  align-items: start;
}

.msr-simple-inputs,
.tdsr-simple-inputs,
.stamp-duty-inputs {
  display: grid;
  gap: 1rem;
  grid-column: 1;
  grid-row: 1;
}

.msr-simple-button,
.tdsr-simple-button,
.stamp-duty-button {
  width: 100%;
  justify-content: center;
}

.msr-simple-result,
.tdsr-simple-result,
.stamp-duty-result {
  grid-column: 2;
  grid-row: 1;
  align-self: start;
  display: flex;
  margin-top: 1rem;
}

.msr-simple-tool > .content-section:not(.msr-simple-inputs),
.tdsr-simple-tool > .content-section:not(.tdsr-simple-inputs):not(.tdsr-simple-result),
.stamp-duty-tool > .content-section:not(.stamp-duty-inputs):not(.stamp-duty-result) {
  grid-column: 1 / -1;
}

.msr-result-card,
.tdsr-result-card {
  width: 100%;
  border: 1px solid #9cb1c6;
  border-radius: 14px;
  padding: 1.1rem;
  background: linear-gradient(180deg, #eff5fb 0%, #f7fbff 100%);
  box-shadow: 0 10px 24px rgba(20, 37, 55, 0.1);
}

.msr-card-pass,
.tdsr-card-pass {
  border-color: #74a763;
  background: linear-gradient(180deg, #edf8e9 0%, #f7fbf6 100%);
}

.msr-card-fail,
.tdsr-card-fail {
  border-color: #c97f7f;
  background: linear-gradient(180deg, #fff0f0 0%, #fff8f8 100%);
}

.msr-card-na,
.tdsr-card-na {
  border-color: #9cb1c6;
}

.msr-result-label,
.tdsr-result-label {
  margin: 0;
  color: #5a7389;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  font-weight: 700;
}

.msr-result-value,
.tdsr-result-value {
  margin: 0.15rem 0 0;
  font-family: 'Barlow Condensed', sans-serif;
  font-size: clamp(3rem, 7vw, 4.5rem);
  line-height: 0.95;
  color: #132f47;
}

.msr-result-state,
.tdsr-result-state {
  margin: 0.35rem 0 0;
  font-size: 1rem;
  font-weight: 800;
}

.msr-result-note,
.tdsr-result-note {
  margin: 0.55rem 0 0;
  color: #294760;
  font-size: 0.95rem;
}
.stamp-duty-result {
  display: flex;
}

.stamp-duty-result-card {
  width: 100%;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.stamp-duty-result-label {
  margin: 0 0 0.9rem;
  color: #5a7389;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 0.82rem;
  font-weight: 700;
}

.stamp-duty-result .choice-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.stamp-duty-result .choice-card {
  margin: 0;
  min-height: 140px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.stamp-duty-result .choice-card h3 {
  margin-bottom: 0.55rem;
}

.stamp-duty-result .choice-card p {
  margin: 0;
}

@media (max-width: 1080px) {
  .mas-calculator {
    grid-template-columns: 1fr;
  }

  .calc-results {
    order: 3;
    top: auto;
    position: static;
  }

  .calc-inputs {
    order: 1;
    display: block;
  }

  .calc-inputs .boost-section {
    order: 2;
  }

  .calc-inputs .calc-cta {
    order: 3;
  }

  .msr-simple-tool,
  .tdsr-simple-tool,
  .stamp-duty-tool,
  .simple-tool-grid,
  .cpf-tool-page {
    grid-template-columns: 1fr;
  }

  .msr-simple-inputs,
  .msr-simple-result,
  .msr-simple-tool > .content-section:not(.msr-simple-inputs),
  .tdsr-simple-inputs,
  .tdsr-simple-result,
  .tdsr-simple-tool > .content-section:not(.tdsr-simple-inputs):not(.tdsr-simple-result),
  .stamp-duty-inputs,
  .stamp-duty-result,
  .stamp-duty-tool > .content-section:not(.stamp-duty-inputs):not(.stamp-duty-result),
  .simple-tool-inputs,
  .simple-tool-result,
  .simple-tool-grid > .content-section:not(.simple-tool-inputs):not(.simple-tool-result) {
    grid-column: 1;
    grid-row: auto;
    margin-top: 1rem;
  }

  .stamp-duty-result .choice-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .field-grid {
    grid-template-columns: 1fr;
  }

  .applicant-groups {
    grid-template-columns: 1fr;
  }

  .calc-results {
    padding: 0.85rem;
  }

  .metric-value {
    font-size: 1.65rem;
  }

  .results-hero,
  .compliance-grid,
  .boost-summary .compliance-grid {
    grid-template-columns: 1fr;
  }

  .tip-text {
    left: 0;
    transform: translateX(0) translateY(-6px);
  }

  .tip-wrap.open .tip-text {
    transform: translateX(0) translateY(0);
  }

  .cpf-result-grid {
    grid-template-columns: 1fr;
  }

  .cpf-tool-page {
    grid-template-columns: 1fr;
  }

  .cpf-tool-page .cpf-result-grid {
    grid-template-columns: 1fr;
  }
}
