:root {
  color-scheme: light;
  --ink: #17221d;
  --muted: #607068;
  --paper: #f5f1e8;
  --card: #fffdf8;
  --line: #d8d4c9;
  --accent: #165f46;
  --accent-light: #d9eee4;
  --gold: #dca63c;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 85% 5%, rgba(220, 166, 60, 0.19), transparent 23rem),
    var(--paper);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0;
}

.hero {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.6rem, 7vw, 5.6rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.96;
}

.intro {
  max-width: 650px;
  margin: 24px 0 36px;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.65;
}

form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr)) auto;
  gap: 14px;
  align-items: end;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 18px 60px rgba(28, 44, 35, 0.08);
}

label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.field-help {
  display: block;
  margin: 7px 2px 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0;
  line-height: 1.35;
  text-transform: none;
}

.money-input {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: white;
  color: var(--ink);
  font-size: 1.15rem;
}

input {
  width: 100%;
  padding: 14px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

button {
  min-height: 51px;
  padding: 0 22px;
  border: 0;
  border-radius: 11px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

button:hover {
  background: #0f4d38;
}

.error {
  min-height: 1.5em;
  color: #a12c25;
}

.summary {
  display: flex;
  gap: 40px;
  margin: 52px 0 18px;
}

.summary div {
  display: grid;
  gap: 4px;
}

.summary span,
.take-home span,
.rate span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.summary strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  font-weight: 500;
}

.results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--card);
}

.result-card.winner {
  border-color: var(--accent);
  box-shadow: inset 0 5px 0 var(--accent);
}

.rank {
  position: absolute;
  top: -22px;
  right: 14px;
  color: rgba(22, 95, 70, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 8rem;
  line-height: 1;
}

.result-heading {
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: start;
}

.result-heading p {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 0.78rem;
}

h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.8rem;
  font-weight: 500;
}

h3,
h4 {
  margin: 0;
}

.badge {
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--accent-light);
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.take-home {
  display: grid;
  gap: 3px;
  margin: 34px 0 24px;
}

.take-home strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.3rem, 6vw, 3.8rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.take-home small {
  color: var(--muted);
}

dl {
  margin: 0;
}

dl div {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 9px 0;
  border-bottom: 1px solid #ebe7de;
}

dt {
  color: var(--muted);
}

dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}

dl .total {
  color: var(--ink);
  font-weight: 800;
}

.allowance-breakdown,
.breakdown {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 2px solid var(--ink);
}

.allowance-breakdown h3,
.breakdown h3 {
  margin-bottom: 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.allowance-breakdown dl div {
  font-size: 0.86rem;
}

.breakdown-section + .breakdown-section {
  margin-top: 20px;
}

.breakdown-section h4 {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tax-tooltip {
  position: relative;
  display: inline-flex;
  font-family: Arial, sans-serif;
  letter-spacing: normal;
  text-transform: none;
}

.tax-tooltip-trigger {
  display: inline-grid;
  box-sizing: border-box;
  flex: 0 0 20px;
  width: 20px;
  min-width: 20px;
  max-width: 20px;
  height: 20px;
  min-height: 20px;
  max-height: 20px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--green);
  border-radius: 999px;
  background: transparent;
  color: var(--green);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  cursor: help;
}

.tax-tooltip-trigger:hover {
  background: rgba(22, 95, 70, 0.1);
  color: var(--green);
}

.tax-tooltip-trigger:focus-visible {
  outline: 3px solid rgba(22, 95, 70, 0.2);
  outline-offset: 2px;
}

.tax-tooltip-content {
  position: absolute;
  z-index: 20;
  bottom: calc(100% + 10px);
  left: 50%;
  width: min(360px, calc(100vw - 48px));
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--ink);
  color: white;
  box-shadow: 0 12px 30px rgba(23, 34, 29, 0.2);
  font-size: 0.78rem;
  font-weight: 400;
  line-height: 1.5;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 5px);
  transition: opacity 120ms ease, transform 120ms ease;
}

