.sg {
  position: relative;
  width: 540px;
  height: 540px;
  overflow: hidden;
  background: #2a1408;
  color: #fff7ec;
  font-family: "Instrument Serif", serif;
}

.sg * { box-sizing: border-box; }

/* The room sits behind the panel, a little out of focus. */
.sg-room {
  position: absolute;
  inset: -20px;
  width: 580px;
  height: 580px;
  object-fit: cover;
  filter: blur(5px) brightness(0.86) saturate(1.08);
}

.sg-glass {
  border: 0;
  background: linear-gradient(180deg, #ffffff38 0%, #ffffff1c 100%);
  backdrop-filter: blur(26px) saturate(1.6) brightness(1.06);
  box-shadow:
    inset 0 1px 0 #ffffff8c,
    inset 0 0 0 1px #ffffff2e,
    inset 0 -1px 0 #0000001f,
    0 28px 56px -18px #1c0a00b3;
}

/* Trigger: 440 x 88 pill, centred; value text starts at x = 86. */
.sg-trigger {
  position: absolute;
  left: 50px;
  top: 55px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 440px;
  height: 88px;
  padding: 0 18px 0 36px;
  border-radius: 44px;
  color: inherit;
  font: inherit;
  font-size: 44px;
  line-height: 52px;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px #2a120066;
  outline: none;
}

.sg-trigger [data-slot="select-value"] { translate: 0 -2px; }

.sg-chev {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 26px;
  background: #fff7ec29;
  box-shadow: inset 0 1px 0 #ffffff5c;
  transition: background-color 160ms;
}

.sg-chev svg {
  width: 28px;
  height: 28px;
  stroke-width: 2;
  transition: rotate 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sg-trigger[data-open] .sg-chev { background: #fff7ec; color: #5b2a12; }
.sg-trigger[data-open] .sg-chev svg { rotate: 180deg; }

/* Popup: same width, 28 + 8 concentric corners, 62 px rows. */
.sg-pop {
  width: var(--anchor-width);
  margin: 0;
  padding: 10px;
  border-radius: 36px;
  color: #fff7ec;
  outline: none;
  transform-origin: 50% 0;
  transition:
    opacity 220ms ease-out,
    transform 300ms cubic-bezier(0.2, 0.9, 0.25, 1);
}

.sg-pop[data-starting-style],
.sg-pop[data-ending-style] {
  opacity: 0;
  transform: translateY(-14px) scale(0.94);
}

.sg-pop [data-slot="select-item"] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 62px;
  padding: 0 17px 0 26px;
  border-radius: 26px;
  font-size: 36px;
  line-height: 44px;
  letter-spacing: -0.01em;
  text-shadow: 0 1px 12px #2a120066;
  outline: none;
  transition: background-color 100ms ease, box-shadow 100ms ease;
}

.sg-pop [data-slot="select-item"] > :first-child { translate: 0 -2px; }

.sg-pop [data-highlighted] {
  background: #fff7ec38;
  box-shadow: inset 0 1px 0 #ffffff66;
}

.sg-check {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 17px;
  background: #fff7ec;
  color: #5b2a12;
}

.sg-check svg { width: 20px; height: 20px; stroke-width: 2.6; }
