.cnwv {
  --cnwv-ink: #27231f;
  --cnwv-muted: #736b62;
  --cnwv-line: #ddd4c9;
  --cnwv-paper: #fffaf3;
  --cnwv-panel: #f7f1e9;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
  width: 100%;
  margin: 0 auto;
  color: var(--cnwv-ink);
  font-family: inherit;
}

.cnwv * {
  box-sizing: border-box;
}

.cnwv__stage,
.cnwv__controls {
  min-width: 0;
}

.cnwv__stage {
  position: relative;
  display: grid;
  width: 100%;
  gap: 14px;
}

.cnwv__room {
  --cnwv-wall-color: #e9d0aa;
  --cnwv-aspect-ratio: 1310 / 926;
  position: relative;
  width: 100%;
  aspect-ratio: var(--cnwv-aspect-ratio);
  min-height: 0;
  overflow: hidden;
  border: 1px solid var(--cnwv-line);
  border-radius: 8px;
  background: #f2eee6;
  box-shadow: 0 18px 50px rgba(55, 42, 31, 0.13);
  transition: background-color 180ms ease, filter 180ms ease;
}

.cnwv__canvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.cnwv__room::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  background:
    radial-gradient(circle at 11% 34%, rgba(255, 255, 255, 0.12), transparent 26%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 32%, rgba(0, 0, 0, 0.06)),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 42%, rgba(0, 0, 0, 0.055));
  pointer-events: none;
}

