/* Calculator page — scoped to /calculate/. */
.page-calculator {
  background: #f5f9fc;
  color: #16324f;
}

.page-calculator section[id] {
  scroll-margin-top: 104px;
}

.calc-hero {
  position: relative;
  overflow: hidden;
  padding: calc(var(--header-height) + 54px) 0 78px;
  color: #fff;
  background:
    radial-gradient(circle at 78% 26%, rgba(21,159,230,.24), transparent 30%),
    linear-gradient(122deg, #03182b 0%, #06365f 58%, #0879b8 100%);
}

.calc-hero::before {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(115deg, transparent 0 58%, rgba(255,255,255,.045) 58% 58.4%, transparent 58.4%),
    linear-gradient(115deg, transparent 0 72%, rgba(255,255,255,.035) 72% 72.4%, transparent 72.4%);
  content: "";
  pointer-events: none;
}

.calc-hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0,1.08fr) minmax(330px,.72fr);
  gap: clamp(40px,6vw,90px);
  align-items: center;
}

.calc-hero .catalog-breadcrumbs {
  margin-bottom: 18px;
}

.calc-hero__copy h1 {
  max-width: 820px;
  margin: 8px 0 0;
  color: #fff;
  font-size: clamp(38px,4.3vw,66px);
  line-height: .98;
  letter-spacing: -.045em;
}

.calc-hero__lead {
  max-width: 44rem;
  margin: 22px 0 0;
  color: rgba(255,255,255,.8);
  font-size: clamp(16px,1.35vw,19px);
  line-height: 1.65;
}

.calc-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.calc-hero__button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid rgba(255,255,255,.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(255,255,255,.08);
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}

.calc-hero__button--primary {
  border-color: #fff;
  color: #033055;
  background: #fff;
}

.calc-hero__button:hover,
.calc-hero__button:focus-visible {
  transform: translateY(-2px);
  border-color: #fff;
  background: rgba(255,255,255,.16);
}

.calc-hero__button--primary:hover,
.calc-hero__button--primary:focus-visible {
  background: #eaf6ff;
}

.calc-hero__panel {
  position: relative;
  min-height: 360px;
  overflow: hidden;
  padding: 30px;
  border: 1px solid rgba(255,255,255,.2);
  border-radius: 28px;
  background: rgba(4,28,49,.68);
  box-shadow: 0 28px 70px rgba(0,0,0,.28);
  backdrop-filter: blur(14px);
}

.calc-hero__panel::before,
.calc-hero__panel::after {
  position: absolute;
  border: 1px solid rgba(143,214,255,.22);
  border-radius: 50%;
  content: "";
}

.calc-hero__panel::before {
  width: 280px;
  height: 280px;
  right: -110px;
  top: -120px;
}

.calc-hero__panel::after {
  width: 190px;
  height: 190px;
  right: -66px;
  top: -76px;
}

.calc-hero__panel-head {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.calc-hero__badge {
  padding: 6px 12px;
  border: 1px solid rgba(143,214,255,.45);
  border-radius: 999px;
  background: rgba(143,214,255,.12);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .04em;
  text-decoration: none;
  white-space: nowrap;
}

.calc-hero__badge:hover {
  background: rgba(143,214,255,.24);
}

.calc-hero__badge:focus-visible {
  outline: 2px solid #9cddff;
  outline-offset: 3px;
}

.calc-hero__panel-label {
  position: relative;
  z-index: 1;
  color: #9cddff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.calc-hero__panel-value {
  position: relative;
  z-index: 1;
  display: block;
  margin-top: 18px;
  color: #fff;
  font-family: var(--font-display);
  font-size: clamp(46px,5vw,70px);
  line-height: .94;
  letter-spacing: -.06em;
}

.calc-hero__panel-value small {
  display: block;
  margin-top: 8px;
  color: rgba(255,255,255,.62);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}

.calc-hero__mini-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 32px;
}

.calc-hero__mini {
  padding: 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 14px;
  background: rgba(255,255,255,.055);
}

.calc-hero__mini strong,
.calc-hero__mini span {
  display: block;
}

.calc-hero__mini strong {
  color: #fff;
  font-size: 18px;
}

.calc-hero__mini span {
  margin-top: 3px;
  color: rgba(255,255,255,.58);
  font-size: 11px;
}

.calc-shell {
  padding: 72px 0 94px;
}

.calc-intro {
  display: grid;
  grid-template-columns: minmax(0,.72fr) minmax(0,1.28fr);
  gap: clamp(36px,5vw,80px);
  align-items: start;
  margin-bottom: 30px;
}

.calc-intro h2 {
  margin: 6px 0 0;
  color: var(--brand-navy);
  font-size: clamp(30px,3vw,44px);
  line-height: 1.06;
  letter-spacing: -.035em;
}

.calc-intro p {
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.calc-card {
  overflow: hidden;
  border: 1px solid rgba(1,77,133,.12);
  border-radius: 26px;
  background: #fff;
  box-shadow: 0 24px 64px rgba(3,24,43,.1);
}

.calc-progress {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  background: #f8fbfd;
}

.calc-progress__item {
  padding: 15px 20px;
  color: #6b8195;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
  letter-spacing: .02em;
}

.calc-progress__item.is-active {
  color: var(--brand-blue);
  background: var(--brand-ice);
}

.calc-card__body {
  padding: 22px clamp(18px,2.4vw,32px) 24px;
}

#calc-input-step [hidden],
.calc-card__body[hidden],
.calc-lead[hidden],
.calc-risk[hidden] {
  display: none !important;
}

.calc-question {
  padding: 12px 0;
  border-bottom: 1px solid rgba(1,77,133,.1);
}

.calc-question:first-child {
  padding-top: 0;
}

.calc-question:last-child {
  border-bottom: 0;
}

.calc-question__head {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}

.calc-question__number {
  display: inline-grid;
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--brand-blue);
  font-size: 12px;
  font-weight: 800;
}

