/* ==========================================================================
   Tufix — Calculator (#calc-app) & "Cere ofertă" form (#quote-app)
   Builder B. Every class is prefixed calc-* / quote-*; buttons reuse A's .btn.
   The calculator sits on the dark forest section, the form on the light one.
   ========================================================================== */

.calc,
.calc *,
.calc *::before,
.calc *::after,
.calc-bar,
.calc-bar *,
.quote,
.quote *,
.quote *::before,
.quote *::after {
  box-sizing: border-box;
}

.calc-sr {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  overflow: hidden !important;
  clip: rect(0 0 0 0) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.calc [hidden],
.calc-bar [hidden],
.quote [hidden] {
  display: none !important;
}

/* Visually hidden native inputs: the ring is drawn on their visual twin */
.calc-tile__input,
.calc-switch__input,
.calc-check__input,
.quote-seg__opt input,
.quote-check input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  opacity: 0;
  pointer-events: none;
}

.calc-tile__input:focus-visible,
.calc-switch__input:focus-visible,
.calc-check__input:focus-visible,
.quote-seg__opt input:focus-visible,
.quote-check input:focus-visible,
.calc-range:focus-visible,
.calc-qty__input:focus-visible,
.calc-area__in:focus-visible,
.calc-panel__title:focus,
.quote-input:focus-visible,
.quote-panel__title:focus,
.quote-done__title:focus {
  outline: none;
}

/* Invisible normally; forced-colors mode (Windows High Contrast) paints it in a system colour,
   since the box-shadow rings below are dropped there. */
.calc-range:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
}

/* ==========================================================================
   1. Layout
   ========================================================================== */
.calc {
  --calc-surface: rgba(238, 243, 230, 0.045);
  --calc-surface-2: rgba(238, 243, 230, 0.085);
  --calc-lime-soft: rgba(214, 236, 107, 0.12);
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--s-5);
  align-items: start;
  margin-top: clamp(32px, 5vw, 64px);
  padding-bottom: 40px; /* room for the mobile estimate bar */
  color: var(--c-on-dark);
  font-family: var(--f-body);
  text-align: left;
}

@media (min-width: 1024px) {
  .calc {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 368px);
    gap: clamp(24px, 2.6vw, 40px);
    padding-bottom: 0;
  }
}

.calc__main {
  container: calc-main / inline-size;
  min-width: 0;
  padding: clamp(16px, 3.2vw, 40px);
  border: 1px solid var(--c-line-dark);
  border-radius: var(--radius-l);
  background:
    radial-gradient(90% 60% at 100% 0%, rgba(214, 236, 107, 0.06), transparent 60%),
    linear-gradient(180deg, rgba(238, 243, 230, 0.06), rgba(238, 243, 230, 0.02));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 30px 60px -40px rgba(0, 0, 0, 0.6);
}

@media (min-width: 640px) {
  .calc__main {
    border-radius: var(--radius-xl);
  }
}

.calc__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-3);
  margin-bottom: clamp(22px, 3.2vw, 40px);
}

/* Entrance (JS adds .calc--pre only when the calculator starts below the fold) */
.calc--pre [data-stagger] {
  opacity: 0;
}

/* ==========================================================================
   2. Step indicator
   ========================================================================== */
.calc-steps {
  flex: 1 1 auto;
  min-width: 0;
}

.calc-steps__list {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.calc-steps__item {
  flex: none;
}

.calc-steps__rail {
  position: relative;
  flex: 1 1 20px;
  max-width: 110px;
  height: 2px;
  overflow: hidden;
  border-radius: 2px;
  background: var(--c-line-dark);
}

.calc-steps__fill {
  position: absolute;
  inset: 0;
  background: var(--c-lime);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--dur-slow) var(--ease-out);
}

.calc-steps__rail--filled .calc-steps__fill {
  transform: scaleX(1);
}

.calc-steps__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 4px 12px 4px 4px;
  border: 0;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-on-dark-muted);
  font: 600 var(--fs-small) / 1 var(--f-body);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), opacity var(--dur) var(--ease-out);
}

.calc-steps__btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.5;
}

.calc-steps__btn--reachable:hover {
  background: var(--calc-surface-2);
  color: var(--c-on-dark);
}

.calc-steps__btn--current {
  color: var(--c-on-dark);
  cursor: default;
}

.calc-steps__dot {
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1.5px solid var(--c-line-dark);
  border-radius: 50%;
  font-variant-numeric: tabular-nums;
  transition:
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out),
    transform var(--dur) var(--ease-spring);
}

.calc-steps__n,
.calc-steps__tick {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
  transition: opacity 0.3s var(--ease-out), transform 0.5s var(--ease-spring);
}

.calc-steps__tick {
  opacity: 0;
  transform: scale(0.3);
}

.calc-steps__tick svg {
  width: 16px;
  height: 16px;
  stroke-width: 2.6;
}

.calc-steps__btn--current .calc-steps__dot {
  border-color: var(--c-lime);
  background: var(--c-lime);
  color: var(--c-ink);
  box-shadow: 0 0 0 6px rgba(214, 236, 107, 0.14);
  transform: scale(1.05);
}

.calc-steps__btn--done .calc-steps__dot {
  border-color: rgba(214, 236, 107, 0.7);
  color: var(--c-lime);
}

.calc-steps__btn--done .calc-steps__n {
  opacity: 0;
  transform: scale(0.3);
}

.calc-steps__btn--done .calc-steps__tick {
  opacity: 1;
  transform: none;
}

@container calc-main (max-width: 480px) {
  .calc-steps__btn:not(.calc-steps__btn--current) .calc-steps__label {
    display: none;
  }

  .calc-steps__btn:not(.calc-steps__btn--current) {
    padding: 4px 5px; /* 5 + 34 + 5 = 44px wide, dot centred */
  }
}

/* Reset (two-step confirm) */
.calc-reset {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border: 1px solid var(--c-line-dark);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--c-on-dark-muted);
  font: 700 var(--fs-micro) / 1 var(--f-body);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  transition: color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

.calc-reset svg {
  width: 16px;
  height: 16px;
  flex: none;
  transition: transform 0.7s var(--ease-out);
}

.calc-reset:hover {
  border-color: rgba(238, 243, 230, 0.4);
  color: var(--c-on-dark);
}

.calc-reset:hover svg {
  transform: rotate(-220deg);
}

.calc-reset--armed,
.calc-reset--armed:hover {
  border-color: var(--c-clay);
  background: var(--c-clay);
  color: var(--c-white);
}

@container calc-main (max-width: 480px) {
  .calc-reset:not(.calc-reset--armed) {
    justify-content: center;
    width: 44px;
    padding: 0;
  }

  .calc-reset:not(.calc-reset--armed) .calc-reset__label {
    display: none;
  }
}

/* ==========================================================================
   3. Stage + panels (transitions run through the Web Animations API)
   ========================================================================== */
.calc-stage,
.quote-stage {
  position: relative;
}

.calc-swapping {
  overflow: hidden;
}

.calc-leaving {
  position: absolute !important;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
}

.calc-panel__head {
  max-width: 62ch;
  margin-bottom: clamp(20px, 2.8vw, 30px);
}

