:root {
  --ink: #0a1f2e;
  --ink-soft: #1a4a5c;
  --teal-deep: #067a8a;
  --teal: #0ea8b5;
  --aqua: #20e3c2;
  --coral: #ff6b4a;
  --sun: #ffc94a;
  --foam: #e6fffb;
  --mist: #f0fffc;
  --sand: #ffe0a3;
  --brass: #ffb020;
  --brass-soft: #ffe6a8;
  --white: #ffffff;
  --line: rgba(10, 31, 46, 0.1);
  --shadow: 0 14px 32px rgba(6, 122, 138, 0.12);
  --shadow-lg: 0 22px 48px rgba(6, 122, 138, 0.16);
  --radius: 18px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Sora", system-ui, sans-serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --mobile-bar-h: 0px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-body);
  color: var(--ink);
  background: #e8fffb;
  line-height: 1.5;
  overflow-x: hidden;
  padding-bottom: var(--mobile-bar-h);
  -webkit-tap-highlight-color: transparent;
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.grain {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 50;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Rich carpet background */
.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background: linear-gradient(160deg, #e8fffb 0%, #dff4ff 40%, #fff0e8 100%);
}

.page-bg__layer {
  position: absolute;
  background-size: cover;
  background-position: center;
  border-radius: 28px;
  opacity: 0.28;
  filter: saturate(1.15) contrast(1.05);
  box-shadow: 0 24px 60px rgba(6, 80, 100, 0.18);
}

.page-bg__layer--a {
  top: -4%;
  right: -8%;
  width: min(72vw, 520px);
  height: min(58vh, 460px);
  opacity: 0.32;
  background-image: url("https://images.unsplash.com/photo-1600166898405-da9535204843?auto=format&fit=crop&w=1200&q=70");
  transform: rotate(8deg);
}

.page-bg__layer--b {
  bottom: 8%;
  left: -12%;
  width: min(80vw, 560px);
  height: min(48vh, 400px);
  opacity: 0.24;
  background-image: url("https://images.unsplash.com/photo-1578662996442-48f60103fc96?auto=format&fit=crop&w=1200&q=70");
  transform: rotate(-10deg);
}

.page-bg__layer--c {
  top: 42%;
  right: -6%;
  width: min(55vw, 380px);
  height: min(40vh, 320px);
  opacity: 0.2;
  background-image: url("https://images.unsplash.com/photo-1586023492125-27b2c045efd7?auto=format&fit=crop&w=1000&q=70");
  transform: rotate(14deg);
}

.page-bg__veil {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 55% at 20% 10%, rgba(32, 227, 194, 0.22), transparent 55%),
    radial-gradient(ellipse 70% 50% at 90% 20%, rgba(255, 107, 74, 0.16), transparent 50%),
    radial-gradient(ellipse 60% 45% at 50% 90%, rgba(255, 201, 74, 0.18), transparent 55%),
    linear-gradient(180deg, rgba(240, 255, 252, 0.55) 0%, rgba(232, 249, 255, 0.72) 45%, rgba(255, 240, 232, 0.78) 100%);
}

/* Header */
.header {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: 40;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  box-shadow: 0 8px 28px rgba(6, 80, 100, 0.08);
}

.header__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand__mark {
  width: 1.1rem;
  height: 1.1rem;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--aqua), var(--coral));
  box-shadow: 0 0 0 3px rgba(255, 107, 74, 0.22);
}

.brand__text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--ink);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  border: none;
  cursor: pointer;
  border-radius: 999px;
  padding: 0.95rem 1.4rem;
  font-weight: 600;
  font-size: 0.95rem;
  transition: transform 0.25s var(--ease), background 0.25s var(--ease), box-shadow 0.25s var(--ease);
}

.btn:hover {
  transform: translateY(-2px);
}

.btn:active {
  transform: translateY(0) scale(0.98);
}

