/* 自管材质面板 · 对齐官网全屏侧栏布局 */

.mirror-material-panel-host,
[data-mirror-material-panel="1"] {
  width: 100%;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  pointer-events: auto;
  overflow: hidden;
}

.mmp-panel.mmp-official {
  --mmp-bg: #151515;
  --mmp-surface: #1c2129;
  --mmp-surface-hover: #252b35;
  --mmp-surface-active: #2a2f38;
  --mmp-border: var(--c-border, #2a2f38);
  --mmp-border-strong: var(--c-border-strong, #3d4450);
  --mmp-text: var(--c-text, #e8eaed);
  --mmp-text-secondary: var(--c-text-secondary, #b8bcc4);
  --mmp-text-muted: var(--c-text-muted, #8b9098);
  --mmp-radius: 8px;
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  font-size: 0.75rem;
  color: var(--mmp-text);
}

.mmp-empty {
  padding: 16px 10px;
  color: var(--c-text-muted, #9aa0a6);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.mmp-panel--idle .mmp-controls {
  opacity: 0.42;
  pointer-events: none;
}

/* 标题行 */
.mmp-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 0 0 10px;
  border-bottom: 1px solid var(--mmp-border);
  flex-shrink: 0;
}

.mmp-head-back {
  flex-shrink: 0;
  width: 27px;
  height: 27px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--mmp-text-secondary);
  cursor: pointer;
  font-size: 0.875rem;
}

.mmp-head-back:hover {
  background: var(--mmp-surface-hover);
  color: var(--mmp-text);
}

.mmp-head-title {
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.mmp-head-sub {
  flex: 1;
  min-width: 0;
  font-size: 0.6875rem;
  font-weight: 400;
  color: var(--mmp-text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 上预览 | 下控件 */
.mmp-body-col {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1;
  overflow: hidden;
}

.mmp-previews {
  display: flex;
  flex-direction: row;
  gap: 8px;
  padding: 10px 0 12px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--mmp-border);
  flex-shrink: 0;
}

.mmp-preview {
  flex: 1 1 0;
  min-width: 0;
  min-height: 96px;
  border-radius: var(--mmp-radius);
  border: 1px solid var(--mmp-border);
  background: #0f1115;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.mmp-preview-scene img {
  width: 100%;
  height: 100%;
  min-height: 96px;
  object-fit: contain;
  display: block;
}

.mmp-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 96px;
  font-size: 0.75rem;
  color: var(--mmp-text-muted);
}

/* 全屏框选模式：左侧 mirror-fs-box 为唯一框线，避免与预览白框重复 */
body.mirror-fs-open .mmp-mark-box {
  display: none !important;
}

.mmp-mark-box {
  position: absolute;
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  pointer-events: none;
  box-sizing: border-box;
}

.mmp-param-swatch {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.mmp-swatch-canvas {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 96px;
  pointer-events: none;
}

.mmp-preview-alt::after {
  content: "参数预览";
  position: absolute;
  left: 6px;
  bottom: 6px;
  z-index: 2;
  font-size: 0.5625rem;
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

.mmp-controls {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 2px;
}

/* 2×2 下拉网格 */
.mmp-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.mmp-cell {
  position: relative;
  min-width: 0;
}

.mmp-official-dd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  height: 30px;
  padding: 0 9px;
  border-radius: var(--mmp-radius);
  border: 1px solid var(--mmp-border);
  background: var(--mmp-surface);
  color: var(--mmp-text);
  font-size: 0.6875rem;
  cursor: pointer;
  box-sizing: border-box;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mmp-official-dd:hover {
  border-color: var(--mmp-border-strong);
  background: var(--mmp-surface-hover);
}

.mmp-dd-inner {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.mmp-dd-muted {
  color: var(--mmp-text-muted);
}

.mmp-dd-sep {
  margin: 0 4px;
  color: var(--mmp-text-muted);
}

.mmp-dd-val {
  color: var(--mmp-text);
}

.mmp-dd-caret {
  flex-shrink: 0;
  opacity: 0.55;
  font-size: 0.625rem;
}

.mmp-menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 400;
  max-height: 220px;
  overflow-y: auto;
  border-radius: var(--mmp-radius);
  border: 1px solid var(--mmp-border-strong);
  background: var(--mmp-bg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.52);
  padding: 4px;
}

.mmp-menu-item {
  display: block;
  width: 100%;
  padding: 6px 10px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--mmp-text);
  font-size: 0.75rem;
  text-align: left;
  cursor: pointer;
}

.mmp-menu-item:hover {
  background: var(--mmp-surface-hover);
}

.mmp-menu-item.is-active {
  background: var(--mmp-surface-active);
}

/* 颜色块 */
.mmp-color-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  border: 1px solid var(--mmp-border);
  border-radius: var(--mmp-radius);
  background: rgba(28, 33, 41, 0.5);
}

.mmp-color-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mmp-color-title {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mmp-text-muted);
}

.mmp-color-reset {
  border: 1px solid var(--mmp-border);
  background: var(--mmp-surface);
  color: var(--mmp-text-secondary);
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
}

.mmp-color-reset:hover {
  background: var(--mmp-surface-hover);
}

.mmp-color-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 8px;
  border-radius: var(--mmp-radius);
  border: 1px solid var(--mmp-border);
  background: var(--mmp-surface);
}

.mmp-color-swatch {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  border-radius: 4px;
  border: 1px solid var(--mmp-border-strong);
  cursor: pointer;
  padding: 0;
}

.mmp-color-swatch.is-original {
  background: linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.85) 0 25%,
    rgba(255, 255, 255, 0.18) 25% 50%,
    rgba(255, 255, 255, 0.85) 50% 75%,
    rgba(255, 255, 255, 0.18) 75%
  ) !important;
}

.mmp-hue {
  flex: 1;
  min-width: 0;
  height: 6px;
  margin: 0;
  appearance: none;
  border-radius: 999px;
  cursor: pointer;
  background: linear-gradient(
    90deg,
    #ef4444,
    #f97316,
    #eab308,
    #22c55e,
    #06b6d4,
    #3b82f6,
    #a855f7,
    #ef4444
  );
}

.mmp-hue::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.8);
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.mmp-color-label {
  flex: 0 0 40px;
  text-align: right;
  font-size: 0.625rem;
  color: var(--mmp-text-muted);
}

