:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --text: #16181d;
  --muted: #666b75;
  --line: #dfe3ea;
  --soft: #f5f6f8;
  --blue: #1264ee;
  --blue-dark: #0d4fd0;
  --shadow: 0 18px 45px rgba(36, 42, 54, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #ffffff;
  color: var(--text);
}

body.has-product-overlay {
  overflow: hidden;
}

button {
  border: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.app-shell {
  width: min(100%, 1080px);
  margin: 0 auto;
  padding: 16px 40px 40px;
}

.selector {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 470px) auto;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 0 0 28px;
}

.topic-search {
  position: relative;
  min-width: 0;
}

.topic-select {
  display: grid;
  grid-template-columns: 68px 1fr 28px;
  align-items: center;
  gap: 18px;
  width: min(470px, 100%);
  max-width: 470px;
  min-width: 0;
  height: 98px;
  padding: 12px 24px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(40, 48, 62, 0.04);
  text-align: left;
}

.topic-select img {
  width: 68px;
  height: 68px;
  border: 3px solid #076dff;
  border-radius: 7px;
  object-fit: cover;
}

.topic-select span {
  min-width: 0;
  font-size: 25px;
  line-height: 1.1;
}

.topic-panel {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  z-index: 25;
  width: min(470px, calc(100vw - 28px));
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(36, 42, 54, 0.14);
}

.topic-panel[hidden] {
  display: none;
}

.topic-search-field {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.topic-search-field span {
  color: var(--muted);
  font-size: 13px;
}

.topic-search-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  outline: none;
}

.topic-search-field input:focus {
  border-color: #0874ff;
  box-shadow: 0 0 0 3px rgba(8, 116, 255, 0.12);
}

.topic-suggestions {
  display: grid;
  gap: 8px;
  max-height: 310px;
  overflow: auto;
}

.topic-suggestion {
  display: grid;
  grid-template-columns: 50px 1fr auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
}

