/* ==========================================================================
   Redix Digital: the price calculator (calculator-for-webdesigners.html,
   calculator.js)
   In the design of the home page: v2.css draws the bar, the menu, the footer,
   the WhatsApp button, the fields, the section titles and the questions;
   page.css puts the home page's sky behind it all. A short opening, then the
   tool: four numbered steps on one pane of dark glass, joined by a thread of
   light, and beside them the summary, which stays in sight. Every choice is
   something to press: cards for the kind of site, buttons with their price
   for the rest. On a narrower screen everything stands in one column and a
   slim strip under the bar carries the totals until the summary is in view.
   On paper only the quote is printed.
   ========================================================================== */

.calc [hidden] { display: none !important; }

/* --- The opening ----------------------------------------------------------------------------- */

.calc-top {
  position: relative;
  padding: calc(76px + clamp(40px, 10vh, 112px) - 50px) var(--pad) clamp(36px, 6vh, 64px);
}

.calc-title {
  margin: 0;
  font-size: clamp(2.75rem, 5.6vw, 6rem);
  line-height: 1;
  letter-spacing: -0.025em;
  text-wrap: balance;
}

.calc-title span { display: block; }
.calc-title span:first-child { font-weight: 200; color: var(--title-thin); }
.calc-title span:last-child { font-weight: 800; color: var(--text); }

.calc-lead {
  max-width: 34em;
  margin: clamp(20px, 4vh, 32px) 0 0;
  padding-top: clamp(16px, 3vh, 24px);
  border-top: 1px solid var(--line);
  font-size: clamp(1.0625rem, 1.3vw, 1.3125rem);
  font-weight: 300;
  color: var(--text-mid);
  text-wrap: pretty;
}

/* The prices are ours until the builder makes them theirs */
.calc-mine {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 20px;
  margin-top: clamp(18px, 3vh, 28px);
}

.calc-mine__text {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-mid);
}

.calc-mine__btn { gap: 10px; }
.calc-mine__btn svg { width: 18px; height: 18px; color: var(--cyan-hi); }
.calc-mine__btn.is-mine { box-shadow: inset 0 0 0 1.5px var(--cyan-hi); }

/* --- The tool: the steps and the summary --------------------------------------------------------- */

.calc-app {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(340px, 28vw, 400px);
  align-items: start;
  gap: clamp(28px, 3.4vw, 56px);
  padding: 0 var(--pad) clamp(64px, 12vh, 132px);
}

.calc-steps {
  position: relative;
  z-index: 3;
  display: grid;
  min-width: 0;
  padding: clamp(22px, 3vw, 44px);
  border-radius: 24px;
  background: linear-gradient(158deg, rgba(28, 40, 82, 0.88) 0%, rgba(13, 20, 44, 0.92) 62%, rgba(9, 14, 33, 0.94) 100%);
  box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.13), inset 0 1px 0 rgba(255, 255, 255, 0.1), 0 44px 90px -44px rgba(0, 0, 0, 0.75);
}

/* A step: its number on the thread of light, its question, and what to press */
.calc-step {
  position: relative;
  display: grid;
  gap: 18px;
  padding-inline-start: 62px;
  padding-bottom: clamp(30px, 4.4vh, 44px);
}

.calc-step:last-child { padding-bottom: 0; }

.calc-step::before {
  content: "";
  position: absolute;
  top: 48px;
  bottom: 6px;
  inset-inline-start: 19px;
  width: 2px;
  border-radius: 2px;
  background: linear-gradient(to bottom, rgba(125, 240, 244, 0.55), rgba(125, 240, 244, 0.08));
}

.calc-step:last-child::before { display: none; }

.calc-step__num {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(7, 11, 26, 0.7);
  box-shadow: inset 0 0 0 1.5px var(--cyan-hi), 0 0 18px rgba(125, 240, 244, 0.25);
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--cyan-hi);
  font-variant-numeric: tabular-nums;
}