.calc-panel__kicker {
  margin: 0 0 10px;
  color: var(--c-on-dark-muted);
  font: 700 var(--fs-micro) / 1.2 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calc-panel__kicker span {
  color: var(--c-lime);
}

.calc-panel__title {
  margin: 0;
  color: var(--c-on-dark);
  font-family: var(--f-display);
  font-size: clamp(1.75rem, 3.4vw, 2.6rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.calc-panel__title em {
  color: var(--c-lime);
  font-style: italic;
  font-weight: 300;
}

.calc-panel__hint {
  margin: 12px 0 0;
  color: var(--c-on-dark-muted);
  font-size: 0.98rem;
  line-height: 1.55;
}

.calc-fieldset,
.calc-group {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

/* ==========================================================================
   4. Step 1 — category tiles
   ========================================================================== */
.calc-tiles {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

@container calc-main (min-width: 520px) {
  .calc-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@container calc-main (min-width: 780px) {
  .calc-tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }
}

.calc-tile {
  position: relative;
  display: block;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.calc-tile__card {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  column-gap: 14px;
  align-content: start;
  height: 100%;
  padding: 16px 16px 16px;
  overflow: hidden;
  border: 1px solid var(--c-line-dark);
  border-radius: var(--radius-m);
  background: var(--calc-surface);
  transition:
    transform var(--dur) var(--ease-out),
    background-color var(--dur) var(--ease-out),
    border-color var(--dur) var(--ease-out),
    box-shadow var(--dur) var(--ease-out);
}

/* Accent sweep: a lime glow that blooms from the corner when selected */
.calc-tile__card::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: radial-gradient(120% 90% at 0% 0%, rgba(214, 236, 107, 0.2), transparent 62%);
  opacity: 0;
  transform: scale(0.6);
  transform-origin: 0 0;
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur-slow) var(--ease-out);
}

.calc-tile__top {
  grid-row: 1 / span 4;
}

.calc-tile__name,
.calc-tile__short,
.calc-tile__meta,
.calc-tile__active {
  grid-column: 2;
  min-width: 0;
}

.calc-tile__icon {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: rgba(238, 243, 230, 0.07);
  color: var(--c-sage);
  transition: background-color var(--dur) var(--ease-out), color var(--dur) var(--ease-out);
}

.calc-tile__icon svg {
  width: 30px;
  height: 30px;
}

.calc-tile__check {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1.5px solid rgba(238, 243, 230, 0.28);
  border-radius: 50%;
  color: var(--c-ink);
  transition: background-color 0.3s var(--ease-out), border-color 0.3s var(--ease-out), transform 0.5s var(--ease-spring);
}

.calc-tile__check svg {
  width: 15px;
  height: 15px;
  stroke-width: 3;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.4s var(--ease-out) 0.08s;
}

.calc-tile__name {
  padding-right: 34px;
  color: var(--c-on-dark);
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-weight: 450;
  line-height: 1.15;
}

.calc-tile__short {
  margin-top: 4px;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.45;
}

.calc-tile__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.calc-tile__meta > span {
  padding: 5px 10px;
  border-radius: var(--radius-pill);
  background: rgba(238, 243, 230, 0.07);
  color: var(--c-on-dark-muted);
  font-size: var(--fs-micro);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
}

.calc-tile__meta > .calc-tile__from {
  color: var(--c-lime);
}

.calc-tile__active {
  margin-top: 10px;
  color: var(--c-lime);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.02em;
}

@media (hover: hover) {
  .calc-tile:hover .calc-tile__card {
    border-color: rgba(238, 243, 230, 0.3);
    background: var(--calc-surface-2);
    transform: translate3d(0, -4px, 0);
    box-shadow: 0 22px 40px -24px rgba(0, 0, 0, 0.7);
  }

  .calc-tile:hover .calc-tile__icon {
    color: var(--c-lime);
  }
}

.calc-tile:active .calc-tile__card {
  transform: scale(0.985);
  transition-duration: 0.12s;
}

.calc-tile__input:checked + .calc-tile__card {
  border-color: var(--c-lime);
  background: rgba(214, 236, 107, 0.07);
  box-shadow: 0 0 0 1px var(--c-lime), 0 24px 44px -26px rgba(0, 0, 0, 0.75);
}

.calc-tile__input:checked + .calc-tile__card::before {
  opacity: 1;
  transform: none;
}

.calc-tile__input:checked + .calc-tile__card .calc-tile__icon {
  background: var(--c-lime);
  color: var(--c-ink);
}

.calc-tile__input:checked + .calc-tile__card .calc-tile__check {
  border-color: var(--c-lime);
  background: var(--c-lime);
  transform: scale(1.08);
}

.calc-tile__input:checked + .calc-tile__card .calc-tile__check svg {
  stroke-dashoffset: 0;
}

.calc-tile__input:focus-visible + .calc-tile__card {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--c-forest), 0 0 0 5px var(--c-lime);
}

@container calc-main (min-width: 520px) {
  .calc-tile__card {
    grid-template-columns: minmax(0, 1fr);
    padding: 20px 20px 18px;
    border-radius: var(--radius-l);
  }

  .calc-tile__top {
    grid-row: auto;
    margin-bottom: 18px;
  }

  .calc-tile__name,
  .calc-tile__short,
  .calc-tile__meta,
  .calc-tile__active {
    grid-column: 1;
  }

  .calc-tile__check {
    top: 18px;
    right: 18px;
  }
}

/* ==========================================================================
   5. Step 2 — groups, toggle rows, switches
   ========================================================================== */
.calc-groups {
  display: grid;
  gap: clamp(22px, 3vw, 34px);
}

.calc-group {
  border-radius: var(--radius-m);
}

.calc-group__legend {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  color: var(--c-on-dark);
  font-family: var(--f-display);
  font-size: 1.25rem;
  line-height: 1.2;
}

.calc-group__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: var(--calc-lime-soft);
  color: var(--c-lime);
}

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

.calc-group__name {
  min-width: 0;
}

.calc-group__count {
  flex: none;
  margin-left: auto;
  padding: 6px 10px;
  border-radius: var(--radius-pill);
  background: var(--calc-lime-soft);
  color: var(--c-lime);
  font: 700 var(--fs-micro) / 1 var(--f-body);
  animation: calc-pop-in 0.45s var(--ease-spring);
}

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

.calc-rows {
  display: grid;
  gap: 10px;
}

.calc-row {
  position: relative;
  border: 1px solid var(--c-line-dark);
  border-radius: var(--radius-m);
  background: var(--calc-surface);
  transition: border-color var(--dur) var(--ease-out), background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

@media (hover: hover) {
  .calc-row:hover {
    border-color: rgba(238, 243, 230, 0.26);
  }
}

.calc-row--on,
.calc-row--on:hover {
  border-color: rgba(214, 236, 107, 0.5);
  background: rgba(214, 236, 107, 0.055);
}

.calc-row__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-right: 18px;
}

.calc-switch__input {
  top: 50%;
  left: 24px;
}

.calc-row__label {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  min-width: 0;
  min-height: 66px;
  padding: 14px 0 14px 16px;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.calc-switch {
  position: relative;
  flex: none;
  width: 46px;
  height: 28px;
  border-radius: var(--radius-pill);
  background: rgba(238, 243, 230, 0.16);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.25);
  transition: background-color var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}

.calc-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: var(--radius-pill);
  background: var(--c-cream);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.5s var(--ease-spring), width 0.25s var(--ease-out), background-color 0.3s var(--ease-out);
}

.calc-row__label:hover .calc-switch {
  background: rgba(238, 243, 230, 0.24);
}

.calc-switch__input:checked + .calc-row__label .calc-switch {
  background: var(--c-lime);
}

.calc-switch__input:checked + .calc-row__label .calc-switch__thumb {
  background: var(--c-ink);
  transform: translateX(18px);
}

/* squash & stretch while pressed */
.calc-row__label:active .calc-switch__thumb {
  width: 27px;
}

.calc-switch__input:checked + .calc-row__label:active .calc-switch__thumb {
  transform: translateX(13px);
}

.calc-switch__input:focus-visible + .calc-row__label .calc-switch {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--c-forest), 0 0 0 5px var(--c-lime);
}

.calc-row__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.calc-row__name {
  color: var(--c-on-dark);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.3;
}

.calc-row__rate {
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
}

.calc-row__total {
  flex: none;
  color: var(--c-lime);
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
  opacity: 0;
  transform: translate3d(10px, 0, 0);
  transition: opacity 0.35s var(--ease-out), transform 0.5s var(--ease-out);
}

