#sphere-photo-button {
  position: fixed;
  z-index: 2;
  translate: -50% -50%;
  display: grid;
  place-items: center;
  inline-size: 64px;
  block-size: 64px;
  padding: 0;
  border-radius: 50%;
  color: var(--ink);
  background: linear-gradient(155deg, rgb(252 254 255 / .95), rgb(221 237 247 / .69));
  box-shadow: inset 0 1px 0 white, inset 0 -2px 0 rgb(240 169 131 / .55), 0 6px 20px var(--shade);
  cursor: pointer;
  transition: scale .17s ease-out, background .17s ease-out;
}
#sphere-photo-button, #sphere-photo-dialog button {
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}
#sphere-photo-button[data-has-photo] {
  background: linear-gradient(155deg, rgb(248 253 255 / .79), rgb(218 237 248 / .5));
}
#sphere-photo-button:hover { background: var(--glass-strong); }
#sphere-photo-button:active { scale: .94; }
#sphere-photo-button:focus-visible, #sphere-photo-dialog button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}
#sphere-photo-button svg, #sphere-photo-dialog svg {
  display: block;
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
#sphere-photo-dialog {
  position: fixed;
  box-sizing: border-box;
  inline-size: min(376px, calc(100% - 28px));
  max-block-size: calc(100dvh - 28px);
  margin: auto;
  border-radius: 32px;
  padding: 28px 24px 22px;
  overflow: auto;
  background: linear-gradient(156deg, rgb(250 253 255 / .94), rgb(223 235 247 / .84));
  color: var(--ink);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .98), 0 22px 68px rgb(13 33 56 / .28);
}
#sphere-photo-dialog:modal { overscroll-behavior: contain; }
#sphere-photo-dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgb(16 36 63 / .33);
  backdrop-filter: blur(3px);
}
#sphere-photo-dialog form { text-align: center; }
.sphere-photo-lens {
  position: relative;
  display: grid;
  place-items: center;
  inline-size: clamp(100px, 28dvh, 166px);
  aspect-ratio: 1;
  margin: 0 auto 17px;
  overflow: hidden;
  border: 1px solid rgb(255 255 255 / .9);
  border-radius: 50%;
  background: radial-gradient(circle at 32% 22%, #f9feff 2%, #e3eff6 37%, #bdd3e4 77%, #9ab8ce 100%);
  color: #3c617a;
  box-shadow: 0 6px 16px var(--shade), 0 1px 0 5px rgb(247 252 255 / .45);
}
.sphere-photo-lens::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(ellipse at 25% 22%, rgb(255 255 255 / .61), transparent 36%);
  box-shadow: inset 0 1px 4px rgb(255 255 255 / .8), inset 0 -12px 24px rgb(25 68 107 / .19);
  pointer-events: none;
  content: '';
}
#sphere-photo-preview { display: block; width: 100%; height: 100%; }
#sphere-photo-empty { width: 42px; height: 42px; }
#sphere-photo-title {
  margin: 0;
  font: 400 25px/1.1 var(--display), sans-serif;
  letter-spacing: .035em;
}
.sphere-photo-note {
  margin: 6px 0 20px;
  color: var(--ink-soft);
  font: 400 13px/1.3 var(--label), sans-serif;
}
#sphere-photo-dialog button {
  min-block-size: 44px;
  padding: 9px 14px;
  border: 1px solid rgb(112 144 168 / .28);
  border-radius: 999px;
  font: 500 14px/1.15 var(--label), sans-serif;
  color: inherit;
  background: rgb(251 254 255 / .62);
  cursor: pointer;
}
#sphere-photo-dialog button:hover { background: rgb(251 254 255 / .95); }
#sphere-photo-dialog .sphere-photo-close {
  position: absolute;
  inset: 12px 12px auto auto;
  display: grid;
  place-items: center;
  inline-size: 44px;
  padding: 0;
}
#sphere-photo-dialog .sphere-photo-close svg { width: 20px; height: 20px; }
.sphere-photo-actions { display: flex; gap: 8px; }
.sphere-photo-actions button { flex: 1; }
#sphere-photo-dialog #sphere-photo-change {
  flex: 1.14;
  border-color: transparent;
  background: #1f374d;
  color: #f5fbff;
  box-shadow: inset 0 -2px 0 rgb(240 169 131 / .7);
}
#sphere-photo-dialog #sphere-photo-change:hover { background: #304c61; }
@media (prefers-reduced-motion: reduce) {
  #sphere-photo-button { transition: none; }
  #sphere-photo-button:active { scale: 1; }
}