.tax-tooltip:hover .tax-tooltip-content,
.tax-tooltip:focus-within .tax-tooltip-content {
  opacity: 1;
  pointer-events: auto;
  transform: translate(-50%, 0);
}

.tax-tooltip-sources {
  display: block;
  margin-top: 8px;
}

.tax-tooltip-content a {
  color: #bce9d8;
  font-weight: 700;
}

.breakdown-section p {
  margin: 5px 0 10px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.tier-heading,
.tier-row {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) repeat(3, minmax(70px, 0.7fr));
  gap: 8px;
  align-items: center;
}

.tier-heading {
  padding: 8px 0 5px;
  color: var(--muted);
  font-size: 0.66rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tier-row {
  padding: 8px 0;
  border-top: 1px solid #ebe7de;
  font-size: 0.78rem;
}

.tier-heading span:not(:first-child),
.tier-row span:not(:first-child),
.tier-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rate {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 22px 0;
  padding: 14px;
  border-radius: 10px;
  background: #f1eee5;
}

.result-card ul,
.assumptions ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.55;
}

.assumptions {
  margin-top: 28px;
  padding: 20px 22px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.assumptions summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.assumptions div {
  margin-top: 16px;
}

@media (max-width: 760px) {
  main {
    padding: 36px 0;
  }

  form,
  .results {
    grid-template-columns: 1fr;
  }

  .summary {
    flex-direction: column;
    gap: 14px;
  }

  .tier-heading {
    display: none;
  }

  .tier-row {
    grid-template-columns: 1fr auto auto;
  }

  .tier-row span:first-child {
    grid-column: 1 / -1;
    font-weight: 700;
  }
}

/* Guided household flow */
.app-intro {
  max-width: 850px;
}

.demo-disclaimer {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  max-width: 760px;
  margin-top: 24px;
  padding: 14px 17px;
  border-left: 4px solid var(--gold);
  border-radius: 0 9px 9px 0;
  background: rgba(255, 253, 248, 0.75);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.demo-disclaimer strong {
  color: var(--ink);
}

.tax-year-reference {
  flex: 0 0 auto;
  padding: 5px 9px;
  border: 1px solid rgba(22, 95, 70, 0.2);
  border-radius: 999px;
  background: rgba(22, 95, 70, 0.07);
  color: var(--green);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.site-footer {
  display: flex;
  gap: 20px;
  align-items: center;
  justify-content: space-between;
  max-width: 1180px;
  margin: 64px auto 0;
  padding: 24px clamp(22px, 5vw, 52px);
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.82rem;
}

.site-footer p {
  margin: 0;
}

.site-footer a {
  color: var(--green);
  font-weight: 700;
}

.company-number {
  white-space: nowrap;
}

.flow {
  max-width: 980px;
  margin-top: 46px;
}

.flow-progress {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.flow-progress li {
  display: flex;
  gap: 9px;
  align-items: center;
  padding: 11px 14px;
  border-bottom: 2px solid var(--line);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
}

.flow-progress li span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--card);
  font-size: 0.7rem;
}

.flow-progress li.active {
  border-color: var(--accent);
  color: var(--accent);
}

.flow-progress li.active span,
.flow-progress li.complete span {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.flow-step {
  display: none;
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 253, 248, 0.9);
  box-shadow: 0 18px 60px rgba(28, 44, 35, 0.08);
}

.flow-step.active {
  display: block;
}

.flow-step > h2,
.results-toolbar h2 {
  margin: 5px 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.035em;
}

.flow-step > p:not(.step-label) {
  max-width: 650px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.step-label {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.household-choices {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 30px;
}

.choice-card {
  display: grid;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
  color: var(--ink);
  text-align: left;
}

.choice-card:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--ink);
}

.choice-card strong {
  align-self: end;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.55rem;
  font-weight: 500;
}

.choice-card span {
  align-self: start;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 500;
  line-height: 1.45;
}

.text-button,
.secondary-button {
  min-height: 0;
  padding: 0;
  background: transparent;
  color: var(--accent);
}

.text-button:hover,
.secondary-button:hover {
  background: transparent;
  color: #0f4d38;
}

.text-button {
  margin-bottom: 24px;
}

#calculator {
  display: block;
  margin-top: 28px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.people-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.person-input,
.relationship-field {
  margin: 0;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: white;
}

.person-input[hidden],
.relationship-field[hidden] {
  display: none;
}

.person-input legend,
.relationship-field legend {
  padding: 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.15rem;
}

.person-input label {
  display: block;
}

.person-input label + label {
  margin-top: 16px;
}

.relationship-field {
  display: grid;
  gap: 9px;
  margin-top: 18px;
}

.radio-option {
  display: flex;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
}

.radio-option:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
}

.radio-option input {
  width: auto;
  margin-top: 3px;
}

.radio-option span {
  color: var(--muted);
  font-size: 0.83rem;
  font-weight: 500;
  line-height: 1.45;
}

.radio-option strong {
  display: block;
  color: var(--ink);
  font-size: 0.88rem;
}

.calculate-button {
  margin-top: 20px;
}

.results-page {
  margin-top: 46px;
}

.results-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: end;
  margin-bottom: 18px;
}

