/* r5 responsive polish: keep upload actions attached to the file workbench. */

/* The lower sidebar is one visual group, so its labels share a centered axis. */
.sidebar-bottom {
  align-items: stretch;
  text-align: center;
}

.storage-summary {
  margin-inline: 0;
  text-align: center;
}

.storage-usage,
.vip-entry {
  justify-content: center;
}

.vip-entry #vipOpen {
  padding-inline: 12px;
}

.theme-toggle,
#logoutButton {
  justify-content: center;
  text-align: center;
}

/* The command bar belongs to the file workbench, not the account heading. */
.workspace-head {
  align-items: flex-start;
  margin-bottom: 18px;
}

.file-command-bar {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  min-height: 46px;
  margin-bottom: 12px;
}

.file-command-bar .mobile-filters {
  margin: 0;
}

.workspace-actions {
  margin-left: auto;
}

.workspace-actions .primary-button,
.workspace-actions .secondary-button {
  min-height: 46px;
}

#mobileUpload[hidden] {
  display: none !important;
}

@media (max-width: 1180px) {
  .app-shell {
    display: block;
  }

  .app-sidebar {
    display: none;
  }

  .app-main {
    height: 100%;
  }

  .mobile-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    height: 66px;
    align-items: center;
    justify-content: space-between;
    padding: 0 22px;
    border-bottom: 1px solid var(--line);
    background: color-mix(in srgb, var(--sidebar) 94%, transparent);
    backdrop-filter: blur(14px);
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .workspace {
    width: calc(100% - 40px);
    padding-top: 28px;
  }

  .workspace-head {
    margin-bottom: 16px;
  }

  .file-command-bar {
    justify-content: space-between;
  }

  .file-command-bar .mobile-filters {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 7px;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .file-command-bar .mobile-filters::-webkit-scrollbar {
    display: none;
  }

  .file-command-bar .mobile-filters button {
    flex: 0 0 auto;
    min-height: 40px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 9px;
    background: var(--white);
    color: var(--muted);
    font-size: 12px;
  }

  .file-command-bar .mobile-filters button.active {
    border-color: transparent;
    background: var(--brand-soft);
    color: var(--brand-dark);
    font-weight: 700;
  }

  .file-section {
    min-height: max(520px, calc(100dvh - 300px));
  }
}

@media (max-width: 760px) {
  .workspace-actions {
    gap: 8px;
  }

  .workspace-actions .transfer-button,
  .workspace-actions .upload-action {
    width: 46px;
    min-width: 46px;
    height: 46px;
    min-height: 46px;
    padding: 0;
    border-radius: 12px;
  }

  .workspace-actions .transfer-button span,
  .workspace-actions .upload-action span {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .workspace-actions svg {
    width: 20px;
    height: 20px;
  }
}

@media (max-width: 650px) {
  .workspace {
    padding-top: 26px;
    padding-bottom: 24px;
  }

  .workspace-head {
    margin-bottom: 14px;
  }

  .file-command-bar {
    gap: 10px;
    margin-bottom: 10px;
  }

  .file-command-bar .mobile-filters {
    gap: 7px;
  }

  .file-command-bar .mobile-filters button {
    min-height: 40px;
    padding-inline: 14px;
  }

  .file-section {
    min-height: max(470px, calc(100dvh - 314px));
  }
}

@media (max-width: 390px) {
  .file-command-bar .mobile-filters button {
    padding-inline: 11px;
  }

  .file-tools .search-box {
    width: 42px;
    flex: 0 0 42px;
    padding-inline: 12px;
  }

  .file-tools .search-box input::placeholder {
    color: transparent;
  }

  .workspace-actions .transfer-button,
  .workspace-actions .upload-action {
    width: 43px;
    min-width: 43px;
  }
}
