body.platform-switching { overflow: hidden; }
body.platform-embedded #mainApp > .container > .header,
body.platform-embedded #appContainer > header,
body.platform-embedded .wrap > .head { display: none; }

#sharedPlatformShell {
  position: fixed;
  inset: 0;
  z-index: 30000;
  display: flex;
  flex-direction: column;
  background: #fff;
}
#sharedPlatformShell[hidden],
#sharedPlatformShell .shared-platform-frame[hidden] { display: none; }
.shared-platform-bar {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 52px 16px;
  color: #fff;
  background: linear-gradient(135deg, #667eea, #764ba2);
}
.shared-platform-bar h1 { margin: 0; font-size: 24px; }
.shared-platform-balance {
  padding: 6px 14px;
  border: 1px solid #ffffff66;
  border-radius: 999px;
  background: #ffffff22;
  font-weight: 600;
}
.shared-platform-buttons { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }
.shared-platform-item { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.shared-platform-buttons button {
  min-width: 120px;
  padding: 10px 16px;
  color: #fff;
  background: #ffffff2e;
  border: 1px solid #ffffff66;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.shared-platform-buttons button.active { color: #5b4cc4; background: #fff; }
.shared-platform-official { color: #fff; font-size: 13px; text-decoration: underline; }
.shared-platform-close {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: #ef4444;
  font-size: 22px;
  cursor: pointer;
}
#sharedPlatformShell .shared-platform-frame { width: 100%; min-height: 0; flex: 1 1 0; border: 0; background: #fff; }

@media (max-width: 768px) {
  #sharedPlatformShell .shared-platform-bar h1,
  #sharedPlatformShell .shared-platform-official {
    display: none;
  }

  #sharedPlatformShell .shared-platform-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto 44px;
    flex: 0 0 auto;
    gap: 4px;
    height: auto;
    padding: 6px 48px 6px 8px;
    overflow: hidden;
  }

  #sharedPlatformShell .shared-platform-balance {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    justify-self: start;
    max-width: 100%;
    margin: 0;
    padding: 3px 10px;
    font-size: 13px;
    line-height: 20px;
  }

  #sharedPlatformShell .shared-platform-buttons {
    display: flex;
    min-width: 0;
    width: 100%;
    flex-wrap: nowrap;
    justify-content: flex-start;
    gap: 5px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  #sharedPlatformShell .shared-platform-item {
    flex: 0 0 auto;
  }

  #sharedPlatformShell .shared-platform-buttons button {
    min-width: 72px;
    height: 42px;
    padding: 6px 8px;
    font-size: 12px;
  }

  #sharedPlatformShell .shared-platform-frame {
    min-height: 0;
    flex: 1 1 0;
  }
}
