@import url("https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700;800;900&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #f0f1f1;
  --input-bg: #ffffff;
  --text: #1f2326;
  --muted: #6d7276;
  --border: #d9dcde;
  --accent: #c79a2b;
  --accent-dark: #8f6712;
  --blue: #3f454a;
  --zero-series: #1f77b4;
  --savings-series: #168a4a;
  --msci-series: #b84a62;
  --rent-series: var(--zero-series);
  --other-series: var(--msci-series);
  --focus-ring: rgba(199, 154, 43, 0.26);
  --chart-track: #dfe2e4;
  --total-bg: #fff4d7;
  --total-text: #5c420d;
  --warning: #8f6712;
  --success: #16794c;
  --danger: #7f1d1d;
  --danger-bg: #fff1f1;
  --danger-border: #e7b8b8;
  --shadow: rgba(31, 35, 38, 0.08);
}

.dark-mode {
  color-scheme: dark;
  --bg: #17191b;
  --surface: #222528;
  --surface-soft: #2d3135;
  --input-bg: #1b1e21;
  --text: #f0eee8;
  --muted: #a9a49a;
  --border: #44484d;
  --accent: #d7ad45;
  --accent-dark: #f0c765;
  --blue: #8e969d;
  --zero-series: #82c7ff;
  --savings-series: #73d39a;
  --msci-series: #ff8fa3;
  --rent-series: var(--zero-series);
  --other-series: var(--msci-series);
  --focus-ring: rgba(215, 173, 69, 0.28);
  --chart-track: #44484d;
  --total-bg: #3b3018;
  --total-text: #ffe9a9;
  --warning: #f0c765;
  --success: #63d18f;
  --danger: #ff9a9a;
  --danger-bg: #3a2020;
  --danger-border: #6f3838;
  --shadow: rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--text);
  font-family: Roboto, Arial, sans-serif;
  font-size: 15px;
}

.site-footer {
  padding: 18px clamp(14px, 4vw, 38px) 24px;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.site-footer p {
  margin: 0;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 12px clamp(14px, 4vw, 38px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

h1,
h2,
legend,
summary {
  margin: 0;
  line-height: 1.2;
}

h1 {
  font-size: clamp(22px, 2.55vw, 32px);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

.site-logo {
  display: block;
  width: clamp(210px, 22vw, 300px);
  height: auto;
  transform: translateY(2px);
}

.brand-link:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

h2,
summary {
  font-size: 18px;
  font-weight: 800;
}

.header-tools {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.site-nav a {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
}

.site-nav a[aria-current="page"] {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.site-nav a:hover {
  border-color: var(--accent);
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  box-shadow: 0 8px 18px var(--shadow);
  cursor: pointer;
}

.theme-toggle:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.theme-toggle:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.theme-icon {
  grid-area: 1 / 1;
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: opacity 140ms ease, transform 140ms ease;
}

.theme-icon-moon,
.dark-mode .theme-icon-sun {
  opacity: 0;
  transform: scale(0.72) rotate(-20deg);
}

.dark-mode .theme-icon-moon {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.assumptions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
  margin: 0;
}

.assumptions div {
  min-width: 112px;
  padding: 6px 9px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.assumptions dt {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 10px;
}

.assumptions dd {
  margin: 0;
  font-weight: 800;
  font-size: 13px;
}

.calculator-overview {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(230px, 0.36fr);
  align-items: center;
  gap: 24px;
  min-height: 230px;
  padding: 28px 30px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--total-bg);
  box-shadow: 0 14px 30px var(--shadow);
}

.summary-icon {
  display: grid;
  place-items: center;
  width: 68px;
  aspect-ratio: 1;
  border: 2px solid var(--accent);
  border-radius: 50%;
  color: var(--accent);
}

.summary-icon svg {
  width: 36px;
  height: 36px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.summary-grid {
  min-width: 0;
}

.calculator-toolbar {
  position: relative;
  display: grid;
  justify-items: stretch;
  gap: 16px;
  padding-left: 28px;
}

.calculator-toolbar::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 1px;
  background: color-mix(in srgb, var(--accent) 38%, transparent);
}

.calculator-overview .assumptions {
  display: grid;
  justify-content: stretch;
  gap: 16px;
}

.calculator-overview .assumptions div {
  min-width: 0;
}

.calculator-overview .assumption-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 72px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 22px var(--shadow);
}

.assumption-icon {
  display: grid;
  place-items: center;
  width: 42px;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--total-bg);
  color: var(--accent);
}

.assumption-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.calculator-mode-help div {
  right: 0;
}

.inflation-control {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 18px var(--shadow);
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.inflation-control input {
  width: 20px;
  height: 20px;
  accent-color: var(--accent);
}

.summary-card {
  min-height: 86px;
  padding: 13px 15px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 14px 30px var(--shadow);
}

.summary-card span,
.summary-card small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.summary-card strong {
  display: block;
  margin: 6px 0 3px;
  font-size: clamp(20px, 2.1vw, 28px);
}

.summary-sentence {
  min-width: 0;
}

.summary-sentence strong {
  margin: 0;
  font-size: clamp(24px, 2.52vw, 37px);
  line-height: 1.08;
  letter-spacing: 0;
}

.summary-sentence strong span {
  display: inline;
  font: inherit;
}

.summary-sentence .summary-amount {
  display: inline-block;
  margin-left: 0.08em;
  padding: 0.03em 0.24em 0.09em;
  border: 2px solid color-mix(in srgb, var(--accent) 68%, var(--surface));
  border-radius: 7px;
  background:
    linear-gradient(
      180deg,
      color-mix(in srgb, var(--accent) 32%, var(--surface)) 0%,
      color-mix(in srgb, var(--accent) 22%, var(--surface)) 100%
    );
  box-shadow:
    0 12px 26px color-mix(in srgb, var(--accent) 28%, transparent),
    inset 0 1px 0 color-mix(in srgb, #ffffff 72%, transparent);
}

.summary-sentence .positive-word {
  color: var(--success);
}

.summary-sentence .negative-word {
  color: var(--danger);
}

.summary-sentence i {
  display: block;
  width: 74px;
  height: 3px;
  margin: 20px 0 20px;
  background: var(--accent);
}

.summary-sentence p {
  max-width: 620px;
  margin: 0;
  color: var(--text);
  font-size: clamp(15px, 1.15vw, 18px);
  font-weight: 900;
  line-height: 1.35;
}

.summary-sentence p span {
  display: inline;
  font: inherit;
}

.summary-sentence small {
  display: block;
  max-width: 620px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.secondary-kpis {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
}

.secondary-kpi {
  min-width: 0;
  padding: 12px 15px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 10px 22px var(--shadow);
}

.secondary-kpi span,
.secondary-kpi small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.secondary-kpi strong {
  display: block;
  margin: 0;
  font-size: clamp(15px, 1.28vw, 19px);
  line-height: 1.24;
}

.secondary-kpi p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.secondary-kpi strong span {
  display: inline;
  font: inherit;
}

.secondary-kpi .positive-word {
  color: var(--success);
}

.secondary-kpi .negative-word {
  color: var(--danger);
}

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

.calculation-ad-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 300px);
  align-items: start;
  gap: 14px;
}

.ad-placeholder {
  display: grid;
  place-items: center;
  aspect-ratio: 300 / 250;
  min-height: 180px;
  padding: 12px;
  border: 1px dashed rgba(47, 111, 159, 0.34);
  border-radius: 8px;
  background: rgba(120, 180, 220, 0.12);
  color: var(--rent-series);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.ad-placeholder span {
  opacity: 0.78;
}

.calculation-ad {
  width: 100%;
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  align-items: start;
  gap: 22px;
  padding: 22px clamp(16px, 4vw, 42px) 36px;
}

.layout > * {
  min-width: 0;
}

.input-panel,
.result-band {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 10px 26px var(--shadow);
}

.input-panel {
  position: sticky;
  top: 18px;
  max-height: var(--input-panel-max-height, calc(100vh - 36px));
  overflow: auto;
  scrollbar-gutter: stable;
  scroll-padding-bottom: 56px;
}

@media (min-width: 1051px) {
  body.calculator-page {
    height: 100vh;
    overflow: hidden;
  }

  body.calculator-page .site-footer {
    padding: 3px clamp(14px, 4vw, 38px) 4px;
    line-height: 1.2;
  }

  .layout {
    height: var(--calculator-layout-height, calc(100vh - 128px));
    overflow: hidden;
    padding-bottom: 4px;
  }

  .input-panel {
    position: static;
    height: 100%;
    max-height: none;
  }

  .results {
    height: 100%;
    overflow-y: auto;
    padding-right: 10px;
    scrollbar-gutter: stable;
    scroll-padding-bottom: 32px;
  }

  .calculator-overview {
    grid-template-columns: 72px minmax(360px, 1fr) minmax(210px, 240px);
    align-items: start;
    gap: 20px;
    min-height: 276px;
    padding: 26px 28px;
  }

  .calculator-overview .summary-icon {
    margin-top: 8px;
  }

  .summary-sentence strong {
    font-size: clamp(28px, 2.2vw, 34px);
  }

  .summary-sentence small {
    margin-top: 14px;
  }

  .calculator-toolbar {
    gap: 14px;
    padding-left: 24px;
  }
}

#inputForm {
  display: grid;
  gap: 12px;
  padding: 14px 14px 24px;
}

.panel-heading {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px;
  background: color-mix(in srgb, var(--surface) 94%, var(--surface-soft));
  border-bottom: 1px solid var(--border);
}

.panel-heading h2 {
  font-size: 18px;
}

#resetInputs {
  min-height: 30px;
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}

#resetInputs:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
  color: var(--text);
}

button {
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #ffffff;
  font-family: inherit;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-dark);
}

fieldset {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  column-gap: 12px;
  row-gap: 9px;
  margin: 0;
  padding: 14px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--surface) 82%, var(--surface-soft));
}

