.bg-settings-card {
  grid-column: 1 / -1;
}

.bg-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.bg-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color .18s var(--ease), transform .18s var(--ease), box-shadow .18s var(--ease);
}

.bg-tile:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lift);
}

.bg-tile:active {
  transform: translateY(0) scale(.99);
}

.bg-tile.is-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent), 0 10px 26px -18px rgba(var(--accent-rgb), .9);
}

.bg-tile:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.bg-tile-shot {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #07070a;
}

.bg-tile-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s var(--ease), filter .3s var(--ease);
}

.bg-tile:hover .bg-tile-shot img {
  transform: scale(1.04);
}

.bg-tile.is-active .bg-tile-shot img {
  filter: saturate(1.05) brightness(1.05);
}

.bg-tile-copy {
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 9px 11px 11px;
  min-width: 0;
}

.bg-tile-copy strong {
  font-size: .86rem;
  letter-spacing: -.01em;
}

.bg-tile-copy small {
  color: var(--text-faint);
  font-size: .7rem;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bg-tile-tick {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  background: var(--accent);
  color: #120a03;
  opacity: 0;
  transform: scale(.7);
  transition: opacity .16s var(--ease), transform .16s var(--ease);
}

.bg-tile-tick svg {
  width: 12px;
  height: 12px;
}

.bg-tile.is-active .bg-tile-tick {
  opacity: 1;
  transform: scale(1);
}

.bg-toggles {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-top: 18px;
  border-top: 1px solid var(--line);
}

.bg-toggle {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.bg-toggle-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.bg-toggle-copy strong {
  font-size: .9rem;
}

.bg-toggle-copy small {
  color: var(--text-faint);
  font-size: .74rem;
  line-height: 1.35;
}

.bg-switch {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  width: 44px;
  height: 25px;
  flex: none;
  margin-left: auto;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface-3);
  cursor: pointer;
  transition: background .18s var(--ease), border-color .18s var(--ease);
}

.bg-switch::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 3px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--text-faint);
  transform: translateY(-50%);
  transition: transform .18s var(--ease), background .18s var(--ease);
}

.bg-switch:checked {
  border-color: var(--accent);
  background: rgba(var(--accent-rgb), .28);
}

.bg-switch:checked::after {
  background: var(--accent);
  transform: translate(19px, -50%);
}

.bg-switch:focus-visible {
  outline: 2px solid var(--accent-ring);
  outline-offset: 2px;
}

.bg-note {
  margin: 13px 0 0;
  color: var(--text-faint);
  font-size: .74rem;
  line-height: 1.4;
}

.bg-note strong {
  color: var(--text-muted);
  font-weight: 600;
}

@media (max-width: 900px) {
  .bg-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .bg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
}