.calc-question__title {
  margin: 0;
  color: var(--brand-navy);
  font-size: 15px;
  font-weight: 800;
  line-height: 1.25;
}

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

.calc-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.calc-field--wide {
  grid-column: 1 / -1;
}

.calc-field label,
.calc-field__label {
  color: #244866;
  font-size: 13px;
  font-weight: 700;
}

.calc-field input,
.calc-field select {
  width: 100%;
  height: 44px;
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid #c9d9e6;
  border-radius: 11px;
  outline: 0;
  color: #16324f;
  background: #fff;
  font: inherit;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.calc-field input:focus,
.calc-field select:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(21,159,230,.13);
}

.calc-field input[aria-invalid="true"],
.calc-field select[aria-invalid="true"] {
  border-color: #c94a4a;
}

.calc-field__hint {
  margin: 0;
  color: #71879a;
  font-size: 11px;
  line-height: 1.45;
}

.calc-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.calc-mode__button {
  min-height: 44px;
  padding: 8px 13px;
  border: 1px solid #c9d9e6;
  border-radius: 999px;
  color: #345a78;
  background: #fff;
  font-weight: 700;
  cursor: pointer;
}

.calc-mode__button.is-active {
  border-color: #8bc8ee;
  color: var(--brand-blue);
  background: var(--brand-ice);
}

.calc-combo {
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(132px,148px);
  gap: 8px;
  align-items: stretch;
}

.calc-error {
  margin: 16px 0 0;
  padding: 12px 14px;
  border: 1px solid rgba(190,56,56,.24);
  border-radius: 10px;
  color: #8f2727;
  background: #fff4f4;
  font-size: 13px;
}

.calc-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  margin-top: 16px;
}

.calc-primary,
.calc-secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.calc-primary {
  border: 1px solid var(--brand-blue);
  color: #fff;
  background: var(--brand-blue);
}

.calc-primary:hover,
.calc-primary:focus-visible {
  background: #004883;
}

.calc-secondary {
  border: 1px solid #b9cedd;
  color: var(--brand-navy);
  background: #fff;
}

.calc-secondary:hover,
.calc-secondary:focus-visible {
  background: var(--brand-ice);
}

.calc-disclaimer {
  margin: 18px 0 0;
  color: #71879a;
  font-size: 12px;
  line-height: 1.55;
}

.calc-result-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 24px;
}

.calc-result-head h2 {
  margin: 0;
  color: var(--brand-navy);
  font-size: clamp(30px,3vw,44px);
  letter-spacing: -.035em;
}

.calc-result-head p {
  margin: 7px 0 0;
  color: var(--muted);
}

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

.calc-metric {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(1,77,133,.12);
  border-radius: 16px;
  background: #fff;
}

.calc-metric--accent {
  border-color: rgba(0,111,189,.25);
  background: linear-gradient(145deg,#edf8ff,#fff);
}

.calc-metric__label {
  min-height: 2.8em;
  color: #6a8195;
  font-size: 12px;
  line-height: 1.4;
}

.calc-metric strong {
  display: block;
  margin-top: 9px;
  color: var(--brand-navy);
  font-family: var(--font-display);
  font-size: clamp(24px,2.5vw,34px);
  line-height: 1;
  letter-spacing: -.035em;
}

.calc-metric__unit {
  display: block;
  margin-top: 7px;
  color: #7b8fa0;
  font-size: 11px;
}

.calc-surplus-note,
.calc-risk,
.calc-limit {
  margin-top: 16px;
  padding: 16px 18px;
  border-radius: 14px;
}

.calc-surplus-note {
  border-left: 4px solid #79bddf;
  color: #526c82;
  background: #f2f9fd;
  font-size: 12px;
}

.calc-risk {
  border: 1px solid rgba(213,167,54,.35);
  background: #fff9e9;
}

.calc-risk__eyebrow {
  color: #8a6518;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.calc-risk strong {
  display: block;
  margin: 8px 0;
  color: #6c4a08;
  font-family: var(--font-display);
  font-size: clamp(25px,2.8vw,38px);
  line-height: 1.1;
}

.calc-risk p {
  max-width: 820px;
  margin: 0;
  color: #745f31;
  font-size: 12px;
  line-height: 1.55;
}

.calc-forecast {
  margin-top: 28px;
}

.calc-forecast h3 {
  margin: 0 0 7px;
  color: var(--brand-navy);
  font-size: 21px;
}

.calc-forecast__lead {
  margin: 0 0 14px;
  color: #71879a;
  font-size: 12px;
}

.calc-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(1,77,133,.12);
  border-radius: 14px;
}

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

.calc-table th,
.calc-table td {
  padding: 11px 13px;
  border-bottom: 1px solid rgba(1,77,133,.09);
  text-align: right;
  font-size: 12px;
}

.calc-table th:first-child,
.calc-table td:first-child {
  text-align: left;
}

.calc-table th {
  color: #4a657c;
  background: #f7fafc;
  font-weight: 800;
}

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