fieldset:first-child {
  padding-top: 14px;
}

fieldset:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
}

.field-pair {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 10px;
  row-gap: 5px;
}

.investment-column {
  display: grid;
  align-content: start;
  gap: 9px;
  min-width: 0;
}

.field-maintenanceRate {
  grid-column: 1;
}

legend {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 0 2px;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
}

.field {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
  gap: 6px;
  margin-top: 0;
}

.field-label {
  display: block;
  min-width: 0;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.25;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.field-heading {
  position: relative;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  min-height: 19px;
}

.help-popover a {
  color: var(--accent);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.field-label a {
  color: var(--accent);
  font-weight: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.field-help-left div {
  left: 0;
  right: auto;
}

.field-help-right div {
  left: auto;
  right: 0;
}

.input-shell {
  display: grid;
  grid-template-columns: minmax(7ch, 1fr) 36px;
  align-items: center;
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: 6px;
  overflow: hidden;
  background: var(--input-bg);
}

.input-shell input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 0 9px;
  border: 0;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  text-align: right;
}

.input-shell input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.input-shell input[type="number"]::-webkit-inner-spin-button,
.input-shell input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.input-shell input:focus {
  outline: 3px solid var(--focus-ring);
}

.input-shell span {
  display: grid;
  place-items: center;
  height: 100%;
  background: var(--surface-soft);
  border-left: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.readonly-field {
  position: relative;
}

.readonly-heading {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
  min-height: 19px;
}

.readonly-output {
  display: grid;
  align-items: center;
  justify-content: end;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  font-weight: 900;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.readonly-output:not(.danger-output, .success-output) {
  color: var(--muted);
}

.success-output {
  color: var(--success);
}

.danger-output {
  border-color: var(--danger-border);
  background: var(--danger-bg);
  color: var(--danger);
}

.help-popover {
  position: relative;
  line-height: 1;
}

.help-popover summary {
  position: absolute;
  display: block;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  clip-path: inset(50%);
  color: transparent;
  cursor: pointer;
  list-style: none;
  white-space: nowrap;
}

.help-popover summary::-webkit-details-marker {
  display: none;
}

.help-popover summary:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.help-popover:not([open]) > div {
  display: none;
}

.help-popover:hover > div,
.help-popover:focus-within > div,
.field-heading:hover .help-popover > div,
.field-heading:focus-within .help-popover > div,
.readonly-heading:hover .help-popover > div,
.readonly-heading:focus-within .help-popover > div,
legend:hover .help-popover > div,
legend:focus-within .help-popover > div,
.inline-help-label:hover .help-popover > div,
.inline-help-label:focus-within .help-popover > div,
.table-heading-help:hover .help-popover > div,
.table-heading-help:focus-within .help-popover > div,
.tax-summary-has-help:hover .help-popover > div,
.tax-summary-has-help:focus-within .help-popover > div {
  display: block !important;
}

.help-popover div,
.tooltip-bubble {
  position: fixed;
  z-index: 2147483647;
  top: var(--tooltip-top, 24px);
  left: var(--tooltip-left, 10px);
  right: auto;
  width: var(--tooltip-width, min(270px, calc(100vw - 56px)));
  max-height: calc(100vh - 20px);
  overflow: auto;
  padding: 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 16px 34px var(--shadow);
  white-space: normal;
  overflow-wrap: break-word;
  line-height: 1.45;
  letter-spacing: 0;
  text-transform: none;
}

.help-popover div *,
.tooltip-bubble * {
  letter-spacing: 0;
  text-transform: none;
}

.help-popover p,
.tooltip-bubble p {
  margin: 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
}

.help-popover p + p {
  margin-top: 8px;
}

.field-heading:has(.help-popover) .field-label,
.readonly-heading:has(.help-popover) .field-label,
legend:has(.help-popover) > span,
.inline-help-label:has(.help-popover) > span,
.inline-help-label:has(.help-popover) > strong,
.table-heading-help:has(.help-popover) .table-heading-label,
.tax-summary-has-help:has(.help-popover) .kpi-label-with-help {
  display: inline;
  width: fit-content;
  max-width: 100%;
  border-bottom: 1px dotted currentColor;
  cursor: help;
  text-decoration: none;
  text-underline-offset: 3px;
}

.group-help div {
  left: var(--tooltip-left, 10px);
  right: auto;
}

.range-field {
  grid-column: 1 / -1;
  grid-template-columns: 1fr;
}

.range-shell {
  display: grid;
  gap: 6px;
}

.range-value {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.range-value strong {
  color: var(--text);
  font-size: 16px;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
}

.results {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
  min-width: 0;
}

.results > * {
  min-width: 0;
}

.side-by-side-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  min-width: 0;
}

.side-by-side-results > * {
  min-width: 0;
}

.calculation-ad-slot {
  display: grid;
  place-items: center;
  min-height: 180px;
  border-style: dashed;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.result-band {
  padding: 17px;
  min-width: 0;
}

.result-band h2,
.result-band summary {
  margin-bottom: 12px;
}

.result-band summary {
  cursor: pointer;
}

.detail-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: -2px 0 12px;
}

.conclusion-list {
  display: grid;
  gap: 8px;
}

.conclusion-list p {
  margin: 0;
  padding: 12px;
  background: var(--surface-soft);
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  font-weight: 800;
}

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

.chart-card {
  min-width: 0;
  padding: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.chart-card h3 {
  margin: 0;
  font-size: 14px;
}

.chart-heading {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 10px;
}

.chart-help div {
  left: 0;
  right: auto;
}

.chart-note {
  margin: 12px 0 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
  text-align: left;
}

.chart-note p {
  margin: 0;
}

.chart-note-intro {
  color: var(--text);
}

.chart-note ul {
  display: block;
  margin: 6px 0 0;
  padding-left: 18px;
}

.chart-note li {
  padding-left: 2px;
  line-height: 1.35;
}

.chart-note li + li {
  margin-top: 2px;
}

.chart-note strong {
  color: var(--text);
  font-weight: 900;
}

.chart-note .amount-negative {
  color: var(--danger);
}

.chart-note .amount-positive {
  color: var(--success);
}

.chart-story {
  display: grid;
  gap: 2px;
  margin-bottom: 12px;
  padding: 10px 11px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 7px;
}

.chart-story strong {
  font-size: 13px;
  line-height: 1.35;
}

.chart-story span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.bar-chart {
  display: grid;
  gap: 10px;
}

.bar-row {
  display: grid;
  grid-template-columns: minmax(94px, 0.9fr) minmax(54px, 1fr) minmax(58px, auto);
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.bar-row strong {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.bar-track {
  height: 10px;
  overflow: hidden;
  background: var(--chart-track);
  border-radius: 999px;
}

.bar-fill {
  height: 100%;
  min-width: 3px;
  border-radius: inherit;
}

.bar-fill.rent {
  background: var(--blue);
}

.bar-fill.buy {
  background: var(--accent);
}

.bar-fill.muted {
  opacity: 0.55;
}

.line-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.stacked-chart {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.axis,
.grid {
  fill: none;
  stroke: var(--border);
  stroke-width: 1;
}

.tick {
  stroke: var(--border);
  stroke-width: 1;
}

.line {
  fill: none;
  stroke-width: 3.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.saving-area {
  fill: var(--accent);
  opacity: 0.12;
}

.rent-line {
  stroke: #198754;
}

.buy-line {
  stroke: var(--accent);
}

.buy-total-line {
  stroke: #000000;
}

.gross-mortgage-line {
  stroke: #198754;
}

.net-mortgage-line {
  stroke: #000000;
}

.point {
  stroke: var(--surface-soft);
  stroke-width: 1.8;
}

.rent-point {
  fill: #198754;
}

.buy-point {
  fill: var(--accent);
}

.buy-total-point {
  fill: #000000;
}

.gross-mortgage-point {
  fill: #198754;
}

.net-mortgage-point {
  fill: #000000;
}

.axis-label,
.x-labels text,
.series-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.rent-label {
  fill: var(--rent-series);
}

.buy-label {
  fill: var(--accent);
}

.chart-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-legend i.legend-line {
  width: 20px;
  height: 3px;
}

.legend-rent {
  background: #198754;
}

.legend-buy {
  background: var(--accent);
}

.legend-buy-total {
  background: #000000;
}

.legend-gross-mortgage {
  background: #198754;
}

.legend-net-mortgage {
  background: #000000;
}

.stack-segment {
  opacity: 0.88;
}

.stack-segment:hover {
  opacity: 1;
}

.stack-rent,
.legend-rent-cost {
  fill: var(--rent-series);
  background: var(--rent-series);
}

.stack-profit,
.legend-profit {
  fill: var(--success);
  background: var(--success);
}

.stack-mortgage,
.legend-mortgage {
  fill: var(--accent);
  background: var(--accent);
}

.stack-maintenance,
.legend-maintenance {
  fill: #8a6f4d;
  background: #8a6f4d;
}

.stack-other,
.legend-other {
  fill: var(--other-series);
  background: var(--other-series);
}

.stack-principal,
.legend-principal {
  fill: var(--accent);
  background: var(--accent);
}

.stack-net-interest,
.legend-net-interest {
  fill: #8a6f4d;
  background: #8a6f4d;
}

.stack-hra,
.legend-hra {
  fill: var(--rent-series);
  background: var(--rent-series);
}

.stacked-legend {
  flex-wrap: wrap;
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
}

th,
td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  font-size: 13px;
}

th {
  position: sticky;
  top: 0;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.results .table-wrap table {
  min-width: 434px;
}

.results .table-wrap th,
.results .table-wrap td {
  padding: 4px 7px;
}

.results .table-wrap .purchase-cost-table,
.results .table-wrap .owner-cost-table {
  width: 100%;
  min-width: 0;
  table-layout: auto;
}

.purchase-cost-table th,
.purchase-cost-table td,
.owner-cost-table th,
.owner-cost-table td {
  width: 1%;
  padding: 4px 6px;
  white-space: nowrap;
}

.purchase-cost-table th:first-child,
.purchase-cost-table td:first-child,
.owner-cost-table th:first-child,
.owner-cost-table td:first-child {
  padding-right: 10px;
}

.purchase-cost-table th:last-child,
.purchase-cost-table td:last-child,
.owner-cost-table th:last-child,
.owner-cost-table td:last-child {
  width: auto;
  padding-right: 6px;
}

.cost-label-with-help {
  position: relative;
  display: inline-block;
  z-index: 1;
  min-height: 0;
  padding-right: 30px;
  line-height: normal;
  vertical-align: baseline;
  white-space: nowrap;
}

.cost-label-with-help:hover,
.cost-label-with-help:focus,
.cost-label-with-help:focus-visible {
  z-index: 2147483647;
}

.cost-label-with-help::after {
  content: "?";
  position: absolute;
  top: 50%;
  right: 6px;
  display: grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  transform: translateY(-50%);
  pointer-events: none;
}

.cost-label-with-help:hover::after,
.cost-label-with-help:focus-visible::after {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.cost-label-with-help > span {
  display: inline;
  line-height: normal;
}

.purchase-cost-note {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
  line-height: 1.25;
  white-space: normal;
}

.table-note-help {
  position: absolute;
  z-index: 2147483647;
  top: calc(50% - 4px);
  right: 0;
  margin: 0;
  transform: none;
}

.table-note-help div {
  left: 0;
  right: auto;
}

.inline-help-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 19px;
  vertical-align: middle;
}

.inline-help-label.cost-label-with-help {
  display: inline-block;
  min-height: 0;
  line-height: normal;
  vertical-align: baseline;
}

.acronym-inline {
  display: inline-flex;
  min-height: 0;
  vertical-align: baseline;
}

.acronym-inline strong {
  font: inherit;
  font-weight: 900;
}

.inline-help-popover {
  margin: 0;
  line-height: 1;
}

.inline-help-popover summary {
  flex: 0 0 auto;
  position: relative;
  top: 5px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--border);
  transform: none;
}

.table-note-help summary {
  position: static;
  top: auto;
}

.chart-note .inline-help-label {
  display: inline-block;
  gap: 0;
  min-height: 0;
  vertical-align: baseline;
}

.chart-note .inline-help-popover summary {
  position: static;
  top: auto;
  transform: none;
}

.table-heading-help,
.kpi-label-with-help {
  display: inline-block;
}

.pressure-table .table-heading-help {
  display: inline-block;
  padding-right: 0;
  line-height: inherit;
}

.pressure-table th.has-heading-help {
  position: relative;
}

.pressure-table th.has-heading-help .acronym-help {
  position: absolute;
  top: calc(50% + 6px);
  right: 4px;
  margin: 0;
  transform: translateY(-50%);
  pointer-events: auto;
}

.pressure-table th.has-heading-help .acronym-help summary {
  position: static;
  top: auto;
  transform: none;
}

.tax-summary .kpi-label-with-help {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tax-summary .tax-summary-has-help {
  position: relative;
}

.tax-summary .tax-summary-has-help > .acronym-help {
  position: absolute;
  top: 9px;
  left: 105px;
  margin: 0;
}

.tax-summary .tax-summary-has-help > .acronym-help summary {
  position: static;
  top: auto;
  transform: none;
}

.acronym-help summary {
  width: 16px;
  height: 16px;
  font-size: 10px;
}

.tax-input-field .field-heading {
  gap: 5px;
}

.help-popover summary,
.inline-help-popover summary,
.table-note-help summary,
.chart-note .inline-help-popover summary,
.pressure-table th.has-heading-help .acronym-help summary,
.tax-summary .tax-summary-has-help > .acronym-help summary,
.acronym-help summary,
.result-band .help-popover summary {
  position: absolute;
  top: auto;
  display: block;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 0;
  box-shadow: none;
  clip-path: inset(50%);
  background: transparent;
  color: transparent;
  transform: none;
  white-space: nowrap;
}

.numeric {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.total-row td {
  background: var(--total-bg);
  color: var(--total-text);
  font-weight: 900;
}

.content-page {
  display: grid;
  gap: 15px;
  width: min(920px, calc(100% - 28px));
  margin: 15px auto 31px;
}

.wide-page {
  width: min(1180px, calc(100% - 28px));
}

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

.blog-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.blog-card a {
  display: grid;
  gap: 9px;
  height: 100%;
  padding: 12px;
  color: inherit;
  text-decoration: none;
}

.blog-card a:hover h3 {
  color: var(--accent-dark);
}

.blog-card img,
.post-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  background: var(--chart-track);
}

.blog-card span,
.post-date {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.blog-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.25;
}

.blog-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.blog-post-page {
  width: min(860px, calc(100% - 28px));
}

.blog-post h2 {
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.08;
}

.post-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
}

.post-nav a {
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  text-decoration: none;
}

.post-nav a:hover {
  border-color: var(--accent);
  color: var(--accent-dark);
}

.post-nav-bottom {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}

.section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.section-copy {
  display: grid;
  gap: 7px;
}

.section-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-title-icon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: rgba(96, 165, 250, 0.15);
  color: #74a9ff;
}

.section-title-icon svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.wide-page .section-head h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
}

.reset-fields-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 34px;
  padding: 0 11px;
  border-color: var(--border);
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  white-space: nowrap;
}

.reset-fields-button:hover {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--accent-dark);
}

.reset-fields-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  line-height: 1.45;
}

.box1-explanation-lead {
  max-width: 860px;
}

.section-explanation {
  margin-top: 2px;
}

.section-explanation summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: fit-content;
  min-height: 26px;
  padding: 3px 8px;
  border: 1px solid rgba(96, 165, 250, 0.28);
  border-radius: 6px;
  background: rgba(96, 165, 250, 0.09);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.section-explanation summary::-webkit-details-marker {
  display: none;
}

.section-explanation summary::marker {
  content: "";
}

.section-summary-icon {
  display: inline-grid;
  place-items: center;
  width: 14px;
  height: 14px;
  color: #74a9ff;
}

.section-summary-icon svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.section-summary-chevron {
  color: #74a9ff;
  font-size: 15px;
  line-height: 1;
}

.section-explanation ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.section-explanation li + li {
  margin-top: 6px;
}

.explanation-blocks {
  display: grid;
  gap: 12px;
  max-width: 900px;
  margin-top: 12px;
  color: var(--muted);
}

.explanation-blocks section {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.explanation-blocks h3 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
}

.explanation-blocks p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.explanation-blocks b {
  color: var(--text);
  font-weight: 900;
}

.mode-toggle {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 4px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.mode-button,
.range-button {
  min-height: 30px;
  padding: 0 10px;
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  box-shadow: none;
}

.mode-button:hover,
.mode-button.active,
.range-button:hover,
.range-button.active {
  border-color: var(--accent);
  background: var(--surface);
  color: var(--text);
}

.range-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tax-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -2px 0 14px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.line-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -4px 0 12px;
}

.line-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.line-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.zero-rate-control {
  color: var(--rent-series);
}

.savings-rate-control {
  color: var(--savings-series);
}

.msci-rate-control {
  color: var(--other-series);
}

.tax-toggle,
.tax-rate-input {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  gap: 7px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
}

.tax-toggle input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.tax-rate-input {
  gap: 6px;
}

.tax-rate-input input {
  width: 64px;
  min-height: 24px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-align: right;
}

.range-presets {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
}

.year-selectors {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 8px;
}

.year-selectors label {
  display: inline-grid;
  grid-template-columns: auto minmax(84px, 1fr);
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.year-selectors select {
  min-height: 30px;
  padding: 0 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-weight: 800;
}

.year-selectors select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.price-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.return-stats {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.price-stats article {
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.price-stats span,
.price-stats small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.price-stats strong {
  display: block;
  margin: 5px 0 3px;
  font-size: clamp(22px, 2.4vw, 32px);
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}

.zero-return-stat strong,
.zero-return-stat span {
  color: var(--zero-series);
}

.savings-return-stat strong,
.savings-return-stat span {
  color: var(--savings-series);
}

.msci-return-stat strong,
.msci-return-stat span {
  color: var(--other-series);
}

.price-chart-wrap {
  min-height: 420px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.chart-subhead {
  margin-top: 18px;
}

.house-price-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 360px;
}

.house-price-line {
  fill: none;
  stroke: var(--accent);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.house-price-point {
  fill: var(--accent);
  stroke: var(--surface-soft);
  stroke-width: 1.8;
}

.purchasing-power-line {
  stroke: var(--zero-series);
}

.purchasing-power-point {
  fill: var(--zero-series);
}

.savings-power-line {
  stroke: var(--savings-series);
}

.savings-power-point {
  fill: var(--savings-series);
}

.zero-rate-label {
  fill: var(--zero-series);
}

.savings-rate-label {
  fill: var(--savings-series);
}

.msci-power-line {
  stroke: var(--msci-series);
}

.msci-power-point {
  fill: var(--msci-series);
}

.msci-rate-label {
  fill: var(--msci-series);
}

.growth-bar {
  fill: var(--accent);
  opacity: 0.72;
}

.growth-bar.negative {
  fill: var(--danger);
}

.growth-bar:hover {
  opacity: 1;
}

.loading-text,
.error-text,
.source-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.error-text {
  color: var(--danger);
}

.source-note {
  margin-top: 12px;
}

.source-note a {
  color: var(--accent-dark);
  font-weight: 900;
}

.pressure-toggles {
  display: grid;
  grid-template-columns: repeat(2, minmax(132px, 1fr));
  gap: 8px;
  min-width: min(330px, 100%);
}

.switch-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 6px 9px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  color: var(--text);
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
}

.switch-row input {
  width: 16px;
  height: 16px;
  accent-color: var(--accent);
}

.tax-tool {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
}

.tax-controls-row {
  display: grid;
  grid-template-columns: 1fr;
  align-items: end;
  gap: 12px;
}

.tax-controls-row .pressure-toggles {
  grid-template-columns: repeat(6, minmax(120px, 1fr));
  justify-self: stretch;
  min-width: 0;
}

.tax-controls-row .switch-row {
  justify-content: flex-start;
}

.tax-input-grid.box1-input-grid {
  grid-template-columns: repeat(7, minmax(112px, 1fr));
  align-items: start;
}

.tax-input-card {
  display: grid !important;
  gap: 12px;
  align-self: stretch;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-soft);
  background: color-mix(in srgb, var(--surface) 44%, var(--surface-soft));
}

.box1-children-card {
  grid-column: 5 / 8 !important;
  grid-row: 1 !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
}

.box1-personal-card {
  grid-column: 1 / 5 !important;
  grid-row: 1 !important;
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
}

.box1-childcare-card {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
}

.tax-input-grid.box1-input-grid > .tax-input-field {
  align-self: start;
}

.tax-input-card h3 {
  grid-column: 1 / -1;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.tax-input-card h3 > svg {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  max-width: 17px;
  max-height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.input-shell-plain {
  grid-template-columns: minmax(0, 1fr);
}

.input-shell-select {
  position: relative;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
}

.input-shell-select::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 11px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  pointer-events: none;
  transform: translateY(-70%) rotate(45deg);
}

.input-shell select {
  appearance: none;
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 0 30px 0 8px;
  border: 0;
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-weight: 800;
  line-height: 30px;
  cursor: pointer;
}

.input-shell select:focus {
  outline: 3px solid var(--focus-ring);
}

.input-shell select:disabled {
  color: var(--muted);
  cursor: not-allowed;
}

.input-shell select option {
  background: var(--input-bg);
  color: var(--text);
}

.tax-input-field.is-disabled {
  opacity: 0.58;
}

.tax-input-field.has-input-warning {
  color: var(--danger);
}

.tax-input-field.has-input-warning .input-shell {
  border-color: var(--danger);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--danger) 18%, transparent);
}

.tax-input-field input:disabled {
  cursor: not-allowed;
}

.tax-input-field select:disabled {
  cursor: not-allowed;
}

.tax-input-field .input-shell input,
.tax-input-field .input-shell select,
.tax-input-field .input-shell > span {
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
}

.tax-input-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
  align-items: end;
}

.tax-input-field {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.tax-input-field .field-label {
  font-weight: inherit;
}

.box1-childcare-card > .tax-input-field {
  grid-template-rows: 32px auto;
}

.box1-childcare-card > .tax-input-field > span:first-child,
.box1-childcare-card > .tax-input-field > .field-heading {
  display: inline-flex;
  align-items: end;
  min-height: 32px;
}

.tax-input-field .field-heading:has(.help-popover) .field-label {
  border-bottom: 0;
  cursor: inherit;
}

.tax-input-field .field-heading .help-popover {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
}

.box1-personal-card > .tax-input-field {
  grid-template-rows: 22px auto;
}

.box1-personal-card > .tax-input-field > span:first-child,
.box1-personal-card > .tax-input-field > .field-heading {
  display: inline-flex;
  align-items: end;
  min-height: 22px;
}

.tax-input-grid.box1-input-grid > .box1-personal-card {
  grid-column: 1 / 5 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: start;
  column-gap: 20px;
  row-gap: 12px;
}

.tax-input-grid.box1-input-grid > .box1-children-card {
  grid-column: 5 / 8 !important;
  grid-row: 1 !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: start;
  column-gap: 20px;
  row-gap: 12px;
}

.tax-input-grid.box1-input-grid > .box1-childcare-card {
  grid-column: 1 / -1 !important;
  grid-row: 2 !important;
  display: flex !important;
  flex-wrap: wrap;
  align-items: start;
  column-gap: 20px;
  row-gap: 12px;
}

.box1-personal-card > h3,
.box1-children-card > h3,
.box1-childcare-card > h3 {
  flex: 0 0 100%;
}

.box1-personal-card > .tax-input-field,
.box1-children-card > .tax-input-field,
.box1-childcare-card > .tax-input-field {
  flex: 1 1 0;
  min-width: 0;
}

.tax-summary {
  display: grid;
  gap: 12px;
}

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

.tax-summary:not(.box1-tax-summary):not(.box3-tax-summary) {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 8px;
}

.tax-summary:not(.box1-tax-summary):not(.box3-tax-summary) article {
  display: grid;
  grid-template-rows: 16px auto;
  align-content: start;
  row-gap: 10px;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
}

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

.box1-kpi-stack {
  display: grid;
  gap: 10px;
}

.box3-kpi-stack {
  display: grid;
  gap: 10px;
}

.box1-net-income-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 22px;
  padding: 22px 26px;
  border: 1px solid color-mix(in srgb, var(--success) 42%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 18%, transparent), transparent 56%),
    var(--input-bg);
}

.box3-main-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px 22px;
  padding: 22px 26px;
  border: 1px solid color-mix(in srgb, var(--success) 42%, var(--border));
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--success) 18%, transparent), transparent 56%),
    var(--input-bg);
}

