/* Paint only the named surface. Browser, modal cards and chat controls keep their styles. */
html[data-og-rain-mode] #ogSettings.og-bg-custom,
html[data-og-rain-mode] #sideMenu.og-bg-custom,
html[data-og-rain-mode][data-og-menu-bg] #sideMenu.og-bg-custom,
html[data-og-rain-mode][data-og-text] #sideMenu.og-bg-custom,
html .chat-container.og-bg-custom {
  background-image: var(--og-bg-shade), var(--og-bg-art);
  background-color: var(--og-bg-base);
  background-position: center, var(--og-bg-position);
  background-size: cover, var(--og-bg-fit);
  background-repeat: no-repeat;
}
#ogSettings.og-bg-custom .og-settings-top,
#ogSettings.og-bg-custom .og-set-page-top,
#ogSettings.og-bg-custom .og-set-note,
#ogSettings.og-bg-custom .og-settings-sec,
#sideMenu.og-bg-custom .og-menu-nav,
#sideMenu.og-bg-custom .og-menu-sec,
#sideMenu.og-bg-custom > .og-menu-foot {
  background: var(--og-ui-surface, #f5f7fb);
  border-radius: 12px;
}
html .chat-container.og-bg-custom #emptyState .og-empty-tag,
html .chat-container.og-bg-custom #emptyState .og-empty-name {
  background: #141d2a;
  color: #fff;
  border-radius: 10px;
  padding-inline: 8px;
}
#ogBackgroundStudio { margin-block: 14px; }
#ogBgTitle { margin: 0; font-size: 1.12rem; }
.og-bg-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-block: 10px; }
.og-bg-grid[hidden], #ogBackgroundStudio [hidden] { display: none; }
.og-bg-full { grid-column: 1 / -1; }
#ogBgControls label { display: grid; gap: 4px; min-width: 0; font-size: .9rem; }
#ogBgControls :is(select,button,input), .og-bg-use {
  box-sizing: border-box; max-width: 100%; min-height: 44px; font: inherit;
}
#ogBgControls :is(select,input:not([type="range"]),button:not(.og-set-primary)), .og-bg-use {
  border: 1px solid #8498ae; border-radius: 10px; background: #eef4fc; color: #142338;
  padding: 6px 8px;
}
#ogBgControls select { width: 100%; text-overflow: ellipsis; }
#ogBgControls input[type="color"] { width: 100%; }
#ogBgControls :focus-visible, .og-bg-use:focus-visible { outline: 2px solid #2878d1; outline-offset: 2px; }
.og-bg-preview {
  display: grid; place-items: end start; margin-top: 10px; min-height: 124px;
  border: 1px solid #8498ae; border-radius: 12px; padding: 10px;
  background-color: #dae6f2;
}
.og-bg-preview.og-bg-custom {
  background-color: var(--og-bg-base);
  background-image: var(--og-bg-shade), var(--og-bg-art);
  background-position: center, var(--og-bg-position);
  background-size: cover, var(--og-bg-fit);
  background-repeat: no-repeat;
}
.og-bg-preview span { border-radius: 8px; padding: 4px 8px; background: #f7faff; color: #142338; }
.og-bg-actions { display:flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.og-bg-actions .og-set-primary { margin: 0; }
#ogBgStatus { margin: 8px 0 0; min-height: 1.25em; }
.og-bg-use { display: block; margin: 6px 0; }
@media (max-width: 360px) { .og-bg-grid { grid-template-columns: 1fr; } }
