/* Load after ui_refresh.css. Keep clear of the status bar and media player. */
.software-downloads {
  position: fixed; right: max(12px, env(safe-area-inset-right, 0px));
  bottom: calc(36px + env(safe-area-inset-bottom, 0px)); z-index: 9991;
  display: flex; flex-direction: column; align-items: flex-end; gap: 8px;
  max-width: calc(100vw - 24px); color: var(--ink, #202940);
  font-family: inherit; pointer-events: none;
}
.software-downloads > * { pointer-events: auto; }
.software-downloads-toggle {
  min-height: 42px; border: 1px solid var(--line, #dce1e9); border-radius: 22px;
  padding: 9px 16px; font-family: inherit; font-weight: 600; font-size: 13px; line-height: 1.5; white-space: nowrap;
  background: var(--panel, #fff); color: var(--brand, #304b87);
  box-shadow: 0 3px 14px #17264120; cursor: pointer;
}
.software-downloads-panel {
  order: -1;
  width: min(340px, calc(100vw - 24px)); max-height: min(440px, 70vh);
  overflow: auto; padding: 16px; border: 1px solid var(--line, #dce1e9);
  border-radius: 16px; background: var(--panel, #fff); box-shadow: 0 8px 32px #17264130;
  box-sizing: border-box;
}
.software-downloads [hidden] { display: none !important; }
.software-downloads-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.software-downloads-heading h2 { margin: 0; font-size: 17px; line-height: 1.5; }
.software-downloads-close { flex: none; width: 36px; min-height: 36px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: inherit; font-size: 24px; cursor: pointer; }
.software-downloads-note, .software-downloads-status { margin: 8px 0; color: var(--sub, #627087); font-size: 12px; line-height: 1.7; overflow-wrap: anywhere; }
.software-downloads-status:empty { display: none; }
.software-downloads-links { display: grid; gap: 8px; margin: 12px 0; }
.software-downloads-link { display: flex; align-items: center; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line, #dce1e9); border-radius: 10px; background: var(--soft, #edf1f8); color: var(--brand, #304b87); text-decoration: none; line-height: 1.5; font-weight: 600; font-size: 14px; overflow-wrap: anywhere; box-sizing: border-box; }
.software-downloads-link:hover, .software-downloads-close:hover { background: var(--ui-hover, #f1f4fa); }
.software-downloads :is(button,a):focus-visible { outline: 3px solid var(--focus, #3b62ad); outline-offset: 2px; }
body:has(#software-downloads):not(.chat-mode) main#main { padding-bottom: 88px; }
body:has(#player:not([hidden])) .software-downloads { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
body:has(.mtdl-panel:not([hidden])) .software-downloads { right: max(390px, env(safe-area-inset-right, 0px)); }
@media (max-width:820px), (pointer:coarse) and (max-width:1024px) {
  .software-downloads { right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(8px + env(safe-area-inset-bottom, 0px)); }
  .software-downloads-toggle { min-height: 44px; padding: 9px 14px; }
  body:has(#player:not([hidden])) .software-downloads { bottom: calc(92px + env(safe-area-inset-bottom, 0px)); right: 52px; }
  body:has(.mtdl-panel:not([hidden])) .software-downloads { right: max(10px, env(safe-area-inset-right, 0px)); bottom: calc(50vh + 24px); }
  body:has(.mtdl-panel:not([hidden])) .software-downloads-panel { max-height: max(60px, calc(45vh - 80px)); }
  body.chat-mode .software-downloads { bottom: calc(80px + env(safe-area-inset-bottom, 0px)); right: 52px; }
}