.box1-net-income-icon,
.box1-kpi-icon,
.box3-main-icon {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--success);
}

.box1-net-income-icon {
  width: 64px;
  background: color-mix(in srgb, var(--success) 22%, transparent);
}

.box3-main-icon {
  width: 64px;
  background: color-mix(in srgb, var(--success) 22%, transparent);
  color: var(--success);
}

.box1-kpi-icon {
  width: 38px;
  background: color-mix(in srgb, var(--success) 14%, transparent);
}

.box1-net-income-icon svg,
.box1-kpi-icon svg,
.box3-main-icon svg {
  display: block;
  width: 56%;
  height: 56%;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.box1-net-income-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.box3-main-copy {
  display: grid;
  justify-items: start;
  gap: 8px;
  min-width: 0;
}

.box1-net-income-card .box1-kpi-label {
  color: var(--text);
  font-size: 13px;
}

.box3-main-card .box3-kpi-label {
  color: var(--text);
  font-size: 13px;
}

.box1-net-income-card strong {
  color: var(--text);
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: .95;
  letter-spacing: 0;
}

.box3-main-card strong {
  color: var(--text);
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: .95;
  letter-spacing: 0;
}

.box1-net-income-meta {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 420px;
}

.box3-main-meta {
  display: flex;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 8px;
}

.box1-net-income-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  line-height: 1;
}