.btn--primary {
  background: linear-gradient(135deg, var(--coral), #ff8f3c);
  color: var(--white);
  box-shadow:
    0 12px 30px rgba(255, 107, 74, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.btn--primary:hover {
  box-shadow: 0 16px 36px rgba(255, 107, 74, 0.5);
}

.btn--ghost {
  width: 100%;
  background: rgba(255, 255, 255, 0.55);
  color: var(--teal-deep);
  border: 1.5px dashed rgba(15, 122, 130, 0.45);
  margin-top: 0.75rem;
  box-shadow: 0 8px 20px rgba(7, 28, 34, 0.06);
}

.btn--ghost:hover {
  background: rgba(15, 122, 130, 0.08);
  border-style: solid;
  box-shadow: 0 12px 28px rgba(15, 122, 130, 0.12);
}

.summary__warn {
  margin: 1rem 0 0;
  padding: 0.75rem 0.9rem;
  border-radius: 12px;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.35;
  color: #9a3412;
  background: #fff4ed;
  border: 1.5px solid rgba(255, 107, 74, 0.45);
  box-shadow: 0 6px 16px rgba(255, 107, 74, 0.12);
}

.summary__warn[hidden] {
  display: none;
}

.btn--whatsapp {
  width: 100%;
  margin-top: 0.85rem;
  background: linear-gradient(135deg, #25d366, #1fa855);
  color: var(--white);
  box-shadow:
    0 14px 32px rgba(31, 168, 85, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
}

.btn--whatsapp:hover {
  background: linear-gradient(135deg, #1fa855, #18964a);
}

.btn--whatsapp.is-disabled {
  opacity: 0.55;
  pointer-events: none;
  transform: none;
  box-shadow: none;
}

.btn--whatsapp-compact {
  width: auto;
  margin: 0;
  padding: 0.85rem 1.15rem;
  flex-shrink: 0;
}

/* Calculator */
.calc {
  position: relative;
  z-index: 1;
  padding: 1.25rem 1rem 3rem;
}

.calc__wrap {
  max-width: 1120px;
  margin: 0 auto;
}

.calc__intro {
  margin-bottom: 1.5rem;
  max-width: 40rem;
  animation: rise 0.7s var(--ease) both;
}

.calc__title {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 4vw, 2.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.calc__sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.calc__sub strong {
  color: var(--teal-deep);
}

.calc__layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .calc__layout {
    grid-template-columns: 1.35fr 0.9fr;
    align-items: start;
    gap: 2rem;
  }

  .calc {
    padding: 1.75rem 1.25rem 5rem;
  }

  .page-bg__layer--a {
    opacity: 0.36;
  }

  .page-bg__layer--b {
    opacity: 0.28;
  }

  .page-bg__layer--c {
    opacity: 0.24;
  }
}

.calc__form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.field-block,
.carpet,
.summary {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(7, 28, 34, 0.06);
  border-radius: var(--radius);
  backdrop-filter: blur(14px);
  box-shadow: var(--shadow-lg);
}

.field-block {
  padding: 1.15rem 1.2rem 1rem;
  animation: rise 0.7s var(--ease) 0.08s both;
}

.label {
  display: block;
  margin-bottom: 0.45rem;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.select-wrap {
  position: relative;
}

.select-wrap__chev {
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--teal);
}

.select,
.input {
  width: 100%;
  appearance: none;
  border: 1.5px solid rgba(15, 122, 130, 0.18);
  background: var(--white);
  border-radius: 14px;
  padding: 0.95rem 1rem;
  color: var(--ink);
  outline: none;
  min-height: 48px;
  box-shadow: 0 4px 14px rgba(7, 28, 34, 0.04);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.select {
  padding-right: 2.5rem;
  cursor: pointer;
}

.select:focus,
.input:focus {
  border-color: var(--aqua);
  box-shadow: 0 0 0 4px rgba(29, 184, 181, 0.16), 0 10px 24px rgba(15, 122, 130, 0.1);
  transform: translateY(-1px);
}

.field-hint {
  margin: 0.55rem 0 0;
  font-size: 0.85rem;
  color: var(--teal);
  min-height: 1.25em;
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}

.field-hint.is-flash {
  animation: hint-flash 0.55s var(--ease);
}

/* Carpet items */
.carpets {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.carpet {
  padding: 1.1rem 1rem 1.15rem;
  animation: carpet-in 0.55s var(--ease) both;
  overflow: visible;
}

.carpet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.carpet__label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
}

.carpet__tip {
  margin: 0 0 0.9rem;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.carpet__remove {
  display: grid;
  place-items: center;
  width: 2.4rem;
  height: 2.4rem;
  border: none;
  border-radius: 50%;
  background: rgba(7, 28, 34, 0.06);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.carpet__remove:hover {
  background: rgba(180, 40, 40, 0.12);
  color: #a31f1f;
  box-shadow: 0 6px 16px rgba(163, 31, 31, 0.15);
}

.carpet__remove:active {
  transform: scale(0.92);
}

.carpet__remove[hidden] {
  visibility: hidden;
}

.carpet__feature {
  margin-top: 1rem;
}

/* Visual rug stage */
.rug-stage {
  position: relative;
  padding: 1rem 0.75rem 1.35rem;
  border-radius: 18px;
  overflow: hidden;
  background:
    radial-gradient(ellipse 80% 60% at 50% 20%, rgba(255, 255, 255, 0.7), transparent 70%),
    linear-gradient(165deg, #d4fff5 0%, #c8f0ff 45%, #ffe8d6 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    inset 0 -20px 40px rgba(6, 122, 138, 0.06);
}

.rug-stage__floor {
  position: absolute;
  inset: 0;
  background-image:
    repeating-linear-gradient(
      90deg,
      transparent 0,
      transparent 28px,
      rgba(6, 122, 138, 0.05) 28px,
      rgba(6, 122, 138, 0.05) 29px
    ),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 28px,
      rgba(255, 107, 74, 0.04) 28px,
      rgba(255, 107, 74, 0.04) 29px
    );
  pointer-events: none;
}

.rug-board {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.65rem;
  max-width: 100%;
}

.rug-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.65rem;
  align-items: stretch;
  min-height: 0;
}

/* Dimension chips */
.dim {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  position: relative;
  animation: dim-in 0.6s var(--ease) both;
}

.dim--width {
  margin-left: 0;
  padding: 0 0.25rem;
  animation-delay: 0.12s;
}

.dim--width::before {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  top: 50%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(7, 28, 34, 0.35), transparent);
  z-index: 0;
}

.dim--length {
  flex-direction: row;
  width: 100%;
  height: auto;
  animation-delay: 0.2s;
}

.dim--length::before {
  content: "";
  position: absolute;
  top: 50%;
  bottom: auto;
  left: 0.5rem;
  right: 0.5rem;
  width: auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(7, 28, 34, 0.35), transparent);
  z-index: 0;
}

.dim__cap {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--coral), var(--sun));
  box-shadow: 0 0 0 4px rgba(255, 107, 74, 0.18);
  flex-shrink: 0;
  z-index: 1;
}

.dim__chip {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 0.75rem;
  min-height: 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1.5px solid rgba(15, 122, 130, 0.28);
  box-shadow:
    0 10px 28px rgba(7, 28, 34, 0.14),
    0 0 0 1px rgba(255, 255, 255, 0.8) inset;
  cursor: text;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease), transform 0.2s var(--ease);
}

.dim__chip:focus-within {
  border-color: var(--aqua);
  box-shadow:
    0 0 0 4px rgba(29, 184, 181, 0.2),
    0 14px 32px rgba(7, 28, 34, 0.16);
  transform: scale(1.05);
}

.dim__chip.is-bump {
  animation: chip-bump 0.4s var(--ease);
}

.dim__chip--vert {
  flex-direction: row;
  border-radius: 999px;
  padding: 0.55rem 0.75rem;
}

.dim__label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--coral);
}

.dim__input {
  width: 3.4rem;
  border: none;
  background: transparent;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--ink);
  padding: 0;
  outline: none;
  -moz-appearance: textfield;
}

