/* RVTik iframe safe-area hotfix v2
   Theme editor shell only. Visual CSS; no iframe contents or handlers changed.
   IMPORTANT: Size the editor against the padded available area, not raw vh.
*/
#themeFrame {
  box-sizing: border-box;
  padding: clamp(56px, 8vh, 72px) clamp(14px, 2vw, 26px) clamp(18px, 3vh, 30px) !important;
  overflow: hidden;
  background: rgba(7, 7, 12, .70) !important;
  backdrop-filter: blur(6px) !important;
  -webkit-backdrop-filter: blur(6px) !important;
}
#themeFrame .theme-editor {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: min(1540px, 100%) !important;
  max-width: 100% !important;
  height: 100% !important;
  max-height: 100% !important;
  min-height: 0;
  overflow: hidden;
  border-radius: 11px;
  border: 1px solid rgba(203, 197, 222, .17) !important;
  background: #13131a !important;
  box-shadow: 0 16px 44px rgba(0, 0, 0, .38) !important;
}
#themeFrame .theme-header {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  flex: 0 0 36px;
  height: 36px;
  min-height: 36px;
  padding: 0 8px 0 14px;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .08);
  background: #191920 !important;
  color: #e3e2ea;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .01em;
  line-height: normal;
}
#themeFrame .theme-header > span {
  display: block;
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
#themeFrame .theme-header #closeTheme {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  min-width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: #bbb9c8;
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  transform: none;
  transition: background-color 140ms ease, color 140ms ease;
  cursor: pointer;
}
#themeFrame .theme-header #closeTheme:hover {
  background: rgba(255, 255, 255, .09);
  color: #fff;
  transform: none;
}
#themeFrame .theme-header #closeTheme:active {
  transform: none;
  background: rgba(255, 255, 255, .13);
}
#themeFrame .theme-header #closeTheme:focus-visible {
  outline: 2px solid #a088e6;
  outline-offset: 1px;
}
#themeFrame #themeIframe {
  display: block;
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  height: auto;
  min-height: 0;
  border: none;
  border-radius: 0;
  background: #0f1016;
}
/* Shorter windows: preserve a safe zone under the app's title bar. */
@media (max-height: 600px) {
  #themeFrame { padding: 48px 12px 16px !important; }
}
@media (max-width: 720px) {
  #themeFrame { padding-left: 10px !important; padding-right: 10px !important; }
  #themeFrame .theme-editor { border-radius: 8px; }
  #themeFrame .theme-header { flex-basis: 34px; height: 34px; min-height: 34px; }
}
@media (max-height: 420px) {
  #themeFrame { padding-top: 42px !important; padding-bottom: 8px !important; }
  #themeFrame .theme-header { flex-basis: 32px; height: 32px; min-height: 32px; }
}
@media (prefers-reduced-motion: reduce) {
  #themeFrame .theme-header #closeTheme { transition: none; }
}