.calc-step__title {
  margin: 0;
  font-size: clamp(1.375rem, 1.9vw, 1.75rem);
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.calc-step__hint {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  color: var(--text-mid);
}

/* --- Step one: the kind of site, as four cards ---------------------------------------------------- */

.calc-types {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.calc-type { position: relative; display: flex; cursor: pointer; }

.calc-type__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.calc-type__box {
  position: relative;
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  padding: 18px 16px 16px;
  border-radius: 16px;
  background: rgba(7, 11, 26, 0.5);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.26);
  transition: background-color 180ms var(--ease-out-strong), box-shadow 180ms var(--ease-out-strong);
}

.calc-type__ic svg {
  display: block;
  width: 30px;
  height: 30px;
  margin-bottom: 6px;
  color: var(--cyan-hi);
}

.calc-type__name {
  font-size: 1.125rem;
  font-weight: 800;
  line-height: 1.25;
  color: var(--text);
}

.calc-type__text {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-mid);
}

.calc-type__price {
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--text-mid);
}

.calc-type__price b {
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.calc-type__mark {
  position: absolute;
  top: 14px;
  inset-inline-end: 14px;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--cyan);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 180ms var(--ease-out-strong), transform 180ms var(--ease-out-strong);
}

.calc-type__mark svg { width: 15px; height: 15px; color: var(--ink); }

.calc-type__input:checked + .calc-type__box {
  background: rgba(0, 196, 204, 0.12);
  box-shadow: inset 0 0 0 2px var(--cyan-hi), 0 0 28px -8px rgba(125, 240, 244, 0.45);
}

.calc-type__input:checked + .calc-type__box .calc-type__mark { opacity: 1; transform: none; }
.calc-type__input:checked + .calc-type__box .calc-type__price b { color: var(--cyan-hi); }

.calc-type__input:focus-visible + .calc-type__box {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 3px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-type:hover .calc-type__input:not(:checked) + .calc-type__box { box-shadow: inset 0 0 0 1px var(--cyan-hi); }
}

/* --- Step two: the size, with a button on each side of every number ---------------------------- */

.calc-scope {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 18px 16px;
}

.calc-num {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
}

.calc-num__label {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.calc-num__ctl {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 48px;
  gap: 6px;
}

.calc-num__ctl input {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  padding: 0 8px;
  border: 0;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.62);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.36);
  font: inherit;
  font-size: 1.125rem;
  font-weight: 800;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}

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

.calc-num__ctl input:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

.calc-num__btn {
  display: grid;
  place-items: center;
  min-height: 48px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(125, 240, 244, 0.1);
  box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.35);
  color: var(--cyan-hi);
  cursor: pointer;
  transition: background-color 160ms ease, transform 120ms var(--ease-out-strong);
}

.calc-num__btn svg { width: 20px; height: 20px; }
.calc-num__btn:active { transform: scale(0.94); }

.calc-num__btn:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-num__btn:hover { background: rgba(125, 240, 244, 0.22); }
}

.calc-num__hint {
  margin: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-low);
}

.calc-design { margin-top: 4px; }

/* A choice of one, as a row of buttons: the design, the VAT and the payments */
.calc-seg {
  display: grid;
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.calc-seg__legend {
  margin-bottom: 8px;
  padding: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

.calc-seg__opts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
}

.calc-seg__opt { position: relative; display: flex; cursor: pointer; }

.calc-seg__opt input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}

.calc-seg__opt span {
  display: grid;
  align-content: center;
  gap: 2px;
  width: 100%;
  min-height: 48px;
  padding: 8px 14px;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.5);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.3);
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.calc-seg__opt small {
  font-size: 0.8125rem;
  font-weight: 400;
  color: var(--text-mid);
  font-variant-numeric: tabular-nums;
}

.calc-seg__opt input:checked + span {
  background: rgba(0, 196, 204, 0.14);
  box-shadow: inset 0 0 0 2px var(--cyan-hi);
}

.calc-seg__opt input:checked + span small { color: var(--cyan-hi); }

.calc-seg__opt input:focus-visible + span {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-seg__opt:hover input:not(:checked) + span { box-shadow: inset 0 0 0 1px var(--cyan-hi); }
}

/* --- Steps three and four: what to press, each with its price ------------------------------------- */