.topic-suggestion:hover,
.topic-suggestion.is-active {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.topic-suggestion img {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.topic-suggestion span {
  min-width: 0;
  font-size: 16px;
  line-height: 1.2;
}

.topic-suggestion small {
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
}

.topic-suggestion-create {
  grid-template-columns: 1fr auto;
}

.empty-topic {
  margin: 0;
  padding: 12px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.preview-card {
  position: relative;
  width: 100%;
  aspect-ratio: 1.42;
  overflow: hidden;
  border-radius: 30px;
  background: #e7dfd7;
  box-shadow: var(--shadow);
}

.room-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.wall-set {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  pointer-events: none;
}

.wall-canvas {
  position: relative;
  width: 100%;
  height: 100%;
  aspect-ratio: 1;
  pointer-events: auto;
}

.wall-canvas.is-free-layout {
  aspect-ratio: auto;
}

.wall-art {
  position: absolute;
  padding: 0;
  border: clamp(1px, 0.28vw, 3px) solid #0c0e13;
  background: #0c0e13;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.35);
  transition: top 240ms ease, left 240ms ease, width 240ms ease, height 240ms ease, transform 160ms ease;
}

.wall-canvas.is-layout-switching .wall-art {
  transition: none;
}

.wall-art:hover {
  transform: translateY(-2px);
}

.free-wall-art {
  cursor: grab;
  touch-action: none;
  transition: transform 160ms ease;
  backface-visibility: hidden;
  will-change: left, top;
}

.free-wall-art:active {
  cursor: grabbing;
}

.free-delete-button {
  position: absolute;
  top: -16px;
  right: -16px;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #e03131;
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.free-replace-button {
  position: absolute;
  top: -16px;
  left: -16px;
  z-index: 5;
  display: grid;
  place-items: center;
  min-width: 54px;
  height: 34px;
  padding: 0 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #0874ff;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.22);
}

.wall-art.is-active {
  outline: 4px solid #0874ff;
  outline-offset: 3px;
  z-index: 4;
}

.wall-art img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.wall-art.is-missing {
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, transparent 48%, rgba(255, 255, 255, 0.55) 49%, rgba(255, 255, 255, 0.55) 51%, transparent 52%),
    #2b2f38;
}

.wall-art.is-missing::after {
  content: attr(data-label);
  color: #fff;
  font-size: 16px;
}

.wall-art.is-missing img {
  display: none;
}

.data-error {
  align-self: start;
  justify-self: center;
  max-width: min(520px, 90%);
  margin: 24px 0 0;
  padding: 12px 14px;
  border: 1px solid #f0b7b7;
  border-radius: 8px;
  background: #fff7f7;
  color: #8a1f1f;
  font-size: 15px;
}

.secondary-action {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 12;
  display: grid;
  place-items: center;
  gap: 8px;
  width: 118px;
  height: 98px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(31, 38, 50, 0.05);
  transform: translateX(-50%);
}

.secondary-action svg {
  width: 30px;
  height: 30px;
}

.secondary-action span {
  font-size: 15px;
  line-height: 1.1;
  text-align: center;
}

.product-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  justify-self: end;
  min-width: 136px;
  min-height: 0;
}

.product-page-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(31, 38, 50, 0.05);
}

.product-page-button:hover {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.product-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.product-page-button svg {
  width: 20px;
  height: 20px;
}

.product-page-count {
  min-width: 54px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.layout-panel {
  position: absolute;
  left: 50%;
  right: auto;
  top: auto;
  bottom: 12px;
  z-index: 35;
  width: calc(100% - 24px);
  max-width: 860px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 45px rgba(36, 42, 54, 0.14);
  transform: translateX(-50%);
}

.layout-panel[hidden] {
  display: none;
}

.layout-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.layout-panel-header h2 {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
}

.layout-options {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding: 2px 6px 8px 2px;
  scrollbar-width: thin;
}

.layout-option {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 3px;
  width: 86px;
  height: 90px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: center;
}

.layout-option-back {
  align-self: stretch;
  min-width: 94px;
}

.layout-option-back .free-layout-icon {
  aspect-ratio: auto;
  min-height: 66px;
}

.layout-option:hover,
.layout-option.is-active {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.14);
}

.layout-option:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.layout-option:disabled:hover {
  border-color: var(--line);
  box-shadow: none;
}

.layout-option img {
  display: block;
  width: 70%;
  max-height: 70px;
  justify-self: center;
  border-radius: 6px;
  object-fit: contain;
}

.free-layout-icon {
  display: grid;
  place-items: center;
  width: 70%;
  height: 70px;
  justify-self: center;
  border-radius: 6px;
  color: var(--text);
  font-size: 20px;
  font-weight: 700;
}

.free-layout-size-icon {
  display: grid;
  place-items: center;
  width: max-content;
  min-width: 86px;
  min-height: 38px;
  padding: 0 12px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
}

.free-layout-group {
  display: grid;
  grid-template-columns: 54px auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 14px;
  min-height: 86px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(36, 42, 54, 0.16);
}

.free-layout-ratio-icon {
  display: block;
  justify-self: center;
  border: 2px solid var(--free-group-color);
  background: #fff;
}

.free-layout-ratio-square {
  width: 34px;
  height: 34px;
}

.free-layout-ratio-portrait {
  width: 28px;
  height: 52px;
}

.free-layout-ratio-landscape {
  width: 52px;
  height: 28px;
}

.free-layout-ratio-tall {
  width: 28px;
  height: 66px;
}

.free-layout-ratio-wide {
  width: 66px;
  height: 28px;
}

.free-layout-size-list {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  gap: 6px 10px;
}

.free-size-option {
  min-width: 90px;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--free-group-color);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  white-space: nowrap;
}

.free-size-option:hover,
.free-size-option.is-active {
  box-shadow: 0 0 0 3px rgba(8, 116, 255, 0.16);
  filter: brightness(0.94);
}

.free-layout-group-yellow {
  --free-group-color: #f2c200;
}

.free-layout-group-blue {
  --free-group-color: #2fa4cf;
}

.free-layout-group-pink {
  --free-group-color: #e12b7f;
}

.free-layout-group-green {
  --free-group-color: #83bf3e;
}

.free-layout-group-orange {
  --free-group-color: #f26d12;
}

.layout-option span {
  font-size: 14px;
  line-height: 1.1;
  overflow-wrap: anywhere;
}

.replacement-panel {
  position: relative;
  margin-top: 22px;
  padding: 22px 24px 26px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 10px 28px rgba(36, 42, 54, 0.06);
}

.replacement-overlay {
  position: absolute;
  left: 22px;
  right: 22px;
  top: 22px;
  bottom: 22px;
  z-index: 30;
  display: flex;
  flex-direction: column;
  margin-top: 0;
  overflow: hidden;
  box-shadow: 0 22px 60px rgba(20, 24, 32, 0.24);
}

.replacement-panel[hidden] {
  display: none;
}

.replacement-panel header {
  position: absolute;
  top: 18px;
  right: 18px;
  z-index: 2;
}

.icon-action {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.icon-action svg {
  width: 22px;
  height: 22px;
}

.replacement-preview {
  display: grid;
  place-items: center;
  min-height: 0;
  margin: 0 0 18px;
}

.replacement-preview-frame {
  display: grid;
  place-items: center;
  max-width: min(420px, 72%);
  max-height: min(360px, 42vh);
  border: clamp(1px, 0.28vw, 3px) solid #0c0e13;
  background: #0c0e13;
}

.replacement-preview-frame img {
  display: block;
  max-width: 100%;
  max-height: min(350px, 40vh);
  object-fit: contain;
}

.replacement-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, 60px);
  grid-auto-flow: row dense;
  justify-content: start;
  align-content: start;
  flex: 1;
  min-height: 0;
  gap: 6px;
  overflow: auto;
  padding-right: 0;
}

