.ov-size-calc {
  --ov-calc-ink: var(--ink, #292a27);
  --ov-calc-soft: var(--ink-soft, #5f605b);
  --ov-calc-paper: var(--paper, #f8f6f1);
  --ov-calc-paper-soft: var(--paper-soft, #f0ede6);
  --ov-calc-line: var(--line, rgba(41, 42, 39, 0.15));
  --ov-calc-accent: var(--brick, #9c3d2a);
  margin: clamp(2.5rem, 7vw, 6rem) 50%;
  width: min(1180px, calc(100vw - (2 * var(--page-pad, 1.25rem))));
  transform: translateX(-50%);
  border: 1px solid var(--ov-calc-line);
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
  color: var(--ov-calc-ink);
  box-shadow: 0 32px 80px rgba(41, 42, 39, 0.09);
}

.ov-size-calc__intro {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(300px, 1.15fr);
  gap: clamp(2rem, 6vw, 6rem);
  padding: clamp(2rem, 6vw, 5.25rem);
  background: var(--ov-calc-ink);
  color: #fff;
}

.entry-content .ov-size-calc__intro h2,
.ov-size-calc__intro h2 {
  max-width: 11ch;
  margin: 0;
  color: #fff;
  font-size: clamp(2.6rem, 6vw, 5.8rem);
  line-height: 0.92;
}

.ov-size-calc__intro > p:last-child {
  align-self: end;
  max-width: 48ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.75);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.ov-size-calc__eyebrow {
  grid-column: 1 / -1;
  margin: 0 0 -0.5rem;
  color: var(--gold, #f5ce53);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.entry-content .ov-size-calc__intro .ov-size-calc__eyebrow {
  color: var(--gold, #f5ce53);
}

.ov-size-calc__form {
  padding: clamp(2rem, 5vw, 4rem);
  background: var(--ov-calc-paper-soft);
}

.ov-size-calc__fieldset {
  margin: 0 0 2rem;
  padding: 0;
  border: 0;
}

.ov-size-calc__fieldset legend,
.ov-size-calc__field > span:first-child {
  display: block;
  margin-bottom: 0.65rem;
  color: var(--ov-calc-soft);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ov-size-calc__segmented {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  padding: 0.35rem;
  border: 1px solid var(--ov-calc-line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.65);
}

.ov-size-calc__segmented label {
  cursor: pointer;
}

.ov-size-calc__segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.ov-size-calc__segmented span {
  display: block;
  padding: 0.7rem 1.05rem;
  border-radius: 999px;
  color: var(--ov-calc-soft);
  font-weight: 700;
}

.ov-size-calc__segmented input:checked + span {
  background: var(--ov-calc-ink);
  color: #fff;
}

.ov-size-calc__segmented input:focus-visible + span {
  outline: 2px solid var(--ov-calc-accent);
  outline-offset: 3px;
}

.ov-size-calc__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}

.ov-size-calc__field {
  min-width: 0;
}

.ov-size-calc__field input,
.ov-size-calc__field select {
  width: 100%;
  min-height: 52px;
  border: 1px solid var(--ov-calc-line);
  border-radius: 12px;
  background: #fff;
  color: var(--ov-calc-ink);
  font: inherit;
}

.ov-size-calc__field input {
  padding: 0.8rem 1rem;
  font-family: var(--serif, Georgia, serif);
  font-size: 1.35rem;
}

.ov-size-calc__field select {
  padding: 0.8rem 2.4rem 0.8rem 1rem;
}

.ov-size-calc__field small {
  display: block;
  margin-top: 0.5rem;
  color: var(--ov-calc-soft);
  font-size: 0.72rem;
  line-height: 1.45;
}

.ov-size-calc__submit,
.ov-size-calc__download,
.ov-size-calc__shop {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 999px;
  font-weight: 700;
  text-decoration: none !important;
}

.ov-size-calc__submit {
  margin-top: 2rem;
  padding: 0.85rem 1.35rem;
  border: 0;
  background: var(--ov-calc-accent);
  color: #fff;
  cursor: pointer;
}

.ov-size-calc__submit:hover {
  background: var(--brick-dark, #7f2f1f);
}

.ov-size-calc__error {
  margin: 1rem 0 0;
  color: #8b2217;
  font-weight: 700;
}

.ov-size-calc__results {
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.05fr);
  gap: clamp(2rem, 5vw, 4rem);
  padding: clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--ov-calc-line);
  background: #fff;
}

.ov-size-calc__results[hidden] {
  display: none;
}

.ov-size-calc__visual {
  align-self: start;
}

.ov-size-calc__wall {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border: 1px solid var(--ov-calc-line);
  border-radius: 4px 4px 18px 18px;
  background: #ece6dc;
}

.ov-size-calc__wall svg {
  display: block;
  width: 100%;
  height: 100%;
}

.ov-size-calc__wall .ov-scale-label {
  fill: #4f514d;
  stroke: rgba(241, 237, 229, 0.92);
  stroke-width: 3px;
  paint-order: stroke fill;
  font-family: var(--sans, sans-serif);
  font-weight: 700;
  letter-spacing: 0.02em;
}

.ov-size-calc__wall .ov-scale-line {
  stroke: #7f684e;
  stroke-width: 1.5;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-guide {
  stroke: rgba(41, 42, 39, 0.25);
  stroke-width: 1;
  stroke-dasharray: 5 5;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-frame {
  fill: #242522;
}

.ov-size-calc__wall .ov-scale-mount {
  fill: none;
  stroke: #f3efe7;
  stroke-width: 8;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-shadow {
  fill: rgba(41, 42, 39, 0.16);
}

.ov-size-calc__wall .ov-scale-sofa-back {
  fill: #626963;
  stroke: rgba(41, 42, 39, 0.34);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-base {
  fill: #4f5651;
  stroke: rgba(41, 42, 39, 0.38);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-arm {
  fill: #555c57;
  stroke: rgba(41, 42, 39, 0.32);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-cushion {
  fill: #727a73;
  stroke: rgba(41, 42, 39, 0.3);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-seat {
  fill: #686f69;
  stroke: rgba(41, 42, 39, 0.32);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-seam {
  fill: none;
  stroke: rgba(255, 255, 255, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-sofa-leg {
  fill: #40372f;
}

.ov-size-calc__wall .ov-scale-sofa-pillow {
  stroke: rgba(41, 42, 39, 0.18);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-baseboard {
  stroke: rgba(97, 75, 53, 0.42);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}

.ov-size-calc__wall .ov-scale-floor {
  fill: #a38c6d;
}

.ov-size-calc__visual > p {
  margin: 0.75rem 0 0;
  color: var(--ov-calc-soft);
  font-size: 0.82rem;
  text-align: center;
}

.ov-size-calc__visual > .ov-size-calc__scale-note {
  margin-top: 0.3rem;
  font-size: 0.72rem;
  line-height: 1.45;
}

.entry-content .ov-size-calc__answer .ov-size-calc__eyebrow,
.ov-size-calc__answer .ov-size-calc__eyebrow {
  color: var(--ov-calc-accent);
}

.ov-size-calc__recommendation {
  margin: 0.35rem 0 0.75rem;
  color: var(--ov-calc-ink);
  font-family: var(--serif, Georgia, serif);
  font-size: clamp(2.2rem, 5vw, 4.4rem);
  letter-spacing: -0.045em;
  line-height: 0.98;
}

.ov-size-calc__answer > p:not(.ov-size-calc__eyebrow):not(.ov-size-calc__recommendation) {
  color: var(--ov-calc-soft);
}

.ov-size-calc__range-note {
  margin: 1.1rem 0 0;
  font-size: 0.86rem;
}

.ov-size-calc__range-note strong {
  color: var(--ov-calc-ink);
  font-weight: 700;
}

.ov-size-calc__result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 2rem 0;
}

.ov-size-calc__result-grid article {
  padding: 1rem;
  border: 1px solid var(--ov-calc-line);
  border-radius: 12px;
  background: var(--ov-calc-paper);
}

.ov-size-calc__result-grid span,
.ov-size-calc__result-grid strong {
  display: block;
}

.ov-size-calc__result-grid span {
  margin-bottom: 0.3rem;
  color: var(--ov-calc-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-size-calc__result-grid strong {
  font-family: var(--serif, Georgia, serif);
  font-size: 1.1rem;
  line-height: 1.2;
}

.ov-size-calc__preview-control {
  margin: 0 0 2rem;
  padding: 1.1rem;
  border: 1px solid var(--ov-calc-line);
  border-left: 4px solid var(--ov-calc-accent);
  border-radius: 12px;
  background: var(--ov-calc-paper-soft);
}

.ov-size-calc__preview-control label > span {
  display: block;
  margin-bottom: 0.55rem;
  color: var(--ov-calc-soft);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ov-size-calc__preview-control select {
  width: 100%;
  min-height: 50px;
  padding: 0.75rem 2.5rem 0.75rem 0.9rem;
  border: 1px solid var(--ov-calc-line);
  border-radius: 9px;
  background: #fff;
  color: var(--ov-calc-ink);
  font: inherit;
  font-weight: 700;
}

.ov-size-calc__preview-control p {
  margin: 0.65rem 0 0;
  color: var(--ov-calc-soft);
  font-size: 0.78rem;
  line-height: 1.5;
}

.entry-content .ov-size-calc__matches h3,
.ov-size-calc__matches h3 {
  max-width: none;
  margin: 0 0 0.8rem;
  font-size: 1.35rem;
}

.ov-size-calc__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.ov-size-calc__chip {
  display: inline-flex;
  flex-direction: column;
  gap: 0.1rem;
  padding: 0.6rem 0.8rem;
  border: 2px solid transparent;
  border-radius: 9px;
  background: var(--ov-calc-ink);
  color: #fff;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, transform 150ms ease;
}

.ov-size-calc__chip:hover {
  transform: translateY(-1px);
}

.ov-size-calc__chip.is-selected {
  border-color: var(--ov-calc-accent);
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ov-calc-accent);
}

.ov-size-calc__chip:focus-visible {
  outline: 2px solid var(--ov-calc-accent);
  outline-offset: 3px;
}

.ov-size-calc__chip strong {
  color: #fff;
  font-size: 0.86rem;
}

.ov-size-calc__chip small {
  color: rgba(255,255,255,0.65);
  font-size: 0.65rem;
}

.ov-size-calc__matches > p {
  margin: 0.9rem 0 0;
  color: var(--ov-calc-soft);
  font-size: 0.82rem;
}

.ov-size-calc__footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  padding: 1.25rem clamp(2rem, 5vw, 4rem);
  border-top: 1px solid var(--ov-calc-line);
  background: var(--ov-calc-paper-soft);
}

.ov-size-calc__download,
.ov-size-calc__shop {
  padding: 0.75rem 1rem;
}

.entry-content .ov-size-calc__download,
.ov-size-calc__download {
  color: var(--ov-calc-accent);
}

.entry-content .ov-size-calc__shop,
.ov-size-calc__shop {
  background: var(--ov-calc-ink);
  color: #fff;
}

@media (max-width: 820px) {
  .ov-size-calc__intro,
  .ov-size-calc__results {
    grid-template-columns: 1fr;
  }

  .ov-size-calc__intro > p:last-child {
    align-self: auto;
  }

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

@media (max-width: 560px) {
  .ov-size-calc {
    border-radius: 18px;
  }

  .ov-size-calc__intro,
  .ov-size-calc__form,
  .ov-size-calc__results {
    padding: 1.35rem;
  }

  .ov-size-calc__segmented {
    display: grid;
    width: 100%;
  }

  .ov-size-calc__grid {
    grid-template-columns: 1fr;
  }

  .ov-size-calc__result-grid {
    grid-template-columns: 1fr;
  }

  .ov-size-calc__footer {
    display: grid;
    padding: 1rem 1.35rem;
  }

  .ov-size-calc__footer a {
    width: 100%;
  }
}