.dim__input::-webkit-outer-spin-button,
.dim__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dim__unit {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--ink-soft);
}

/* The rug itself — sabit dikey (portre) oran */
.rug {
  position: relative;
  width: min(58vw, 210px);
  max-width: 68%;
  margin-inline: auto;
  aspect-ratio: 3 / 5;
  height: auto;
  touch-action: none;
}

.rug.is-dragging .rug__body {
  transform: scale(1.015);
}

.rug__shadow {
  position: absolute;
  left: 8%;
  right: 8%;
  bottom: -6%;
  height: 18%;
  border-radius: 50%;
  background: radial-gradient(ellipse at center, rgba(6, 80, 100, 0.32), transparent 70%);
  filter: blur(8px);
  pointer-events: none;
  z-index: 0;
}

.rug__body {
  position: relative;
  z-index: 1;
  height: 100%;
  transition: transform 0.2s var(--ease);
  filter: drop-shadow(0 18px 28px rgba(6, 80, 100, 0.28));
}

.rug__fringe {
  height: 10px;
  background:
    repeating-linear-gradient(
      90deg,
      #ffb020 0 3px,
      transparent 3px 7px
    );
  opacity: 0.95;
}

.rug__fringe--top {
  border-radius: 4px 4px 0 0;
}

.rug__fringe--bottom {
  border-radius: 0 0 4px 4px;
}