.replacement-item {
  display: grid;
  place-items: center;
  min-width: 0;
  width: 60px;
  height: 60px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  text-align: left;
  line-height: 0;
}

.replacement-item:hover {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.replacement-frame {
  display: block;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 6px;
  background: var(--soft);
  line-height: 0;
}

.replacement-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transform-origin: center;
}

.replacement-item[data-ratio="3:2"] {
  width: 87px;
}

.replacement-item[data-ratio="3:2"] .replacement-frame {
  width: 81px;
  height: 54px;
}

.replacement-list[data-ratio="3:2"] {
  grid-template-columns: repeat(auto-fit, minmax(78px, 1fr));
  justify-content: stretch;
}

.replacement-list[data-ratio="3:2"] .replacement-item {
  width: 100%;
  max-width: none;
}

.replacement-list[data-ratio="3:2"] .replacement-frame {
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
}

.replacement-item[data-ratio="1:2"] {
  width: 36px;
}

.replacement-item[data-ratio="1:2"] .replacement-frame {
  width: 27px;
  height: 54px;
}

.replacement-list[data-ratio="1:2"] {
  grid-template-columns: repeat(auto-fit, 36px);
  justify-content: center;
}

.replacement-list[data-ratio="1:2"] .replacement-frame {
  width: 27px;
  aspect-ratio: 1 / 2;
  height: auto;
}

.replacement-item[data-ratio="2:1"] {
  width: 60px;
  height: 36px;
}

.replacement-item[data-ratio="2:1"] .replacement-frame {
  width: 54px;
  height: 27px;
}

.replacement-list[data-ratio="2:1"] {
  grid-template-columns: repeat(auto-fit, 60px);
  justify-content: center;
}

.replacement-list[data-ratio="2:1"] .replacement-frame {
  width: 54px;
  aspect-ratio: 2 / 1;
  height: auto;
}

.replacement-item[data-ratio="2:3"] {
  width: 42px;
}

.replacement-item[data-ratio="2:3"] .replacement-frame {
  width: 36px;
  height: 54px;
}

.replacement-list[data-ratio="2:3"] {
  grid-template-columns: repeat(auto-fit, 42px);
  justify-content: center;
}

.replacement-list[data-ratio="2:3"] .replacement-frame {
  width: 36px;
  aspect-ratio: 2 / 3;
  height: auto;
}

