button.matrix-board-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  border: 0;
  padding: 0;
  cursor: zoom-in;
  background: #f7f4ed;
}

.matrix-board-image img {
  object-fit: contain;
  background: #f7f4ed;
  transition: transform .25s ease;
}

.matrix-board-image:hover img,
.matrix-board-image:focus-visible img {
  transform: scale(1.018);
}

.sku-row {
  grid-template-columns: auto minmax(0, 1fr) 64px;
}

.sku-open {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #182235;
  padding: 3px 4px;
  text-align: left;
  cursor: pointer;
  display: grid;
  gap: 1px;
}

.sku-open b { font-size: 14px; }
.sku-open small { color: #a94733; font-size: 10px; font-weight: 750; }
.sku-open:hover b,
.sku-open:focus-visible b { text-decoration: underline; text-underline-offset: 3px; }

.matrix-board-dialog,
.matrix-item-dialog {
  border: 0;
  border-radius: 24px;
  padding: 0;
  color: #182235;
  background: #f7f4ed;
  box-shadow: 0 28px 90px rgba(7, 16, 29, .38);
  overflow: auto;
}

.matrix-board-dialog { width: min(1100px, calc(100vw - 36px)); max-width: 1100px; max-height: calc(100dvh - 36px); }
.matrix-item-dialog { width: min(980px, calc(100vw - 36px)); max-width: 980px; max-height: calc(100dvh - 36px); }
.matrix-board-dialog::backdrop,
.matrix-item-dialog::backdrop { background: rgba(7, 16, 29, .72); backdrop-filter: blur(5px); }

.matrix-dialog-close {
  position: sticky;
  float: right;
  top: 12px;
  right: 12px;
  z-index: 12;
  width: 42px;
  height: 42px;
  margin: 12px 12px -54px 0;
  border: 0;
  border-radius: 50%;
  background: #182235;
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 26px rgba(7, 16, 29, .25);
}

.matrix-dialog-close:hover,
.matrix-dialog-close:focus-visible { background: #c34832; }
.matrix-dialog-canvas { padding: 22px; clear: both; }
.matrix-board-stage { position: relative; width: 100%; max-width: 1024px; margin: 0 auto; background: #fff; }
.matrix-board-stage > img { display: block; width: 100%; height: auto; }

.matrix-board-hotspots {
  position: absolute;
  z-index: 2;
  left: 0;
  right: 0;
  top: var(--hotspot-top);
  height: var(--hotspot-height);
  display: grid;
  grid-template-columns: repeat(var(--hotspot-cols), minmax(0, 1fr));
  grid-template-rows: repeat(var(--hotspot-rows), minmax(0, 1fr));
}

.matrix-board-hotspots button {
  position: relative;
  min-width: 0;
  border: 1px solid transparent;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.matrix-board-hotspots button span {
  position: absolute;
  left: 50%;
  bottom: 5px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: rgba(24, 34, 53, .88);
  color: #fff;
  padding: 3px 7px;
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .16s ease;
}

.matrix-board-hotspots button:hover,
.matrix-board-hotspots button:focus-visible {
  border-color: #f5c75b;
  outline: 3px solid rgba(245, 199, 91, .7);
  outline-offset: -3px;
  background: rgba(245, 199, 91, .12);
}

.matrix-board-hotspots button:hover span,
.matrix-board-hotspots button:focus-visible span { opacity: 1; }

.matrix-item-layout {
  display: grid;
  grid-template-columns: minmax(320px, .92fr) minmax(380px, 1.08fr);
  min-height: 620px;
  clear: both;
}

.matrix-item-media { background: #ece8df; padding: 30px; display: grid; place-items: center; }
.matrix-item-media img { display: block; width: 100%; height: min(560px, 68dvh); object-fit: contain; border-radius: 18px; background: #f7f4ed; }
.matrix-item-media p { display: none; max-width: 300px; text-align: center; color: #706b62; }
.matrix-item-media.missing p { display: block; }
.matrix-item-details { padding: 44px 38px 34px; }
.matrix-item-details h3 { margin: 5px 0 6px; font-size: clamp(34px, 5vw, 56px); line-height: 1; }
.matrix-item-theme { color: #6b6f79; font-weight: 650; margin-bottom: 22px; }
.matrix-item-details dl { display: grid; gap: 12px; margin: 0 0 18px; }
.matrix-item-details dl > div { border-left: 3px solid #f5c75b; padding-left: 12px; }
.matrix-item-details dt { color: #7a746c; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.matrix-item-details dd { margin: 3px 0 0; font-size: 14px; line-height: 1.5; }

.matrix-item-tiers { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.matrix-item-tiers span { border: 1px solid #d8d1c6; border-radius: 12px; padding: 9px; display: grid; font-size: 12px; }
.matrix-item-progress { margin: 14px 0; border-radius: 12px; background: #182235; color: #fff; padding: 12px; font-size: 13px; }
.matrix-item-progress b { color: #f5c75b; }
.matrix-item-quantity { display: grid; gap: 6px; color: #182235; font-size: 12px; font-weight: 800; }
.matrix-item-quantity input { width: 100%; border: 1px solid #cfc8bc; border-radius: 10px; background: #fff; padding: 12px; font: inherit; font-size: 16px; }
.matrix-item-add { width: 100%; margin-top: 10px; border: 0; border-radius: 11px; background: #c34832; color: #fff; padding: 14px 18px; font-weight: 850; cursor: pointer; }
.matrix-item-add:hover,
.matrix-item-add:focus-visible { background: #a93826; }

.matrix-item-nav { display: grid; grid-template-columns: 1fr 1.25fr 1fr; gap: 6px; margin-top: 14px; }
.matrix-item-nav button { min-width: 0; border: 1px solid #cfc8bc; border-radius: 9px; background: #fff; color: #182235; padding: 9px 6px; font-size: 11px; font-weight: 750; cursor: pointer; }
.matrix-item-nav button:disabled { opacity: .42; cursor: not-allowed; }

@media (max-width: 760px) {
  .matrix-board-dialog,
  .matrix-item-dialog { width: calc(100vw - 16px); max-height: calc(100dvh - 82px); border-radius: 18px; margin-bottom: 74px; }
  .matrix-dialog-canvas { padding: 12px; }
  .matrix-board-hotspots button span { display: none; }
  .matrix-item-layout { display: block; min-height: 0; }
  .matrix-item-media { padding: 16px; }
  .matrix-item-media img { height: min(350px, 42dvh); }
  .matrix-item-details { padding: 24px 18px 22px; }
  .matrix-item-details h3 { font-size: 38px; }
  .matrix-item-theme { margin-bottom: 14px; }
  .matrix-item-tiers span { font-size: 10px; padding: 7px; }
  .matrix-item-nav { position: static; background: #f7f4ed; padding-top: 8px; }
}