.cnwv__image-actions {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 3;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.cnwv__color-open,
.cnwv__texture-open,
.cnwv__room-open {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.68);
  border-radius: 999px;
  background: rgba(39, 35, 31, 0.82);
  box-shadow: 0 12px 26px rgba(30, 24, 18, 0.22);
  color: #fff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.cnwv__color-open[hidden],
.cnwv__texture-open[hidden] {
  display: none;
}

.cnwv__color-open,
.cnwv__room-open {
  text-align: left;
}

.cnwv.is-wohnung .cnwv__room-open {
  margin-left: 12px;
}

.cnwv__color-open > span:last-child,
.cnwv__room-open > span:last-child {
  min-width: 0;
}

.cnwv__color-dot,
.cnwv__room-icon {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
}

.cnwv__color-dot {
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: #e9d0aa;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.16);
}

.cnwv__room-icon {
  position: relative;
  color: #fff;
}

.cnwv__room-icon::before,
.cnwv__room-icon::after {
  content: "";
  position: absolute;
  display: block;
}

.cnwv__room-icon--living::before {
  left: 3px;
  right: 3px;
  bottom: 5px;
  height: 9px;
  border: 2px solid currentColor;
  border-top-width: 4px;
  border-radius: 5px 5px 3px 3px;
}

.cnwv__room-icon--living::after {
  left: 1px;
  right: 1px;
  bottom: 2px;
  height: 5px;
  border: 2px solid currentColor;
  border-top: 0;
  border-radius: 0 0 4px 4px;
}

.cnwv__room-icon--kitchen::before {
  left: 4px;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: inset 0 -8px 0 rgba(255, 255, 255, 0.24);
}

.cnwv__room-icon--kitchen::after {
  left: 7px;
  right: 7px;
  top: 10px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 5px 0 currentColor;
}

.cnwv__room-icon--kids::before {
  left: 2px;
  bottom: 3px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 3px;
  box-shadow: 10px 0 0 -2px rgba(255, 255, 255, 0.22), 10px 0 0 0 currentColor;
}

.cnwv__room-icon--kids::after {
  left: 8px;
  bottom: 13px;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.cnwv__button-label,
.cnwv__color-open strong,
.cnwv__room-open strong {
  display: block;
  line-height: 1.15;
}

.cnwv__button-label {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.78;
}

.cnwv__color-open strong,
.cnwv__room-open strong {
  margin-top: 2px;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cnwv__color-open:hover,
.cnwv__color-open:focus-visible,
.cnwv__texture-open:hover,
.cnwv__texture-open:focus-visible,
.cnwv__room-open:hover,
.cnwv__room-open:focus-visible {
  background: rgba(39, 35, 31, 0.94);
  outline: none;
}

.cnwv__ceiling,
.cnwv__left-wall,
.cnwv__window,
.cnwv__art,
.cnwv__shelf,
.cnwv__plant,
.cnwv__sofa,
.cnwv__table,
.cnwv__rug,
.cnwv__floor {
  display: none;
}

.cnwv__ceiling {
  position: absolute;
  inset: 0 0 auto;
  height: 62px;
  background: linear-gradient(#f7f0e6, #eadfce);
  clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
}

.cnwv__left-wall {
  position: absolute;
  inset: 54px auto 128px 0;
  width: 22%;
  background: rgba(74, 55, 43, 0.12);
  clip-path: polygon(0 0, 100% 8%, 100% 100%, 0 100%);
}

.cnwv__floor {
  position: absolute;
  inset: auto 0 0;
  height: 148px;
  background:
    linear-gradient(115deg, rgba(255, 255, 255, 0.22), transparent 32%),
    repeating-linear-gradient(90deg, #a9744b 0 76px, #9f6b43 76px 82px, #b07d55 82px 154px);
  clip-path: polygon(0 24%, 100% 0, 100% 100%, 0 100%);
}

.cnwv__window {
  position: absolute;
  top: 92px;
  right: 9%;
  width: 168px;
  height: 168px;
  border: 10px solid #fbf7ef;
  background: linear-gradient(135deg, #d8edf2, #f6e6c8);
  box-shadow: 0 12px 24px rgba(59, 45, 34, 0.16);
}

.cnwv__window span {
  position: absolute;
  background: rgba(255, 255, 255, 0.82);
}

.cnwv__window span:first-child {
  inset: 0 auto 0 50%;
  width: 8px;
  transform: translateX(-50%);
}

.cnwv__window span:last-child {
  inset: 50% 0 auto;
  height: 8px;
  transform: translateY(-50%);
}

.cnwv__art {
  position: absolute;
  top: 118px;
  width: 72px;
  height: 96px;
  border: 8px solid #f9f2e8;
  box-shadow: 0 10px 20px rgba(57, 43, 34, 0.16);
}

.cnwv__art--one {
  left: 28%;
  background: linear-gradient(150deg, #576c62 0 45%, #d3a96d 45% 64%, #f1e0c8 64%);
}

.cnwv__art--two {
  left: calc(28% + 92px);
  background: linear-gradient(145deg, #b88772 0 38%, #eee0c9 38% 68%, #536d85 68%);
}

.cnwv__shelf {
  position: absolute;
  top: 276px;
  right: 10%;
  width: 178px;
  height: 12px;
  background: #6b4b35;
  box-shadow: 0 10px 16px rgba(54, 41, 31, 0.18);
}

.cnwv__shelf span {
  position: absolute;
  bottom: 12px;
  width: 28px;
  border-radius: 3px 3px 0 0;
}

.cnwv__shelf span:nth-child(1) {
  left: 18px;
  height: 48px;
  background: #385f68;
}

.cnwv__shelf span:nth-child(2) {
  left: 54px;
  height: 34px;
  background: #c58b43;
}

.cnwv__shelf span:nth-child(3) {
  right: 24px;
  height: 58px;
  background: #f2e6d5;
}

.cnwv__plant {
  position: absolute;
  right: 15%;
  bottom: 124px;
  width: 72px;
  height: 132px;
}

.cnwv__plant::after {
  content: "";
  position: absolute;
  left: 19px;
  bottom: 0;
  width: 34px;
  height: 46px;
  border-radius: 0 0 12px 12px;
  background: #886649;
}

.cnwv__plant i {
  position: absolute;
  bottom: 38px;
  width: 46px;
  height: 74px;
  border-radius: 80% 0 80% 0;
  background: #506f4d;
  transform-origin: bottom center;
}

.cnwv__plant i:nth-child(1) {
  left: 6px;
  transform: rotate(-28deg);
}

.cnwv__plant i:nth-child(2) {
  left: 18px;
  height: 88px;
  background: #5c815a;
}

.cnwv__plant i:nth-child(3) {
  right: 4px;
  transform: rotate(26deg) scaleX(-1);
}

.cnwv__sofa {
  position: absolute;
  left: 12%;
  bottom: 112px;
  width: min(420px, 66%);
  height: 172px;
}

.cnwv__sofa-back,
.cnwv__sofa-seat {
  position: absolute;
  display: block;
  border-radius: 8px;
  background: #6f7d76;
}

.cnwv__sofa-back {
  inset: 18px 22px 54px;
  box-shadow: inset 0 18px 0 rgba(255, 255, 255, 0.08);
}

.cnwv__sofa-seat {
  inset: auto 0 20px;
  height: 70px;
  background: #607269;
  box-shadow: 0 22px 28px rgba(51, 38, 29, 0.18);
}

.cnwv__sofa::before,
.cnwv__sofa::after {
  content: "";
  position: absolute;
  bottom: 22px;
  width: 52px;
  height: 88px;
  border-radius: 8px;
  background: #586a62;
}

.cnwv__sofa::before {
  left: 0;
}

.cnwv__sofa::after {
  right: 0;
}

.cnwv__cushion {
  position: absolute;
  bottom: 82px;
  width: 78px;
  height: 58px;
  border-radius: 7px;
  box-shadow: inset 0 8px 0 rgba(255, 255, 255, 0.12);
}

.cnwv__cushion--one {
  left: 86px;
  background: #d5b678;
}

.cnwv__cushion--two {
  left: 178px;
  background: #b66d59;
}

.cnwv__table {
  position: absolute;
  left: 37%;
  bottom: 70px;
  width: 154px;
  height: 48px;
  border-radius: 50%;
  background: #5f432f;
  box-shadow: 0 22px 26px rgba(45, 34, 25, 0.16);
}

.cnwv__rug {
  position: absolute;
  left: 20%;
  bottom: 38px;
  width: 46%;
  height: 72px;
  border-radius: 50%;
  background: rgba(239, 225, 204, 0.7);
}

.cnwv__selected {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--cnwv-line);
  border-radius: 8px;
  background: var(--cnwv-paper);
}

.cnwv__selected-label,
.cnwv__selected span:last-child {
  color: var(--cnwv-muted);
  font-size: 13px;
}

.cnwv__selected strong {
  font-size: 20px;
  line-height: 1.2;
}

.cnwv__controls {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 20px;
  border: 1px solid var(--cnwv-line);
  border-radius: 8px;
  background: var(--cnwv-paper);
}

.cnwv__modal[hidden] {
  display: none;
}

.cnwv__modal {
  position: fixed;
  inset: 0;
  z-index: 99999;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(29, 25, 22, 0.58);
}

.cnwv__modal-panel {
  display: grid;
  gap: 16px;
  width: min(980px, 100%);
  max-height: min(86vh, 820px);
  padding: 20px;
  overflow: hidden;
  border: 1px solid var(--cnwv-line);
  border-radius: 8px;
  background: var(--cnwv-paper);
  box-shadow: 0 26px 80px rgba(24, 19, 15, 0.32);
}

.cnwv__modal-panel--small {
  width: min(520px, 100%);
}

.cnwv__modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.cnwv__modal-head strong {
  font-size: 22px;
  line-height: 1.2;
}

.cnwv__modal-close {
  appearance: none;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--cnwv-line);
  border-radius: 50%;
  background: #fff;
  color: var(--cnwv-ink);
  font: inherit;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.cnwv__heading h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
}

.cnwv__heading p {
  margin: 0;
  color: var(--cnwv-muted);
  font-size: 16px;
  line-height: 1.55;
}

.cnwv__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cnwv__filters button,
.cnwv__texture button,
.cnwv__texture-options button,
.cnwv__swatch {
  appearance: none;
  border: 1px solid var(--cnwv-line);
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.cnwv__filters button,
.cnwv__texture button,
.cnwv__texture-options button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 999px;
  background: #fff;
  color: #4d463f;
  transition: background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.cnwv__texture-options button .cnwv__room-icon {
  width: 18px;
  height: 18px;
}

.cnwv__texture-options button:hover,
.cnwv__texture-options button:focus-visible {
  border-color: #8b765f;
  background: #f2eadf;
  color: #2f2923;
  box-shadow: 0 4px 12px rgba(47, 41, 35, 0.12);
  outline: none;
  transform: translateY(-1px);
}

.cnwv__texture-options button:active {
  box-shadow: 0 2px 7px rgba(47, 41, 35, 0.16);
  transform: translateY(1px) scale(0.98);
}

.cnwv__filters button.is-active,
.cnwv__texture button.is-active,
.cnwv__texture-options button.is-active {
  border-color: #3f342b;
  background: #3f342b;
  color: #fff;
}

.cnwv__texture-options button.is-active:hover,
.cnwv__texture-options button.is-active:focus-visible {
  border-color: #3f342b;
  background: #3f342b;
  color: #fff;
}

.cnwv__texture-options button.is-active:active {
  transform: translateY(1px) scale(0.98);
}

.cnwv__texture {
  display: grid;
  gap: 8px;
  color: var(--cnwv-muted);
  font-size: 13px;
}

.cnwv__texture-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.cnwv__search {
  display: grid;
  gap: 7px;
  color: var(--cnwv-muted);
  font-size: 13px;
}

.cnwv__search input {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--cnwv-line);
  border-radius: 6px;
  background: #fff;
  color: var(--cnwv-ink);
  font: inherit;
}

.cnwv__palette {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 10px;
  max-height: 560px;
  overflow: auto;
  padding-right: 4px;
}

.cnwv__swatch {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 2px 9px;
  align-items: center;
  min-height: 58px;
  padding: 9px;
  border-radius: 7px;
  background: #fff;
  text-align: left;
}

.cnwv__swatch span {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--swatch-color);
  border: 1px solid rgba(0, 0, 0, 0.12);
}

.cnwv__swatch strong,
.cnwv__swatch small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cnwv__swatch strong {
  font-size: 13px;
  line-height: 1.2;
}

.cnwv__swatch small {
  color: var(--cnwv-muted);
  font-size: 12px;
}

.cnwv__swatch:hover,
.cnwv__swatch:focus-visible,
.cnwv__swatch.is-selected {
  border-color: #2f2923;
  box-shadow: 0 0 0 2px rgba(47, 41, 35, 0.12);
  outline: none;
}

.cnwv__empty {
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--cnwv-line);
  border-radius: 8px;
  color: var(--cnwv-muted);
}

.cnwv__notice {
  margin: -2px 0 0;
  color: var(--cnwv-muted);
  font-size: 12px;
  line-height: 1.35;
  text-align: right;
}

@media (max-width: 900px) {
  .cnwv__image-actions {
    position: static;
    order: -1;
    justify-content: stretch;
  }

  .cnwv__color-open,
  .cnwv__room-open {
    flex: 1 1 calc(50% - 5px);
    max-width: calc(50% - 5px);
    min-width: 0;
  }

  .cnwv__modal {
    padding: 14px;
  }

  .cnwv__modal-panel {
    max-height: calc(100dvh - 28px);
  }

  .cnwv__palette {
    max-height: calc(100dvh - 260px);
  }
}

@media (max-width: 767px) {
  .cnwv {
    gap: 16px;
  }

  .cnwv__room {
    width: 100%;
    min-height: clamp(220px, 70vw, 380px);
    border-radius: 6px;
  }

  .cnwv__image-actions {
    gap: 6px;
  }

  .cnwv__color-open,
  .cnwv__room-open {
    flex: 1 1 calc(50% - 3px);
    max-width: calc(50% - 3px);
    min-width: 0;
    min-height: 36px;
    gap: 7px;
    justify-content: center;
    padding: 7px 9px;
    border-width: 1px;
    box-shadow: 0 8px 18px rgba(30, 24, 18, 0.18);
    text-align: center;
  }

  .cnwv__color-dot {
    width: 18px;
    height: 18px;
    border-width: 1px;
  }

  .cnwv__button-label {
    font-size: 10px;
  }

  .cnwv__color-open strong,
  .cnwv__room-open strong {
    font-size: 12px;
  }

  .cnwv__modal {
    align-items: center;
    padding: 8px;
  }

  .cnwv__modal-panel {
    gap: 12px;
    max-height: calc(100dvh - 16px);
    padding: 14px;
    border-radius: 8px;
  }

  .cnwv__modal-head strong {
    font-size: 19px;
  }

  .cnwv__modal-close {
    width: 34px;
    height: 34px;
    font-size: 22px;
  }

  .cnwv__filters {
    flex-wrap: nowrap;
    margin: 0 -14px;
    padding: 0 14px 4px;
    overflow-x: auto;
  }

  .cnwv__filters button,
  .cnwv__texture button,
  .cnwv__texture-options button {
    flex: 0 0 auto;
    min-height: 34px;
    padding: 7px 10px;
  }

  .cnwv__search input {
    min-height: 40px;
  }

  .cnwv__palette {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    max-height: calc(100dvh - 250px);
    padding-right: 0;
  }

  .cnwv__swatch {
    grid-template-columns: 26px minmax(0, 1fr);
    min-height: 50px;
    gap: 2px 7px;
    padding: 7px;
  }

  .cnwv__swatch span {
    width: 26px;
    height: 26px;
  }

  .cnwv__swatch strong {
    font-size: 12px;
  }

  .cnwv__swatch small {
    font-size: 11px;
  }

  .cnwv__window,
  .cnwv__shelf,
  .cnwv__plant {
    transform: scale(0.78);
    transform-origin: top right;
  }

  .cnwv__sofa {
    left: 7%;
    width: 72%;
  }

  .cnwv__art {
    transform: scale(0.78);
    transform-origin: top left;
  }
}