.rug__surface {
  position: relative;
  height: calc(100% - 20px);
  border-radius: 4px;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 201, 74, 0.25), transparent 42%),
    repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.07) 0 8px,
      transparent 8px 16px
    ),
    linear-gradient(145deg, #0fb8c4 0%, #067a8a 35%, #0ea8b5 65%, #055f6b 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    inset 0 -18px 30px rgba(0, 0, 0, 0.22);
  transition: background 0.3s var(--ease);
}

.rug__shine {
  display: none;
}

.carpet[data-pattern="yun"] .rug__surface {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 201, 74, 0.22), transparent 45%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.06) 0 8px, transparent 8px 16px),
    linear-gradient(145deg, #1ec98a 0%, #0f9a68 45%, #14b87a 100%);
}

.carpet[data-pattern="shaggy"] .rug__surface {
  background:
    radial-gradient(circle at 50% 40%, rgba(120, 220, 255, 0.28), transparent 50%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.07) 0 2px, transparent 2px 6px),
    linear-gradient(160deg, #3db4ff 0%, #1a7ec7 50%, #0f5f9a 100%);
}

.carpet[data-pattern="ipek"] .rug__surface {
  background:
    radial-gradient(circle at 50% 50%, rgba(255, 214, 80, 0.35), transparent 40%),
    repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.08) 0 6px, transparent 6px 14px),
    linear-gradient(145deg, #ffb020 0%, #e8890b 40%, #ffc94a 70%, #c46a00 100%);
}

.carpet[data-pattern="lekeli"] .rug__surface {
  background:
    radial-gradient(circle at 30% 40%, rgba(80, 40, 20, 0.35), transparent 25%),
    radial-gradient(circle at 70% 65%, rgba(60, 30, 15, 0.3), transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(255, 201, 74, 0.18), transparent 42%),
    linear-gradient(145deg, #0fb8c4 0%, #067a8a 40%, #0ea8b5 70%, #055f6b 100%);
}

.rug__border {
  position: absolute;
  inset: 7%;
  border: 2px solid rgba(255, 201, 74, 0.7);
  border-radius: 2px;
  box-shadow: inset 0 0 0 6px rgba(5, 60, 70, 0.3);
  pointer-events: none;
}

.rug__medallion {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 38%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%) rotate(45deg);
  border: 2px solid rgba(255, 201, 74, 0.55);
  background: radial-gradient(circle, rgba(255, 201, 74, 0.22), transparent 70%);
  pointer-events: none;
}

.rug__corner {
  position: absolute;
  width: 14%;
  aspect-ratio: 1;
  border: 1.5px solid rgba(255, 201, 74, 0.5);
  pointer-events: none;
}

.rug__corner--tl { top: 12%; left: 12%; }
.rug__corner--tr { top: 12%; right: 12%; }
.rug__corner--bl { bottom: 12%; left: 12%; }
.rug__corner--br { bottom: 12%; right: 12%; }

.rug__info {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  text-align: center;
  color: var(--white);
  pointer-events: none;
  background: radial-gradient(circle at 50% 50%, rgba(7, 28, 34, 0.4), transparent 65%);
  padding: 0.5rem;
}