.results-toolbar h2 {
  margin-bottom: 0;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.secondary-button {
  padding: 10px 0;
  border-bottom: 1px solid var(--accent);
  border-radius: 0;
}

.assessment-method {
  min-height: 2.8em;
  margin: 13px 0 0;
  color: var(--muted);
  font-size: 0.73rem;
  line-height: 1.4;
}

.assessment-callout {
  display: grid;
  gap: 4px;
  margin-top: 22px;
  padding: 16px 18px;
  border-radius: 11px;
  background: var(--accent-light);
}

.assessment-callout strong {
  color: var(--accent);
}

.assessment-callout span {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
}

.member-section {
  margin-top: 34px;
  padding-top: 28px;
  border-top: 2px solid var(--ink);
}

.member-section-heading span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.member-section-heading h3 {
  margin-top: 4px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.6rem;
  font-weight: 500;
}

.member-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.member-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #fff;
}

.member-card h4 {
  margin-bottom: 12px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.25rem;
  font-weight: 500;
}

.member-card .allowance-breakdown {
  margin-top: 20px;
  padding-top: 16px;
  border-top-width: 1px;
}

.member-note {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .demo-disclaimer,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .flow-progress li {
    justify-content: center;
    padding: 9px 4px;
    font-size: 0;
  }

  .flow-progress li span {
    font-size: 0.7rem;
  }

  .household-choices,
  .people-inputs,
  .member-grid {
    grid-template-columns: 1fr;
  }

  .results-toolbar {
    align-items: center;
  }
}

/* Recommendation-first results layout */
main {
  width: min(1280px, calc(100% - 32px));
}

.winner-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) auto minmax(280px, 0.75fr);
  gap: 38px;
  align-items: center;
  margin: 52px 0 22px;
  padding: clamp(26px, 4vw, 44px);
  border-radius: 24px;
  background: var(--accent);
  color: white;
  box-shadow: 0 22px 70px rgba(22, 95, 70, 0.2);
}

.winner-label,
.winner-amount span,
.winner-stats span,
.compact-take-home span,
.compact-stats span {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.winner-label,
.winner-amount span,
.winner-stats span {
  color: rgba(255, 255, 255, 0.68);
}

.winner-year {
  margin: 16px 0 3px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 0.78rem;
}

.winner-copy h2 {
  font-size: clamp(2.3rem, 5vw, 4rem);
}

.winner-message {
  max-width: 500px;
  margin: 14px 0 0;
  color: rgba(255, 255, 255, 0.78);
  line-height: 1.55;
}

.winner-amount {
  display: grid;
  gap: 3px;
  min-width: 225px;
}

.winner-amount strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.7rem, 5vw, 4.5rem);
  font-weight: 500;
  letter-spacing: -0.045em;
  white-space: nowrap;
}