.calc-row--on .calc-row__total {
  opacity: 1;
  transform: none;
}

/* On-request rows already say "la evaluare" under their name */
.calc-row .calc-row__total--req {
  display: none;
}

@container calc-main (max-width: 480px) {
  .calc-row__head {
    flex-wrap: wrap;
    gap: 0;
    padding-right: 0;
  }

  .calc-row__total {
    width: 100%;
    margin-top: -8px;
    padding: 0 16px 12px 76px;
  }

  .calc-row:not(.calc-row--on) .calc-row__total {
    display: none;
  }
}

/* Expand / collapse (grid-rows trick → smooth height, no measuring) */
.calc-row__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease-out);
}

.calc-row--on .calc-row__body {
  grid-template-rows: 1fr;
}

.calc-row__inner {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear var(--dur);
}

.calc-row--on .calc-row__inner {
  visibility: visible;
  transition-delay: 0s;
}

.calc-row__pad {
  padding: 2px 16px 18px;
  opacity: 0;
  transform: translate3d(0, -6px, 0);
  transition: opacity 0.3s var(--ease-out), transform 0.5s var(--ease-out);
}

.calc-row--on .calc-row__pad {
  opacity: 1;
  transform: none;
  transition-delay: 0.08s;
}

@container calc-main (min-width: 560px) {
  .calc-row__pad {
    padding: 2px 20px 20px 76px;
  }
}

.calc-row__note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 12px 0 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.calc-row__pad > .calc-row__note:first-child {
  margin-top: 0;
}

.calc-row__note svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--c-sage);
}

/* Highlight after a "Calculează" shortcut */
.calc-flash {
  animation: calc-flash 1.6s var(--ease-out);
}

@keyframes calc-flash {
  0% { box-shadow: 0 0 0 0 rgba(214, 236, 107, 0); }
  22% { box-shadow: 0 0 0 6px rgba(214, 236, 107, 0.55); }
  100% { box-shadow: 0 0 0 14px rgba(214, 236, 107, 0); }
}

@keyframes calc-pop-in {
  from { opacity: 0; transform: scale(0.6); }
}

/* ==========================================================================
   6. Quantity control — steppers, custom range, numeric field
   ========================================================================== */
.calc-qty {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  grid-template-areas:
    "range range range"
    "minus field plus";
  align-items: center;
  gap: 8px 10px;
}

.calc-qty__btn[data-dir="-1"] { grid-area: minus; }
.calc-qty__btn[data-dir="1"] { grid-area: plus; }
.calc-qty__track { grid-area: range; min-width: 0; }
.calc-qty__field { grid-area: field; }

@container calc-main (min-width: 560px) {
  .calc-qty {
    grid-template-columns: 44px minmax(0, 1fr) 44px 136px;
    grid-template-areas: "minus range plus field";
    gap: 12px;
  }
}

.calc-qty__btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--c-line-dark);
  border-radius: 50%;
  background: rgba(238, 243, 230, 0.05);
  color: var(--c-on-dark);
  cursor: pointer;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), color 0.25s, transform 0.35s var(--ease-spring), opacity 0.25s;
}

.calc-qty__btn svg {
  width: 18px;
  height: 18px;
  pointer-events: none;
}

@media (hover: hover) {
  .calc-qty__btn:not([aria-disabled="true"]):hover {
    border-color: rgba(214, 236, 107, 0.6);
    background: rgba(214, 236, 107, 0.14);
    color: var(--c-lime);
  }
}

.calc-qty__btn:not([aria-disabled="true"]):active {
  transform: scale(0.88);
  background: var(--c-lime);
  color: var(--c-ink);
}

.calc-qty__btn[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.32;
}

/* Range: filled track via --fill (set by JS), works with mouse, touch, keys */
.calc-range {
  --fill: 0%;
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.calc-range::-webkit-slider-runnable-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--c-lime) 0, var(--c-lime-2) var(--fill), rgba(238, 243, 230, 0.16) var(--fill));
}

.calc-range::-webkit-slider-thumb {
  width: 26px;
  height: 26px;
  margin-top: -9px;
  border: 0;
  border-radius: 50%;
  background: var(--c-cream);
  box-shadow: 0 0 0 5px rgba(214, 236, 107, 0.32), 0 4px 12px rgba(0, 0, 0, 0.4);
  -webkit-appearance: none;
  appearance: none;
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}

.calc-range:hover::-webkit-slider-thumb {
  transform: scale(1.08);
}

.calc-range:active::-webkit-slider-thumb {
  box-shadow: 0 0 0 10px rgba(214, 236, 107, 0.26), 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: scale(1.2);
}

.calc-range:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--c-forest), 0 0 0 6px var(--c-lime), 0 4px 12px rgba(0, 0, 0, 0.4);
}

.calc-range::-moz-range-track {
  height: 8px;
  border-radius: var(--radius-pill);
  background: rgba(238, 243, 230, 0.16);
}

.calc-range::-moz-range-progress {
  height: 8px;
  border-radius: var(--radius-pill);
  background: var(--c-lime);
}

.calc-range::-moz-range-thumb {
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 50%;
  background: var(--c-cream);
  box-shadow: 0 0 0 5px rgba(214, 236, 107, 0.32), 0 4px 12px rgba(0, 0, 0, 0.4);
  transition: transform 0.35s var(--ease-spring), box-shadow 0.3s var(--ease-out);
}

.calc-range:active::-moz-range-thumb {
  box-shadow: 0 0 0 10px rgba(214, 236, 107, 0.26), 0 6px 16px rgba(0, 0, 0, 0.45);
  transform: scale(1.2);
}

.calc-range:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--c-forest), 0 0 0 6px var(--c-lime);
}

.calc-qty__field {
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
  height: 48px;
  border: 1px solid var(--c-line-dark);
  border-radius: 14px;
  background: rgba(15, 31, 23, 0.45);
  cursor: text;
  transition: border-color 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.calc-qty__field:focus-within {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--c-lime);
  box-shadow: 0 0 0 3px rgba(214, 236, 107, 0.28);
}

.calc-qty__input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0 6px 0 14px;
  border: 0;
  background: transparent;
  color: var(--c-on-dark);
  font: 700 1.08rem / 1 var(--f-body);
  font-variant-numeric: tabular-nums;
  text-align: right;
  -moz-appearance: textfield;
}

.calc-qty__unit {
  flex: none;
  padding-right: 14px;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  font-weight: 600;
}

.calc-qty__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 20px;
  margin-top: 6px;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
}

.calc-qty__msg {
  color: var(--c-lime);
  font-weight: 700;
  text-align: center;
}

@container calc-main (min-width: 560px) {
  .calc-qty__meta {
    margin-right: 204px; /* align min/max with the slider (field + stepper width) */
    margin-left: 56px;
  }
}

/* L × l helper (m² services) */
.calc-area {
  margin-top: 10px;
}

.calc-area__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 4px 6px 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--c-sage);
  font: 600 var(--fs-small) / 1.3 var(--f-body);
  text-align: left;
  cursor: pointer;
  transition: color 0.25s var(--ease-out);
}

.calc-area__toggle u {
  text-decoration-color: rgba(155, 183, 154, 0.5);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.calc-area__toggle svg {
  width: 18px;
  height: 18px;
  flex: none;
  transition: transform 0.6s var(--ease-spring);
}

.calc-area__toggle:hover {
  color: var(--c-lime);
}

.calc-area__toggle[aria-expanded="true"] {
  color: var(--c-lime);
}

.calc-area__toggle[aria-expanded="true"] svg {
  transform: rotate(-45deg);
}

.calc-area__panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  padding: 12px;
  border: 1px dashed rgba(238, 243, 230, 0.22);
  border-radius: 16px;
  background: rgba(15, 31, 23, 0.4);
}