.box3-main-meta > span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  line-height: 1;
}

.box1-net-income-meta .meta-label,
.box1-net-income-meta .meta-value,
.box3-main-meta .meta-label,
.box3-main-meta .meta-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  line-height: 1;
}

.box1-net-income-meta .meta-value,
.box3-main-meta .meta-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.box1-net-income-meta .kpi-label-with-help {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  text-transform: none;
}

.box3-main-meta .kpi-label-with-help {
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
  text-transform: none;
}

.box1-kpi-row {
  display: grid;
  gap: 8px;
}

.box3-kpi-row {
  display: grid;
  gap: 8px;
}

.box1-allowance-row {
  grid-template-columns: repeat(4, minmax(120px, 1fr));
}

.box1-pressure-row {
  grid-template-columns: repeat(3, minmax(150px, 1fr));
}

.box1-credit-row {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.box3-component-row {
  grid-template-columns: repeat(4, minmax(130px, 1fr));
}

.box3-credit-row {
  grid-template-columns: repeat(2, minmax(150px, 1fr));
}

.box1-kpi-row article {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
}

.box3-kpi-row article {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 68px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
}

.box3-credit-row article {
  min-height: 62px;
  background: var(--surface-soft);
}

.box3-component-row article {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger) 8%, transparent), transparent),
    var(--input-bg);
}

