.bumio .telegram-invite-actions {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}

.bumio .telegram-invite-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid #4c4c4c;
  border-radius: 9px;
  color: #eee;
  background: #171717;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
}

.bumio .telegram-invite-link:hover {
  background: #252525;
  border-color: #888;
}

.bumio .telegram-invite-share {
  color: #111;
  background: #e3e3e3;
  border-color: #e3e3e3;
}

.bumio .telegram-invite-share:hover {
  color: #111;
  background: #fff;
  border-color: #fff;
}

.bumio .telegram-invite-actions .invite-url {
  margin: 0;
  font-size: 16px;
}

html[data-telegram-mode="true"] {
  background: #111;
  color-scheme: dark;
  --bumio-telegram-height: 100dvh;
  --bumio-telegram-stable-height: 100dvh;
  --bumio-telegram-top: calc(max(env(safe-area-inset-top, 0px), var(--bumio-telegram-system-top, 0px)) + var(--bumio-telegram-content-top, 0px));
  --bumio-telegram-right: calc(max(env(safe-area-inset-right, 0px), var(--bumio-telegram-system-right, 0px)) + var(--bumio-telegram-content-right, 0px));
  --bumio-telegram-bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--bumio-telegram-system-bottom, 0px)) + var(--bumio-telegram-content-bottom, 0px));
  --bumio-telegram-left: calc(max(env(safe-area-inset-left, 0px), var(--bumio-telegram-system-left, 0px)) + var(--bumio-telegram-content-left, 0px));
  --bumio-telegram-available-height: calc(var(--bumio-telegram-height) - var(--bumio-telegram-top) - var(--bumio-telegram-bottom) - 16px);
  scroll-padding-top: calc(var(--bumio-player-height) + var(--bumio-telegram-top) + 24px);
}

html[data-telegram-mode="true"] .bumio {
  min-height: var(--bumio-telegram-stable-height);
  padding: var(--bumio-telegram-top) var(--bumio-telegram-right) var(--bumio-telegram-bottom) var(--bumio-telegram-left);
}

html[data-telegram-mode="true"] .bumio .room {
  margin: 8px auto;
  min-height: calc(var(--bumio-telegram-stable-height) - var(--bumio-telegram-top) - var(--bumio-telegram-bottom) - 16px);
}

html[data-telegram-mode="true"] .bumio .room-entry {
  margin-top: 24px;
  min-height: 260px;
}

html[data-telegram-mode="true"] .bumio .player-panel {
  top: calc(var(--bumio-telegram-top) + 8px);
}

html[data-telegram-mode="true"] .bumio dialog {
  top: calc(var(--bumio-telegram-top) + 8px);
  right: calc(var(--bumio-telegram-right) + 8px);
  bottom: calc(max(0px, 100dvh - var(--bumio-telegram-height)) + var(--bumio-telegram-bottom) + 8px);
  left: calc(var(--bumio-telegram-left) + 8px);
  max-width: calc(100vw - var(--bumio-telegram-left) - var(--bumio-telegram-right) - 16px);
  max-height: var(--bumio-telegram-available-height);
  margin: auto;
}

html[data-telegram-mode="true"] .bumio .service-dialog,
html[data-telegram-mode="true"] .bumio .library-dialog.remote-browser {
  height: var(--bumio-telegram-available-height);
}

html[data-telegram-mode="true"] .bumio .queue-item,
html[data-telegram-mode="true"] .bumio .library-tracks,
html[data-telegram-mode="true"] .bumio #queue-list {
  scroll-margin-top: calc(var(--bumio-player-height) + var(--bumio-telegram-top) + 24px);
}

html[data-telegram-mode="true"] .bumio-install {
  display: none;
}