.mmp-color-bar .mmp-orig-btn {
  flex-shrink: 0;
  border: 1px solid var(--mmp-border);
  background: #151515;
  color: var(--mmp-text-secondary);
  font-size: 0.625rem;
  padding: 2px 8px;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  line-height: 1.2;
}

.mmp-orig-btn.is-on {
  border-color: rgba(52, 211, 153, 0.35);
  background: rgba(52, 211, 153, 0.12);
  color: rgba(167, 243, 208, 0.95);
}

/* 开启原图色：色块 / 色相条不可调 */
.mmp-color-bar.is-locked .mmp-color-swatch,
.mmp-color-bar.is-locked .mmp-hue,
.mmp-color-bar.is-locked .mmp-color-label {
  opacity: 0.38;
  filter: grayscale(1);
  pointer-events: none;
  cursor: not-allowed;
}

.mmp-color-bar.is-locked .mmp-hue {
  background: linear-gradient(
    90deg,
    #4a4f58,
    #5a5f68,
    #4a4f58
  ) !important;
}

.mmp-color-bar.is-locked .mmp-hue::-webkit-slider-thumb {
  background: #9aa0a6;
  border-color: #6b7280;
}

.mmp-color-swatch:disabled {
  cursor: not-allowed;
}

.mmp-hue:disabled {
  cursor: not-allowed;
}

/* 贴图 + 号（嵌在纹理/法线滑条行前） */
.mmp-tex-btn {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--mmp-radius);
  border: 1px dashed var(--mmp-border);
  background: var(--mmp-surface);
  color: var(--mmp-text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  overflow: hidden;
  padding: 0;
}

.mmp-tex-btn.has-img {
  border-style: solid;
  border-color: var(--mmp-border-strong);
}