.calc-area__f {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--c-line-dark);
  border-radius: 12px;
  background: rgba(238, 243, 230, 0.06);
  cursor: text;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.calc-area__f:focus-within {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--c-lime);
  box-shadow: 0 0 0 3px rgba(214, 236, 107, 0.25);
}

.calc-area__lbl {
  color: var(--c-on-dark-muted);
  font-size: var(--fs-micro);
  font-weight: 700;
}

.calc-area__in {
  width: 4.2em;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--c-on-dark);
  font: 700 1rem / 1 var(--f-body);
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.calc-area__in::placeholder {
  color: rgba(238, 243, 230, 0.3);
}

.calc-area__u,
.calc-area__x {
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  font-weight: 700;
}

.calc-area__out {
  min-width: 4.5ch;
  color: var(--c-lime);
  font-family: var(--f-display);
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}

.calc-area__apply[aria-disabled="true"] {
  pointer-events: none;
}

/* Narrow rows: L × l on one line, result + button below */
@container calc-main (max-width: 559px) {
  .calc-area__panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    align-items: center;
    gap: 10px 8px;
  }

  .calc-area__eq {
    display: none;
  }

  .calc-area__f {
    flex-wrap: wrap;
    align-content: center;
    gap: 0 4px;
    height: auto;
    min-height: 56px;
    padding: 7px 10px;
  }

  .calc-area__lbl {
    flex: 1 0 100%;
  }

  .calc-area__in {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    font-size: 1.05rem;
    text-align: left;
  }

  .calc-area__out {
    grid-column: 1;
  }

  .calc-area__out::before {
    content: "= ";
    opacity: 0.6;
  }

  .calc-area__apply {
    grid-column: 2 / span 2;
  }
}

/* ==========================================================================
   7. Materials checkbox + step navigation
   ========================================================================== */
.calc-check {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 14px;
  margin-top: clamp(20px, 3vw, 30px);
  padding: 16px 18px;
  border: 1px dashed rgba(238, 243, 230, 0.24);
  border-radius: var(--radius-m);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.3s var(--ease-out), background-color 0.3s var(--ease-out);
}

.calc-check:hover {
  border-color: rgba(214, 236, 107, 0.55);
}

.calc-check__box {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1.5px solid rgba(238, 243, 230, 0.45);
  border-radius: 7px;
  color: var(--c-ink);
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.4s var(--ease-spring);
}

.calc-check__box svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.35s var(--ease-out) 0.05s;
}

.calc-check__input:checked + .calc-check__box {
  border-color: var(--c-lime);
  background: var(--c-lime);
  transform: scale(1.06);
}

.calc-check__input:checked + .calc-check__box svg {
  stroke-dashoffset: 0;
}

.calc-check:has(.calc-check__input:checked) {
  border-style: solid;
  border-color: rgba(214, 236, 107, 0.5);
  background: rgba(214, 236, 107, 0.05);
}

.calc-check__input:focus-visible + .calc-check__box {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 2px var(--c-forest), 0 0 0 5px var(--c-lime);
}

.calc-check__text {
  display: grid;
  gap: 4px;
}

.calc-check__text strong {
  color: var(--c-on-dark);
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.35;
}

.calc-check__text small {
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.calc-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 16px;
  margin-top: clamp(24px, 3.4vw, 36px);
  padding-top: clamp(18px, 2.4vw, 24px);
  border-top: 1px solid var(--c-line-dark);
}

.calc-nav__start {
  flex: 0 0 0;
}

.calc-nav__end {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 10px 16px;
  margin-left: auto;
}

.calc-nav__hint {
  margin: 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  opacity: 0;
  visibility: hidden;
  transform: translate3d(6px, 0, 0);
  transition: opacity 0.3s var(--ease-out), transform 0.4s var(--ease-out), visibility 0s linear 0.4s;
}

.calc-nav__hint--shown {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition-delay: 0s;
}

.calc-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px 8px 6px;
  border: 0;
  border-radius: var(--radius-pill);
  background: none;
  color: var(--c-on-dark-muted);
  font: 600 var(--fs-small) / 1 var(--f-body);
  cursor: pointer;
  transition: color 0.25s var(--ease-out);
}

.calc-back svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease-out);
}

.calc-back:hover {
  color: var(--c-on-dark);
}

.calc-back:hover svg {
  transform: translateX(-4px);
}

.calc-cta {
  max-width: 100%;
  white-space: normal;
  text-align: left;
}

.calc-cta .btn__label {
  line-height: 1.25;
}

@container calc-main (max-width: 520px) {
  .calc-nav__end,
  .calc-nav__end .btn {
    width: 100%;
  }

  .calc-nav__end .btn {
    justify-content: space-between;
  }

  .calc-nav__hint {
    order: 2;
    width: 100%;
    text-align: center;
    transform: translate3d(0, -4px, 0);
  }
}

/* ==========================================================================
   8. Step 3 — summary
   ========================================================================== */
.calc-sum {
  display: grid;
  gap: clamp(20px, 2.6vw, 26px);
}

.calc-sum__cat {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 6px;
  color: var(--c-sage);
  font: 700 var(--fs-micro) / 1.2 var(--f-body);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.calc-sum__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 9px;
  background: var(--calc-lime-soft);
  color: var(--c-lime);
}

.calc-sum__icon svg {
  width: 17px;
  height: 17px;
}

.calc-sum__lines {
  margin: 0;
  padding: 0;
  list-style: none;
}

.calc-sum__line {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(14px, 1fr) auto;
  grid-template-areas:
    "name leader price"
    "calc calc calc";
  align-items: baseline;
  column-gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--c-line-dark);
}

.calc-sum__name {
  grid-area: name;
  min-width: 0;
  color: var(--c-on-dark);
  font-weight: 600;
  line-height: 1.35;
}

.calc-sum__leader {
  grid-area: leader;
  align-self: end;
  margin-bottom: 0.4em;
  border-bottom: 1.5px dotted rgba(238, 243, 230, 0.28);
}

.calc-sum__price {
  grid-area: price;
  color: var(--c-on-dark);
  font-family: var(--f-display);
  font-size: 1.1rem;
  font-variant-numeric: tabular-nums lining-nums;
  white-space: nowrap;
}

.calc-sum__calc {
  grid-area: calc;
  margin-top: 3px;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  font-variant-numeric: tabular-nums;
}

@container calc-main (max-width: 480px) {
  .calc-sum__line {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "name price"
      "calc calc";
  }

  .calc-sum__leader {
    display: none;
  }
}

.calc-sum__line--req .calc-sum__price {
  color: var(--c-sage);
  font-family: var(--f-body);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.calc-sum__group--req {
  padding: 16px 18px 6px;
  border: 1px dashed rgba(238, 243, 230, 0.2);
  border-radius: var(--radius-m);
}

.calc-sum__reqnote,
.calc-sum__empty {
  margin: 0 0 4px;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.calc-sum__total {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid rgba(214, 236, 107, 0.42);
  border-radius: var(--radius-l);
  background: linear-gradient(135deg, rgba(214, 236, 107, 0.16), rgba(214, 236, 107, 0.03) 70%);
}

.calc-sum__total::after {
  content: "";
  position: absolute;
  top: -40%;
  right: -10%;
  z-index: -1;
  width: 60%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 236, 107, 0.22), transparent 65%);
}