.rug__m2 {
  font-size: clamp(0.75rem, 2.5vw, 0.9rem);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.92;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.rug__price {
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 6vw, 1.95rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  transition: transform 0.25s var(--ease), color 0.25s var(--ease);
}

.rug__price.is-pulse {
  animation: price-pop 0.35s var(--ease);
  color: #fff3a0;
}

.rug__handle {
  position: absolute;
  z-index: 5;
  border: none;
  padding: 0;
  display: grid;
  place-items: center;
  background: var(--white);
  box-shadow:
    0 8px 20px rgba(6, 80, 100, 0.22),
    0 0 0 3px rgba(255, 107, 74, 0.2);
  cursor: grab;
  touch-action: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.2s var(--ease), background 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.rug__handle:active {
  cursor: grabbing;
  background: var(--coral);
}

.rug__handle:hover,
.rug__handle:focus-visible {
  background: var(--coral);
  outline: none;
  box-shadow:
    0 10px 24px rgba(255, 107, 74, 0.35),
    0 0 0 4px rgba(255, 107, 74, 0.22);
}

.rug__handle-grip {
  display: block;
  width: 40%;
  height: 40%;
  border-radius: 2px;
  background: rgba(255, 107, 74, 0.45);
}

.rug__handle--e {
  top: 50%;
  right: -12px;
  width: 28px;
  height: 52px;
  border-radius: 999px;
  transform: translateY(-50%);
  cursor: ew-resize;
}

.rug__handle--e:hover,
.rug__handle--e:focus-visible,
.rug__handle--e:active {
  transform: translateY(-50%) scale(1.1);
}

.rug__handle--s {
  left: 50%;
  bottom: -12px;
  width: 52px;
  height: 28px;
  border-radius: 999px;
  transform: translateX(-50%);
  cursor: ns-resize;
}

.rug__handle--s:hover,
.rug__handle--s:focus-visible,
.rug__handle--s:active {
  transform: translateX(-50%) scale(1.1);
}

@media (min-width: 640px) {
  .rug-row {
    grid-template-columns: auto 1fr;
  }

  .dim--width {
    margin-left: calc(3.6rem + 0.55rem);
  }

  .dim--length {
    flex-direction: column;
    width: 3.6rem;
    align-self: stretch;
  }

  .dim--length::before {
    top: 0.5rem;
    bottom: 0.5rem;
    left: 50%;
    right: auto;
    width: 1px;
    height: auto;
    background: linear-gradient(180deg, transparent, rgba(7, 28, 34, 0.35), transparent);
  }

  .dim__chip--vert {
    flex-direction: column;
    border-radius: 18px;
    padding: 0.65rem 0.45rem;
    min-height: auto;
  }

  .rug {
    width: min(240px, 42%);
    max-width: 260px;
    aspect-ratio: 3 / 5;
  }
}

/* Summary */
.summary {
  padding: 1.3rem 1.2rem 1.25rem;
  position: relative;
  animation: rise 0.7s var(--ease) 0.15s both;
}

@media (min-width: 900px) {
  .summary {
    position: sticky;
    top: 5.5rem;
  }
}

.summary__top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.summary__title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
}

.summary__meta {
  margin: 0;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.summary__lines {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 220px;
  overflow: auto;
}

.summary__lines li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 0.88rem;
  color: var(--ink-soft);
  padding-bottom: 0.5rem;
  border-bottom: 1px dashed var(--line);
  animation: line-in 0.35s var(--ease) both;
}

.summary__lines strong {
  color: var(--ink);
  font-weight: 600;
  white-space: nowrap;
}

.summary__row {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.45rem;
}

.summary__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.85rem;
  padding-top: 0.9rem;
  border-top: 1.5px solid rgba(15, 122, 130, 0.2);
}

.summary__total > span:first-child {
  font-weight: 600;
}

.summary__price {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2rem);
  font-weight: 700;
  color: var(--teal-deep);
  letter-spacing: -0.02em;
  transition: transform 0.3s var(--ease);
  text-shadow: 0 8px 24px rgba(15, 122, 130, 0.18);
}

.summary__price.is-pulse {
  animation: price-pop 0.45s var(--ease);
  color: var(--aqua);
}

.summary__note {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

/* Mobile sticky bar */
.mobile-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid rgba(7, 28, 34, 0.08);
  box-shadow: 0 -12px 40px rgba(7, 28, 34, 0.14);
  transform: translateY(0);
  transition: transform 0.35s var(--ease);
}

.mobile-bar.is-hidden {
  transform: translateY(110%);
}

.mobile-bar__info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.mobile-bar__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.mobile-bar__price {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--teal-deep);
  line-height: 1.15;
}

.mobile-bar__price.is-pulse {
  animation: price-pop 0.45s var(--ease);
  color: var(--aqua);
}

@media (min-width: 900px) {
  .mobile-bar {
    display: none;
  }

  body {
    padding-bottom: 0;
  }
}

/* Footer */
.footer {
  position: relative;
  z-index: 1;
  padding: 2.5rem 1.25rem calc(3rem + var(--mobile-bar-h));
  text-align: center;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(10px);
  color: var(--ink-soft);
}

.footer__brand {
  margin: 0 0 0.35rem;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--ink);
}

.footer__copy {
  margin: 0;
  font-size: 0.9rem;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes carpet-in {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes dim-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes chip-bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.06); }
  100% { transform: scale(1); }
}

@keyframes price-pop {
  0% { transform: scale(1); }
  40% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes hint-flash {
  0%, 100% { transform: translateY(0); }
  40% { transform: translateY(-2px); color: var(--coral); }
}

@keyframes line-in {
  from {
    opacity: 0;
    transform: translateX(-6px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 899px) {
  .page-bg__layer--a,
  .page-bg__layer--b,
  .page-bg__layer--c {
    opacity: 0.18;
  }

  .page-bg__layer--c {
    display: none;
  }

  .field-block,
  .carpet,
  .summary,
  .calc__intro,
  .dim {
    animation: none;
  }
}
