body.eo-mh {
  background: var(--page-bg);
  color: var(--t0);
}
.eo-mh .mh {
  --mh-line: var(--edge);
  --mh-line-2: var(--edge-2);
  --mh-ink: var(--t0);
  --mh-mute: var(--t2);
  --mh-pick: var(--blue);
  --mh-surface: var(--s1);
  --mh-surface-2: var(--s2);
  --mh-surface-3: var(--s3);
  --mh-fill: #111;
  --mh-on-fill: #fff;
  max-width: 100%;
  width: fit-content;
  margin: 0 auto;
  padding: 12px 16px 48px;
  color: var(--t0);
  font-family: var(--font-ui);
  border: 1px solid var(--t0);
  box-shadow: none;
  text-shadow: none;
}
.eo-mh .mh *,
.eo-mh .mh *::before,
.eo-mh .mh *::after {
  box-shadow: none !important;
  text-shadow: none !important;
}
.eo-mh .mh button,
.eo-mh .mh input {
  font: inherit;
  color: inherit;
}
.eo-mh .mh button {
  border: 1px solid var(--mh-line-2);
  background: var(--mh-surface);
  border-radius: 0;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--t1);
}
.eo-mh .mh button:hover { background: var(--hover-bg); color: var(--t0); border-color: var(--edge-3); }
.eo-mh .mh button:disabled { opacity: .4; cursor: not-allowed; }
.eo-mh .mh button.primary {
  background: #111;
  border-color: #111;
  color: #fff;
}
.eo-mh .mh button.primary:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}
.eo-mh .mh button.primary::before,
.eo-mh .mh button.primary::after,
.eo-mh .mh .mh-save::before,
.eo-mh .mh .mh-save::after {
  display: none !important;
  content: none !important;
  background: none !important;
}

.mh-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  width: 100%;
}
.mh-bar h1 {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0;
  margin: 0;
}
.mh-bar-l, .mh-bar-r {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}
.user-chip {
  font-size: 12px;
  color: var(--mh-mute);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 40vw;
}
.eo-mh .mh .mh-bar-r .mh-chip,
.eo-mh .mh .mh-bar-r a.mh-chip,
.eo-mh .mh .mh-bar-r button.mh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 8px;
  margin: 0;
  border: 1px solid var(--mh-line-2);
  border-radius: 0;
  background: var(--mh-surface);
  color: var(--t1);
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  box-sizing: border-box;
}
.eo-mh .mh .mh-bar-r .mh-chip:hover,
.eo-mh .mh .mh-bar-r a.mh-chip:hover,
.eo-mh .mh .mh-bar-r button.mh-chip:hover {
  background: var(--hover-bg);
  color: var(--t0);
  border-color: var(--edge-3);
}
.eo-mh .mh .mh-bar-r .mh-chip .mh-ico {
  width: 12px;
  height: 12px;
  flex: 0 0 auto;
  stroke: currentColor;
  stroke-width: 1.35;
  fill: none;
  stroke-linecap: square;
  stroke-linejoin: miter;
}
.eo-mh .mh .mh-bar-r .mh-chip .mh-chip-t {
  display: inline-block;
}
.eo-mh .mh .mh-bar-r .mh-bgm:not(.off) {
  border-color: var(--t0);
  color: var(--t0);
}
.eo-mh .mh .mh-bar-r .mh-bgm.off {
  color: var(--mh-mute);
  border-color: var(--mh-line-2);
}

.mh-work {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  min-height: 0;
  align-items: stretch;
  justify-content: flex-start;
}

.shop {
  display: flex;
  flex-direction: column;
  min-height: 0;
  width: 340px;
  flex: 0 0 340px;
  height: calc(100dvh - 150px);
  max-height: calc(100dvh - 150px);
  position: sticky;
  top: 10px;
  background: var(--mh-surface);
  border: 1px solid var(--t0);
  border-radius: 0;
  overflow: hidden;
}
.shop-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px 5px;
  border-bottom: 1px solid var(--mh-line);
  flex: 0 0 auto;
}
.pack-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  border-bottom: 1px solid var(--t0);
}
.eo-mh .mh .pack-switch button {
  height: 32px;
  padding: 0;
  border: 0;
  border-right: 1px solid var(--t0);
  border-radius: 0;
  background: var(--mh-surface);
  color: var(--t1);
  font-size: 12px;
}
.eo-mh .mh .pack-switch button:last-child {
  border-right: 0;
}
.eo-mh .mh .pack-switch button:hover {
  background: var(--mh-surface-3);
  color: var(--t0);
}
.eo-mh .mh .pack-switch button.on,
.eo-mh .mh .pack-switch button.on:hover {
  background: #111;
  color: #fff;
}
.back-btn { font-size: 12px; }
.back-btn.hidden,
.side-search.hidden,
.side-grid.hidden,
.cat-grid.hidden,
.pager.hidden {
  display: none !important;
}
.side-title { font-size: 13px; font-weight: 700; }