.calc-sum__label {
  margin: 0 0 10px;
  color: var(--c-on-dark-muted);
  font: 700 var(--fs-micro) / 1.2 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calc-sum__label span {
  color: var(--c-sage);
}

.calc-sum__foot {
  margin: 12px 0 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

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

.calc-sum .calc-check {
  margin-top: 0;
}

.calc-sum__notes {
  display: grid;
  gap: 8px;
}

.calc-sum__notes p {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
}

.calc-sum__notes svg {
  width: 16px;
  height: 16px;
  flex: none;
  margin-top: 2px;
  color: var(--c-sage);
}

/* ==========================================================================
   9. Totals (shared component, tweened by JS)
   ========================================================================== */
.calc-total {
  font-family: var(--f-display);
  font-variant-numeric: tabular-nums lining-nums;
  font-weight: 400;
  line-height: 1.02;
  letter-spacing: -0.02em;
}

.calc-total__val {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  column-gap: 0.2em;
  transition: opacity 0.4s var(--ease-out);
}

.calc-total__sep {
  opacity: 0.55;
}

.calc-total__tail {
  white-space: nowrap; /* "lei" never orphans onto its own line */
}

.calc-total__sep,
.calc-total__max {
  display: none;
}

.calc-total--range .calc-total__sep,
.calc-total--range .calc-total__max {
  display: inline;
}

.calc-total__cur {
  margin-left: 0.3em;
  font-family: var(--f-body);
  font-size: 0.46em;
  font-weight: 700;
  letter-spacing: 0;
  opacity: 0.75;
}

.calc-total--from .calc-total__cur::after {
  content: "*";
}

.calc-total__req {
  display: none;
  font-size: 0.6em;
  font-style: italic;
  font-weight: 300;
}

.calc-total[data-mode="request"] .calc-total__val {
  display: none;
}

.calc-total[data-mode="request"] .calc-total__req {
  display: inline;
}

.calc-total[data-mode="empty"] .calc-total__val {
  opacity: 0.38;
}

.calc-total--xl {
  color: var(--c-lime);
  font-size: clamp(2.1rem, 6vw, 3.8rem);
}

@supports (font-size: 1cqi) {
  .calc-total--xl {
    font-size: clamp(2rem, 8.6cqi, 3.8rem);
  }
}

.calc-total--live {
  color: var(--c-ink);
  font-size: clamp(1.75rem, 2.35vw, 2.35rem);
}

.calc-total--bar {
  color: var(--c-lime);
  font-size: clamp(0.86rem, 4.3vw, 1.3rem);
  white-space: nowrap;
}

.calc-total--bar .calc-total__val {
  flex-wrap: nowrap;
}

/* Small parts of the bar total stay legible (≥ 11px / 13px) */
.calc-total--bar .calc-total__cur {
  font-size: max(0.46em, 0.6875rem);
  opacity: 0.85;
}

.calc-total--bar .calc-total__req {
  font-size: max(0.6em, 0.8125rem);
  font-weight: 400;
}

.calc-total--sel {
  color: var(--c-lime);
  font-size: clamp(1.6rem, 3vw, 2.1rem);
}

/* ==========================================================================
   10. Live estimate — the "ticket" (desktop sidebar)
   ========================================================================== */
.calc-live {
  display: none;
}

@media (min-width: 1024px) {
  .calc-live {
    position: sticky;
    top: calc(var(--header-h) + 24px);
    display: block;
  }
}

.calc-live__card {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 28px 26px 24px;
  border-radius: var(--radius-l);
  background: var(--c-paper);
  color: var(--c-text);
  box-shadow: 0 36px 70px -28px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.calc-live__card::before {
  content: "";
  position: absolute;
  top: -110px;
  right: -90px;
  z-index: -1;
  width: 250px;
  height: 250px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 236, 107, 0.6), rgba(214, 236, 107, 0) 68%);
}

.calc-live__glow {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: inset 0 0 0 2px var(--c-lime), inset 0 0 40px rgba(214, 236, 107, 0.35);
  opacity: 0;
  pointer-events: none;
}

.calc-live__eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  color: var(--c-text-muted);
  font: 700 var(--fs-micro) / 1 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calc-live__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c-success);
  animation: calc-ping 2.4s var(--ease-out) infinite;
}

@keyframes calc-ping {
  0% { box-shadow: 0 0 0 0 rgba(60, 138, 85, 0.5); }
  70%,
  100% { box-shadow: 0 0 0 9px rgba(60, 138, 85, 0); }
}

.calc-live__meta {
  margin: 10px 0 0;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

/* Perforated tear line with notches cut out of the ticket */
.calc-live__cut {
  position: relative;
  height: 0;
  margin: 20px -26px 14px;
  border-top: 2px dashed rgba(20, 38, 28, 0.14);
}

.calc-live__cut::before,
.calc-live__cut::after {
  content: "";
  position: absolute;
  top: -12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--c-forest);
}

.calc-live__cut::before { left: -11px; }
.calc-live__cut::after { right: -11px; }

.calc-live__list {
  display: grid;
  max-height: 264px; /* ~4.5 rows: a half-visible row + the fade say "more below" */
  margin: 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(20, 38, 28, 0.25) transparent;
}

.calc-live__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--c-line);
  font-size: var(--fs-small);
}

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

.calc-live__name {
  min-width: 0;
  color: var(--c-text);
  line-height: 1.35;
}

.calc-live__name small {
  display: block;
  margin-top: 2px;
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
  font-variant-numeric: tabular-nums;
}