.mmp-tex-btn:hover {
  border-color: var(--mmp-border-strong);
  background: var(--mmp-surface-hover);
  color: var(--mmp-text);
}

.mmp-tex-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* glow 滑条 */
.mmp-glow-pair-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  width: 100%;
}

.mmp-glow-col {
  min-width: 0;
}

.mmp-glow-col-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.mmp-glow-col-inline .mmp-tex-btn {
  flex-shrink: 0;
}

.mmp-glow-col-inline .mmp-glow-label {
  flex: 0 0 28px;
  font-size: 0.6875rem;
  color: var(--mmp-text-muted);
}

.mmp-glow-col-inline .mmp-glow-track-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.mmp-glow-col-inline .mmp-glow-val {
  flex: 0 0 36px;
  font-size: 0.6875rem;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.mmp-glow-row-full {
  width: 100%;
}

.mmp-glow-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.mmp-glow-label {
  flex: 0 0 36px;
  font-size: 0.6875rem;
  color: var(--mmp-text-muted);
}

.mmp-glow-track-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  height: 28px;
  display: flex;
  align-items: center;
}

.mmp-glow-track {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 999px;
  background: var(--mmp-surface);
  border: 1px solid var(--mmp-border);
  overflow: hidden;
  pointer-events: none;
}

.mmp-glow-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #4f83ff 0%, #6f6bf2 100%);
  opacity: 0.85;
}

.mmp-glow-input,
.mmp-panel input.glow-slider[type="range"] {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 28px;
  margin: 0;
  appearance: none;
  background: transparent;
  cursor: pointer;
}

.mmp-glow-input::-webkit-slider-thumb,
.mmp-panel input.glow-slider[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mmp-glow-val {
  flex: 0 0 40px;
  text-align: right;
  font-size: 0.6875rem;
  font-variant-numeric: tabular-nums;
  color: var(--mmp-text);
}

/* 底栏生成 */
.mmp-upload-dock {
  position: relative;
  flex-shrink: 0;
  min-height: 122px;
  margin-top: 12px;
  padding: 22px 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    #1f1f21;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.04),
    0 14px 34px rgba(0, 0, 0, 0.26);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.mmp-upload-handle {
  position: absolute;
  left: 50%;
  top: 10px;
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  transform: translateX(-50%);
}

.mmp-upload-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 56px;
}

.mmp-upload-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--mmp-text-secondary);
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.mmp-upload-btn svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mmp-upload-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--mmp-text);
  transform: translateY(-1px);
}

.mmp-upload-btn:active {
  transform: translateY(0);
}

.mmp-upload-btn:disabled {
  opacity: 0.44;
  cursor: not-allowed;
  transform: none;
}

.mmp-upload-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 58px;
  resize: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--mmp-text);
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.45;
  padding: 3px 2px;
  caret-color: #f4f5f6;
}

.mmp-upload-input::placeholder {
  color: rgba(215, 217, 220, 0.52);
}

.mmp-upload-input:focus::placeholder {
  color: rgba(215, 217, 220, 0.36);
}

.mmp-upload-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: var(--mmp-text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  user-select: none;
}

.mmp-upload-model,
.mmp-upload-quality,
.mmp-upload-cost,
.mmp-upload-send {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.mmp-upload-model {
  gap: 6px;
  min-width: 0;
  max-width: 152px;
  overflow: hidden;
  color: var(--mmp-text);
}

.mmp-upload-model span:nth-child(2) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mmp-upload-model-dot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: #f4f5f6;
  font-size: 0.5rem;
  letter-spacing: -0.03em;
}

.mmp-upload-caret {
  color: var(--mmp-text-muted);
  font-size: 0.75rem;
}

.mmp-upload-quality {
  gap: 6px;
  color: var(--mmp-text-secondary);
  opacity: 0.9;
}

.mmp-upload-check {
  width: 13px;
  height: 13px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1.5px currentColor;
  opacity: 0.84;
}

.mmp-upload-spacer {
  flex: 1 1 auto;
  min-width: 6px;
}

.mmp-upload-cost {
  gap: 4px;
  color: var(--mmp-text-muted);
  opacity: 0.9;
}