.shop-scroll {
  flex: 1 1 auto;
  min-height: 180px;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 6px;
  align-content: start;
}
.cat-btn {
  display: block;
  padding: 3px 2px;
  font-size: 11px;
  text-align: center;
  line-height: 1.2;
}
.eo-mh .mh .cat-btn:hover,
.eo-mh .mh .cat-btn:focus-visible {
  background: var(--mh-surface-3);
  color: var(--t0);
  border-color: var(--t0);
}

.side-search { padding: 6px 8px 0; flex: 0 0 auto; }
.side-search input {
  width: 100%;
  border: 1px solid var(--mh-line);
  background: var(--mh-surface-2);
  padding: 6px 8px;
  border-radius: 0;
  outline: none;
  font-size: 12px;
}

.side-grid {
  padding: 6px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  align-content: start;
  background: var(--mh-surface-2);
}
.asset-card {
  border: 1px solid var(--mh-line);
  background: var(--mh-surface);
  padding: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  cursor: pointer;
  border-radius: 0;
}
.asset-card .thumb {
  position: relative;
  height: 68px;
  flex: 0 0 68px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--mh-surface-3);
  overflow: hidden;
}
.asset-card .thumb.thumb-missing::after {
  content: attr(data-name);
  position: absolute;
  inset: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 10px;
  color: var(--mh-mute);
}
.asset-card img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}
.asset-card img.is-broken { opacity: 0; }
.asset-card .label {
  padding: 2px 4px;
  font-size: 10px;
  color: var(--mh-mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border-top: 1px solid var(--mh-line);
  text-align: left;
}

.pager {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  column-gap: 8px;
  padding: 8px 10px;
  border-top: 1px solid var(--mh-line);
  flex: 0 0 auto;
  background: var(--mh-surface);
}
.pager-nav {
  height: 30px;
  padding: 0 10px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  box-sizing: border-box;
}
.pager #pagePrev {
  justify-self: start;
}
.pager #pageNext {
  justify-self: end;
}
.pager-info {
  justify-self: center;
  min-width: 4.5em;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 1px solid var(--mh-line-2);
  background: var(--mh-surface-2);
  color: var(--t0);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  box-sizing: border-box;
  user-select: none;
}

.side-foot {
  padding: 6px 10px;
  border-top: 1px solid var(--mh-line);
  color: var(--mh-mute);
  font-size: 12px;
  flex: 0 0 auto;
}

.room {
  display: grid;
  grid-template-rows: auto auto auto;
  width: fit-content;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  background: var(--mh-surface-3);
  border: 1px solid var(--t0);
  border-radius: 0;
  overflow: hidden;
}
.stage-wrap {
  min-height: 0;
  overflow: hidden;
  padding: 8px 6px;
  display: grid;
  place-items: center;
}
.stage {
  position: relative;
  width: min(100%, 560px);
  aspect-ratio: 619 / 398;
  height: auto;
  background: var(--s4);
  overflow: hidden;
  touch-action: none;
  outline: none;
}
.stage-bg,
.stage-wall {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: fill;
  pointer-events: none;
  user-select: none;
}
.stage-bg { z-index: 0; }
.stage-wall { z-index: 1; }
.stage-layer { position: absolute; inset: 0; z-index: 2; }
.stage-hint {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: var(--mh-mute);
  font-size: 14px;
  pointer-events: none;
  text-align: center;
  padding: 20px;
}
.stage-hint.hidden { display: none; }

.item {
  position: absolute;
  left: 0;
  top: 0;
  transform-origin: center center;
  cursor: grab;
  user-select: none;
  outline: 2px solid transparent;
}
.item img {
  display: block;
  max-width: none;
  pointer-events: none;
  -webkit-user-drag: none;
}
.item.selected { outline-color: var(--mh-pick); }
.item.dragging { cursor: grabbing; }

.tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  padding: 6px 8px;
  background: var(--mh-surface);
  border-bottom: 1px solid var(--mh-line);
}
.tool-group {
  display: inline-flex;
  align-items: stretch;
}
.eo-mh .mh .tools button {
  padding: 4px 8px;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}
.tool-group button {
  border-radius: 0;
  margin-left: -1px;
}
.tool-group button:first-child {
  margin-left: 0;
  border-radius: 0;
}
.tool-group button:last-child {
  border-radius: 0;
}
.tool-group button:only-child {
  border-radius: 0;
}
.tool-group button:hover,
.tool-group button:focus-visible {
  position: relative;
  z-index: 1;
}
.scale-wrap {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--mh-mute);
  padding: 2px 6px;
  border: 1px solid var(--mh-line);
  border-radius: 0;
  background: var(--mh-surface-2);
}
.scale-tag { flex: 0 0 auto; }
.scale-wrap input {
  width: 78px;
  height: 18px;
  margin: 0;
  vertical-align: middle;
}
#scaleLabel {
  min-width: 2.6em;
  font-variant-numeric: tabular-nums;
  color: var(--mh-ink);
  font-size: 12px;
}

.status {
  padding: 5px 10px;
  background: var(--mh-surface);
  border-top: 1px solid var(--mh-line);
  color: var(--mh-mute);
  font-size: 12px;
}

.save-mask {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 17, 17, .35);
  display: grid;
  place-items: center;
}
.save-mask.hidden { display: none !important; }
.save-card {
  background: var(--mh-surface);
  border: 1px solid var(--mh-line-2);
  padding: 16px 22px;
  border-radius: 0;
  box-shadow: none;
}
.mh-dlg {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(255,255,255,.88);
  display: grid;
  place-items: center;
  padding: 20px;
}
.mh-dlg.hidden { display: none !important; }
.mh-dlg-card {
  width: min(320px, 100%);
  background: #fff;
  border: 1px solid #111;
  padding: 16px 14px 14px;
}
.mh-dlg-t {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: #111;
  white-space: pre-wrap;
}
.mh-dlg-ops {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}
.eo-mh .mh-dlg .mh-chip,
.mh-dlg .mh-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 26px;
  padding: 0 10px;
  margin: 0;
  border: 1px solid #111;
  border-radius: 0;
  background: #fff;
  color: #111;
  font: inherit;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}
.eo-mh .mh-dlg .mh-chip:hover,
.mh-dlg .mh-chip:hover {
  background: #f4f4f4;
}
.eo-mh .mh-dlg .mh-chip.on,
.mh-dlg .mh-chip.on {
  background: #111;
  color: #fff;
}
.eo-mh .mh-dlg .mh-chip.on:hover,
.mh-dlg .mh-chip.on:hover {
  background: #333;
  border-color: #333;
  color: #fff;
}
.mh-dlg .mh-chip::before,
.mh-dlg .mh-chip::after {
  display: none !important;
  content: none !important;
}

@media (max-width: 860px) {
  .mh { padding: 8px 10px 28px; }
  .mh-work {
    flex-direction: column;
    align-items: stretch;
  }
  .room {
    min-height: 0;
    width: 100%;
    grid-template-rows: auto auto auto;
  }
  .stage-wrap {
    padding: 8px;
  }
  .stage {
    width: min(100%, 560px);
    height: auto;
  }
  .shop {
    position: static;
    width: 100%;
    flex: none;
    height: min(52vh, 460px);
    max-height: min(52vh, 460px);
    min-height: 280px;
  }
  .shop-scroll {
    min-height: 160px;
  }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .side-grid { grid-template-columns: repeat(3, 1fr); }
  .asset-card .thumb { height: 68px; flex-basis: 68px; }
  .tools {
    display: grid;
    grid-template-columns: 1fr;
    gap: 6px;
    padding: 8px;
  }
  .tool-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    width: 100%;
  }
  .tool-group[aria-label="朝向"] {
    grid-template-columns: 1fr;
  }
  .tool-group button {
    margin-left: 0;
    border-radius: 0;
    min-height: 34px;
  }
  .tool-group button:not(:first-child) {
    border-left-width: 0;
  }
  .tool-group button:first-child { border-radius: 0; }
  .tool-group button:last-child { border-radius: 0; }
  .scale-wrap {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 8px;
  }
  .scale-wrap input {
    flex: 1;
    width: auto;
    min-width: 0;
  }
}

