.mirror-material-replace-ui {
  position: absolute;
  inset: 0;
  z-index: 28;
  pointer-events: none;
  border-radius: inherit;
}

.mirror-material-replace-ui.is-empty {
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(20, 21, 23, 0.1);
}

.mirror-material-replace-empty {
  pointer-events: auto;
  width: min(86%, 280px);
  min-height: 112px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px dashed rgba(255, 255, 255, 0.28);
  border-radius: 18px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(28, 30, 32, 0.72);
  backdrop-filter: blur(14px);
  cursor: pointer;
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mirror-material-replace-empty:hover {
  border-color: rgba(255, 255, 255, 0.54);
  background: rgba(42, 44, 46, 0.82);
  transform: translateY(-1px);
}

.mirror-material-replace-empty strong {
  font-size: 13px;
  font-weight: 650;
  letter-spacing: 0.01em;
}

.mirror-material-replace-empty span {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.52);
}

html[data-mirror-material-replace-selected="1"] .dock-panel {
  display: none !important;
}

.mirror-material-replace-dock {
  position: absolute;
  left: 50%;
  top: -52px;
  transform: translateX(-50%);
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px 6px;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.86);
  background: rgba(0, 0, 0, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(24px);
  pointer-events: auto;
  z-index: 32;
}

[data-mirror-material-replace-node="1"]:not([data-mirror-node-selected="1"]) .mirror-material-replace-dock {
  display: none !important;
}

.mirror-material-replace-dock button,
.mirror-material-replace-upload-menu button {
  border: 0;
  color: rgba(255, 255, 255, 0.88);
  background: transparent;
  border-radius: 10px;
  font-size: 12px;
  cursor: pointer;
}

.mirror-material-replace-dock button {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: rgba(255, 255, 255, 0.82);
}

.mirror-material-replace-dock button svg {
  width: 18px;
  height: 18px;
}

.mirror-material-replace-dock button:hover,
.mirror-material-replace-upload-menu button:hover {
  background: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.96);
}

.mirror-material-replace-upload-menu {
  position: fixed;
  z-index: 100040;
  min-width: 132px;
  padding: 6px;
  border-radius: 14px;
  background: rgba(34, 36, 38, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.mirror-material-replace-upload-menu[hidden] {
  display: none !important;
}

.mirror-material-replace-upload-menu button {
  display: block;
  width: 100%;
  padding: 9px 10px;
  text-align: left;
}

.mirror-material-replace-toast {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 100050;
  padding: 9px 14px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(28, 30, 32, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
  font-size: 12px;
}

.mirror-material-replace-toast[hidden] {
  display: none !important;
}

body.mirror-material-replace-editor-open #root {
  visibility: hidden !important;
}

.mirror-material-replace-editor {
  position: fixed;
  inset: 0;
  z-index: 100090;
  display: none;
  grid-template-columns: minmax(0, 1fr) 300px;
  color: rgba(255, 255, 255, 0.9);
  background: #151515;
}

.mirror-material-replace-editor.is-open {
  display: grid;
}

.mmre-main {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: #151515;
}

.mmre-toolbar {
  position: absolute;
  left: 50%;
  top: 6px;
  transform: translateX(-50%);
  z-index: 4;
  height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(22, 22, 22, 0.92);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(16px);
}

.mmre-tab,
.mmre-icon {
  height: 32px;
  border: 0;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.74);
  background: transparent;
  cursor: pointer;
}

.mmre-tab {
  padding: 0 11px;
  font-size: 13px;
  font-weight: 650;
}

.mmre-tab.is-active,
.mmre-icon.is-active,
.mmre-tab:hover,
.mmre-icon:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
}

.mmre-icon {
  width: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mmre-icon svg {
  width: 17px;
  height: 17px;
}

.mmre-sep {
  width: 1px;
  height: 22px;
  background: rgba(255, 255, 255, 0.12);
}

.mmre-size {
  min-width: 48px;
  font-size: 13px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
}

.mmre-size small {
  margin-left: 3px;
  color: rgba(255, 255, 255, 0.55);
}

.mmre-line {
  width: 180px;
  accent-color: rgba(255, 255, 255, 0.82);
}

.mmre-color {
  width: 24px;
  height: 24px;
  border: 0;
  border-radius: 999px;
  background: #f10d0d;
}

.mmre-stage-wrap {
  position: absolute;
  inset: 0;
  overflow: auto;
  display: grid;
  place-items: center;
  padding: 62px 42px 36px;
}

.mmre-stage {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  min-height: 40px;
}

.mmre-stage img {
  max-width: calc(100vw - 420px);
  max-height: calc(100vh - 92px);
  object-fit: contain;
  transform-origin: center center;
  user-select: none;
  pointer-events: none;
}

.mmre-box-layer,
.mmre-preview {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.mmre-box,
.mmre-preview {
  position: fixed;
  box-sizing: border-box;
  border: 2px solid #ff1a1a;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: 4px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.mmre-box {
  pointer-events: auto;
  cursor: pointer;
}

.mmre-box.is-selected {
  border-color: #fff;
  box-shadow: 0 0 0 2px rgba(255, 26, 26, 0.55), 0 0 18px rgba(255, 26, 26, 0.38);
}

.mmre-preview {
  border-style: dashed;
}

.mmre-icon.is-disabled {
  opacity: 0.34;
}

.mmre-zoom-badge {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  padding: 7px 10px;
  border-radius: 8px;
  background: rgba(30, 30, 30, 0.9);
  color: rgba(255, 255, 255, 0.88);
  font-size: 12px;
  font-weight: 700;
}

.mmre-side {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: #151515;
}

.mmre-side-title {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  font-size: 13px;
}

.mmre-side-title span {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
}

.mmre-zoom-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 28px;
  color: rgba(255, 255, 255, 0.5);
  font-size: 12px;
}

.mmre-zoom-row input {
  width: 100%;
  accent-color: rgba(255, 255, 255, 0.84);
}

.mmre-zoom-row span {
  justify-self: end;
  margin-top: -28px;
  color: rgba(255, 255, 255, 0.55);
  font-weight: 700;
}

.mmre-zoom-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.mmre-zoom-actions button,
.mmre-save-current,
.mmre-save-new {
  height: 38px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.8);
  background: rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.mmre-side-fill {
  flex: 1;
}

.mmre-save-current,
.mmre-save-new {
  width: 100%;
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 650;
}

.mmre-save-current {
  border-color: transparent;
  color: #111;
  background: rgba(255, 255, 255, 0.86);
}

.mmre-save-current svg,
.mmre-save-new svg {
  width: 16px;
  height: 16px;
}
