.ya3d-home-actions {
  display: flex;
  justify-content: center;
  clear: both;
  width: 100%;
  margin: 6px 0 12px;
  padding: 0;
}

.ya3d-home-actions .ya3d-home-trigger {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 44px;
  max-width: 100%;
  margin: 0;
  padding: 8px 15px;
  border: 1px solid #d9bbc6;
  border-radius: 999px;
  background: #fff8fa;
  box-shadow: none;
  color: #79213f;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .16s, border-color .16s;
}

.ya3d-home-trigger svg {
  display: block;
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ya3d-home-actions .ya3d-home-trigger:hover {
  border-color: #a26b7e;
  background: #f7e9ef;
  color: #671833;
}

.ya3d-home-trigger:focus-visible,
#ya3d-home-dialog .ya3d-home-close:focus-visible {
  outline: 3px solid #a5667d;
  outline-offset: 3px;
}

#ya3d-home-dialog {
  box-sizing: border-box;
  display: none;
  width: min(1320px, 96vw);
  max-width: none;
  height: 94vh;
  height: min(920px, 94dvh);
  max-height: 94dvh;
  margin: auto;
  padding: 0;
  border: 1px solid #ffffff90;
  border-radius: 22px;
  background: #faf6f2;
  color: #3b2630;
  overflow: hidden;
  box-shadow: 0 30px 100px #22111c66;
}

#ya3d-home-dialog[open] {
  display: flex;
  flex-direction: column;
}

#ya3d-home-dialog::backdrop {
  background: #251a24b8;
  backdrop-filter: blur(8px);
}

/* The common viewer owns the title and close; this is a loading/error fallback. */
#ya3d-home-dialog .ya3d-home-header {
  position: absolute;
  z-index: 5;
  top: 12px;
  right: 20px;
  width: 44px;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: none;
}
#ya3d-home-heading {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
#ya3d-home-dialog .ya3d-home-close { pointer-events: auto; }
#ya3d-home-dialog .ya3d-home-close[hidden] { display: none; }

#ya3d-home-dialog .ya3d-home-close {
  display: grid;
  flex: 0 0 44px;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 10px;
  border: 1px solid #ddcbd3;
  border-radius: 50%;
  background: #fff;
  color: #79213f;
  box-shadow: none;
  cursor: pointer;
}

#ya3d-home-dialog .ya3d-home-close:hover {
  background: #f7e9ef;
}

.ya3d-home-close svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

#ya3d-home-dialog .ya3d-home-viewer {
  position: relative;
  flex: 1;
  min-height: 0;
}

#ya3d-home-dialog iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
  background: #faf6f2;
}

#ya3d-home-dialog .ya3d-home-status {
  position: absolute;
  z-index: 1;
  inset: 0;
  display: grid;
  place-content: center;
  margin: 0;
  padding: 24px;
  background: #faf6f2;
  color: #79213f;
  font-size: 15px;
  line-height: 1.6;
  text-align: center;
  pointer-events: none;
}

#ya3d-home-dialog .ya3d-home-status[hidden] {
  display: none;
}

html.ya3d-home-open {
  overflow: hidden;
  scrollbar-gutter: auto;
}

@media (max-width: 650px) {
  .ya3d-home-actions .ya3d-home-trigger {
    font-size: 12px;
    padding-inline: 13px;
  }

  #ya3d-home-dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }

  #ya3d-home-dialog .ya3d-home-header {
    top: 10px;
    right: 14px;
  }

  #ya3d-home-heading {
    font-size: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ya3d-home-actions .ya3d-home-trigger {
    transition: none;
  }
}