.winner-amount small {
  color: rgba(255, 255, 255, 0.68);
}

.winner-financials {
  display: grid;
  gap: 16px;
  min-width: 225px;
}

.winner-stats {
  display: grid;
  gap: 14px;
  padding-left: 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.22);
}

.winner-stats div,
.compact-stats div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.cost-of-living span,
.quality-of-life span {
  display: grid;
  gap: 1px;
}

.cost-of-living small,
.quality-of-life small {
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

.cost-of-living a,
.quality-of-life a {
  align-self: center;
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-decoration-color: rgba(22, 95, 70, 0.35);
  text-underline-offset: 3px;
}

.winner-cost-of-living a,
.winner-quality-of-life a {
  color: white;
  text-decoration-color: rgba(255, 255, 255, 0.4);
}

.winner-cost-of-living small,
.winner-quality-of-life small {
  color: rgba(255, 255, 255, 0.6);
}

.winner-stats strong,
.compact-stats strong {
  font-variant-numeric: tabular-nums;
}

.ctc-score {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ctc-score-label {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.ctc-score-label > span:first-child {
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.ctc-score > strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 2.65rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  line-height: 1;
}

.ctc-score > small {
  color: var(--muted);
  font-size: 0.68rem;
}

.ctc-score .tax-tooltip-content {
  right: 0;
  left: auto;
  transform: translate(0, 5px);
}

.ctc-score .tax-tooltip:hover .tax-tooltip-content,
.ctc-score .tax-tooltip:focus-within .tax-tooltip-content {
  transform: translate(0, 0);
}

.tax-tooltip-formula {
  display: block;
  margin: 8px 0;
  color: #bce9d8;
  font-weight: 700;
}

.card-ctc-score {
  margin: 0 0 18px;
  padding: 9px 11px;
  border: 1px solid rgba(22, 95, 70, 0.13);
  border-radius: 9px;
  background: rgba(22, 95, 70, 0.055);
  color: var(--accent);
}

.card-ctc-score > strong {
  font-size: 1.9rem;
}

.card-ctc-score.best-ctc-score {
  border-color: rgba(22, 95, 70, 0.34);
  background: rgba(22, 95, 70, 0.11);
  color: var(--accent);
  box-shadow: none;
}

.best-ctc-score .ctc-score-label > span:first-child,
.best-ctc-score > small {
  color: var(--muted);
}

.best-ctc-score .tax-tooltip-trigger {
  border-color: var(--accent);
  color: var(--accent);
}

.winner-ctc-score {
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.07);
  color: white;
}

.winner-ctc-score > strong {
  font-size: 2.25rem;
}

.winner-ctc-score .ctc-score-label > span:first-child,
.winner-ctc-score > small {
  color: rgba(255, 255, 255, 0.72);
}

.winner-ctc-score .tax-tooltip-trigger {
  border-color: rgba(255, 255, 255, 0.72);
  color: white;
}

.winner-ctc-score .tax-tooltip-trigger:hover {
  background: rgba(255, 255, 255, 0.14);
  color: white;
}

.results {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.result-card {
  min-width: 0;
  overflow: visible;
  padding: 20px;
  border-radius: 16px;
}

.result-card.top-result {
  border-color: var(--accent);
  box-shadow: inset 0 4px 0 var(--accent);
}

.compact-heading {
  display: flex;
  gap: 10px;
  justify-content: space-between;
  align-items: flex-start;
}

.compact-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
}

.take-home-badge {
  border: 1px solid rgba(23, 34, 29, 0.16);
  background: #f1eee5;
  color: var(--ink);
}

.compact-rank {
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 850;
}

.compact-year {
  margin: 22px 0 4px;
  color: var(--muted);
  font-size: 0.72rem;
}

.result-card h3 {
  min-height: 2.35em;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.45rem;
  font-weight: 500;
  line-height: 1.08;
}

.compact-take-home {
  display: grid;
  gap: 3px;
  margin: 22px 0 18px;
}

.compact-take-home strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.95rem, 3vw, 2.65rem);
  font-weight: 500;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.compact-take-home small {
  color: var(--muted);
  font-size: 0.76rem;
}

.compact-stats {
  display: grid;
  gap: 9px;
  padding: 13px;
  border-radius: 10px;
  background: #f1eee5;
}

.compact-stats strong {
  font-size: 0.82rem;
}

.compact-cost-of-living {
  padding-top: 9px;
  border-top: 1px solid rgba(23, 34, 29, 0.1);
}

.result-card.selected {
  border-color: var(--accent);
  background: #fbfffc;
  box-shadow: inset 0 4px 0 var(--accent), 0 12px 30px rgba(22, 95, 70, 0.1);
}

.view-calculation {
  width: 100%;
  min-height: 0;
  margin-top: 15px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
}

.view-calculation:hover,
.view-calculation[aria-pressed="true"] {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.calculation-panel {
  scroll-margin-top: 24px;
  margin-top: 18px;
  padding: clamp(24px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 18px 55px rgba(23, 34, 29, 0.08);
}

.calculation-panel:empty {
  display: none;
}

.calculation-panel-heading {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 2px solid var(--ink);
}

.calculation-panel-heading span,
.panel-take-home span {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.calculation-panel-heading p {
  margin: 13px 0 3px;
  color: var(--muted);
  font-size: 0.78rem;
}

.calculation-panel-heading h2 {
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.panel-take-home {
  display: grid;
  gap: 3px;
  text-align: right;
}

.panel-heading-actions {
  display: grid;
  gap: 13px;
  justify-items: end;
}

.panel-ctc-score {
  min-width: 190px;
  padding: 9px 11px;
  border: 1px solid rgba(22, 95, 70, 0.13);
  border-radius: 9px;
  background: rgba(22, 95, 70, 0.055);
  color: var(--accent);
  text-align: left;
}

.panel-ctc-score > strong {
  font-size: 1.9rem;
}

.export-image-button {
  min-height: 0;
  padding: 10px 14px;
  border: 1px solid var(--accent);
  border-radius: 9px;
  background: transparent;
  color: var(--accent);
  font-size: 0.8rem;
}

.export-image-button:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.panel-take-home strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4vw, 3.4rem);
  font-weight: 500;
  letter-spacing: -0.04em;
}

.panel-summary {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1.3fr);
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
  padding-top: 26px;
}

.panel-summary .allowance-breakdown,
.panel-summary .breakdown {
  margin-top: 0;
}

.panel-summary .breakdown {
  margin-top: 26px;
}

.panel-cost-of-living,
.panel-quality-of-life {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-top: 14px;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1eee5;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-quality-of-life {
  margin-top: 8px;
}

.panel-notes {
  margin: 30px 0 0;
  padding: 20px 0 0 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}

@media (max-width: 1050px) {
  .winner-panel {
    grid-template-columns: 1fr 1fr;
  }

  .winner-stats {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, 1fr);
    padding: 18px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.22);
    border-left: 0;
  }

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

}

@media (max-width: 760px) {
  .winner-panel {
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 34px;
  }

  .winner-stats {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .result-card h3 {
    min-height: 0;
  }

  .calculation-panel-heading {
    display: grid;
  }

  .panel-take-home {
    text-align: left;
  }

  .panel-heading-actions {
    justify-items: start;
  }

  .panel-ctc-score {
    width: 100%;
  }

  .panel-summary {
    grid-template-columns: 1fr;
  }
}