.box1-kpi-copy {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
}

.box1-pressure-row article,
.box1-credit-row article {
  grid-template-columns: 1fr;
  align-items: start;
}

.box1-pressure-row article {
  border-color: color-mix(in srgb, var(--danger) 28%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--danger) 8%, transparent), transparent),
    var(--input-bg);
}

.box1-allowance-row article {
  grid-template-columns: 1fr;
  align-items: start;
  border-color: color-mix(in srgb, var(--success) 32%, var(--border));
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--success) 10%, transparent), transparent),
    var(--input-bg);
}

.box1-allowance-row .box1-kpi-icon {
  display: none;
}

.box1-allowance-row .box1-kpi-copy {
  align-content: start;
}

.box1-credit-row article {
  min-height: 62px;
  background: var(--surface-soft);
}

.kpi-primary-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 10px;
}

.kpi-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
}

.kpi-icon {
  display: grid;
  place-items: center;
  width: 48px;
  aspect-ratio: 1;
  border-radius: 50%;
  color: var(--text);
}

.kpi-icon svg {
  display: block;
  width: 27px;
  height: 27px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.kpi-card-success .kpi-icon {
  background: color-mix(in srgb, var(--success) 48%, transparent);
  color: #7ef0a2;
}

.kpi-card-warning .kpi-icon {
  background: color-mix(in srgb, #c56b1b 48%, transparent);
  color: #ff9f37;
}

.kpi-card-danger .kpi-icon {
  background: color-mix(in srgb, var(--danger) 42%, transparent);
  color: #ff8f8f;
}

.kpi-card-info .kpi-icon {
  background: color-mix(in srgb, var(--zero-series) 34%, transparent);
  color: #b9e0ff;
}

.kpi-copy {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.tax-summary span,
.kpi-detail-panel h3 {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tax-summary .kpi-icon {
  display: grid;
  place-items: center;
}

.kpi-card .kpi-label-with-help,
.kpi-card > .kpi-copy > span {
  line-height: 1.15;
}

.tax-summary .tax-summary-positive > span,
.tax-summary .tax-summary-positive .kpi-label-with-help {
  color: var(--success);
}

.tax-summary .tax-summary-pressure > span,
.tax-summary .tax-summary-pressure .kpi-label-with-help {
  color: var(--danger);
  color: color-mix(in srgb, var(--danger) 68%, var(--muted));
}

.tax-summary .kpi-label-with-help {
  display: block;
  width: fit-content;
  max-width: 100%;
  min-height: 16px;
  line-height: 16px;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tax-summary strong {
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.tax-summary .box1-net-income-card strong {
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: .95;
}

.tax-summary .box3-main-card strong {
  font-size: clamp(30px, 3.1vw, 42px);
  line-height: .95;
}

.tax-summary .box1-net-income-icon,
.tax-summary .box1-kpi-icon,
.tax-summary .box3-main-icon {
  display: grid;
  place-items: center;
}

.tax-summary .box1-net-income-icon svg,
.tax-summary .box1-kpi-icon svg,
.tax-summary .box3-main-icon svg {
  display: block;
  margin: auto;
}

.tax-summary .box1-net-income-meta > span {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  line-height: 1;
}

.tax-summary .box3-main-meta > span {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: max-content;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: none;
  line-height: 1;
}

.tax-summary .box1-net-income-meta .meta-label,
.tax-summary .box1-net-income-meta .meta-value,
.tax-summary .box3-main-meta .meta-label,
.tax-summary .box3-main-meta .meta-value {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 16px;
  min-height: 16px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 16px;
  text-transform: none;
}

.tax-summary .box1-net-income-meta .meta-value,
.tax-summary .box3-main-meta .meta-value {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.tax-summary .box1-net-income-meta .kpi-label-with-help {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  height: 16px;
  min-height: 16px;
  line-height: 16px;
  text-transform: none;
}

.tax-summary .box3-main-meta .kpi-label-with-help {
  display: inline-flex;
  align-items: center;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  height: 16px;
  min-height: 16px;
  line-height: 16px;
  text-transform: none;
}

.tax-summary .box1-allowance-row strong {
  color: #ffffff;
  font-size: 18px;
}

.tax-summary .box1-allowance-row article {
  grid-template-columns: 1fr;
  align-content: start;
  align-items: start;
  min-height: 72px;
  gap: 8px;
}

.tax-summary .box1-allowance-row .box1-kpi-icon {
  display: none;
}

.tax-summary .box1-allowance-row .box1-kpi-copy {
  align-content: start;
  gap: 8px;
}

.kpi-card strong {
  font-size: clamp(21px, 1.7vw, 25px);
  line-height: 1.05;
}

.kpi-detail-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--surface-soft);
}

.kpi-detail-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  text-transform: none;
}

.kpi-detail-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(130px, 1fr));
  gap: 12px;
}

.kpi-detail-grid article {
  display: grid;
  align-content: start;
  gap: 12px;
  min-height: 74px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--input-bg);
}

.pressure-layout {
  display: grid;
  grid-template-columns: 373px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  margin-top: 12px;
}

.pressure-table-options {
  display: grid;
  grid-template-columns: 373px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  margin-top: 10px;
}

.pressure-table-options-left,
.pressure-table-options-right {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.pressure-table-options-left {
  justify-content: flex-start;
}

.pressure-table-options-right {
  justify-content: flex-end;
}

.pressure-table-options .switch-row {
  width: fit-content;
}

.pressure-layout .table-wrap {
  grid-column: 2;
  min-width: 0;
  width: auto;
  max-width: 100%;
}

.pressure-chart-column {
  grid-column: 1;
  grid-row: 1;
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 0;
}

.pressure-layout > .pressure-chart-wrap {
  grid-column: 1;
  grid-row: 1;
}

.pressure-chart-wrap {
  width: 373px;
  max-width: 100%;
  padding: 18px 14px 14px;
  border: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-radius: 8px;
  background: var(--input-bg);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--shadow) 70%, transparent);
  overflow: hidden;
}

