:root {
  --bg: #f8f7f5;
  --card: #ffffff;
  --text: #15181d;
  --muted: #7d818a;
  --line: #e6e2dc;
  --soft: #f0ede8;
  --accent: #b99272;
  --accent-dark: #8d6a50;
  --radius-xl: 12px;
  --radius-lg: 10px;
  --radius-md: 8px;
  --shadow: 0 18px 52px rgba(22, 24, 29, 0.06);
  --shadow-sm: 0 8px 24px rgba(22, 24, 29, 0.055);
  --selector-preview-max-height: min(72vh, 780px);
}

@keyframes modalBackdropIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes modalPanelIn {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes previewMagicDim {
  0%, 100% {
    filter: brightness(1);
  }
  50% {
    filter: brightness(1.06);
  }
}

@keyframes previewMagicParallax {
  0%, 100% {
    transform: translate3d(-8%, 4%, 0) scale(1.03);
  }
  50% {
    transform: translate3d(5%, -3%, 0) scale(1.06);
  }
}

@keyframes previewRevealFlash {
  0% {
    opacity: 0;
    transform: scale(0.98);
  }
  36% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.04);
  }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 44%, #f7f5f1 100%);
  color: var(--text);
}

.product-interior-selector {
  transform-origin: top left;
}

.section {
  width: min(1920px, calc(100% - 48px));
  margin: 0 auto;
  padding: 10px 0 0;
}

.steps {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.step {
  display: flex;
  align-items: center;
  gap: 13px;
  font-weight: 600;
  font-size: 16px;
}

.step span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: #ebedf0;
  color: #53565c;
}

.step.active {
  color: var(--accent-dark);
}

.step.active span {
  background: var(--accent);
  color: #fff;
}

.step-line {
  width: 78px;
  height: 1px;
  background: var(--line);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(720px, 0.92fr);
  gap: 8px;
  align-items: start;
}

.workspace.has-history {
  grid-template-columns: minmax(620px, 1fr) minmax(720px, 0.92fr);
  gap: 8px;
}

.workspace > *,
.card,
.panel {
  min-width: 0;
}

.card {
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(12px);
}

.panel {
  padding: 22px 22px 20px;
}

.workspace > aside > .card.panel {
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding-inline: 15px;
}

.workspace > aside > .card.panel .settings {
  background: transparent;
}

.catalog-panel {
  height: calc(100vh - 24px);
  max-height: none;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  padding-inline: 15px;
}

.panel h2 {
  margin: 0 0 18px;
  font-size: 18px;
  letter-spacing: 0;
}

.upload-box {
  display: grid;
  grid-template-columns: minmax(180px, 0.72fr) minmax(260px, 1.15fr);
  gap: 18px;
  min-height: 302px;
  border: 1.5px dashed #d9d5ce;
  border-radius: var(--radius-lg);
  padding: 14px;
  background: linear-gradient(135deg, #fff, #faf9f7);
}

.upload-box.has-client-image {
  display: block;
  padding: 0;
  border: 0;
  min-height: 0;
  background: transparent;
}

.upload-box.has-client-image .drop-zone {
  display: none;
}

.drop-zone {
  min-height: 270px;
  display: grid;
  place-items: center;
  text-align: center;
  border-radius: var(--radius-lg);
  transition: 0.2s ease;
  cursor: pointer;
}

.drop-zone:hover,
.drop-zone.dragover {
  background: #f7f1eb;
}

.upload-icon {
  width: 54px;
  height: 54px;
  margin-bottom: 16px;
}

.drop-zone strong {
  display: block;
  font-size: 17px;
  margin-bottom: 9px;
}

.drop-zone small {
  color: var(--muted);
  line-height: 1.5;
}

.drop-zone small button {
  border: none;
  background: none;
  padding: 0;
  color: var(--accent-dark);
  font: inherit;
  cursor: pointer;
}

.room-preview {
  border-radius: var(--radius-lg);
  overflow: hidden;
  position: relative;
  min-height: 270px;
  background: url("../assets/rooms/sample-living.svg") center / cover no-repeat;
}

.room-preview.has-office-logo {
  background: #fff;
  border: 0;
  box-shadow: none;
}

.room-preview::before,
.room-preview::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  border-radius: inherit;
}

.room-preview::before {
  background:
    radial-gradient(circle at 24% 20%, rgba(248, 223, 168, 0.22), transparent 34%),
    radial-gradient(circle at 78% 72%, rgba(199, 161, 127, 0.24), transparent 38%),
    linear-gradient(135deg, rgba(143, 104, 79, 0.2), rgba(21, 24, 29, 0.34));
  backdrop-filter: saturate(0.96) brightness(0.86);
}