/* The groups fold: a short line each until one is opened, saying how many of it are chosen */
.calc-accs {
  display: grid;
  gap: 10px;
}

.calc-acc {
  border-radius: 14px;
  background: rgba(7, 11, 26, 0.45);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.22);
  transition: box-shadow 180ms ease, background-color 180ms ease;
}

.calc-acc[open] {
  background: rgba(7, 11, 26, 0.62);
  box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.35);
}

.calc-acc__sum {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  cursor: pointer;
  list-style: none;
}

.calc-acc__sum::-webkit-details-marker { display: none; }

.calc-acc__name {
  font-size: 1.0625rem;
  font-weight: 800;
  color: var(--text);
}

.calc-acc__meta {
  margin-inline-start: auto;
  font-size: 0.875rem;
  color: var(--text-low);
  white-space: nowrap;
}

/* Something chosen in it: its count lights up */
.calc-acc.has-on .calc-acc__meta {
  padding: 3px 10px;
  border-radius: 999px;
  background: rgba(0, 196, 204, 0.16);
  box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.5);
  font-weight: 700;
  color: var(--cyan-hi);
}

.calc-acc__sum::after {
  content: "";
  flex: none;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--cyan-hi);   /* physical: a chevron that points down, then up, in either direction of reading */
  border-bottom: 2px solid var(--cyan-hi);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms var(--ease-out-strong);
}

.calc-acc[open] > .calc-acc__sum::after { transform: translateY(2px) rotate(-135deg); }

.calc-acc__sum:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
  border-radius: 14px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-acc:not([open]):hover { box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.45); }
}

.calc-acc > .calc-chips { padding: 2px 18px 18px; }

.calc-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calc-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 16px 8px 14px;
  border: 0;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.55);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.3);
  font: inherit;
  text-align: start;
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease, transform 120ms var(--ease-out-strong);
}

.calc-chip:active { transform: scale(0.97); }

.calc-chip__mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1.5px rgba(194, 205, 232, 0.55);
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.calc-chip__mark svg {
  width: 13px;
  height: 13px;
  color: var(--ink);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 160ms ease, transform 160ms var(--ease-out-strong);
}

.calc-chip__name {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.calc-chip__price {
  font-size: 0.8125rem;
  color: var(--text-mid);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.calc-chip[aria-pressed="true"] {
  background: rgba(0, 196, 204, 0.15);
  box-shadow: inset 0 0 0 1.5px var(--cyan-hi);
}

.calc-chip[aria-pressed="true"] .calc-chip__mark { background: var(--cyan); box-shadow: none; }
.calc-chip[aria-pressed="true"] .calc-chip__mark svg { opacity: 1; transform: none; }
.calc-chip[aria-pressed="true"] .calc-chip__price { color: var(--cyan-hi); }

.calc-chip:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-chip:hover:not([aria-pressed="true"]) { box-shadow: inset 0 0 0 1px var(--cyan-hi); }
}

/* --- The summary ----------------------------------------------------------------------------------- */

.calc-sum {
  position: sticky;
  top: 96px;
  display: grid;
  gap: 18px;
  max-height: calc(100vh - 112px);
  max-height: calc(100dvh - 112px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: clamp(22px, 2.4vw, 32px);
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 240, 244, 0.35) transparent;
}

.calc-sum__title {
  margin: 0;
  font-size: clamp(1.25rem, 1.6vw, 1.5rem);
  font-weight: 800;
  color: var(--text);
}

/* Until a kind of site is chosen the summary waits behind a line that says what to do first */
.calc-sum__empty {
  margin: 0;
  padding: 14px 0;
  border-top: 1px solid var(--line);
  font-size: clamp(1.125rem, 1.4vw, 1.3125rem);
  font-weight: 700;
  color: var(--cyan-hi);
}

.calc-sum:not([data-empty]) .calc-sum__empty,
.calc-sum[data-empty] .calc-sum__body { display: none; }

.calc-sum__body {
  display: grid;
  gap: 18px;
}

/* The number the reader came for */
.calc-total {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.calc-total p { margin: 0; }

.calc-total__label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-mid);
}