.chart-title {
  position: relative;
  margin: 0;
  padding-bottom: 12px;
  color: var(--text);
  font-size: 20px;
  font-weight: 900;
  line-height: 1.08;
}

.chart-title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 54px;
  height: 4px;
  border-radius: 999px;
  background: #f5b400;
}

.chart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 10px;
}

.chart-range-checkbox {
  flex: 0 0 auto;
  width: fit-content;
  min-width: 0;
}

.pressure-chart {
  display: block;
  width: 100%;
  height: auto;
  min-height: 305px;
}

.pressure-area {
  fill: url("#pressureAreaGradient");
  pointer-events: none;
}

.pressure-area-box3 {
  fill: url("#pressureAreaGradientBox3");
}

.pressure-line {
  fill: none;
  stroke: #ffb000;
  stroke-width: 3.5;
  stroke-linecap: square;
  stroke-linejoin: miter;
}

.pressure-chart .axis {
  stroke: color-mix(in srgb, var(--border) 82%, transparent);
  stroke-width: 1.2;
}

.pressure-chart .grid {
  stroke: color-mix(in srgb, var(--border) 68%, transparent);
  stroke-width: 1;
  stroke-dasharray: 4 5;
}

.pressure-chart .tick {
  stroke: color-mix(in srgb, var(--border) 82%, transparent);
}