.room-preview::after {
  inset: -22%;
  background:
    linear-gradient(115deg, transparent 10%, rgba(248, 223, 168, 0.4) 36%, rgba(255, 255, 255, 0.36) 49%, rgba(178, 138, 106, 0.34) 62%, transparent 84%),
    linear-gradient(68deg, transparent 24%, rgba(248, 223, 168, 0.22) 45%, transparent 66%),
    radial-gradient(circle at 50% 50%, rgba(199, 161, 127, 0.32), transparent 46%);
  transform: translate3d(-8%, 4%, 0) scale(1.03);
  filter: drop-shadow(0 0 24px rgba(248, 223, 168, 0.48));
  mix-blend-mode: screen;
}

.office-brand-placeholder {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 12;
  width: min(72%, 320px);
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transform: translate(-50%, -50%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.office-brand-placeholder[hidden],
.room-preview.has-image .office-brand-placeholder,
.room-preview.has-result .office-brand-placeholder {
  display: none;
}

.office-brand-placeholder img {
  width: min(220px, 100%);
  max-height: 94px;
  object-fit: contain;
  display: block;
}

.room-preview.is-generating::before {
  opacity: 1;
  animation: previewMagicDim 4.8s ease-in-out infinite;
}

.room-preview.is-generating::after {
  opacity: 1;
  animation: previewMagicParallax 5.6s ease-in-out infinite;
}

.room-preview.is-reveal-flash::before {
  opacity: 1;
  background: radial-gradient(circle at 50% 45%, rgba(255, 255, 255, 0.9), rgba(248, 223, 168, 0.5) 28%, rgba(199, 161, 127, 0.2) 54%, transparent 72%);
  backdrop-filter: none;
  animation: previewRevealFlash 0.42s ease-out both;
}

.room-preview.is-reveal-flash::after {
  display: none;
}

.upload-box.has-client-image .room-preview {
  width: min(100%, calc(var(--selector-preview-max-height) * var(--preview-aspect-number, 1.7777778)));
  min-height: 0;
  aspect-ratio: var(--preview-aspect, 16 / 9);
  max-height: var(--selector-preview-max-height);
  margin: 0 auto;
  border-radius: var(--radius-lg);
  background: #fff;
}

.room-preview > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: none;
  position: absolute;
  inset: 0;
  background: #fff;
  z-index: 1;
}

.room-preview.has-image > img {
  display: block;
}

.room-preview.has-result > img {
  display: none;
}

.remove-client-photo {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 28px;
  height: 28px;
  display: none;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #3f4248;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 24, 29, 0.14);
  z-index: 90;
}

.room-preview.has-image .remove-client-photo,
.room-preview.has-result .remove-client-photo {
  display: grid;
}

body.result-expanded .room-preview > .remove-client-photo {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.settings {
  margin-top: 14px;
  padding: 14px 16px;
  border: 0;
  border-radius: var(--radius-lg);
  background: #fff;
}

.generation-history-panel {
  display: none;
  align-self: start;
  margin-top: 12px;
  padding: 0;
  max-height: max(178px, calc(100dvh - 36px - 12px - (100vw - 48px) * 0.5 * 9 / 16));
  overflow-y: auto;
  overflow-x: hidden;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  scrollbar-width: thin;
}

.generation-history-panel:not([hidden]) {
  display: block;
}

.history-head {
  display: none;
}

.history-head span {
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.history-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.25;
}

.generation-history-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  min-height: 0;
  padding: 0 0 10px;
}

.generation-history-list.is-empty {
  display: flex;
  align-items: flex-start;
  min-height: 72px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
}

.history-item {
  display: grid;
  grid-template-rows: 90px minmax(70px, auto) 34px;
  padding: 0;
  min-height: 194px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(22, 24, 29, 0.045);
}

.history-item.is-reference {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(185, 146, 114, 0.18), 0 8px 18px rgba(22, 24, 29, 0.045);
}

.history-item img {
  display: block;
  width: 100%;
  height: 90px;
  object-fit: contain;
  object-position: center;
  background: #f7f6f4;
}

.history-meta {
  min-width: 0;
  padding: 8px 8px 4px;
}

.history-meta strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-product-title {
  cursor: zoom-in !important;
}

.history-meta strong:has(.history-product-title) {
  cursor: zoom-in;
}

.history-meta strong:hover .history-product-title,
.history-product-title:hover,
.history-product-title:focus-visible {
  color: var(--accent-dark) !important;
  cursor: zoom-in !important;
}

.history-meta small {
  display: -webkit-box;
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.22;
  text-align: left;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.history-detail-list {
  display: grid;
  gap: 2px;
  margin-top: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.18;
  text-align: left;
}

.history-detail-list > span {
  display: block;
}

.history-detail-list span span,
.history-detail-list b {
  display: inline;
}

.history-detail-list b {
  color: var(--text);
  font-weight: 800;
}

.history-use {
  width: auto;
  min-width: 0;
  min-height: 28px;
  margin: 0 8px 8px;
  border: 1px solid #ded8d0;
  border-radius: 7px;
  background: #fbfaf8;
  color: var(--accent-dark);
  font: inherit;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.history-use:hover {
  border-color: var(--accent);
  background: #f5eee8;
}

.selected-title {
  margin: 0 0 14px;
  font-size: 15px;
  font-weight: 800;
}

.fields {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.field label {
  display: block;
  margin-bottom: 7px;
  color: #656971;
  font-size: 12px;
  font-weight: 700;
}

select,
input {
  width: 100%;
  height: 40px;
  border: 1px solid #dcd8d2;
  border-radius: 7px;
  background: #fff;
  padding: 0 14px;
  font: inherit;
  color: var(--text);
  outline: none;
}

select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%2314181f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 5px center;
  background-size: 18px 18px;
}

select:focus,
input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(185, 146, 114, 0.14);
}

.selected-box {
  margin-top: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
}

.selected-box {
  padding: 12px;
}

.selected-list {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
}

.empty {
  color: var(--muted);
  font-size: 14px;
}

.selected-mini-card {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 18px rgba(22, 24, 29, 0.045);
}

.selected-mini-card img {
  display: block;
  width: 100%;
  aspect-ratio: 5 / 4;
  object-fit: contain;
  object-position: center;
  background: #f7f6f4;
}

.selected-mini-card span {
  display: -webkit-box;
  min-height: 42px;
  padding: 7px 7px 9px;
  overflow: hidden;
  color: var(--text);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.22;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.catalog-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.catalog-header h2 {
  margin-bottom: 7px;
}

.hint {
  display: none;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  max-width: 620px;
}

.tabs {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.catalog-import {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  margin: 0 0 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fbfaf8;
  flex: 0 0 auto;
  min-width: 0;
}

.selector-action-cluster {
  display: contents;
}

.catalog-room-field {
  flex: 0 0 155px;
  min-width: 0;
}

.catalog-top-search {
  flex: 1 1 auto;
  min-width: 0;
}

.selector-icon-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 88px;
  width: 88px;
  min-width: 88px;
  opacity: 1 !important;
  visibility: visible !important;
}

.selector-icon-btn {
  height: 40px;
  width: 40px;
  min-width: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: #514236;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(22, 24, 29, 0.04);
  transition: border 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.selector-icon-btn {
  display: grid;
  place-items: center;
  flex: 0 0 40px;
  opacity: 1 !important;
  visibility: visible !important;
}

.selector-icon-btn svg {
  width: 21px;
  height: 21px;
  stroke: currentColor;
  stroke-width: 2.1;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.selector-icon-btn:hover {
  border-color: #d4c8bd;
  background: #fbfaf8;
  transform: translateY(-1px);
}

.cabinet-btn {
  border-color: rgba(240, 92, 20, .28);
  color: #f05c14;
}

.cabinet-btn:hover {
  border-color: #f05c14;
  background: #fff7f2;
}

.save-project-btn {
  color: #8f684f;
}

.catalog-room-field label {
  margin-bottom: 5px;
}

.catalog-category-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  flex: 0 0 auto;
}

.source-switch {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border: 1px solid #ded9d1;
  border-radius: 8px;
  background: #fff;
}

.source-btn {
  height: 32px;
  border: 0;
  border-radius: 6px;
  padding: 0 12px;
  background: transparent;
  color: #5f636b;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.source-btn.active {
  background: var(--accent);
  color: #fff;
}

.import-form {
  display: grid;
  grid-template-columns: auto auto;
  gap: 8px;
  align-items: center;
  justify-content: end;
}

.file-btn {
  height: 36px;
  min-width: 112px;
  display: inline-grid;
  place-items: center;
  padding: 0 12px;
  border: 1px solid #d5d0ca;
  border-radius: 7px;
  background: #fff;
  color: #3f4248;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.import-btn {
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--accent);
  background: #fff;
  color: var(--accent-dark);
  font-size: 13px;
  white-space: nowrap;
}

.import-status {
  grid-column: 1 / -1;
  min-height: 18px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.import-status:empty,
.import-status[hidden] {
  display: none;
}

.import-status.ok {
  color: #497554;
}

.import-status.error {
  color: #a34040;
}

.import-status.auth {
  color: #a34040;
}

.import-status-link {
  color: var(--accent-dark);
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tab {
  border: none;
  min-width: 80px;
  height: 36px;
  padding: 0 18px;
  border-radius: 8px;
  color: #53565c;
  background: #f0efed;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  transition: 0.18s ease;
}

.tab:hover {
  transform: translateY(-1px);
  background: #ebe7e1;
}

.tab.active {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 8px 18px rgba(185, 146, 114, 0.2);
}

.catalog-tools {
  display: none;
  grid-template-columns: 1fr auto;
  gap: 18px;
  margin-bottom: 14px;
  align-items: start;
  flex: 0 0 auto;
}

.search {
  position: relative;
}

.search input {
  padding-left: 44px;
}

.catalog-top-search input {
  width: 100%;
  font-size: 13px;
  padding-left: 38px;
}

.catalog-top-search img {
  left: 12px;
}

.search img {
  width: 20px;
  height: 20px;
  position: absolute;
  left: 15px;
  top: 10px;
}

.search-suggestions {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.search-suggestions.visible {
  display: flex;
}

.suggestion-chip {
  min-height: 30px;
  border: 1px solid #ded9d1;
  border-radius: 999px;
  padding: 0 11px;
  background: #fff;
  color: #5c5148;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.suggestion-chip strong {
  color: var(--accent-dark);
}

.search-summary {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.filter-btn {
  width: 48px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: #fff;
  color: #565b63;
  font-size: 18px;
  cursor: pointer;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  grid-auto-rows: 252px;
  gap: 12px;
  align-items: stretch;
  align-content: start;
  flex: 1 1 auto;
  height: 100%;
  max-height: none;
  min-height: 0;
  overflow-y: auto;
  padding: 6px 6px 0 0;
  overscroll-behavior: contain;
}

.products--doors {
  grid-auto-rows: 404px;
}

.product {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 252px;
  min-height: 252px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 8px 22px rgba(22, 24, 29, 0.045);
  cursor: pointer;
  transition: 0.18s ease;
}

.product:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px rgba(22, 24, 29, 0.07);
}

.product.selected {
  border-color: var(--line);
  box-shadow: 0 12px 28px rgba(22, 24, 29, 0.08);
}

.check {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid #d7d3cd;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  color: transparent;
  font-weight: 900;
  font-size: 12px;
  line-height: 1;
  z-index: 2;
  box-shadow: 0 5px 14px rgba(22, 24, 29, 0.12);
  opacity: 0;
}

.product.selected .check {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

.thumb {
  width: 100%;
  height: 190px;
  aspect-ratio: auto;
  flex: 0 0 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  margin-bottom: 0;
  background: #fff;
  overflow: hidden;
}

.thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
  display: block;
}

.product--door {
  height: 404px;
  min-height: 404px;
}

.product--door .thumb {
  height: 340px;
  aspect-ratio: auto;
  flex-basis: 340px;
  background: #fff;
}

.product--door .thumb img {
  object-fit: contain;
  object-position: center center;
}

.product h3 {
  margin: 0;
  padding: 10px 10px 12px;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.22;
  letter-spacing: 0;
  min-height: 0;
}

.product--door h3 {
  padding-top: 12px;
  padding-bottom: 14px;
}

.product-title-btn {
  display: -webkit-box;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: 0;
  text-align: left;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  cursor: zoom-in;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-title-btn:hover {
  color: var(--accent-dark);
}

.product p {
  display: -webkit-box;
  min-height: 32px;
  margin: 0;
  padding: 0 10px 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.34;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex: 0 0 auto;
  margin: 14px -22px -20px;
  padding: 16px 22px 20px;
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 -14px 30px rgba(22, 24, 29, 0.045);
}

.selected-inline {
  display: none;
  grid-template-columns: repeat(auto-fill, 160px);
  gap: 10px;
  min-width: 0;
  flex: 0 0 auto;
  align-self: start;
  margin: 12px 0 0;
  padding: 0;
}

.selected-inline.is-empty {
  display: none;
  align-items: center;
  min-height: 0;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.selected-inline-card {
  height: 210px;
  min-height: 210px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(22, 24, 29, 0.045);
}

.selected-inline-card:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(22, 24, 29, 0.07);
}

.selected-inline-card .thumb {
  height: 126px;
  background: #fff;
}

.selected-inline-card .thumb img {
  object-fit: contain;
}

.selected-inline-card--object .thumb img {
  object-fit: contain;
}

.selected-inline-card h3 {
  padding: 14px 10px 4px;
  font-size: 13px;
  min-height: 40px;
  display: block;
}

.selected-inline-card p {
  display: -webkit-box;
}

.btn {
  height: 48px;
  padding: 0 30px;
  border-radius: 8px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: 0.18s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  min-width: 0;
  border: 1px solid var(--accent);
  color: #fff;
  background: linear-gradient(135deg, #c2a084, #9c7658);
  box-shadow: 0 18px 34px rgba(156, 118, 88, 0.23);
}

.catalog-generate-btn {
  flex: 0 0 168px;
  width: 168px !important;
  min-width: 168px !important;
  max-width: 168px !important;
  padding: 0 8px !important;
  white-space: nowrap;
}

.magic-generate-btn {
  --magic-bronze: #b28a6a;
  --magic-beige: #c7a17f;
  --magic-coffee: #8f684f;
  --magic-glow: rgba(199, 161, 127, 0.45);
  position: relative;
  isolation: isolate;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  overflow: visible;
  min-height: 48px;
  border-radius: 999px;
  font-size: 14px !important;
  color: #fff;
  background: linear-gradient(135deg, var(--magic-beige), var(--magic-bronze) 46%, var(--magic-coffee));
}

.magic-generate-btn::before,
.magic-generate-btn::after {
  content: "";
  position: absolute;
  pointer-events: none;
  opacity: 0;
}

.magic-generate-btn::before {
  inset: -1px;
  z-index: -1;
  border-radius: inherit;
  background: linear-gradient(115deg, var(--magic-coffee), var(--magic-beige), var(--magic-bronze), var(--magic-coffee));
  background-size: 240% 240%;
  box-shadow: 0 18px 38px rgba(143, 104, 79, 0.24), 0 0 0 1px rgba(248, 223, 168, 0.18);
}

.magic-generate-btn::after {
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(105deg, transparent 0%, rgba(255, 255, 255, 0.06) 34%, rgba(248, 223, 168, 0.36) 48%, rgba(255, 255, 255, 0.07) 62%, transparent 100%);
  transform: translateX(-110%);
}

.magic-generate-btn__content {
  position: relative;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 0;
  max-width: 100%;
  line-height: 1.1;
}

.magic-generate-btn__label {
  display: block;
  overflow: visible;
  text-overflow: clip;
  font-size: 14px !important;
  line-height: 1;
}

.magic-generate-btn__spark {
  display: none;
  color: #f8dfa8;
  font-size: 14px;
  filter: drop-shadow(0 0 8px var(--magic-glow));
}

.magic-room {
  position: absolute;
  left: 18px;
  top: 50%;
  z-index: 2;
  width: 38px;
  height: 23px;
  color: #f8dfa8;
  opacity: 0;
  transform: translateY(-50%);
  filter: drop-shadow(0 0 10px var(--magic-glow));
  pointer-events: none;
}

.magic-room svg {
  display: block;
  width: 100%;
  height: 100%;
  overflow: visible;
}

.magic-room__line {
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 160;
  stroke-dashoffset: 160;
}

.magic-generate-btn__particles {
  position: absolute;
  inset: -16px 4px;
  z-index: 1;
  overflow: hidden;
  border-radius: 14px;
  opacity: 0;
  pointer-events: none;
}

.magic-generate-btn__particles span {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 999px;
  background: #f8dfa8;
  box-shadow: 0 0 12px rgba(248, 223, 168, 0.76);
}

.magic-generate-btn__particles span:nth-child(1) { left: 8%; top: 62%; animation-delay: 0s; }
.magic-generate-btn__particles span:nth-child(2) { left: 18%; top: 26%; animation-delay: 0.5s; }
.magic-generate-btn__particles span:nth-child(3) { left: 32%; top: 72%; animation-delay: 1.15s; }
.magic-generate-btn__particles span:nth-child(4) { left: 48%; top: 18%; animation-delay: 0.25s; }
.magic-generate-btn__particles span:nth-child(5) { left: 63%; top: 68%; animation-delay: 0.9s; }
.magic-generate-btn__particles span:nth-child(6) { left: 76%; top: 30%; animation-delay: 1.45s; }
.magic-generate-btn__particles span:nth-child(7) { left: 88%; top: 58%; animation-delay: 0.7s; }
.magic-generate-btn__particles span:nth-child(8) { left: 56%; top: 82%; animation-delay: 1.8s; }

.magic-generate-btn.is-loading {
  width: 100%;
  cursor: wait;
  border-color: rgba(248, 223, 168, 0.32);
  box-shadow: 0 20px 46px rgba(143, 104, 79, 0.32), 0 0 32px var(--magic-glow);
}

.magic-generate-btn.is-loading::before {
  opacity: 1;
  animation: magicGradientFlow 4.8s ease-in-out infinite;
}

.magic-generate-btn.is-loading::after {
  opacity: 1;
  animation: magicLightPass 2.8s ease-in-out infinite;
}

.magic-generate-btn.is-loading .magic-generate-btn__spark {
  display: inline-block;
  font-size: 12px;
  animation: magicSparkBreath 2.1s ease-in-out infinite;
}

.magic-generate-btn.is-loading .magic-generate-btn__content {
  gap: 6px;
  transform: none;
}

.magic-generate-btn.is-loading .magic-generate-btn__label {
  font-size: 14px;
  line-height: 1.1;
  text-align: center;
}

.magic-generate-btn.is-loading .magic-room {
  opacity: 1;
  transform: translateY(-50%);
  transition: opacity 0.32s ease, transform 0.32s ease;
}

.magic-generate-btn.is-loading .magic-room__line {
  animation: magicRoomDraw 2.6s ease-in-out infinite;
}

.magic-generate-btn.is-loading .magic-room__line--floor {
  animation-delay: 0.18s;
}

.magic-generate-btn.is-loading .magic-room__line--left {
  animation-delay: 0.34s;
}

.magic-generate-btn.is-loading .magic-generate-btn__particles {
  opacity: 1;
}

.magic-generate-btn.is-loading .magic-generate-btn__particles span {
  animation: magicParticleFloat 3.8s ease-in-out infinite;
}

.magic-generate-btn.is-success {
  border-color: rgba(248, 223, 168, 0.48);
  background: linear-gradient(135deg, #c7a17f, #b28a6a 52%, #8f684f);
  box-shadow: 0 22px 52px rgba(143, 104, 79, 0.36), 0 0 38px rgba(248, 223, 168, 0.34);
  animation: magicSuccessFlash 0.48s ease-out both;
}

@keyframes magicGradientFlow {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

@keyframes magicLightPass {
  0% { transform: translateX(-110%); }
  48%, 100% { transform: translateX(110%); }
}

@keyframes magicSparkBreath {
  0%, 100% { opacity: 0.62; transform: scale(0.92); }
  50% { opacity: 1; transform: scale(1.08); }
}

@keyframes magicRoomDraw {
  0% { stroke-dashoffset: 160; opacity: 0.2; }
  36%, 70% { stroke-dashoffset: 0; opacity: 1; }
  100% { stroke-dashoffset: -160; opacity: 0.28; }
}

@keyframes magicParticleFloat {
  0%, 100% { opacity: 0; transform: translate3d(0, 8px, 0) scale(0.75); }
  22% { opacity: 0.85; }
  68% { opacity: 0.5; transform: translate3d(6px, -14px, 0) scale(1); }
}

@keyframes magicSuccessFlash {
  0% { filter: brightness(1); }
  42% { filter: brightness(1.28); box-shadow: 0 24px 58px rgba(143, 104, 79, 0.3), 0 0 46px rgba(248, 223, 168, 0.52); }
  100% { filter: brightness(1); }
}

@media (prefers-reduced-motion: reduce) {
  .magic-generate-btn,
  .magic-generate-btn::before,
  .magic-generate-btn::after,
  .magic-generate-btn *,
  .magic-room__line,
  .room-preview::before,
  .room-preview::after {
    animation: none !important;
    transition: color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease !important;
  }

  .magic-generate-btn.is-loading {
    transform: none;
    box-shadow: 0 18px 34px rgba(156, 118, 88, 0.23);
  }

  .magic-generate-btn.is-loading::before,
  .magic-generate-btn.is-loading::after,
  .magic-generate-btn.is-loading .magic-room,
  .magic-generate-btn.is-loading .magic-generate-btn__particles {
    display: none;
  }

  .room-preview.is-generating::before {
    opacity: 1;
  }

  .room-preview.is-generating::after,
  .room-preview.is-reveal-flash::before,
  .room-preview.is-reveal-flash::after {
    display: none;
  }
}

.generation-result {
  margin-top: 20px;
  padding: 18px;
}

.generation-result[hidden] {
  display: none;
}

.generation-result__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
}

.generation-result__eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.generation-result h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0;
}

.generation-result__link {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
  background: #fff;
}

.generation-result--inline {
  position: absolute;
  inset: 0;
  z-index: 1;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: inherit;
  background: transparent;
  box-shadow: none;
}

.generation-result--inline .generation-result__link,
.generation-result--inline .generation-result__header {
  display: none;
}

.generation-result--inline .compare-frame {
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border-radius: inherit;
}

.generation-result--expanded {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  border-radius: 0;
  background: rgba(18, 16, 14, 0.55);
  backdrop-filter: blur(3px);
  box-shadow: none;
  animation: modalPanelIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

body.project-modal-open .generation-result--expanded,
body.project-modal-open .generation-result--expanded .result-expand-btn {
  display: none;
}

.generation-result--expanded .compare-frame {
  width: min(100%, calc((100vh - 48px) * var(--compare-aspect-number, 1.7777778)));
  height: auto;
  aspect-ratio: var(--compare-aspect, 16 / 9);
  max-height: calc(100vh - 48px);
  border-radius: var(--radius-xl);
  box-shadow: 0 24px 80px rgba(22, 24, 29, 0.22);
}

.image-nav {
  position: absolute;
  top: 50%;
  z-index: 10;
  width: 58px;
  height: 86px;
  display: none;
  align-items: center;
  justify-content: center;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: #fff;
  text-shadow: 0 2px 14px rgba(0, 0, 0, 0.5);
  cursor: pointer;
  transition: transform 0.18s ease, opacity 0.18s ease, color 0.18s ease;
}

.image-nav svg {
  width: 24px;
  height: 48px;
  display: block;
  overflow: visible;
  filter: drop-shadow(0 2px 12px rgba(0, 0, 0, 0.42));
}

.image-nav path {
  fill: none;
  stroke: currentColor;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.generation-result--expanded .image-nav {
  display: inline-flex;
}

.image-nav:hover {
  transform: translateY(-50%) scale(1.03);
  color: #f8f2ea;
}

.image-nav:disabled {
  opacity: 0.28;
  cursor: default;
  transform: translateY(-50%);
}

.image-nav.prev {
  left: 26px;
}

.image-nav.next {
  right: 26px;
}

.compare-frame {
  position: relative;
  width: 100%;
  aspect-ratio: var(--compare-aspect, var(--preview-aspect, 16 / 9));
  max-height: min(74vh, 820px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #1f211f;
}

.compare-frame::before,
.compare-before::before {
  content: "";
  position: absolute;
  inset: -22px;
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  filter: blur(18px);
  transform: scale(1.04);
  opacity: 0.78;
  pointer-events: none;
}

.compare-frame::before {
  z-index: 0;
  background-image: var(--compare-after-bg);
}

.compare-image {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  user-select: none;
  pointer-events: none;
  background: transparent;
}

.compare-before {
  position: absolute;
  inset: 0;
  z-index: 2;
  width: 100%;
  overflow: hidden;
  border-right: 0;
  clip-path: inset(0 calc(100% - var(--compare-position, 50%)) 0 0);
}

.compare-before::before {
  z-index: 0;
  background-image: var(--compare-before-bg);
}

.compare-before .compare-image {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  min-width: 0;
  max-width: none;
}

.compare-divider {
  position: absolute;
  z-index: 5;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  transform: translateX(-1px);
  background: rgba(57, 62, 70, 0.66);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  left: 0;
  top: 50%;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transform: translate(-50%, -50%);
  border: 2px solid rgba(57, 62, 70, 0.66);
  border-radius: 50%;
  background: rgba(57, 62, 70, 0.66);
  color: #fff;
  box-shadow: 0 10px 24px rgba(22, 24, 29, 0.22);
}

.compare-arrow {
  display: block;
  flex: 0 0 auto;
  width: 7px;
  height: 7px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.compare-arrow-left {
  transform: translateX(1px) rotate(-135deg);
}

.compare-arrow-right {
  transform: translateX(-1px) rotate(45deg);
}

.compare-range {
  position: absolute;
  z-index: 8;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: ew-resize;
}

.result-expand-btn {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 12;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(17, 19, 24, 0.62);
  color: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(22, 24, 29, 0.24);
}

.generation-result--expanded .result-expand-btn {
  display: grid;
  top: auto;
  right: 12px;
  bottom: 12px;
  left: auto;
}

body.result-expanded {
  overflow: hidden;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%) translateY(18px);
  opacity: 0;
  pointer-events: none;
  padding: 14px 18px;
  border-radius: 999px;
  background: #15181d;
  color: #fff;
  font-size: 14px;
  box-shadow: var(--shadow);
  transition: 0.25s ease;
  z-index: 20;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.modal-open {
  overflow: hidden;
}

.project-save-modal[hidden] {
  display: none;
}

.project-save-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
}

.project-save-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(21, 24, 29, 0.34);
  backdrop-filter: blur(10px);
  animation: modalBackdropIn 0.18s ease both;
}

.project-save-modal__panel {
  position: relative;
  z-index: 1;
  width: min(420px, 100%);
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 24px 70px rgba(22, 24, 29, 0.18);
  padding: 28px;
  animation: modalPanelIn 0.22s ease both;
}

.project-save-modal__panel h2 {
  margin: 0 0 18px;
  font-size: 20px;
  line-height: 1.2;
  letter-spacing: 0;
}

.project-save-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
  color: #6c625a;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.project-save-form {
  display: grid;
  gap: 14px;
}

.project-save-form label {
  display: grid;
  gap: 8px;
  color: #5f5952;
  font-size: 12px;
  font-weight: 780;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.project-save-form input,
.project-save-form select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
  padding: 0 14px;
  font: inherit;
  font-size: 14px;
  font-weight: 430;
  letter-spacing: 0;
  text-transform: none;
  outline: none;
  transition: border 0.18s ease, box-shadow 0.18s ease;
}

.project-save-form input:focus,
.project-save-form select:focus {
  border-color: #d4c8bd;
  box-shadow: 0 0 0 3px rgba(185, 146, 114, 0.13);
}

.project-save-submit {
  width: 100%;
  min-height: 48px;
  margin-top: 6px;
  border: 1px solid #111;
  border-radius: 12px;
  background: #111113;
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.12);
}

.product-modal[hidden] {
  display: none;
}

.product-modal {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  z-index: 40;
  animation: modalBackdropIn 0.22s ease both;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(18, 16, 14, 0.42);
  backdrop-filter: blur(3px);
}

.product-modal__panel {
  position: relative;
  z-index: 1;
  width: min(820px, calc(100vw - 32px));
  height: min(720px, calc(100vh - 48px));
  max-height: calc(100vh - 48px);
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(220px, 0.75fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 24px 80px rgba(22, 24, 29, 0.22);
  animation: modalPanelIn 0.24s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.product-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #3f4248;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(22, 24, 29, 0.12);
  z-index: 2;
}

.product-modal__image {
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
  object-position: center;
  background: #f7f6f4;
}

.product-modal__content {
  padding: 34px 28px;
  align-self: center;
}

.product-modal__content h2 {
  margin: 0 0 12px;
  font-size: 24px;
  line-height: 1.12;
  letter-spacing: 0;
}

.product-modal__content p {
  display: grid;
  gap: 8px;
  margin: 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
}

.product-modal__detail {
  display: block;
}

.product-modal__detail span {
  display: block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.2;
}

.product-modal__detail b {
  display: block;
  color: var(--text);
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: normal;
  word-break: normal;
}

@media (max-width: 1180px) {
  .workspace,
  .workspace.has-history {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .catalog-panel {
    height: auto;
    min-height: 0;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  }
}

@media (min-width: 1181px) {
  .product-interior-selector {
    zoom: 0.9;
  }

  .catalog-panel {
    height: calc((100dvh - 24px) / 0.9);
  }

  .generation-history-panel {
    max-height: max(178px, calc((100dvh - 36px - 12px) / 0.9 - (100vw - 48px) * 0.5 * 9 / 16));
  }
}

@media (max-width: 560px) {
  .section {
    width: calc(100vw - 28px);
    max-width: calc(100vw - 28px);
    padding-top: 28px;
  }

  .steps {
    gap: 10px 8px;
    max-width: 100%;
  }

  .step {
    gap: 7px;
    font-size: 12px;
  }

  .step span {
    width: 30px;
    height: 30px;
  }

  .step-line {
    display: none;
  }

  .upload-box,
  .fields {
    grid-template-columns: 1fr;
  }

  .workspace > aside > .card.panel {
    display: block;
  }

  .generation-history-panel {
    position: static;
    max-height: 360px;
    margin-bottom: 14px;
    padding-right: 0;
    overflow-y: auto;
  }

  .generation-history-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-tools {
    grid-template-columns: 1fr auto;
  }

  .catalog-import,
  .import-form {
    grid-template-columns: 1fr;
  }

  .selector-action-cluster {
    justify-self: stretch;
    width: 100%;
    min-width: 0;
  }

  .selector-icon-actions {
    justify-content: flex-start;
    width: auto;
    min-width: 0;
  }

  .products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 226px;
    gap: 12px;
    flex-basis: 362px;
    height: 362px;
  }

  .products--doors {
    grid-auto-rows: 358px;
    flex-basis: 638px;
    height: 638px;
  }

  .selected-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .product {
    height: 226px;
    min-height: 226px;
    padding: 0;
  }

  .thumb {
    height: 166px;
    aspect-ratio: auto;
    flex-basis: 166px;
    margin-bottom: 0;
  }

  .product--door {
    height: 358px;
    min-height: 358px;
  }

  .product--door .thumb {
    height: 300px;
    aspect-ratio: auto;
    flex-basis: 300px;
  }

  .product h3 {
    font-size: 15px;
  }

  .product p {
    font-size: 13px;
  }

  .actions {
    flex-direction: column-reverse;
    margin: 14px -22px -20px;
  }

  .product-modal {
    padding: 14px;
  }

  .product-modal__panel {
    grid-template-columns: 1fr;
    width: calc(100vw - 28px);
    height: auto;
  }

  .product-modal__image {
    min-height: 260px;
    max-height: 46vh;
  }

  .product-modal__content {
    padding: 22px 20px 24px;
  }

  .btn,
  .btn-primary {
    width: 100%;
  }
}