.mmp-upload-spark {
  font-size: 0.8125rem;
  color: var(--mmp-text-secondary);
}

.mmp-upload-send {
  border: 0;
  padding: 0;
  justify-content: center;
  width: 34px;
  height: 34px;
  margin-left: -2px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #151515;
  cursor: pointer;
  transition: background 0.16s ease, transform 0.16s ease;
}

.mmp-upload-send svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.mmp-upload-send:hover {
  background: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}

.mmp-upload-send:active {
  transform: translateY(0);
}

body.mirror-fs-open #root [data-testid="material-control-grid"],
body.mirror-fs-open #root .absolute.bottom-10:has([data-testid="material-control-grid"]) {
  display: none !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Official material-controller parity skin: derived from bundled Up component. */
.mmp-panel.mmp-official {
  --mmp-bg: var(--c-node-bg, #151515);
  --mmp-surface: var(--c-bg-input, #1c2129);
  --mmp-surface-hover: var(--c-bg-hover, #252b35);
  --mmp-surface-active: var(--c-bg-active, #2a2f38);
  --mmp-border: var(--c-border, #2a2f38);
  --mmp-border-soft: var(--c-border, #2a2f38);
  --mmp-border-strong: var(--c-border-strong, #3d4450);
  --mmp-text: var(--c-text, #e8eaed);
  --mmp-text-secondary: var(--c-text-secondary, #b8bcc4);
  --mmp-text-muted: var(--c-text-muted, #8b9098);
  --mmp-radius: 6px;
  font-family: inherit;
  color: var(--mmp-text);
  text-shadow: none;
}

.mmp-empty {
  color: var(--mmp-text-muted);
}

.mmp-head {
  border-bottom-color: var(--mmp-border-soft);
}

.mmp-head-back {
  border: 0;
  border-radius: var(--mmp-radius);
  background: transparent;
  color: var(--mmp-text-secondary);
  box-shadow: none;
  transition: background 0.16s ease, color 0.16s ease;
}

.mmp-head-back:hover {
  background: var(--mmp-surface-hover);
  color: var(--mmp-text);
  transform: none;
}

.mmp-head-title {
  color: var(--mmp-text);
  font-weight: 600;
}

.mmp-tex-wrap {
  position: relative;
  display: inline-flex;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.mmp-tex-menu {
  position: absolute;
  left: 0;
  top: 34px;
  width: 190px;
  padding: 6px;
  border-radius: 8px;
  border: 1px solid var(--mmp-border);
  background: var(--mmp-bg);
  box-shadow: 0 12px 32px var(--c-shadow, rgba(0, 0, 0, 0.52));
  backdrop-filter: blur(18px);
}

.mmp-tex-menu-item {
  display: flex;
  width: 100%;
  min-height: 30px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  padding: 6px 8px;
  color: var(--mmp-text);
  text-align: left;
  font-size: 0.75rem;
  line-height: 1.15;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease;
}

.mmp-tex-menu-item + .mmp-tex-menu-item {
  margin-top: 4px;
}

.mmp-tex-menu-item:hover {
  background: var(--mmp-surface-hover);
}

.mmp-tex-menu-item small {
  color: var(--mmp-text-muted);
  font-size: 0.625rem;
  line-height: 1.2;
}

.mmp-tex-menu-item--danger {
  color: rgba(254, 202, 202, 0.82);
}

.mmp-tex-menu-item--danger:hover {
  background: rgba(248, 113, 113, 0.12);
  color: #fee2e2;
}

.mmp-previews {
  border-bottom-color: var(--mmp-border-soft);
}

.mmp-preview {
  border-color: var(--mmp-border);
  background: var(--mmp-surface);
  box-shadow: none;
}

.mmp-mark-box {
  border-color: rgba(255, 255, 255, 0.85);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.mmp-preview-alt::after {
  color: rgba(255, 255, 255, 0.75);
  background: rgba(0, 0, 0, 0.45);
}

.mmp-controls {
  scrollbar-color: #8cc6ee transparent;
}

.mmp-official-dd {
  height: 28px;
  background: var(--mmp-surface);
  border-color: var(--mmp-border);
  color: var(--mmp-text);
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mmp-official-dd:hover {
  border-color: var(--mmp-border-strong);
  background: var(--mmp-surface-hover);
  transform: none;
}

.mmp-dd-muted {
  color: var(--mmp-text-muted);
}

.mmp-dd-sep {
  color: var(--mmp-text-muted);
}

.mmp-dd-caret {
  color: var(--mmp-text-secondary);
  opacity: 1;
}

.mmp-menu {
  border-color: var(--mmp-border-strong);
  background: var(--mmp-bg);
  box-shadow: 0 12px 32px var(--c-shadow, rgba(0, 0, 0, 0.52));
}

.mmp-menu-item {
  color: var(--mmp-text);
}

.mmp-menu-item:hover {
  background: var(--mmp-surface-hover);
}

.mmp-menu-item.is-active {
  background: var(--mmp-surface-active);
  color: var(--mmp-text);
  font-weight: 500;
}

.mmp-color-block {
  padding: 0;
  border-color: transparent;
  background: transparent;
  box-shadow: none;
}

.mmp-color-title,
.mmp-glow-val {
  color: var(--mmp-text);
}

.mmp-color-reset,
.mmp-color-bar .mmp-orig-btn {
  border-color: var(--mmp-border);
  background: var(--mmp-surface);
  color: var(--mmp-text-secondary);
  border-radius: var(--mmp-radius);
  transition: background 0.16s ease, color 0.16s ease;
}

.mmp-color-reset:hover,
.mmp-color-bar .mmp-orig-btn:hover {
  background: var(--mmp-surface-hover);
  color: var(--mmp-text);
  transform: none;
}

.mmp-color-bar {
  border-color: var(--mmp-border-soft);
  background: var(--mmp-surface);
}

.mmp-color-swatch {
  border-color: var(--mmp-border-strong);
  box-shadow: none;
}

.mmp-orig-btn.is-on {
  border-color: rgba(52, 211, 153, 0.25);
  background: rgba(52, 211, 153, 0.1);
  color: rgba(167, 243, 208, 0.8);
}

.mmp-color-bar.is-locked .mmp-hue {
  background: linear-gradient(90deg, #4a4f58, #5a5f68, #4a4f58) !important;
}

.mmp-color-bar.is-locked .mmp-hue::-webkit-slider-thumb {
  background: #9aa0a6;
  border-color: #6b7280;
}

.mmp-tex-btn {
  border-color: var(--mmp-border);
  background: var(--mmp-surface);
  color: var(--mmp-text-muted);
  box-shadow: none;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mmp-tex-btn:hover {
  border-color: var(--mmp-border-strong);
  background: var(--mmp-surface-hover);
  color: var(--mmp-text);
  transform: none;
}

.mmp-glow-col-inline .mmp-glow-label,
.mmp-glow-label {
  color: var(--mmp-text-muted);
}

.mmp-glow-track {
  height: 2px;
  background: var(--c-slider-track, rgba(255, 255, 255, 0.18));
  border-color: transparent;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1;
}

.mmp-glow-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: #ffffff;
  opacity: 1;
  pointer-events: none;
}

.mmp-panel.mmp-official input.glow-slider.mmp-glow-input[type="range"] {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  z-index: 2;
  height: 14px !important;
  margin: 0 !important;
  transform: translateY(-50%);
  background: transparent !important;
}

.mmp-glow-input::-webkit-slider-runnable-track,
.mmp-panel input.glow-slider[type="range"]::-webkit-slider-runnable-track {
  height: 14px !important;
  border: 0 !important;
  background: transparent !important;
}

.mmp-glow-input::-moz-range-track,
.mmp-panel input.glow-slider[type="range"]::-moz-range-track {
  height: 14px !important;
  border: 0 !important;
  background: transparent !important;
}

.mmp-glow-input::-webkit-slider-thumb,
.mmp-panel input.glow-slider[type="range"]::-webkit-slider-thumb {
  width: 12px !important;
  height: 12px !important;
  margin-top: 1px !important;
  border-color: rgba(255, 255, 255, 0.8);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

.mmp-glow-input::-moz-range-thumb,
.mmp-panel input.glow-slider[type="range"]::-moz-range-thumb {
  width: 12px !important;
  height: 12px !important;
  border: 0 !important;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
}

@media (prefers-reduced-motion: reduce) {
  .mmp-head-back,
  .mmp-official-dd,
  .mmp-color-reset,
  .mmp-color-bar .mmp-orig-btn,
  .mmp-tex-btn {
    transition: none;
  }

  .mmp-head-back:hover,
  .mmp-official-dd:hover,
  .mmp-color-reset:hover,
  .mmp-color-bar .mmp-orig-btn:hover,
  .mmp-tex-btn:hover {
    transform: none;
  }
}

/* Borderless material controller skin for fullscreen marking mode. */
body.mirror-fs-open .mmp-panel.mmp-official {
  --mmp-bg: #151515;
  --mmp-surface: #151515;
  --mmp-surface-hover: #1c1c1c;
  --mmp-surface-active: #252525;
  --mmp-border: transparent;
  --mmp-border-soft: transparent;
  --mmp-border-strong: transparent;
  background: #151515;
}

body.mirror-fs-open .mmp-head,
body.mirror-fs-open .mmp-previews {
  border-color: transparent;
}

body.mirror-fs-open .mmp-preview,
body.mirror-fs-open .mmp-official-dd,
body.mirror-fs-open .mmp-color-block,
body.mirror-fs-open .mmp-color-bar,
body.mirror-fs-open .mmp-color-reset,
body.mirror-fs-open .mmp-color-bar .mmp-orig-btn,
  body.mirror-fs-open .mmp-menu,
  body.mirror-fs-open .mmp-tex-menu {
  border-color: transparent;
  box-shadow: none;
}

body.mirror-fs-open .mmp-preview,
body.mirror-fs-open .mmp-official-dd,
body.mirror-fs-open .mmp-color-bar,
body.mirror-fs-open .mmp-color-reset,
body.mirror-fs-open .mmp-color-bar .mmp-orig-btn,
body.mirror-fs-open .mmp-menu,
body.mirror-fs-open .mmp-tex-menu {
  background: #151515;
}

body.mirror-fs-open .mmp-official-dd:hover,
body.mirror-fs-open .mmp-color-reset:hover,
body.mirror-fs-open .mmp-color-bar .mmp-orig-btn:hover,
body.mirror-fs-open .mmp-menu-item:hover,
body.mirror-fs-open .mmp-tex-menu-item:hover,
body.mirror-fs-open .mmp-head-back:hover {
  background: #1c1c1c;
}

/* Text brightness pass for the fullscreen material controller. */
body.mirror-fs-open .mmp-panel.mmp-official {
  --mmp-text: #f4f5f6;
  --mmp-text-secondary: #d7d9dc;
  --mmp-text-muted: #b8bdc4;
}

body.mirror-fs-open .mmp-panel--idle .mmp-controls {
  opacity: 0.72;
}

body.mirror-fs-open .mmp-glow-col-inline .mmp-tex-wrap {
  display: none;
}

body.mirror-fs-open .mmp-glow-col-inline .mmp-glow-label {
  flex-basis: 34px;
}

body.mirror-fs-open .mmp-upload-dock {
  border-color: transparent;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    #1f1f21;
  box-shadow: none;
}

body.mirror-fs-open .mmp-upload-btn {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.045);
  color: var(--mmp-text-secondary);
}

body.mirror-fs-open .mmp-upload-btn:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--mmp-text);
}

body.mirror-fs-open .mmp-dd-muted,
body.mirror-fs-open .mmp-dd-sep,
body.mirror-fs-open .mmp-color-title,
body.mirror-fs-open .mmp-glow-label,
body.mirror-fs-open .mmp-glow-col-inline .mmp-glow-label,
body.mirror-fs-open .mmp-glow-val,
body.mirror-fs-open .mmp-preview-empty {
  color: var(--mmp-text-secondary);
}
