.overlay {
  position: fixed;
  z-index: 140;
  inset: 0;
  background: rgb(17 7 14 / 34%);
  backdrop-filter: blur(2px);
  cursor: pointer;
}

.settings-panel {
  position: fixed;
  z-index: 150;
  background: var(--color-surface);
  box-shadow: var(--shadow-soft);
}

.settings-panel {
  top: 0;
  right: 0;
  bottom: 0;
  width: min(390px, 100%);
  overflow-y: auto;
}

.settings-handle {
  display: none;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  padding: 0 20px;
  border-bottom: 1px solid var(--color-line);
}

.panel-header h2 {
  margin: 0;
  font-family: "Cormorant Garamond", serif;
  font-size: 24px;
}

.settings-label {
  padding: 16px 20px 8px;
  color: var(--color-faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.5px;
}

.orientation-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  padding: 8px 20px 16px;
  gap: 10px;
}

.orientation-options button {
  height: 36px;
  border: 1px solid var(--color-line-strong);
  border-radius: 999px;
  background: var(--color-surface-muted);
  cursor: pointer;
}

.orientation-options button[aria-pressed="true"] {
  border-color: transparent;
  background: var(--gradient-brand);
  color: #fff;
}

.settings-row {
  display: flex;
  align-items: center;
  height: 58px;
  padding: 0 20px;
  gap: 12px;
  border-top: 1px solid var(--color-line);
}

.settings-row > span:nth-child(2) {
  flex: 1;
  font-size: 14px;
}

.switch {
  position: relative;
  width: 44px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--color-line-strong);
  cursor: pointer;
}

.switch::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 5px rgb(0 0 0 / 18%);
  content: "";
  transition: transform 160ms ease;
}

.switch[aria-pressed="true"] {
  background: var(--color-brand);
}

.switch[aria-pressed="true"]::after {
  transform: translateX(20px);
}

@media (max-width: 767px) {
  .settings-panel {
    top: auto;
    height: min(620px, 88vh);
    border-radius: 20px 20px 0 0;
  }

  .settings-handle {
    display: grid;
    height: 24px;
    place-items: center;
  }

  .settings-handle::after {
    width: 36px;
    height: 4px;
    border-radius: 3px;
    background: var(--color-line-strong);
    content: "";
  }

  .panel-header {
    height: 52px;
  }
}
