.sun-zoom {
  position: relative;
  grid-column: 2;
  justify-self: center;
  align-self: center;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 2px;
  max-width: calc(100vw - 24px);
  padding: 0;
  box-sizing: border-box;
  background: transparent;
  color: var(--text);
  border-radius: 0;
  box-shadow: none;
}

.sun-zoom-tools {
  display: contents;
}

#zoomOut { order: 1; }
#zoomIn { order: 2; }
.sun-zoom-rule { order: 3; }
#viewFromEarth { order: 4; }
#sunFullscreen { order: 5; }

.sun-zoom button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: var(--sun-zoom-size);
  height: var(--sun-zoom-size);
  min-width: 0;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  transition: background-color 140ms ease, color 140ms ease;
}

.sun-zoom button:active {
  background: var(--chrome-line);
}

.sun-zoom button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (hover: hover) and (pointer: fine) {
  .sun-zoom button:hover {
    background: var(--panel-bg);
  }

  .sun-zoom button:hover::after {
    opacity: 1;
  }
}

.sun-zoom button::after {
  content: attr(aria-label);
  position: absolute;
  left: 50%;
  bottom: calc(100% + 8px);
  transform: translateX(-50%);
  z-index: 6;
  padding: 4px 8px;
  border-radius: 8px;
  background: var(--text);
  color: var(--panel-bg);
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
}

.sun-zoom button:focus-visible::after {
  opacity: 1;
}

.sun-zoom-value {
  position: absolute;
  width: 1px;
  height: 1px;
  min-width: 0;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.sun-zoom-rule {
  width: 1px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--chrome-line);
}

.sun-shell.is-zoom-dock .sun-zoom {
  position: fixed;
  top: auto;
  right: calc(var(--sun-zoom-dock-right, 0px) + env(safe-area-inset-right, 0px));
  bottom: calc(var(--sun-status-block, 55px) + 12px + var(--sun-zoom-lift, 0px) + env(safe-area-inset-bottom, 0px));
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 0;
  background: rgb(from var(--panel-bg) r g b / 0.3);
  border-radius: var(--radius);
  box-shadow: none;
}

.sun-shell.is-zoom-dock #zoomIn {
  order: 1;
}

.sun-shell.is-zoom-dock #zoomOut {
  order: 2;
}

.sun-shell.is-zoom-dock .sun-zoom-rule {
  width: 18px;
  height: 1px;
}

.sun-shell.is-zoom-dock .sun-zoom button::after {
  left: auto;
  right: calc(100% + 8px);
  bottom: auto;
  top: 50%;
  transform: translateY(-50%);
}