.calc-limit {
  color: #fff;
  background: linear-gradient(135deg,#03182b,#075283);
}

.calc-limit h3 {
  margin: 0;
  color: #fff;
  font-size: 20px;
}

.calc-limit p {
  max-width: 820px;
  margin: 8px 0 0;
  color: rgba(255,255,255,.72);
  font-size: 13px;
  line-height: 1.55;
}

.calc-limit .calc-primary {
  margin-top: 16px;
  border-color: #fff;
  color: #063255;
  background: #fff;
}

.calc-lead {
  margin-top: 18px;
  padding: clamp(20px,3vw,32px);
  border: 1px solid rgba(0,111,189,.15);
  border-radius: 18px;
  background: #f7fbfe;
}

.calc-lead h3 {
  margin: 0;
  color: var(--brand-navy);
  font-size: 24px;
}

.calc-lead__copy {
  margin: 8px 0 18px;
  color: #61788c;
  font-size: 13px;
}

.calc-lead__status {
  min-height: 1.5em;
  margin-top: 12px;
  font-size: 13px;
}

.calc-lead__status.is-error {
  color: #9a2d2d;
}

.calc-lead__status.is-success {
  color: #08714f;
}

.calc-honeypot {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}

.calc-source-note {
  margin: 24px 0 0;
  color: #8294a4;
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 980px) {
  .calc-hero__grid,
  .calc-intro {
    grid-template-columns: 1fr;
  }

  .calc-hero__panel {
    min-height: 0;
  }

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

@media (max-width: 760px) {
  .calc-hero {
    padding: calc(var(--header-height) + 28px) 0 56px;
  }

  .calc-hero__grid {
    gap: 28px;
  }

  .calc-hero__copy h1 {
    font-size: 38px;
  }

  .calc-hero__panel {
    padding: 22px;
    border-radius: 22px;
  }

  .calc-shell {
    padding: 52px 0 70px;
  }

  .calc-card {
    border-radius: 20px;
  }

  .calc-card__body {
    padding: 20px;
  }

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

  .calc-combo {
    grid-template-columns: 1fr;
  }

  .calc-result-head {
    display: block;
  }

  .calc-result-head .calc-secondary {
    margin-top: 12px;
  }

  .calc-metric__label {
    min-height: 0;
  }

  .calc-actions .calc-primary,
  .calc-actions .calc-secondary {
    width: 100%;
  }
}

@media (max-width: 420px) {
  .calc-hero__copy h1 {
    font-size: 33px;
  }

  .calc-hero__mini-grid {
    grid-template-columns: 1fr;
  }

  .calc-question__head {
    gap: 9px;
  }

  .calc-question__number {
    width: 27px;
    height: 27px;
    flex-basis: 27px;
  }
}

/* Shell: white instrument plates on the brand-deep chassis. */
.calc-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 0;
  border-radius: 26px;
  background: var(--brand-deep);
  box-shadow: 0 24px 64px rgba(3,24,43,.18);
}

.calc-card .calc-card__body {
  padding: 0;
}

.calc-card,
#calc-input-step,
#calc-result-step {
  grid-template-columns: minmax(0,1fr);
}

#calc-input-step,
#calc-result-step {
  display: grid;
  gap: 10px;
}

.calc-progress {
  overflow: hidden;
  border: 1px solid #0d3a5e;
  border-radius: 14px;
  background: transparent;
}

.calc-progress__item {
  padding: 11px 16px;
  color: #8fb3d1;
}

.calc-progress__item.is-active {
  color: #fff;
  background: var(--brand-navy);
}

.calc-plate {
  position: relative;
  padding: 16px 18px;
  color: var(--brand-navy);
  background: var(--surface);
  clip-path: polygon(16px 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%,0 16px);
}

.calc-plate::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 7px;
  height: 7px;
  border: 1px solid #8fa9bf;
  border-radius: 50%;
  background: var(--line);
  content: "";
}

.calc-plate--head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
  padding: 14px 30px 14px 20px;
}