.calc-total .calc-total__num {
  margin-top: 4px;
  font-size: clamp(2.375rem, 3.2vw, 3.125rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--cyan-hi);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-total .calc-total__sub {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--text-low);
}

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

.calc-facts > div {
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

.calc-facts dt {
  font-size: 0.8125rem;
  color: var(--text-mid);
}

.calc-facts dd {
  margin: 2px 0 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* The breakdown, and the builder's details: folded until asked for */
.calc-fold {
  border-radius: 14px;
  background: rgba(7, 11, 26, 0.45);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.2);
}

.calc-fold summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 16px;
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  list-style: none;
}

.calc-fold summary::-webkit-details-marker { display: none; }

.calc-fold summary::after {
  content: "";
  width: 9px;
  height: 9px;
  margin-inline-start: auto;
  border-right: 2px solid var(--cyan-hi);   /* physical: a chevron that points down, then up, in either direction of reading */
  border-bottom: 2px solid var(--cyan-hi);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 200ms var(--ease-out-strong);
}

.calc-fold[open] summary::after { transform: translateY(2px) rotate(-135deg); }

.calc-fold summary:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
  border-radius: 14px;
}

.calc-fold__count { font-weight: 400; color: var(--text-mid); }

.calc-break__list,
.calc-pay {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calc-break__list { padding: 0 16px 10px; }

.calc-break__list li,
.calc-pay li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
  line-height: 1.45;
  color: var(--text-mid);
}

.calc-break__list b,
.calc-pay b {
  flex: none;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.calc-break__list .calc-break__hours,
.calc-break__list .calc-break__hours b { color: var(--text-low); }

.calc-pay { margin-top: -6px; }
.calc-pay li:first-child { border-top: 0; }

.calc-seg--two .calc-seg__opts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.calc-seg--pay .calc-seg__opts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.calc-seg--pay .calc-seg__opt span { padding-inline: 6px; font-size: 0.875rem; text-align: center; }
.calc-sum .calc-seg__opt span { min-height: 44px; }

.calc-who__fields {
  display: grid;
  gap: 12px;
  padding: 4px 16px 16px;
}

.calc-who .field input { min-height: 46px; font-size: 1rem; }

/* The four ways to take it away; the first, to the client, leads */
.calc-acts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.calc-act {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 10px;
  border: 0;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.5);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.36);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: var(--text);
  cursor: pointer;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.calc-act svg { flex: none; width: 18px; height: 18px; color: var(--cyan-hi); }

.calc-act:first-child {
  background: var(--cyan);
  box-shadow: none;
  color: var(--ink);
}

.calc-act:first-child svg { color: var(--ink); }

.calc-act:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .calc-act:not(:first-child):hover { box-shadow: inset 0 0 0 1px var(--cyan-hi); }
  .calc-act:first-child:hover { background: var(--c-cyan-400); }
}

.calc-status {
  margin: -6px 0 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--cyan-hi);
}

.calc-status:empty { display: none; }

.calc-sum__note {
  margin: 0;
  font-size: 0.875rem;
  color: var(--text-low);
}

/* For a web designer: the calculator itself, on their own site */
.calc-next {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.calc-next__q {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text);
}

/* The strip of totals: only where the summary is out of sight */
.calc-strip { display: none; }

/* --- "המחירים שלי" --------------------------------------------------------------------------------- */

.calc-dlg {
  width: min(760px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 900px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: linear-gradient(158deg, #1c2852 0%, #0d142c 62%, #090e21 100%);
  box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.2), 0 40px 120px -20px rgba(0, 0, 0, 0.85);
  color: var(--text);
  overflow: hidden;
}

.calc-dlg[open] { display: flex; }

.calc-dlg::backdrop {
  background: rgba(3, 6, 16, 0.72);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.calc-dlg__in {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: inherit;
}

.calc-dlg__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 22px clamp(20px, 3vw, 32px) 0;
}

.calc-dlg__title {
  margin: 0;
  font-size: clamp(1.375rem, 2vw, 1.75rem);
  font-weight: 800;
}

.calc-dlg__x {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: rgba(7, 11, 26, 0.6);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.36);
  color: var(--text);
  cursor: pointer;
}