.calc-live__price {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.calc-live__item--req .calc-live__price {
  color: var(--c-text-muted);
  font-style: italic;
  font-weight: 600;
}

.calc-live__empty {
  margin: 0;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.calc:not(.calc--empty) .calc-live__empty,
.calc--empty .calc-live__list,
.calc[data-step="3"] .calc-live__list,
.calc[data-step="3"] .calc-live__cut {
  display: none;
}

.calc-live__foot {
  margin: 12px 0 0;
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
  line-height: 1.5;
}

.calc-live__cta {
  width: 100%;
  margin-top: 20px;
}

/* The ticket is a light card inside the dark section: undo A's dark-surface
   primary fill (paper), which would make the button vanish into the card on hover. */
.calc-live .btn--primary {
  --btn-fill: var(--c-ink);
  --btn-fill-fg: var(--c-lime);
  box-shadow: 0 12px 28px -14px rgba(96, 124, 18, 0.65);
}

.calc-live__note {
  margin: 14px 0 0;
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
  line-height: 1.5;
}

.calc-live :focus-visible {
  outline-color: var(--c-forest);
}

/* ==========================================================================
   11. Mobile estimate bar (fixed, appended to <body>)
   ========================================================================== */
.calc-bar {
  position: fixed;
  right: max(12px, env(safe-area-inset-right));
  bottom: calc(12px + env(safe-area-inset-bottom));
  left: max(12px, env(safe-area-inset-left));
  z-index: var(--z-sticky);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate3d(0, calc(100% + 28px), 0);
  transition: transform 0.5s var(--ease-out), opacity 0.35s var(--ease-out), visibility 0s linear 0.5s;
}

.calc-bar--shown {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: none;
  transition: transform 0.75s var(--ease-spring), opacity 0.3s var(--ease-out), visibility 0s;
}

@media (min-width: 1024px) {
  .calc-bar {
    display: none;
  }
}

/* While the bar is shown, native focus scrolling keeps controls clear of it
   (only the bottom longhand: main.css' scroll-padding-top stays). */
@media (max-width: 1023.98px) {
  html.has-calc-bar {
    scroll-padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }
}

/* A's full-screen mobile menu inerts <main> and the footer, not body children:
   keep the bar out of view, the tab order and the accessibility tree meanwhile. */
html.menu-open .calc-bar {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.calc-bar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: 560px;
  margin: 0 auto;
  padding: 8px 8px 8px 18px;
  border: 1px solid rgba(238, 243, 230, 0.14);
  border-radius: 22px;
  background: rgba(15, 31, 23, 0.9);
  color: var(--c-on-dark);
  font-family: var(--f-body);
  box-shadow: 0 20px 44px -14px rgba(0, 0, 0, 0.55);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
}

.calc-bar__info {
  display: grid;
  gap: 5px;
  min-width: 0;
  overflow: hidden;
}

.calc-bar__label {
  color: var(--c-on-dark-muted);
  font: 700 0.6875rem / 1 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.calc-bar__btn {
  flex: none;
}

.calc-bar :focus-visible {
  outline-color: var(--c-lime);
}

@media (max-width: 379px) {
  .calc-bar__btn .btn__icon {
    display: none;
  }

  .calc-bar__btn {
    padding: 0 1em;
  }

  /* A range that does not fit breaks after the "–" instead of being clipped */
  .calc-total--bar .calc-total__val {
    flex-wrap: wrap;
    row-gap: 2px;
  }
}

/* ==========================================================================
   12. Quote — wrapper + "Selecția ta" card
   ========================================================================== */
.quote {
  container: quote / inline-size;
  display: grid;
  gap: clamp(16px, 2.4vw, 24px);
  color: var(--c-text);
  font-family: var(--f-body);
}

.quote-sel {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: clamp(18px, 2.6vw, 26px);
  border-radius: var(--radius-l);
  background: var(--c-forest);
  color: var(--c-on-dark);
  box-shadow: var(--shadow-m);
}

.quote-sel::before {
  content: "";
  position: absolute;
  top: -120px;
  right: -80px;
  z-index: -1;
  width: 260px;
  height: 260px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(214, 236, 107, 0.28), transparent 68%);
}

.quote-sel:focus {
  outline: none;
}

.quote-sel:focus-visible {
  outline: 3px solid var(--c-forest);
  outline-offset: 3px;
}

.quote-sel :focus-visible {
  outline-color: var(--c-lime);
}

.quote-sel[data-mode="empty"] {
  border: 1.5px dashed rgba(20, 38, 28, 0.22);
  background: transparent;
  color: var(--c-text);
  box-shadow: none;
}

.quote-sel[data-mode="empty"]::before {
  display: none;
}

.quote-sel[data-mode="empty"] :focus-visible {
  outline-color: var(--c-forest);
}

.quote-sel--highlight {
  animation: quote-hl 1.6s var(--ease-out);
}

@keyframes quote-hl {
  0% { box-shadow: 0 0 0 0 rgba(214, 236, 107, 0), var(--shadow-m); }
  25% { box-shadow: 0 0 0 7px rgba(214, 236, 107, 0.85), var(--shadow-m); }
  100% { box-shadow: 0 0 0 18px rgba(214, 236, 107, 0), var(--shadow-m); }
}

.quote-sel__head {
  display: flex;
  align-items: center;
  gap: 14px;
}

.quote-sel__icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: rgba(214, 236, 107, 0.15);
  color: var(--c-lime);
}

.quote-sel__icon svg {
  width: 24px;
  height: 24px;
}

@container quote (max-width: 400px) {
  .quote-sel__head .quote-sel__icon {
    display: none;
  }

  .quote-sel__edit {
    padding: 8px 14px;
  }
}

.quote-sel[data-mode="empty"] .quote-sel__icon {
  background: var(--c-mint);
  color: var(--c-forest);
}

.quote-sel__titles {
  flex: 1 1 auto;
  min-width: 0;
}

.quote-sel__eyebrow {
  margin: 0;
  color: var(--c-on-dark-muted);
  font: 700 var(--fs-micro) / 1.2 var(--f-body);
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.quote-sel__count {
  margin: 4px 0 0;
  font-family: var(--f-display);
  font-size: 1.22rem;
  line-height: 1.25;
}

.quote-sel__text {
  margin: 10px 0 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.55;
}

.quote-sel[data-mode="empty"] .quote-sel__count {
  margin: 0;
}

.quote-sel[data-mode="empty"] .quote-sel__text {
  margin-top: 6px;
  color: var(--c-text-muted);
}

.quote-sel__edit {
  display: inline-flex;
  flex: none;
  align-items: center;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid rgba(238, 243, 230, 0.28);
  border-radius: var(--radius-pill);
  color: var(--c-on-dark);
  font-size: var(--fs-small);
  font-weight: 700;
  text-decoration: none;
  transition: background-color 0.3s var(--ease-out), color 0.3s var(--ease-out), border-color 0.3s var(--ease-out);
}

.quote-sel__edit:hover {
  border-color: var(--c-lime);
  background: var(--c-lime);
  color: var(--c-ink);
}

.quote-sel__list {
  max-height: 214px; /* ~5.5 rows */
  margin: 16px 0 0;
  padding: 0 6px 0 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  list-style: none;
  scrollbar-width: thin;
  scrollbar-color: rgba(238, 243, 230, 0.3) transparent;
}

/* JS toggles .is-clipped while lines are hidden below (overlay scrollbars show nothing) */
.calc-live__list.is-clipped,
.quote-sel__list.is-clipped {
  -webkit-mask-image: linear-gradient(#000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(#000 calc(100% - 48px), transparent);
}

/* The mask would also clip the focus outline (it paints outside the border box) */
.calc-live__list.is-clipped:focus-visible,
.quote-sel__list.is-clipped:focus-visible {
  -webkit-mask-image: none;
  mask-image: none;
}

.quote-sel__line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-top: 1px solid var(--c-line-dark);
  font-size: var(--fs-small);
}

.quote-sel__name {
  min-width: 0;
  line-height: 1.4;
}

.quote-sel__name small {
  margin-left: 4px;
  color: var(--c-on-dark-muted);
  font-size: 0.92em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quote-sel__price {
  flex: none;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.quote-sel__line--req .quote-sel__price {
  color: var(--c-sage);
  font-style: italic;
  font-weight: 600;
}

.quote-sel__total {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-top: 6px;
  padding-top: 14px;
  border-top: 1px solid rgba(214, 236, 107, 0.4);
}

.quote-sel__label {
  color: var(--c-on-dark-muted);
  font-size: var(--fs-small);
  font-weight: 700;
}

.quote-sel__flags {
  margin: 10px 0 0;
  color: var(--c-on-dark-muted);
  font-size: var(--fs-micro);
  line-height: 1.55;
}

.quote-sel__empty {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 14px 16px;
}

.quote-sel__go {
  grid-column: 1 / -1;
  justify-self: start;
}

@container quote (min-width: 640px) {
  .quote-sel__empty {
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
  }

  .quote-sel__go {
    grid-column: auto;
  }
}

/* ==========================================================================
   13. Quote — form card + fields (floating labels)
   ========================================================================== */
.quote-form,
.quote-panel,
.quote-done {
  padding: clamp(20px, 3.6vw, 40px);
  border: 1px solid var(--c-line);
  border-radius: var(--radius-l);
  background: var(--c-paper);
  box-shadow: var(--shadow-l);
}

@media (min-width: 640px) {
  .quote-form,
  .quote-panel,
  .quote-done {
    border-radius: var(--radius-xl);
  }
}

.quote-form__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px 16px;
  margin-bottom: 22px;
}

.quote-form__title {
  margin: 0;
  color: var(--c-text);
  font-family: var(--f-display);
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 400;
  line-height: 1.1;
}

.quote-form__title em {
  color: var(--c-moss);
  font-style: italic;
}

.quote-form__req {
  margin: 0;
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
}

.quote-form__req span {
  color: var(--c-clay);
  font-weight: 800;
}

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

@container quote (min-width: 600px) {
  .quote-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quote-span {
    grid-column: 1 / -1;
  }

  /* 60px input + 7px hint margin + one micro hint line → every 2-col row has the same rhythm */
  .quote-grid > .quote-field:not(.quote-span) {
    min-height: calc(67px + 1.45 * var(--fs-micro));
  }
}

.quote-field {
  position: relative;
  min-width: 0;
}

.quote-input {
  display: block;
  width: 100%;
  height: 60px;
  margin: 0;
  padding: 25px 46px 8px 16px;
  border: 1.5px solid rgba(20, 38, 28, 0.55); /* ≥ 3:1 against paper and white */
  border-radius: 16px;
  background: var(--c-white);
  color: var(--c-text);
  font: 500 1rem / 1.3 var(--f-body);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.2s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s var(--ease-out);
}

.quote-input:hover {
  border-color: rgba(20, 38, 28, 0.7);
}

.quote-input:focus,
.quote-input:focus-visible {
  outline: 2px solid transparent;
  outline-offset: 2px;
  border-color: var(--c-forest);
  box-shadow: 0 0 0 4px rgba(60, 107, 76, 0.22);
}

.quote-label {
  position: absolute;
  top: 19px;
  left: 17px;
  max-width: calc(100% - 64px);
  overflow: hidden;
  color: var(--c-text-muted);
  font-size: 1rem;
  line-height: 1.3;
  white-space: nowrap;
  text-overflow: ellipsis;
  pointer-events: none;
  transform-origin: left top;
  transition: transform 0.3s var(--ease-out), color 0.2s var(--ease-out), max-width 0.3s var(--ease-out);
}

.quote-input:focus + .quote-label,
.quote-input:not(:placeholder-shown) + .quote-label,
.quote-field--select .quote-label {
  max-width: calc((100% - 40px) / 0.76);
  transform: translate3d(0, -10px, 0) scale(0.76);
}

.quote-input:focus + .quote-label {
  color: var(--c-moss);
}

.quote-req {
  color: var(--c-clay);
  font-weight: 800;
}

.quote-opt {
  color: inherit; /* follows .quote-label (muted, moss on focus) — AA contrast */
  font-size: 0.88em;
}

.quote-field .quote-req {
  display: none;
}

.quote-field--required .quote-req {
  display: inline;
}

.quote-field--required .quote-opt {
  display: none;
}

.quote-ok {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 20px;
  height: 20px;
  color: var(--c-success);
  opacity: 0;
  pointer-events: none;
  transform: scale(0.4) rotate(-20deg);
  transition: opacity 0.25s var(--ease-out), transform 0.5s var(--ease-spring);
}

.quote-ok svg {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}

.quote-field--valid .quote-ok {
  opacity: 1;
  transform: none;
}

.quote-field--invalid .quote-input {
  border-color: var(--c-error);
  background: #fff8f5;
}

.quote-field--invalid .quote-input:focus {
  box-shadow: 0 0 0 4px rgba(185, 65, 43, 0.16);
}

.quote-field--invalid .quote-label {
  color: var(--c-error);
}

.quote-msg {
  display: flex;
  gap: 7px;
  margin: 7px 2px 0;
  color: var(--c-error);
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.4;
}

.quote-msg:empty {
  display: none;
}

.quote-msg::before {
  content: "!";
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  border-radius: 50%;
  background: var(--c-error);
  color: var(--c-white);
  font: 800 11px / 17px var(--f-body);
  text-align: center;
}

.quote-field--invalid .quote-msg {
  animation: quote-msg-in 0.4s var(--ease-out);
}

@keyframes quote-msg-in {
  from { opacity: 0; transform: translate3d(0, -5px, 0); }
}

.quote-hint {
  margin: 7px 2px 0;
  color: var(--c-text-muted);
  font-size: var(--fs-micro);
  line-height: 1.45;
}

.quote-hint:empty,
.quote-field--invalid .quote-hint {
  display: none;
}

.quote-hint--row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.quote-count {
  flex: none;
  font-variant-numeric: tabular-nums;
}

/* Select */
.quote-select {
  padding-right: 48px;
  cursor: pointer;
}

.quote-chev {
  position: absolute;
  top: 20px;
  right: 16px;
  width: 20px;
  height: 20px;
  color: var(--c-text-muted);
  pointer-events: none;
}

.quote-chev svg {
  width: 20px;
  height: 20px;
}

/* Textarea */
.quote-textarea {
  height: 124px;
  min-height: 124px;
  padding-top: 30px;
  padding-right: 16px;
  line-height: 1.55;
  resize: none;
}

/* Segmented contact preference */
.quote-seg {
  min-width: 0;
  margin: 4px 0 0;
  padding: 0;
  border: 0;
}

.quote-seg__legend {
  margin: 0 0 9px;
  padding: 0;
  color: var(--c-text);
  font-size: var(--fs-small);
  font-weight: 700;
}

.quote-seg__track {
  --i: 0;
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
  border: 1.5px solid rgba(20, 38, 28, 0.1);
  border-radius: 18px;
  background: rgba(20, 38, 28, 0.05);
}

.quote-seg__thumb {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc((100% - 8px) / 3);
  border-radius: 14px;
  background: var(--c-forest);
  box-shadow: 0 8px 18px -8px rgba(15, 31, 23, 0.55);
  transform: translate3d(calc(var(--i) * 100%), 0, 0);
  transition: transform 0.55s var(--ease-spring);
}

.quote-seg__opt {
  position: relative;
  z-index: 1;
  min-width: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quote-seg__face {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 6px;
  border-radius: 14px;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  font-weight: 700;
  transition: color 0.35s var(--ease-out), box-shadow 0.25s var(--ease-out);
}

.quote-seg__face svg {
  width: 18px;
  height: 18px;
  flex: none;
}

.quote-seg__opt:hover .quote-seg__face {
  color: var(--c-text);
}

.quote-seg__opt input:checked + .quote-seg__face {
  color: var(--c-on-dark);
}

.quote-seg__opt input:checked + .quote-seg__face svg {
  color: var(--c-lime);
}

.quote-seg__opt input:focus-visible + .quote-seg__face {
  outline: 2px solid transparent;
  outline-offset: -2px; /* inside the face, so it never spills onto the neighbouring segments */
  box-shadow: 0 0 0 3px var(--c-paper), 0 0 0 6px var(--c-forest);
}

@container quote (max-width: 380px) {
  .quote-seg__face svg {
    display: none;
  }
}

/* GDPR checkbox */
.quote-field--check {
  margin-top: 2px;
}

.quote-check {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 4px 0;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
  line-height: 1.5;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.quote-check__box {
  display: grid;
  flex: none;
  place-items: center;
  width: 24px;
  height: 24px;
  margin-top: 1px;
  border: 1.5px solid rgba(20, 38, 28, 0.6); /* ≥ 3:1: the only cue for the required consent box */
  border-radius: 7px;
  background: var(--c-white);
  color: var(--c-lime);
  transition: background-color 0.25s var(--ease-out), border-color 0.25s var(--ease-out), transform 0.4s var(--ease-spring);
}

.quote-check__box svg {
  width: 16px;
  height: 16px;
  stroke-width: 3;
  stroke-dasharray: 24;
  stroke-dashoffset: 24;
  transition: stroke-dashoffset 0.35s var(--ease-out) 0.05s;
}

.quote-check input:checked + .quote-check__box {
  border-color: var(--c-forest);
  background: var(--c-forest);
  transform: scale(1.06);
}

.quote-check input:checked + .quote-check__box svg {
  stroke-dashoffset: 0;
}

.quote-check input:focus-visible + .quote-check__box {
  outline: 2px solid transparent;
  outline-offset: 2px;
  box-shadow: 0 0 0 3px var(--c-paper), 0 0 0 6px var(--c-forest);
}

.quote-field--invalid .quote-check__box {
  border-color: var(--c-error);
}

/* Privacy-policy link inside the consent label (clicking it does not toggle the box) */
.quote-check__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.quote-check__link:hover {
  color: var(--c-forest);
}

/* Keeps A's forest :focus-visible outline (lime --ring would vanish on the light card), just tighter */
.quote-check__link:focus-visible {
  border-radius: 3px;
  outline-offset: 2px;
}

/* Honeypot: off-screen, never visible or focusable */
.quote-hp {
  position: absolute !important;
  top: auto;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Actions */
.quote-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 22px;
  margin-top: 26px;
}

.quote-actions__note {
  margin: 0;
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.quote-submit {
  position: relative;
}

.quote-spinner {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 22px;
  height: 22px;
  margin: -11px 0 0 -11px;
  border: 2.5px solid rgba(15, 31, 23, 0.22);
  border-top-color: var(--c-ink);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  animation: quote-spin 0.8s linear infinite;
}

.quote-submit .btn__label,
.quote-submit .btn__icon {
  transition: opacity 0.2s var(--ease-out);
}

.quote-submit--loading .btn__label,
.quote-submit--loading .btn__icon {
  opacity: 0;
}

.quote-submit--loading .quote-spinner {
  opacity: 1;
}

.quote-submit--loading,
.quote-submit--loading:disabled,
.quote-submit--loading[aria-disabled="true"] {
  cursor: progress;
  opacity: 1;
}

@keyframes quote-spin {
  to { transform: rotate(360deg); }
}

@container quote (max-width: 440px) {
  .quote-submit {
    width: 100%;
  }
}

/* Network error */
.quote-error {
  margin-top: 20px;
  padding: 16px 18px;
  border: 1px solid rgba(185, 65, 43, 0.3);
  border-radius: 16px;
  background: #fbeee9;
  color: #7a2a1a;
  font-size: var(--fs-small);
  line-height: 1.55;
}

.quote-error p {
  margin: 0;
}

.quote-error__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.quote-error .quote-error__note:not(:empty) {
  margin-top: 10px;
  font-weight: 600;
}

/* ==========================================================================
   14. Quote — "ready to send" panel + success
   ========================================================================== */
.quote-panel__badge {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 22px;
  border-radius: 20px;
  background: var(--c-forest);
  color: var(--c-lime);
  box-shadow: 0 16px 30px -14px rgba(15, 31, 23, 0.6);
  animation: quote-badge 0.9s var(--ease-spring) 0.15s backwards;
}

.quote-panel__badge svg {
  width: 30px;
  height: 30px;
}

@keyframes quote-badge {
  from { opacity: 0; transform: scale(0.4) rotate(-25deg); }
}

.quote-panel__title,
.quote-done__title {
  margin: 0;
  color: var(--c-text);
  font-family: var(--f-display);
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  font-weight: 400;
  line-height: 1.06;
  letter-spacing: -0.015em;
}

.quote-panel__title em,
.quote-done__title em {
  color: var(--c-moss);
  font-style: italic;
}

.quote-panel__lead,
.quote-done__text {
  max-width: 54ch;
  margin: 14px 0 0;
  color: var(--c-text-muted);
  font-size: 1.02rem;
  line-height: 1.6;
}

.quote-panel__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.quote-send svg {
  position: relative;
  width: 20px;
  height: 20px;
  flex: none;
}

@container quote (max-width: 520px) {
  .quote-panel__actions .btn {
    width: 100%;
  }
}

.quote-panel__status {
  min-height: 1.5em;
  margin: 14px 0 0;
  color: var(--c-moss); /* 5.8:1 on paper — this text carries instructions */
  font-size: var(--fs-small);
  font-weight: 600;
  line-height: 1.5;
}

.quote-panel__status:empty {
  min-height: 0;
  margin: 0;
}

.quote-preview {
  margin-top: 22px;
  padding-top: 14px;
  border-top: 1px solid var(--c-line);
}

.quote-preview summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  color: var(--c-moss);
  font-size: var(--fs-small);
  font-weight: 700;
  list-style: none;
  cursor: pointer;
}

.quote-preview summary::-webkit-details-marker {
  display: none;
}

.quote-preview summary svg {
  width: 18px;
  height: 18px;
  transition: transform 0.4s var(--ease-out);
}

.quote-preview[open] summary svg {
  transform: rotate(180deg);
}

.quote-preview__text {
  max-height: 300px;
  margin: 8px 0 0;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid var(--c-line);
  border-radius: 14px;
  background: var(--c-cream);
  color: var(--c-text);
  font: 500 0.86rem / 1.65 var(--f-body);
  white-space: pre-wrap;
  word-break: break-word;
}

.quote-preview[open] .quote-preview__text {
  animation: quote-msg-in 0.4s var(--ease-out);
}

.quote-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 4px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--c-moss);
  font: 700 var(--fs-small) / 1.2 var(--f-body);
  cursor: pointer;
}

.quote-link:hover {
  color: var(--c-forest);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.quote-link svg {
  width: 18px;
  height: 18px;
}

.quote-panel__foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid var(--c-line);
  color: var(--c-text-muted);
  font-size: var(--fs-small);
}

.quote-panel__foot a {
  color: var(--c-text);
  font-weight: 700;
}

/* Success — circle draws, disc pops, tick draws, leaves burst */
.quote-done {
  position: relative;
  overflow: hidden;
  padding-top: clamp(36px, 6vw, 64px);
  padding-bottom: clamp(36px, 6vw, 64px);
  text-align: center;
}

.quote-done__mark {
  position: relative;
  width: 104px;
  height: 104px;
  margin: 0 auto 24px;
}

.quote-done__mark svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.quote-done__disc {
  fill: var(--c-lime);
  transform: scale(0);
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.7s var(--ease-spring) 0.45s;
}

.quote-done__circle {
  fill: none;
  stroke: var(--c-moss);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 227;
  stroke-dashoffset: 227;
  transform: rotate(-90deg);
  transform-box: fill-box;
  transform-origin: center;
  transition: stroke-dashoffset 0.8s var(--ease-out);
}

.quote-done__tick {
  fill: none;
  stroke: var(--c-ink);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 48;
  stroke-dashoffset: 48;
  transition: stroke-dashoffset 0.55s var(--ease-out) 0.8s;
}

.quote-done--drawn .quote-done__disc {
  transform: scale(1);
}

.quote-done--drawn .quote-done__circle,
.quote-done--drawn .quote-done__tick {
  stroke-dashoffset: 0;
}

.quote-done__leaf {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 16px;
  border-radius: 10px 0 10px 0;
  opacity: 0;
  pointer-events: none;
}

.quote-done__text {
  margin-right: auto;
  margin-left: auto;
}

.quote-done__again {
  margin-top: 26px;
}

/* ==========================================================================
   15. Reduced motion — everything stays usable, nothing moves
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  .calc *,
  .calc-bar,
  .calc-bar *,
  .quote *,
  .quote-sel {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0s !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }

  .calc-tile:hover .calc-tile__card,
  .calc-tile:active .calc-tile__card {
    transform: none;
  }
}

html.reduced-motion .calc *,
html.reduced-motion .calc-bar,
html.reduced-motion .quote * {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0s !important;
}

/* ==========================================================================
   16. Forced colors (Windows High Contrast): backgrounds and shadows are
   replaced, so switch / segmented / range state gets explicit system colours.
   Never put forced-color-adjust:none on an element that carries a focus outline.
   ========================================================================== */
@media (forced-colors: active) {
  .calc-switch {
    border: 2px solid CanvasText;
  }

  .calc-switch__thumb {
    forced-color-adjust: none;
    top: 1px;
    left: 1px;
    background: CanvasText;
  }

  .calc-switch__input:checked + .calc-row__label .calc-switch__thumb {
    background: Highlight;
  }

  .quote-seg__thumb {
    forced-color-adjust: none;
    background: Highlight;
  }

  .quote-seg__opt input:checked + .quote-seg__face > * {
    forced-color-adjust: none;
    color: HighlightText;
  }

  /* Separate rules: an unknown vendor pseudo-element would drop a whole selector list */
  .calc-range::-webkit-slider-runnable-track {
    forced-color-adjust: none;
    background: GrayText;
  }

  .calc-range::-moz-range-track {
    forced-color-adjust: none;
    background: GrayText;
  }

  .calc-range::-moz-range-progress {
    forced-color-adjust: none;
    background: Highlight;
  }

  .calc-range::-webkit-slider-thumb {
    forced-color-adjust: none;
    border: 2px solid Canvas;
    background: ButtonText;
  }

  .calc-range::-moz-range-thumb {
    forced-color-adjust: none;
    border: 2px solid Canvas;
    background: ButtonText;
  }
}