.calc-plate__brand,
.calc-plate__status {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calc-plate__lens {
  flex: 0 0 34px;
}

.calc-plate__lens circle:nth-child(1) { fill: var(--brand-navy); }
.calc-plate__lens circle:nth-child(2) { fill: none; stroke: #0d3a5e; stroke-width: 2; }
.calc-plate__lens circle:nth-child(3) { fill: var(--brand-deep); stroke: var(--brand-cyan); }
.calc-plate__lens circle:nth-child(4) { fill: #fff; }

.calc-plate__eyebrow,
.calc-visor__label {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.calc-plate__title {
  margin: 2px 0 0;
  color: var(--brand-navy);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  line-height: 1.2;
}

.calc-plate__badge {
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: var(--brand-navy);
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.calc-plate__badge:hover {
  background: var(--brand-blue);
}

.calc-plate__badge:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

.calc-leds {
  display: flex;
  gap: 6px;
}

.calc-led {
  display: inline-block;
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #1e4466;
  transition: background-color .18s ease-out;
}

.calc-led.is-on {
  background: #3ccf6e;
}

.calc-basics,
.calc-basics__stack {
  display: grid;
  gap: 10px;
}

.calc-question.calc-plate,
.calc-question.calc-plate:first-child {
  padding: 16px 30px 16px 18px;
  border-bottom: 0;
}

.calc-card .calc-question__head {
  margin-bottom: 12px;
}

.calc-card .calc-question__number {
  width: 28px;
  height: 28px;
  flex-basis: 28px;
  border: 3px solid #c9dbe8;
  background: var(--brand-navy);
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 11px;
  transition: background-color .18s ease-out, border-color .18s ease-out;
}

.calc-question.is-done .calc-question__number {
  border-color: #9cddff;
  background: var(--brand-cyan);
}

.calc-question.calc-plate::after {
  transition: background-color .18s ease-out, border-color .18s ease-out;
}

.calc-question.is-done::after {
  border-color: #2a9d55;
  background: #3ccf6e;
}

.calc-card .calc-question__title {
  color: var(--brand-navy);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.calc-question__body {
  display: grid;
  min-width: 0;
  gap: 10px;
}

.calc-question--panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.calc-question--panel .calc-question__head {
  margin-bottom: 0;
}

.calc-card .calc-field label {
  color: var(--muted);
  font-size: 12px;
}

.calc-card .calc-field input,
.calc-card .calc-field select {
  height: 46px;
  min-height: 46px;
  padding: 8px 14px;
  border-color: #0d3a5e;
  border-radius: 10px;
  color: #fff;
  background-color: #062a47;
}

.calc-card .calc-field select {
  padding-right: 38px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%238fb3d1' stroke-width='1.8'/%3E%3C/svg%3E");
  background-position: right 14px center;
  background-repeat: no-repeat;
}

.calc-card .calc-field select option {
  color: var(--brand-navy);
  background: #fff;
}

.calc-card .calc-field input::placeholder {
  color: #8fb3d1;
  opacity: 1;
}

.calc-card .calc-field input:focus,
.calc-card .calc-field select:focus {
  border-color: var(--brand-cyan);
  box-shadow: 0 0 0 3px rgba(21,159,230,.32);
}

.calc-card .calc-field input[aria-invalid="true"],
.calc-card .calc-field select[aria-invalid="true"] {
  border-color: #e5484d;
}

.calc-card .calc-field__hint {
  color: var(--muted);
}

.calc-field__hint--led {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.calc-field__hint--led::before {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: #1e4466;
  content: "";
  transform: translateY(-1px);
  transition: background-color .18s ease-out;
}

.calc-field__hint--led[data-state="region"]::before { background: #3ccf6e; }
.calc-field__hint--led[data-state="missing"]::before { background: #f0b429; }
.calc-field__hint--led[data-state="manual"]::before { background: var(--brand-cyan); }

.calc-card .calc-mode {
  margin: 0;
}

.calc-card .calc-mode__button {
  min-height: 38px;
  padding: 6px 14px;
  border-color: #c9dbe8;
  color: var(--muted);
  background: transparent;
  font-size: 13px;
}

.calc-card .calc-mode__button.is-active {
  border-color: var(--brand-navy);
  color: #fff;
  background: var(--brand-navy);
}

.calc-card .calc-mode__button:focus-visible {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

#calc-business-questions:not([hidden]) {
  display: grid;
  gap: 10px;
}

.calc-q4 {
  display: grid;
  grid-template-columns: minmax(0,1.3fr) minmax(0,1fr);
  gap: 0 12px;
  align-items: start;
}

.calc-q4 > .calc-question__head {
  grid-column: 1 / -1;
}

.calc-card .calc-combo {
  grid-template-columns: minmax(0,1fr) minmax(150px,172px);
}

.calc-card .calc-q4 .calc-combo {
  grid-template-columns: minmax(0,1fr) 118px;
}

.calc-card .calc-actions {
  margin-top: 0;
}

.calc-card .calc-actions .calc-secondary {
  min-height: 52px;
  padding: 0 24px;
}

.calc-card .calc-primary {
  min-height: 52px;
  padding: 0 30px;
  border: 0;
  border-radius: 0;
  color: var(--brand-navy);
  background: var(--surface);
  font-family: var(--font-display);
  clip-path: polygon(14px 0,100% 0,100% 100%,0 100%,0 14px);
}

.calc-card .calc-primary:hover {
  background: #fff;
}

.calc-card .calc-primary:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px var(--brand-cyan);
}

.calc-card .calc-secondary {
  border-color: #0d3a5e;
  border-radius: 0 0 14px 0;
  color: #c9dbe8;
  background: transparent;
}

.calc-card .calc-secondary:hover,
.calc-card .calc-secondary:focus-visible {
  color: #fff;
  background: #01203d;
}

.calc-card .calc-disclaimer {
  margin: 0;
  padding: 0 6px 4px;
  color: #8fb3d1;
}

.calc-card .calc-result-head {
  margin: 0;
  padding: 10px 8px 4px;
}

.calc-card .calc-result-head h2 {
  color: #fff;
}

.calc-card .calc-result-head p {
  color: #8fb3d1;
}

.calc-visor {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) 170px;
  gap: 24px;
  align-items: center;
  overflow: hidden;
  padding: 22px 24px;
  border: 1px solid #0d3a5e;
  border-radius: 18px;
  background: #01203d;
}

.calc-visor::before {
  position: absolute;
  top: 0;
  left: 40px;
  width: 180px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: #0d3a5e;
  content: "";
}

.calc-visor__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #9cddff;
}

.calc-visor__value {
  margin: 8px 0 0;
  color: #fff;
  font-family: var(--font-display);
}

.calc-visor__value strong {
  font-size: clamp(34px,4.4vw,56px);
  line-height: 1;
  letter-spacing: -.03em;
}

.calc-visor__value span {
  color: #8fb3d1;
  font-size: 16px;
}

.calc-visor__payback {
  margin: 10px 0 0;
  color: #9cddff;
  font-size: 14px;
  font-weight: 700;
}

.calc-visor__payback strong {
  color: #fff;
  font-family: var(--font-display);
  font-size: 20px;
  white-space: nowrap;
}

.calc-visor__payback span {
  color: #8fb3d1;
  font-size: 13px;
  font-weight: 400;
}

.calc-visor .calc-metrics {
  grid-template-columns: repeat(5,minmax(0,1fr));
  gap: 14px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #0d3a5e;
}

.calc-visor .calc-metric {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
}

.calc-visor .calc-metric__label {
  min-height: 0;
  color: #8fb3d1;
  font-size: 11px;
}

.calc-visor .calc-metric strong {
  margin-top: 5px;
  color: #fff;
  font-size: clamp(18px,1.7vw,22px);
}

.calc-visor .calc-metric__unit {
  margin-top: 4px;
  color: #6f93b3;
}

.calc-lens {
  margin: 0;
  justify-self: center;
  text-align: center;
}

.calc-lens svg {
  display: block;
  width: 170px;
  height: auto;
}

.calc-lens figcaption {
  margin-top: 6px;
  color: #8fb3d1;
  font-size: 11px;
}

.calc-lens__rim { fill: var(--brand-ice); }
.calc-lens__body { fill: var(--brand-navy); }
.calc-lens__track { fill: none; stroke: #062a47; stroke-width: 6; }
.calc-lens__ring {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 6;
  transition: stroke-dasharray 1.1s cubic-bezier(.2,.8,.2,1);
}
.calc-lens__glass { fill: var(--brand-deep); stroke: #0d3a5e; stroke-width: 1.5; }
.calc-lens__core { fill: #021222; stroke: #0d3a5e; }
.calc-lens__glint { fill: #fff; opacity: .85; }
.calc-lens__value {
  fill: #fff;
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: 18px;
  font-weight: 700;
}

.calc-card .calc-surplus-note,
.calc-card .calc-risk,
.calc-card .calc-limit,
.calc-card .calc-forecast,
.calc-card .calc-lead {
  margin-top: 0;
}

.calc-card .calc-surplus-note {
  border-left-color: var(--brand-cyan);
  border-radius: 0;
  color: #8fb3d1;
  background: #01203d;
}

.calc-card .calc-forecast.calc-plate {
  padding: 18px 30px 18px 18px;
}

.calc-card .calc-table-wrap {
  background: #fff;
}

.calc-card .calc-limit {
  border: 1px solid #0d3a5e;
  border-radius: 18px;
  background: #01203d;
}

.calc-card .calc-lead.calc-plate {
  padding: clamp(20px,3vw,30px);
  border: 0;
  border-radius: 0;
}

.calc-card .calc-lead .calc-primary {
  color: #fff;
  background: var(--brand-navy);
}

.calc-card .calc-lead .calc-primary:hover {
  background: var(--brand-blue);
}

@media (min-width: 900px) {
  .calc-basics,
  #calc-business-questions:not([hidden]) {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .calc-basics__stack {
    grid-auto-rows: 1fr;
  }
}

@media (max-width: 1100px) {
  .calc-visor .calc-metrics {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

@media (max-width: 760px) {
  .calc-card {
    padding: 8px;
    border-radius: 20px;
  }

  .calc-visor {
    grid-template-columns: minmax(0,1fr);
    padding: 20px 18px;
  }

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

  .calc-card .calc-actions .calc-primary {
    width: 100%;
  }
}

@media (max-width: 560px) {
  .calc-q4,
  .calc-card .calc-combo {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .calc-plate--head {
    padding-right: 20px;
  }

  .calc-plate--head::after {
    display: none;
  }
}

/* Experimental: the shell look across the whole calculator page. */
.calc-hero,
.calc-shell {
  background-color: var(--brand-deep);
  background-image:
    linear-gradient(rgba(143,179,209,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143,179,209,.07) 1px, transparent 1px);
  background-size: 48px 48px;
}

.calc-hero {
  border-bottom: 1px solid #0d3a5e;
}

.calc-hero__button {
  border-color: #0d3a5e;
  border-radius: 0 0 14px 0;
  background: transparent;
}

.calc-hero__button--primary {
  border: 0;
  border-radius: 0;
  color: var(--brand-navy);
  background: var(--surface);
  clip-path: polygon(14px 0,100% 0,100% 100%,0 100%,0 14px);
}

.calc-hero__button--primary:focus-visible {
  outline: 0;
  box-shadow: inset 0 0 0 3px var(--brand-cyan);
}

.calc-hero__panel {
  min-height: 0;
  padding: 24px 32px 24px 24px;
  border: 0;
  border-radius: 0;
  color: var(--brand-navy);
  background: var(--surface);
  box-shadow: none;
  backdrop-filter: none;
  clip-path: polygon(20px 0,100% 0,100% calc(100% - 20px),calc(100% - 20px) 100%,0 100%,0 20px);
}

.calc-hero__panel::before {
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  border-color: #8fa9bf;
  background: var(--line);
}

.calc-hero__panel::after {
  display: none;
}

.calc-hero__panel-label {
  color: var(--muted);
}

.calc-hero__badge {
  border: 0;
  color: #fff;
  background: var(--brand-navy);
}

.calc-hero__badge:hover {
  background: var(--brand-blue);
}

.calc-hero__badge:focus-visible {
  outline-color: var(--brand-cyan);
}

.calc-hero__panel-value {
  color: var(--brand-navy);
}

.calc-hero__panel-value small {
  color: var(--muted);
}

.calc-hero__mini-grid {
  margin-top: 24px;
}

.calc-hero__mini {
  border-color: #0d3a5e;
  border-radius: 10px;
  background: #062a47;
}

.calc-hero__mini span {
  color: #8fb3d1;
}

.calc-intro .eyebrow {
  color: #9cddff;
}

.calc-intro h2 {
  color: #fff;
}

.calc-intro p {
  color: #8fb3d1;
}

.calc-card {
  border: 1px solid #0d3a5e;
  box-shadow: none;
}

.calc-card .calc-source-note {
  margin: 0;
  padding: 0 6px 4px;
  color: #6f93b3;
}

@media (max-width: 760px) {
  .calc-hero__panel {
    padding: 20px 26px 20px 20px;
  }
}

@media (max-width: 560px) {
  .calc-hero__actions {
    display: grid;
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .calc-hero__button--primary {
    grid-column: 1 / -1;
  }
}

/* Experimental: one cut-corner shape for every box and button on the page.
   Borders don't follow a clip-path diagonal, so surfaces are told apart by fill,
   and focus rings are drawn inside the shape. */
.page-calculator {
  --cut-sm: polygon(8px 0,100% 0,100% calc(100% - 8px),calc(100% - 8px) 100%,0 100%,0 8px);
  --cut-md: polygon(14px 0,100% 0,100% calc(100% - 14px),calc(100% - 14px) 100%,0 100%,0 14px);
  --cut-lg: polygon(22px 0,100% 0,100% calc(100% - 22px),calc(100% - 22px) 100%,0 100%,0 22px);
  --ring: inset 0 0 0 2px var(--brand-cyan);
}

.calc-card {
  border: 0;
  border-radius: 0;
  background: #01203d;
  clip-path: var(--cut-lg);
}

.calc-progress {
  border: 0;
  border-radius: 0;
  background: #021627;
  clip-path: var(--cut-md);
}

.calc-visor,
.calc-card .calc-limit {
  border: 0;
  border-radius: 0;
  background: #021627;
  clip-path: var(--cut-lg);
}

/* Итог расчёта — в фирменном синем hero вместо тёмной панели */
.calc-visor {
  background: var(--blueprint);
}

.calc-visor::before {
  display: none;
}

.calc-visor .calc-metrics {
  border-top-color: rgba(255,255,255,.22);
}

.calc-visor .calc-visor__label,
.calc-visor .calc-visor__payback,
.calc-visor .calc-visor__value span,
.calc-visor .calc-visor__payback span,
.calc-visor .calc-metric__label,
.calc-visor .calc-metric__unit,
.calc-visor .calc-lens figcaption {
  color: #dbe7fb;
}

.calc-card .calc-surplus-note,
.calc-card .calc-risk {
  border-top: 0;
  border-right: 0;
  border-bottom: 0;
  border-radius: 0;
  clip-path: var(--cut-md);
}

.calc-card .calc-surplus-note {
  background: #021627;
}

.calc-card .calc-risk {
  border-left: 0;
}

.calc-card .calc-error,
.calc-card .calc-table-wrap,
.calc-hero__mini {
  border: 0;
  border-radius: 0;
  clip-path: var(--cut-sm);
}

.calc-card .calc-field input,
.calc-card .calc-field select {
  border: 0;
  border-radius: 0;
  clip-path: var(--cut-sm);
}

.calc-card .calc-field input:focus,
.calc-card .calc-field select:focus {
  box-shadow: var(--ring);
}

.calc-card .calc-field input[aria-invalid="true"],
.calc-card .calc-field select[aria-invalid="true"] {
  box-shadow: inset 0 0 0 2px #e5484d;
}

.calc-card .calc-primary,
.calc-hero__button--primary {
  clip-path: var(--cut-md);
}

.calc-card .calc-secondary,
.calc-hero__button:not(.calc-hero__button--primary) {
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #062a47;
  clip-path: var(--cut-md);
}

.calc-card .calc-secondary:hover,
.calc-hero__button:not(.calc-hero__button--primary):hover {
  background: #0d3a5e;
}

.calc-card .calc-mode__button {
  border: 0;
  border-radius: 0;
  background: #e3eef6;
  clip-path: var(--cut-sm);
}

.calc-plate__badge,
.calc-hero__badge {
  padding: 6px 14px;
  border-radius: 0;
  clip-path: var(--cut-sm);
}

.calc-card .calc-secondary:focus-visible,
.calc-card .calc-mode__button:focus-visible,
.calc-hero__button:focus-visible,
.calc-plate__badge:focus-visible,
.calc-hero__badge:focus-visible {
  outline: 0;
  box-shadow: var(--ring);
}

@media (prefers-reduced-motion: reduce) {
  .calc-hero__button,
  .calc-led,
  .calc-field__hint--led::before,
  .calc-card .calc-question__number,
  .calc-question.calc-plate::after,
  .calc-lens__ring {
    transition: none;
  }
}

/* Calm layout: the client's ТВЭС drawing sheet carries the hero on drafting blue;
   the calculator sits on a light ground in one column, without instrument ornaments. */
.page-calculator {
  --blueprint: #1f5fd6;
  --chassis: #e3eef8;
  --ink: #0e2c4a;
  --ease-out: cubic-bezier(.23,1,.32,1);
}

.calc-hero {
  position: relative;
  overflow: hidden;
  padding-bottom: 96px;
  border-bottom: 0;
  color: #fff;
  background: var(--blueprint);
}

.calc-hero::before {
  display: none;
}

.calc-hero__grid {
  position: relative;
  z-index: 1;
  grid-template-columns: minmax(0, 960px);
}

.calc-blueprint {
  position: absolute;
  z-index: 0;
  top: -10%;
  left: 0;
  width: 100%;
  max-width: none;
  height: 120%;
  object-fit: cover;
  object-position: 70% 45%;
  opacity: .5;
  pointer-events: none;
  user-select: none;
  will-change: transform;
  -webkit-mask-image: linear-gradient(90deg, transparent 34%, #000 78%);
  mask-image: linear-gradient(90deg, transparent 34%, #000 78%);
}

.calc-hero__copy h1 {
  max-width: 960px;
}

.calc-hero__lead {
  max-width: 44rem;
  color: rgba(255,255,255,.92);
}

/* Facts as one cut-corner spec strip, the same plate language as the calculator. */
.calc-hero__facts {
  display: grid;
  max-width: 960px;
  grid-template-columns: repeat(4,minmax(0,1fr));
  margin: 40px 0 0;
  padding: 0;
  list-style: none;
  color: rgba(255,255,255,.82);
  background: rgba(3,24,43,.22);
  font-size: 14px;
  line-height: 1.4;
  clip-path: polygon(16px 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%,0 16px);
}

.calc-hero__facts li {
  padding: 18px 20px 20px;
}

.calc-hero__facts li + li {
  border-left: 1px solid rgba(255,255,255,.18);
}

.calc-hero__facts strong {
  display: block;
  margin: 0 0 4px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -.01em;
  line-height: 1.15;
}

.calc-hero__button,
.calc-hero__button:not(.calc-hero__button--primary) {
  color: #fff;
  background: rgba(3,24,43,.22);
}

.calc-hero__button:not(.calc-hero__button--primary):hover {
  background: rgba(3,24,43,.34);
}

.calc-hero__button--primary {
  color: var(--brand-navy);
  background: #fff;
}

.calc-hero__button--primary:hover {
  background: var(--brand-ice);
}

/* Calculator: light ground, one readable column. */
.calc-shell {
  padding: 88px 0 110px;
  color: var(--ink);
  background: var(--surface);
}

.calc-intro,
.calc-card {
  max-width: 760px;
  margin-inline: auto;
}

.calc-intro {
  display: block;
  margin-bottom: 24px;
}

.calc-intro h2 {
  color: var(--brand-navy);
}

.calc-card {
  background: var(--chassis);
}

.calc-basics,
.calc-basics__stack,
#calc-business-questions:not([hidden]) {
  grid-template-columns: minmax(0,1fr);
  grid-auto-rows: auto;
}

.calc-plate::after,
.calc-question.calc-plate::after {
  display: none;
}

.calc-card .calc-question__title {
  font-size: 18px;
  letter-spacing: -.01em;
  line-height: 1.3;
  text-transform: none;
}

.calc-card .calc-field label {
  color: var(--ink);
  font-size: 14px;
}

.calc-card .calc-field__hint,
.calc-card .calc-disclaimer {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.calc-card .calc-field input,
.calc-card .calc-field select {
  color: var(--brand-navy);
  background-color: #fff;
}

.calc-card .calc-field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%2301275a' stroke-width='1.8'/%3E%3C/svg%3E");
}

.calc-card .calc-field input::placeholder {
  color: #5d7a93;
}

.calc-card .calc-primary {
  color: #fff;
  background: var(--brand-navy);
}

.calc-card .calc-primary:hover {
  background: var(--brand-blue);
}

.calc-card .calc-secondary {
  color: var(--brand-navy);
  background: #fff;
}

.calc-card .calc-secondary:hover,
.calc-card .calc-secondary:focus-visible {
  color: var(--brand-navy);
  background: var(--brand-ice);
}

.calc-card .calc-result-head h2 {
  color: var(--brand-navy);
}

.calc-card .calc-result-head p {
  color: var(--muted);
}

.calc-card .calc-surplus-note {
  color: var(--ink);
  background: #fff;
}

.calc-card .calc-limit {
  background: var(--brand-navy);
}

.calc-card .calc-limit .calc-primary {
  color: var(--brand-navy);
  background: #fff;
}

.calc-card .calc-limit .calc-primary:hover {
  background: var(--brand-ice);
}

.calc-visor__label,
.calc-risk__eyebrow {
  font-size: 13px;
  letter-spacing: 0;
  text-transform: none;
}

.calc-card .calc-risk strong {
  font-size: clamp(20px,2vw,26px);
  line-height: 1.2;
}

@media (min-width: 761px) {
  .calc-visor .calc-metrics {
    grid-template-columns: repeat(3,minmax(0,1fr));
  }
}

/* Feedback: presses answer, the result arrives instead of snapping in. */
.calc-hero__button,
.calc-card .calc-primary,
.calc-card .calc-secondary,
.calc-card .calc-mode__button {
  transition: transform 160ms var(--ease-out), background-color 180ms ease;
}

.calc-hero__button:hover,
.calc-hero__button:focus-visible {
  transform: none;
}

.calc-hero__button:active,
.calc-card .calc-primary:active,
.calc-card .calc-secondary:active,
.calc-card .calc-mode__button:active {
  transform: scale(.97);
}

@keyframes calc-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

#calc-result-step > *,
.calc-visor .calc-metric {
  animation: calc-rise 260ms var(--ease-out) both;
}

#calc-result-step > :nth-child(2) { animation-delay: 40ms; }
#calc-result-step > :nth-child(3) { animation-delay: 80ms; }
#calc-result-step > :nth-child(4) { animation-delay: 120ms; }
#calc-result-step > :nth-child(5) { animation-delay: 160ms; }
#calc-result-step > :nth-child(n+6) { animation-delay: 200ms; }
.calc-visor .calc-metric:nth-child(1) { animation-delay: 120ms; }
.calc-visor .calc-metric:nth-child(2) { animation-delay: 160ms; }
.calc-visor .calc-metric:nth-child(3) { animation-delay: 200ms; }
.calc-visor .calc-metric:nth-child(4) { animation-delay: 240ms; }
.calc-visor .calc-metric:nth-child(5) { animation-delay: 280ms; }

@media (max-width: 760px) {
  .calc-blueprint {
    top: auto;
    bottom: -20px;
    left: -120%;
    width: 220%;
    height: auto;
    opacity: .4;
    -webkit-mask-image: radial-gradient(closest-side, #000 55%, transparent);
    mask-image: radial-gradient(closest-side, #000 55%, transparent);
  }

  .calc-hero {
    padding-bottom: 64px;
  }

  .calc-hero__facts {
    grid-template-columns: repeat(2,minmax(0,1fr));
    margin-top: 28px;
    font-size: 13px;
    clip-path: polygon(12px 0,100% 0,100% calc(100% - 12px),calc(100% - 12px) 100%,0 100%,0 12px);
  }

  .calc-hero__facts li {
    padding: 14px 14px 16px;
  }

  .calc-hero__facts li + li {
    border-left: 0;
  }

  .calc-hero__facts li:nth-child(even) {
    border-left: 1px solid rgba(255,255,255,.18);
  }

  .calc-hero__facts li:nth-child(n+3) {
    border-top: 1px solid rgba(255,255,255,.18);
  }

  .calc-hero__facts strong {
    margin: 0 0 2px;
    font-size: 19px;
  }

  .calc-shell {
    padding: 56px 0 72px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-blueprint {
    will-change: auto;
  }

  #calc-result-step > *,
  .calc-visor .calc-metric {
    animation: calc-fade 200ms ease both;
    animation-delay: 0ms;
  }

  .calc-hero__button:active,
  .calc-card .calc-primary:active,
  .calc-card .calc-secondary:active,
  .calc-card .calc-mode__button:active {
    transform: none;
  }
}

@keyframes calc-fade {
  from {
    opacity: 0;
  }
}

/* Workspace: the form beside a live board, on a faint drafting grid. */
.calc-shell {
  position: relative;
  isolation: isolate;
}

.calc-shell::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background-image:
    linear-gradient(rgba(31,95,214,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,95,214,.08) 1px, transparent 1px),
    linear-gradient(rgba(31,95,214,.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(31,95,214,.04) 1px, transparent 1px);
  background-position: center top;
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  content: "";
  pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
  mask-image: linear-gradient(180deg, #000 30%, transparent 95%);
}

.calc-intro,
.calc-card {
  max-width: none;
  margin-inline: 0;
}

.calc-intro {
  margin-bottom: 40px;
}

.calc-shell .calc-intro__lead {
  max-width: 40rem;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.5;
}

.calc-workspace {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(300px,360px);
  gap: 28px;
  align-items: start;
}

.calc-workspace:has(> .calc-live[hidden]) {
  grid-template-columns: minmax(0,1fr);
}

/* Dimension lines along the top and left edge of the sheet. */
.calc-workspace::before,
.calc-workspace::after {
  position: absolute;
  border: 0 solid rgba(31,95,214,.4);
  content: "";
  pointer-events: none;
}

.calc-workspace::before {
  top: -20px;
  right: 0;
  left: 0;
  height: 9px;
  border-width: 0 1px;
  background: linear-gradient(rgba(31,95,214,.4),rgba(31,95,214,.4)) center / 100% 1px no-repeat;
}

.calc-workspace::after {
  top: 0;
  bottom: 0;
  left: -22px;
  width: 9px;
  border-width: 1px 0;
  background: linear-gradient(90deg,rgba(31,95,214,.4),rgba(31,95,214,.4)) center / 1px 100% no-repeat;
}

/* Object type as tiles: one tap tells the visitor the calculator is about them. */
.calc-card .calc-types {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.calc-card .calc-types legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--ink);
  font-size: 14px;
}

.calc-types__sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.calc-types__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill,minmax(112px,1fr));
  gap: 8px;
}

.calc-card .calc-types .calc-type {
  position: relative;
  display: flex;
  min-height: 88px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 10px;
  border: 1px solid #c9d9e6;
  border-radius: 12px;
  color: var(--brand-navy);
  background: #fff;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
  cursor: pointer;
  transition: transform 160ms var(--ease-out), border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.calc-card .calc-types .calc-type input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  cursor: pointer;
}

.calc-type svg {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
  color: var(--blueprint);
  transition: color 180ms ease;
}

@media (hover: hover) {
  .calc-card .calc-types .calc-type:hover {
    border-color: var(--blueprint);
  }
}

.calc-card .calc-types .calc-type:active {
  transform: scale(.97);
}

.calc-card .calc-types .calc-type:has(input:checked) {
  border-color: var(--blueprint);
  color: #fff;
  background: var(--blueprint);
}

.calc-type:has(input:checked) svg {
  color: #fff;
}

.calc-type:has(input:focus-visible) {
  outline: 2px solid var(--brand-cyan);
  outline-offset: 2px;
}

.calc-card .calc-types:has([aria-invalid="true"]) .calc-type {
  border-color: #e5484d;
}

/* Live board. */
.calc-live {
  position: sticky;
  top: 96px;
  overflow: hidden;
  color: #fff;
  background: var(--brand-navy);
  clip-path: polygon(16px 0,100% 0,100% calc(100% - 16px),calc(100% - 16px) 100%,0 100%,0 16px);
}

.calc-live[hidden] {
  display: none;
}

.calc-live__figure {
  position: relative;
  height: 168px;
  overflow: hidden;
  background: var(--blueprint);
}

.calc-live__figure img {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 640px;
  max-width: none;
  height: auto;
  opacity: .85;
  transform: translate(-55%,-29%);
}

.calc-live__figure::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, var(--brand-navy));
  content: "";
}

.calc-live__body {
  padding: 4px 24px 24px;
}

.calc-live__title {
  margin: 0;
  color: rgba(255,255,255,.72);
  font-size: 14px;
  font-weight: 700;
}

.calc-live__saving {
  margin: 10px 0 0;
}

.calc-live__saving strong {
  display: block;
  font-size: clamp(34px,3.2vw,44px);
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1;
}

.calc-live:not(.is-ready) .calc-live__saving strong {
  color: rgba(255,255,255,.4);
}

.calc-live__saving span {
  display: block;
  margin-top: 6px;
  color: rgba(255,255,255,.72);
  font-size: 14px;
}

.calc-live__list {
  margin: 20px 0 0;
  padding: 0;
  border-top: 1px solid rgba(255,255,255,.14);
}

.calc-live__row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid rgba(255,255,255,.1);
}

.calc-live__row dt {
  color: rgba(255,255,255,.72);
  font-size: 14px;
}

.calc-live__row dd {
  margin: 0;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  text-align: right;
}

.calc-live__note {
  margin: 16px 0 0;
  color: rgba(255,255,255,.65);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .calc-workspace {
    grid-template-columns: minmax(0,1fr);
    gap: 16px;
  }

  .calc-workspace::after {
    display: none;
  }

  /* On a phone the board becomes a bar pinned to the bottom of the screen. */
  .calc-live {
    z-index: 5;
    top: auto;
    bottom: 12px;
    clip-path: polygon(12px 0,100% 0,100% calc(100% - 12px),calc(100% - 12px) 100%,0 100%,0 12px);
  }

  .calc-live__figure,
  .calc-live__title,
  .calc-live__note,
  .calc-live__row:not(.calc-live__row--key) {
    display: none;
  }

  .calc-live__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 18px;
  }

  .calc-live__saving {
    margin: 0;
  }

  .calc-live__saving strong {
    font-size: 26px;
  }

  .calc-live__saving span {
    margin-top: 2px;
    font-size: 12px;
  }

  .calc-live__list {
    margin: 0;
    border: 0;
  }

  .calc-live__row--key {
    display: block;
    padding: 0;
    border: 0;
    text-align: right;
  }

  .calc-live__row--key dt {
    font-size: 12px;
  }

  .calc-live__row--key dd {
    font-size: 16px;
  }

  .page-calculator .back-to-top {
    bottom: 98px;
  }
}

@media (max-width: 560px) {
  .calc-types__grid {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }

  .calc-card .calc-types .calc-type {
    min-height: 72px;
    gap: 8px;
    padding: 10px;
    font-size: 13px;
  }

  .calc-type svg {
    width: 22px;
    height: 22px;
  }

  .calc-intro {
    margin-bottom: 32px;
  }

  .calc-shell .calc-intro__lead {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .calc-card .calc-types .calc-type:active {
    transform: none;
  }
}