.calc-dlg__x svg { width: 18px; height: 18px; }

.calc-dlg__x:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 2px;
}

.calc-dlg__lead {
  margin: 8px 0 0;
  padding: 0 clamp(20px, 3vw, 32px) 16px;
  border-bottom: 1px solid var(--line);
  font-size: 0.9375rem;
  color: var(--text-mid);
}

.calc-dlg__body {
  display: grid;
  align-content: start;
  gap: 10px;
  padding: 18px clamp(20px, 3vw, 32px) 22px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.calc-pins {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 22px;
  min-width: 0;
  padding: 0 18px 12px;
}

.calc-pins .calc-pin:last-child,
.calc-pins .calc-pin:nth-last-child(2):nth-child(odd) { border-bottom: 0; }

.calc-pin {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  border-bottom: 1px solid var(--line);
}

.calc-pin label {
  font-size: 0.9375rem;
  line-height: 1.35;
  color: var(--text-mid);
}

.calc-pin__ctl {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  font-size: 0.875rem;
  color: var(--text-low);
}

.calc-pin input {
  width: 96px;
  min-height: 40px;
  padding: 0 10px;
  border: 0;
  border-radius: 10px;
  background: rgba(7, 11, 26, 0.62);
  box-shadow: inset 0 0 0 1px rgba(194, 205, 232, 0.36);
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-align: center;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.calc-pin input:focus-visible {
  outline: 3px solid var(--cyan-hi);
  outline-offset: 1px;
}

.calc-dlg__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 16px clamp(20px, 3vw, 32px) 20px;
  border-top: 1px solid var(--line);
}

/* --- The quote on paper: nothing of it on screen ------------------------------------------------- */

.calc-print { display: none; }

/* --- The questions -------------------------------------------------------------------------------- */

.calc-faq { padding-top: clamp(32px, 6vh, 72px); }

/* --- Narrower screens ----------------------------------------------------------------------------- */

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

@media (max-width: 1099px) {
  .calc-app { grid-template-columns: minmax(0, 1fr); }

  .calc-sum {
    position: static;
    max-height: none;
    overflow: visible;
  }

  /* The totals ride under the bar while the steps are filled in, and step aside when the summary
     comes into view */
  .calc-strip {
    position: sticky;
    top: 84px;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: -12px;
    padding: 10px 18px;
    border-radius: 14px;
    background: rgba(9, 14, 33, 0.94);
    box-shadow: inset 0 0 0 1px rgba(125, 240, 244, 0.22), 0 18px 36px -18px rgba(0, 0, 0, 0.8);
    font-weight: 600;
    color: var(--text-mid);
    transition: opacity 200ms var(--ease-out-strong), visibility 200ms;
  }

  .calc-strip b {
    margin-inline-start: 6px;
    font-weight: 800;
    color: var(--text);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
  }

  .calc-strip__empty + .calc-strip__sum b { color: var(--cyan-hi); }

  .calc-strip__empty { color: var(--cyan-hi); font-weight: 700; }
  .calc-strip:not([data-empty]) .calc-strip__empty,
  .calc-strip[data-empty] .calc-strip__sum { display: none; }

  .calc-strip.is-away {
    opacity: 0;
    visibility: hidden;
  }
}

@media (max-width: 767px) {
  .calc-top { padding-top: calc(64px + clamp(32px, 7vh, 64px) - 34px); }

  /* On a phone the opening stands on the bright line of the horizon: a deeper night behind the
     words only, soft at its edges */
  .calc-top::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 20px 0 -20px;
    background: linear-gradient(180deg, rgba(7, 11, 26, 0) 0, rgba(7, 11, 26, 0.6) 56px, rgba(7, 11, 26, 0.6) calc(100% - 56px), rgba(7, 11, 26, 0) 100%);
    pointer-events: none;
  }

  .calc-strip { top: 72px; }
  .calc-steps { padding: 22px 16px 26px; border-radius: 20px; }
  .calc-step { padding-inline-start: 46px; }
  .calc-step::before { top: 40px; inset-inline-start: 15px; }
  .calc-step__num { width: 32px; height: 32px; font-size: 0.9375rem; }
  .calc-pins { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  .calc-types { gap: 10px; }
  .calc-type__box { padding: 14px 12px 12px; }
  .calc-type__ic svg { width: 26px; height: 26px; margin-bottom: 2px; }
  .calc-type__name { font-size: 1rem; }
  .calc-type__text { font-size: 0.8125rem; }
  .calc-type__mark { top: 10px; inset-inline-end: 10px; width: 22px; height: 22px; }
  .calc-chip { padding: 8px 12px 8px 10px; }
}

/* --- Motion stopped --------------------------------------------------------------------------------- */

.no-motion :is(.calc-type__box, .calc-type__mark, .calc-chip, .calc-chip__mark, .calc-chip__mark svg, .calc-seg__opt span, .calc-num__btn, .calc-strip) { transition-duration: 1ms; }
.no-motion .calc-fold summary::after,
.no-motion .calc-acc__sum::after { transition-duration: 1ms; }

/* --- The colour modes of the accessibility menu, and the system's forced colours ---------------------
   What was told apart by its glass or its fill is told apart by a line */

html:is(.a11y-contrast, .a11y-negative, .a11y-light) :is(.calc-acc, .calc-strip, .calc-steps, .calc-type__box, .calc-chip, .calc-seg__opt span, .calc-num__btn, .calc-num__ctl input, .calc-fold, .calc-act, .calc-dlg, .calc-pin input) { outline: 1px solid currentColor; }
html:is(.a11y-contrast, .a11y-negative, .a11y-light) :is(.calc-chip[aria-pressed="true"], .calc-type__input:checked + .calc-type__box, .calc-seg__opt input:checked + span) { outline: 3px solid currentColor; }
html:is(.a11y-contrast, .a11y-negative, .a11y-light) .calc-step::before { background: currentColor; }

@media (forced-colors: active) {
  .calc-strip, .calc-steps, .calc-type__box, .calc-chip, .calc-seg__opt span, .calc-num__btn, .calc-fold, .calc-act, .calc-dlg { border: 1px solid CanvasText; }
  .calc-chip[aria-pressed="true"], .calc-type__input:checked + .calc-type__box, .calc-seg__opt input:checked + span { border: 3px solid Highlight; }
  .calc-chip[aria-pressed="true"] .calc-chip__mark, .calc-type__mark { background-color: Highlight; }
  .calc-step::before { background: CanvasText; }
}

/* --- On paper: the quote alone, black on white ------------------------------------------------------ */

@media print {
  @page { margin: 16mm; }

  html, body { background: #fff !important; color: #000 !important; }
  body::before, body::after { display: none !important; }
  body > :not(main) { display: none !important; }
  main > :not(.calc-print) { display: none !important; }

  .calc-print {
    display: block !important;
    font-size: 11pt;
    line-height: 1.5;
    color: #000;
  }

  .calc-print * { color: #000 !important; text-shadow: none !important; }
  .pr-head { margin-bottom: 14pt; padding-bottom: 10pt; border-bottom: 2px solid #000; }
  .pr-head p { margin: 2pt 0 0; }
  .pr-from { font-size: 12pt; }
  .calc-print h1 { margin: 6pt 0 0; font-size: 20pt; line-height: 1.2; }
  .calc-print h2 { margin: 16pt 0 6pt; font-size: 13pt; }
  .pr-table { width: 100%; border-collapse: collapse; }
  .pr-table td { padding: 5pt 0; border-bottom: 1px solid #bbb; vertical-align: top; }
  .pr-table td:last-child { text-align: left; white-space: nowrap; padding-inline-start: 16pt; font-variant-numeric: tabular-nums; }
  .pr-sub td { border-top: 1px solid #000; }
  .pr-total td { padding-top: 7pt; border-top: 2px solid #000; border-bottom: 0; font-size: 13pt; font-weight: 800; }
  .pr-note { margin-top: 16pt; font-size: 9pt; }
}
