.view-cube-shell {
  display: grid;
  justify-items: center;
  gap: 1px;
  margin-bottom: 4px;
}

#orientation-cube {
  width: 86px;
  height: 86px;
  overflow: visible;
  touch-action: none;
  user-select: none;
  cursor: grab;
  filter: drop-shadow(0 3px 3px #213d5930);
  border-radius: 12px;
}

#orientation-cube.is-dragging { cursor: grabbing; }

.cube-facet polygon {
  fill: #d6e9f8;
  stroke: #7b9db3;
  stroke-width: 1;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.cube-facet[data-cube-view="上"] polygon { fill: #edfaff; }
.cube-facet[data-cube-view="右"] polygon,
.cube-facet[data-cube-view="左"] polygon { fill: #c5def1; }
.cube-facet-2 polygon { fill: #b5d3e7; }
.cube-facet-3 polygon { fill: #91b8d4; }
.cube-facet:hover polygon,
.cube-facet:focus-visible polygon {
  fill: #7bcbe3;
  stroke: #165b78;
}

.cube-facet text {
  pointer-events: none;
  fill: #22465d;
  font: 700 16px var(--font-ui);
  text-anchor: middle;
  dominant-baseline: central;
}

.view-cube-hint {
  color: var(--muted);
  font-size: 10px;
  pointer-events: none;
}

.view-control-buttons {
  display: grid;
  gap: 8px;
}

.view-pan-indicator {
  position: absolute;
  z-index: 8;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 9px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent);
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
}

#view.pan-mode #cv { cursor: grab; }
#view.is-panning #cv { cursor: grabbing; }
#view.pan-mode :is(#handles *, #rotation-overlay .ring-hit, #deform-handles *, #ruler-labels *, #note-markers *) {
  pointer-events: none;
}

#views .view-round {
  display: grid;
  place-items: center;
  width: 38px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 11px;
  color: var(--fg);
  background: var(--surface);
  padding: 0;
}

#views .view-round:hover,
#views .view-round[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

#views .view-round svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

@media (max-width: 820px) {
  #views { width: 86px; }
}

@media (max-width: 540px), (max-height: 620px) {
  #views {
    width: auto;
    max-width: calc(100% - 36px);
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 5px;
  }
  #orientation-cube { width: 68px; height: 68px; }
  .view-control-buttons { grid-template-columns: repeat(2, 36px); gap: 4px; }
  #views .view-round { width: 36px; height: 34px; }
  .view-pan-indicator { top: auto; bottom: 12px; }
}

@media (max-height: 480px) {
  #views { top: 6px; gap: 4px; transform: scale(.75); transform-origin: top left; }
  .view-cube-hint { display: none; }
}