.empty-replacements {
  grid-column: 1 / -1;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.gallery-shell {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 12px 10px 28px;
}

.gallery-controls {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  gap: 10px;
  margin: 0 -10px 12px;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(10px);
}

.gallery-search-field {
  display: grid;
  gap: 6px;
}

.gallery-search-field span {
  color: var(--muted);
  font-size: 12px;
}

.gallery-search-field input {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  font-size: 15px;
  outline: none;
}

.gallery-search-field input:focus {
  border-color: #0874ff;
  box-shadow: 0 0 0 3px rgba(8, 116, 255, 0.12);
}

.gallery-topic-list {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.gallery-topic-list::-webkit-scrollbar {
  display: none;
}

.gallery-topic {
  display: inline-grid;
  grid-template-columns: auto auto;
  align-items: center;
  flex: 0 0 auto;
  gap: 7px;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.gallery-topic:hover,
.gallery-topic.is-active {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.gallery-topic span {
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.gallery-topic small {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.gallery-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
}

.gallery-page-button {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.gallery-page-button:hover {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.gallery-page-button:disabled {
  cursor: not-allowed;
  opacity: 0.38;
  box-shadow: none;
}

.gallery-page-button svg {
  width: 20px;
  height: 20px;
}

.gallery-page-count {
  min-width: 64px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.set-gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.set-card {
  position: relative;
  display: block;
  width: 100%;
  padding: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 6px 18px rgba(31, 38, 50, 0.05);
  text-align: left;
}

.set-card:hover {
  border-color: #0874ff;
  box-shadow: 0 0 0 2px rgba(8, 116, 255, 0.12);
}

.set-card img {
  display: block;
  width: 100%;
  height: auto;
  background: var(--soft);
}

.set-card-meta {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: 26px 8px 8px;
  background: linear-gradient(to top, rgba(12, 14, 19, 0.68), rgba(12, 14, 19, 0));
  color: #fff;
}

.set-card-meta h2 {
  margin: 0 0 2px;
  font-weight: 400;
  font-size: 14px;
  line-height: 1.15;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.32);
}

.set-card-meta p {
  margin: 0;
  overflow: hidden;
  color: #ff8a00;
  font-weight: 700;
  font-size: 11px;
  line-height: 1.3;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.28);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 14px;
}

.product-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
}

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

.product-overlay-toolbar {
  display: flex;
  justify-content: flex-end;
  padding: 8px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.product-overlay-close {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.product-overlay-close svg {
  width: 22px;
  height: 22px;
}

.product-overlay iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #fff;
}

@media (max-width: 760px) {
  .app-shell {
    padding: 8px 12px 24px;
  }

  .selector {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 7px;
    margin-bottom: 12px;
  }

  .topic-search {
    grid-column: 1;
    grid-row: 1;
  }

  .topic-select {
    grid-template-columns: 42px 1fr 20px;
    width: auto;
    max-width: none;
    min-width: 0;
    height: 58px;
    gap: 8px;
    padding: 7px 10px;
    border-radius: 12px;
  }

  .topic-select img {
    width: 42px;
    height: 42px;
    border-width: 2px;
  }

  .topic-select span {
    font-size: 17px;
  }

  .preview-card {
    border-radius: 20px;
    aspect-ratio: 0.9;
  }

  .room-image {
    object-position: center;
  }

  .secondary-action {
    bottom: 14px;
    width: 58px;
    height: 58px;
    gap: 3px;
    border-radius: 10px;
  }

  .product-pager {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    min-width: 0;
    min-height: 0;
    gap: 6px;
  }

  .product-page-button {
    width: 32px;
    height: 32px;
    border-radius: 7px;
  }

  .secondary-action svg {
    width: 20px;
    height: 20px;
  }

  .secondary-action span {
    font-size: 10.5px;
  }

  .product-page-count {
    min-width: 44px;
    font-size: 14px;
  }

  .layout-panel {
    width: calc(100% - 24px);
    padding: 12px;
  }

  .gallery-search-field input {
    font-size: 16px;
  }

  .layout-option {
    flex-basis: auto;
  }

  .replacement-panel {
    padding: 18px 14px;
  }

  .replacement-overlay {
    position: fixed;
    left: 20px;
    right: 20px;
    top: 12px;
    bottom: 18px;
    z-index: 60;
    max-height: none;
  }

  .replacement-preview-frame {
    max-width: min(360px, 82vw);
    max-height: min(280px, 30vh);
  }

  .replacement-preview-frame img {
    max-height: min(274px, 29vh);
  }

  .replacement-panel header {
    top: 16px;
    right: 16px;
  }

  .replacement-list {
    grid-template-columns: repeat(auto-fill, 60px);
    justify-content: center;
    gap: 6px;
  }

  .replacement-list[data-ratio="1:2"],
  .replacement-list[data-ratio="2:1"],
  .replacement-list[data-ratio="2:3"] {
    justify-content: center;
  }

}

@media (min-width: 761px) {
  .gallery-shell {
    padding: 22px 40px 44px;
  }

  .gallery-controls {
    position: static;
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr) auto;
    gap: 16px;
    margin: 0 0 24px;
    padding: 0;
    border-bottom: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .gallery-search-field input {
    height: 46px;
    font-size: 16px;
  }

  .gallery-topic-list {
    flex-wrap: wrap;
    overflow: visible;
  }

  .gallery-topic {
    min-height: 42px;
    border-radius: 8px;
  }

  .gallery-topic span {
    font-size: 14px;
  }

  .gallery-pager {
    justify-content: end;
    align-self: end;
  }

  .set-gallery {
    gap: 18px;
  }

  .set-card-meta {
    padding: 38px 14px 14px;
  }

  .set-card-meta h2 {
    font-size: 18px;
  }

  .set-card-meta p {
    font-size: 14px;
  }
}