.pressure-chart .axis-label {
  fill: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.chart-axis-title {
  fill: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.chart-axis-title-x {
  font-size: 12px;
}

.pressure-hover-zone {
  fill: transparent;
  pointer-events: all;
}

.phaseout-marker {
  stroke: var(--accent-dark);
  stroke-dasharray: 4 4;
  stroke-width: 1.4;
  opacity: 0.72;
}

.phaseout-label {
  fill: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
}

.pressure-table {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--border);
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 8px;
  background: var(--input-bg);
  overflow: hidden;
  table-layout: auto;
}

.pressure-table:not(.show-allowance-calculation) {
  width: min(100%, 620px);
}

.pressure-table.show-allowance-calculation {
  width: 100%;
}

.pressure-table th,
.pressure-table td {
  width: auto;
  padding: 7px 9px;
  border-right: 1px solid color-mix(in srgb, var(--border) 72%, transparent);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  line-height: 1.16;
}

.pressure-table th {
  vertical-align: middle;
  max-width: none;
  white-space: nowrap;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--accent) 7%, transparent), transparent),
    var(--surface-soft);
  color: var(--text);
  font-size: 12px;
  line-height: 1.12;
  text-align: left;
}

.pressure-table td {
  background: var(--input-bg);
  color: var(--text);
  white-space: nowrap;
}

.pressure-table tr:last-child td {
  border-bottom: 0;
}

.pressure-table tr.pressure-row-over-100 td {
  background:
    linear-gradient(90deg, color-mix(in srgb, #3a0208 52%, transparent), color-mix(in srgb, #7f1d1d 24%, transparent)),
    var(--input-bg);
  border-color: color-mix(in srgb, #7f1d1d 62%, var(--border));
  color: #ffffff;
}

.pressure-table tr.pressure-row-over-100 .income-cell,
.pressure-table tr.pressure-row-over-100 .numeric {
  color: #ffffff;
}

.pressure-table th:last-child,
.pressure-table td:last-child {
  border-right: 0;
}

.pressure-heading {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.pressure-heading-icon {
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  color: #6ea8ff;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
}

.pressure-table .income-cell,
.pressure-table th:first-child {
  max-width: none;
}

.pressure-table .numeric {
  min-width: 0;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pressure-table .is-zero-value {
  color: var(--text-muted);
  opacity: 0.58;
}

.pressure-table .pressure-total.is-zero-value {
  opacity: 1;
}

.pressure-table:not(.show-allowance-calculation) .allowance-calculation-column {
  display: none;
}

.pressure-table .pressure-total {
  min-width: 0;
}

.pressure-table th:last-child,
.pressure-table td:last-child {
  padding-right: 9px;
}

.pressure-table th:last-child {
  max-width: none;
  white-space: nowrap;
}

.pressure-note-row td {
  text-align: center;
  font-weight: 700;
  color: var(--text);
  background: var(--surface-muted);
}

.explanation-table {
  min-width: 760px;
}

.explanation-callout {
  display: grid;
  gap: 8px;
  margin: 12px 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background: var(--surface-soft);
}

.explanation-callout p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.subsection-title {
  margin: 0 0 10px;
  font-size: 16px;
  font-weight: 900;
}

.pressure-total {
  font-weight: 900;
}

.pressure-pill {
  display: inline-flex;
  justify-content: center;
  min-width: 58px;
  padding: 3px 9px;
  border-radius: 999px;
  color: var(--pill-text);
  background: var(--pill-bg);
  font-size: 12px;
  font-weight: 900;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.pressure-band-low {
  --pill-bg: color-mix(in srgb, #44d77e 30%, #ffffff);
  --pill-text: #078038;
}

.pressure-band-moderate {
  --pill-bg: color-mix(in srgb, #ffd44f 42%, #ffffff);
  --pill-text: #b77600;
}

.pressure-band-elevated {
  --pill-bg: color-mix(in srgb, #ffb34d 46%, #ffffff);
  --pill-text: #d66b00;
}

.pressure-band-high {
  --pill-bg: color-mix(in srgb, #ff7a3d 78%, #ffffff);
  --pill-text: #ffffff;
}

.pressure-band-very-high {
  --pill-bg: linear-gradient(135deg, #ff4f42, #e5324f);
  --pill-text: #ffffff;
}

.pressure-band-extreme {
  --pill-bg: linear-gradient(135deg, #3a0208, #120003);
  --pill-text: #ffffff;
}

.prose {
  display: grid;
  gap: 12px;
}

.prose p {
  margin: 0;
  color: var(--text);
  line-height: 1.6;
}

.prose details {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.prose details:last-child {
  border-bottom: 0;
}

.prose summary {
  margin: 0;
  font-size: 15px;
}

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

  .calculation-ad-layout {
    grid-template-columns: 1fr;
  }

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

  .calculation-ad {
    max-width: 360px;
    justify-self: center;
  }

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

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

  .input-panel {
    position: static;
    width: 100%;
    max-width: 100%;
    max-height: none;
  }

  .calculator-overview {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .calculator-toolbar {
    grid-column: 1 / -1;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: stretch;
  }

  .pressure-layout {
    grid-template-columns: 1fr;
  }

  .pressure-layout .table-wrap {
    grid-column: 1;
    grid-row: 2;
  }

  .pressure-chart-column,
  .pressure-layout > .pressure-chart-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  .tax-controls-row {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .tax-controls-row .pressure-toggles {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
    justify-self: stretch;
  }

  .tax-input-grid.box1-input-grid {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }

  .box1-personal-card,
  .box1-children-card,
  .box1-childcare-card {
    grid-column: 1 / -1;
    grid-row: auto;
  }
}

@media (max-width: 1280px) {
  .pressure-layout {
    grid-template-columns: 1fr;
  }

  .pressure-layout .table-wrap {
    grid-column: 1;
    grid-row: 2;
  }

  .pressure-chart-column,
  .pressure-layout > .pressure-chart-wrap {
    grid-column: 1;
    grid-row: 1;
  }

  .pressure-chart-wrap {
    width: 373px;
  }
}

@media (max-width: 640px) {
  .topbar {
    display: grid;
    gap: 10px;
  }

  .pressure-table-options {
    grid-template-columns: 1fr;
  }

  .pressure-table-options-right {
    justify-content: flex-start;
  }

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

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

  .layout {
    display: block;
    width: 100%;
    max-width: 100vw;
  }

  .input-panel,
  .results,
  .result-band {
    width: 100%;
    max-width: calc(100vw - 28px);
  }

  .header-tools {
    justify-content: start;
  }

  .site-nav {
    justify-content: start;
  }

  .assumptions {
    justify-content: stretch;
  }

  .assumptions div,
  .summary-card {
    min-width: 0;
  }

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

  .calculator-toolbar {
    justify-content: flex-start;
  }

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

  fieldset {
    grid-template-columns: 1fr;
  }

  .investment-column {
    grid-column: 1;
  }

  .field-maintenanceRate {
    grid-column: auto;
  }

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

  .input-shell {
    grid-template-columns: minmax(0, 1fr) 44px;
  }

  .input-shell-plain {
    grid-template-columns: minmax(0, 1fr);
  }

  .bar-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .bar-row strong {
    text-align: left;
  }

  .result-band {
    padding: 16px;
  }

  .calculator-overview {
    grid-template-columns: 1fr;
    justify-items: stretch;
  }

  .summary-icon {
    display: none;
  }

  .calculator-toolbar {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: grid;
  }

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

  .box1-tax-summary,
  .tax-summary {
    grid-template-columns: 1fr;
  }

  .box1-net-income-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .box3-main-card {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
  }

  .box1-net-income-copy {
    justify-items: center;
  }

  .box3-main-copy {
    justify-items: center;
  }

  .box1-net-income-meta {
    justify-content: center;
  }

  .box3-main-meta {
    justify-content: center;
  }

  .box1-allowance-row,
  .box1-pressure-row,
  .box1-credit-row,
  .box3-component-row,
  .box3-credit-row {
    grid-template-columns: 1fr;
  }

  .kpi-primary-grid,
  .kpi-detail-grid {
    grid-template-columns: 1fr;
  }

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

  .box1-personal-card,
  .box1-children-card,
  .box1-childcare-card {
    grid-column: 1 / -1;
    grid-template-columns: 1fr;
  }

  .box1-personal-card > .tax-input-field,
  .box1-children-card > .tax-input-field,
  .box1-childcare-card > .tax-input-field {
    flex-basis: 100%;
  }

  .tax-controls-row {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .tax-controls-row .pressure-toggles {
    grid-template-columns: 1fr;
    justify-self: stretch;
  }

  .chart-head {
    display: grid;
  }

  .mode-toggle {
    justify-self: start;
  }

  .range-controls {
    display: grid;
    justify-content: stretch;
  }

  .range-presets,
  .year-selectors {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .price-stats {
    grid-template-columns: 1fr;
  }

  .price-chart-wrap {
    min-height: 300px;
    padding: 8px;
  }

  .secondary-kpis {
    grid-template-columns: 1fr;
  }
}
